Start a Conversation

Unsolved

10 Posts

2391

April 1st, 2020 09:00

ECS Automation with Ansible and API Calls

I have been having an issue trying to get this one piece to work via automation. No matter what I do I keep getting an error saying that the JSON is bad. Any help would be greatly appreciated.

The forum will not let me put the coding in with proper indentation without flagging the post as spam.

Coding:

- name: add ro user to bucket acl
uri:
url: "{{ ecs_host }}/object/bucket/{{ manifest.bucket_name }}/acl"
method: PUT
validate_certs: no
headers:
X-SDS-AUTH-TOKEN: "{{ auth.x_sds_auth_token }}"
return_content: yes
body_format: json
body:
bucket: "{{ manifest.bucket_name }}"
namespace: "{{ manifest.name }}"
acl:
user_acl:
user: nbu-dev-ro
permission: READ
register: user_add_acl
- debug: var=user_add_acl

Error:

fatal: [localhost]: FAILED! => {"changed": false, "connection": "close", "content": "e=\"yes\"?>1013Bad request body

The JSON you provided was not well-formed.ils>false", "content_length": "219", "content_type": "application/xml", "date": "Wed, 01 Apr 2020 14:23:
25 GMT", "elapsed": 0, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "status": 400, "ur
l": "https://d53ecsobj001t0a:4443/object/bucket/nbu-dev-bucket/acl"}

Documentation I am referencing:

http://doc.isilon.com/ECS/3.2/API/BucketService_setBucketACL_98919dd290b71afe51274a98d1c3f79f_e652c976d9be14caf2ca84a7c175d88c_detail.html

Thank you.

No Responses!
No Events found!

Top