blob: cf76f6f693f0476b4addff91566e3d0ffaa47152 [file] [log] [blame]
Matteo Scandolo1c049b02018-01-18 11:32:46 -08001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15---
16- hosts: 127.0.0.1
17 connection: local
18 vars:
Matteo Scandoload7f3b42018-01-30 16:41:19 -080019 - body: '{{ body }}'
Matteo Scandolo1c049b02018-01-18 11:32:46 -080020 - endpoint: '{{ endpoint }}'
21
22 tasks:
23 - debug:
Matteo Scandoload7f3b42018-01-30 16:41:19 -080024 msg: "{{ '{{' }} body {{ '}}' }}"
Matteo Scandolo1c049b02018-01-18 11:32:46 -080025 # NOTE that the task has a generic name as it's planned to be used for all the requests
26 - name: Call onos Progran
27 uri:
28 url: "http://{{ onos_url }}:{{ onos_port }}/onos/progran/{{ '{{' }} endpoint {{ '}}' }}"
29 method: "{{ method }}"
30 user: "{{ onos_username }}"
31 password: "{{ onos_password }}"
32 force_basic_auth: yes
33 status_code: 200
34 {% if method == "POST" or method == "PUT" -%}
Matteo Scandoload7f3b42018-01-30 16:41:19 -080035 body: "{{ '{{' }} body {{ '}}' }}"
Matteo Scandolo1c049b02018-01-18 11:32:46 -080036 body_format: json
37 {%- endif -%}