Advertisement
Guest User

Untitled

a guest
Apr 14th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. this works
  2.  
  3. curl -u admin:smartvm -O -k -v -X POST https://192.168.1.17/api/services/99000000000001/custom_attributes \
  4. -H "Resource:" \
  5. -H 'Content-Type: text/json; charset=utf8' \
  6. -d @- << EOF
  7. {
  8. "action": "add",
  9. "resources": [{
  10. "name": "ip-10-0-1-217.ec2.internal",
  11. "value": "10.0.1.217"
  12. }, {
  13. "name": "ip-10-0-1-192.ec2.internal",
  14. "value": "10.0.1.192"
  15. }, {
  16. "name": "ip-10-0-1-98.ec2.internal",
  17. "value": "10.0.1.98"
  18. }]
  19. }
  20. EOF
  21.  
  22. But this
  23.  
  24. - name: Find the generic objects that belong to this service
  25. uri:
  26. url: "https://localhost/api/services/99000000000145/custom_attributes"
  27. method: POST
  28. validate_certs: no
  29. body_format: json
  30. body: "{{ lookup('template','templates/custom_attributes.j2') | to_json }}"
  31. validate_certs: false
  32. user: admin
  33. password: r3dhat2018
  34. register: cra
  35.  
  36. {
  37. "action": "add",
  38. "resources": [{
  39. "name": "ip-10-0-1-217.ec2.internal",
  40. "value": "10.0.1.217"
  41. }, {
  42. "name": "ip-10-0-1-192.ec2.internal",
  43. "value": "10.0.1.192"
  44. }, {
  45. "name": "ip-10-0-1-98.ec2.internal",
  46. "value": "10.0.1.98"
  47. }]
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement