NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Software Development Kit (SDK) and API Discussions

APItest with API "cifs-local-group-members-add-members" getting errors on tag "member-names"

VARONISSYSTEMS
4,339 Views

Hi all. 

 

I'm trying to execute APItest with "cifs-local-group-members-add-members" api as following and getting errosr.

When executing this way: 
     APItest <IP> <User> <password> cifs-local-group-members-add-members group-name "<group name>" member-names "<user name>" 

Getting the following error: 

     "For array tag member-names: expected element cifs-name, but found value : <user name>" errno="13115" status="Failed" 

 

When executing that way:

     APItest <IP> <User> <password> cifs-local-group-members-add-members group-name "<group name>" member-names/cifs-name "<user name>" 

Getting this error: 

     "Couldn't find end of Start Tag member-names " errno="13001" status="failed" 

 

1. Can some one direct me how i execute this API?

2. If i use any other APIs that has sub-elements, is there a templete of executing such APIs?

 

 

Thank you.

Alex. 

1 ACCEPTED SOLUTION

asulliva
4,332 Views

You might try using the "-i" option to pass the XML for ZAPI directly...

 

apitest <ip> <user> <password> -i "<cifs-local-group-members-add-members><group-name>some_ad_group</group-name><member-names><cifs-name>username_1</cifs-name></member-names></cifs-local-group-members-add-members>"

It's ugly, but should validate the API functionality for you.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

asulliva
4,333 Views

You might try using the "-i" option to pass the XML for ZAPI directly...

 

apitest <ip> <user> <password> -i "<cifs-local-group-members-add-members><group-name>some_ad_group</group-name><member-names><cifs-name>username_1</cifs-name></member-names></cifs-local-group-members-add-members>"

It's ugly, but should validate the API functionality for you.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

VARONISSYSTEMS
4,324 Views

It works!
- only that you need to put the "-i" after the "apitest.exe"  and before the <IP>

apitest.exe -i <ip> <user> <password> "<cifs-local-group-members-add-members><group-name​>some_ad_group</group-name><member-names><cifs-nam​e>username_1</cifs-name></member-names></cifs-loca​l-group-members-add-members>"

Also, If we need to use quotation marks inside the xml, we should use:  \"
 
Thank you very much!!!
Alex.

 

Public