Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
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.
Solved! See The Solution
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
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
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-name>username_1</cifs-name></member-names></cifs-local-group-members-add-members>"
Also, If we need to use quotation marks inside the xml, we should use: \"
Thank you very much!!!
Alex.