- name: GET Request for CLUSTERS uri: url: https://zsapi.com/BETA/{{ item }} method: GET validate_certs: no return_content: yes status_code: 200 headers: Content-Type: application/json Cookie: "{{ login.set_cookie.split(';')[0] }}" body_format: json with_items: "{{ cluster }}" register: cluster_result
ok: [localhost] => { "msg": [ { "bandwidthControlApp": true, "cloud": "BETA", "createTime": 1550875210, "datacenter": { "id": 526, "name": "FMT1" }, "description": "cluster with VIP 169.254.1.100", "disabled": false, "id": 2334, "lastModifiedTime": 1560896398, "lastModifiedUser": { "id": 1009, "name": "ad...@xyz.com" }, "mipUser": false, "mtsInstances": [], "name": "fmt1", "rateLimit": true,
} ]} --
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1c09b86a-eaf1-4e42-a4d9-b75168c4e2b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
>> To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d3eba162-c81e-4311-9fa2-521aef83f85c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- set_fact:
updated_flag: "{{ cluster_result | combine({'traceSyncApp': true}) }}"
- debug:
msg: "{{ updated_flag }}"
- name: Enable Tracesync
uri:
url: <API URL>
method: PUT
validate_certs: no
return_content: yes
status_code: 200
headers:
Content-Type: application/json
Cookie: "{{ login.set_cookie.split(';')[0] }}"
body_format: json
body : "{{ updated_flag }}"
register: cluster_resultfatal: [localhost]: FAILED! => {"changed": false, "connection": "close", "content": "Request body is invalid.", "content_length": "24", "content_type": "text/plain", "date": "Mon, 24 Jun 2019 06:58:51 GMT", "failed": true, "msg": "Status code was not [200]: HTTP Error 400: "}
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d3eba162-c81e-4311-9fa2-521aef83f85c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.