1234

July 6th, 2021 14:00

namespace service not working with isilon onefs REST-API via Ansible uri module

Can anyone provide a working example of the syntax to access the 'namespace' service ?

I'm using Ansible uri module with session cookies. I know the module works because I can get the sessionID and use it to get 'platform' queries successfully, but when I try to do the same for the 'namespace' service, it doesn't work. A regular curl/get command does get me a reply from the both services so I suspect is something I'm missing in my ansible playbook. I do understand that I need to create 'namespaces' but the default /ifs is there and accessible by root and I can't even query that one.

This is the syntax I'm using (it's exactly the same as the one I use for the 'platform' service).

    -  name :  Return the contents of a directory   info from API
       uri :
         url :  "{ { Isilon_IP }}/namespace/ifs/"
         method :  GET  
         return_content :  no
         validate_certs :  no
         headers :
           Cookie :  "isisessid={ { results_login.cookies.isisessid }}"
           X-CSRF-Token :  "{ { results_login.cookies.isicsrf }}"
           x-isi-ifs-target-type :  "container"
           referer :  "{ { Isilon_IP }}"
         body_format :  json
 

July 6th, 2021 16:00

I did figure out the problem: a bad formatted GET request. It looks like the namespace service is too sensitive to a null body. My original playbook was:

headers:
Cookie: "isisessid={ { results_login.cookies.isisessid }}"
X-CSRF-Token: "{ { results_login.cookies.isicsrf }}"
x-isi-ifs-target-type: "container"
referer: "{ { Isilon_IP }}"
body_format: json

The last line is not actually needed because I'm not sending anything in the GET body, I removed it and it is now working as expected. The 'platform' service is not as sensitive, the GET there still hast the NULL body and it still works.

No Events found!

Top