Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this works
- curl -u admin:smartvm -O -k -v -X POST https://192.168.1.17/api/services/99000000000001/custom_attributes \
- -H "Resource:" \
- -H 'Content-Type: text/json; charset=utf8' \
- -d @- << EOF
- {
- "action": "add",
- "resources": [{
- "name": "ip-10-0-1-217.ec2.internal",
- "value": "10.0.1.217"
- }, {
- "name": "ip-10-0-1-192.ec2.internal",
- "value": "10.0.1.192"
- }, {
- "name": "ip-10-0-1-98.ec2.internal",
- "value": "10.0.1.98"
- }]
- }
- EOF
- But this
- - name: Find the generic objects that belong to this service
- uri:
- url: "https://localhost/api/services/99000000000145/custom_attributes"
- method: POST
- validate_certs: no
- body_format: json
- body: "{{ lookup('template','templates/custom_attributes.j2') | to_json }}"
- validate_certs: false
- user: admin
- password: r3dhat2018
- register: cra
- {
- "action": "add",
- "resources": [{
- "name": "ip-10-0-1-217.ec2.internal",
- "value": "10.0.1.217"
- }, {
- "name": "ip-10-0-1-192.ec2.internal",
- "value": "10.0.1.192"
- }, {
- "name": "ip-10-0-1-98.ec2.internal",
- "value": "10.0.1.98"
- }]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement