Rest API call to update sub-client content of virtual sever sub-client
Can anyone share the REST API call to update subclient content of virtual sever sub-client ?
Also what does this error means - FuncnaddVMToSubClient] Linen629]: status=401 content=u'<Api_GenericResp errorMessage="Access denied" errorCode="5" />' INFO:api.v1.services:status=401 content=u'<Api_GenericResp errorMessage="Access denied" errorCode="5" />'
Page 1 / 1
@Mohit Chordia 401 error code means that the token being used to make these API calls is invalid or has expired.
@psingh :
I am able to successfully login in to commserve but facing an error when trying to update subclient content., not sure how to resolve this and what is the root cause of this issue.
2021-02-09 10:08:51,446 INFO Source[/root/BackupAPI/api/v1/services.py] Moduleeservices] FunccgetToken] Linee246]: http://xxxxx.corp.adobe.com:81/SearchSvc/CVWebService.svc/Login
@Mohit Chordia what permissions do you have on the VM group?
@psingh
The account which I am using for API call, using the same account I can log in into commcell console and update subclient content ( add and remove ) successfully.
Also, I have added the user account to the master group so I believe permission is not an issue here.
I also tried to run the automation through cvadmin account but still seeing the same error.
@Mohit Chordia Thank you! I’ll try and involve another colleague who can check more details.
Paste the XML and make sure you filled out the vmcontentoperation type, in my case “overwrite” and the “children” details:
It should look like this.
If you submit it correctly, it should update the subclient/vm group.
@MFasulo
We are using the POST method to ADD VMs to the virtual server subclient. It was working fine earlier but suddenly started giving “access denied error” 401. I am using operation type as ADD as I don't want to overwrite existing content. Also we are not using webconsole URL but below mentioned one -
Thanks for the reply. Which account are you using for the API calls?
Is there any special permission that needs to be assigned to the user?
@MFasulo
Thanks for the reply. Which account are you using for the API calls?
Is there any special permission that needs to be assigned to the user?
Almost full admin
Do me a favor, go into command center type “roles” into the entity search bar. There should be a hit for manage > security > roles. Open the role that is assigned to your user having the issue. At the bottom of that window (hopefully you are on the latest release) there should be a button/link that says “Equivalent API”. Download the JSON file and email it to me at “bro@commvault.com” I’ll create a user with that role and see why your having this issue.
@MFasulo My Commserve Version is 11.20.32.
I don't see any button/link that says “Equivalent API”, However, I can email you snapshots.
Also which tool are you using for API testing?
Is there any change in the API version, How can I validate which API version I am using?
Regards, Mohit
for my apis, I normally use a read only account but if you want to make changes you might have to modify the account and give it enough rights.