Commvault / cvpysdk

Developer SDK - Python
https://commvault.github.io/cvpysdk/
Apache License 2.0
54 stars 41 forks source link

Editing the subclient content #114

Closed noam412 closed 3 years ago

noam412 commented 3 years ago

I'm trying to edit a subclient content in order to add new information to the content, the error given to me is is " 'name' not given in content" and redirects me to vssubclients.py line 492. the thing I tried to do is basically adding a new VM to the subclient manually, getting the the subclient content with the command- print(subclient.content), and then copying the output of that command in order to understand the format u should write the new info (tried list, Jason), but still it refuses to update with the same error.

any way u could show me the right format to add new content to a vssubclient ?

example of one item in the vssubclient: [{'equal_value': True, 'allOrAnyChildren': True, id: 'test', 'path': 'test', 'display_name': 'test', 'type': ;SERVER'}]

for that example I'm trying to add test 2 in with the command below:

subclient.content = [{'equal_value': True, 'allOrAnyChildren': True, id: 'test', 'path': 'test', 'display_name': 'test', 'type': ;SERVER'}, {'equal_value': True, 'allOrAnyChildren': True, id: 'test2', 'path': 'test2', 'display_name': 'test2', 'type': ;SERVER'}]

thanks for your help :)

kneerudge commented 3 years ago

Name tag is missing. We will check and get it added. You can add name tag manually and use the following way to update the content.

subclient.content = [{'equal_value': True, 'allOrAnyChildren': True, id: 'test', 'path': 'test', 'display_name': 'test', 'name': '','type': VSAObjects.SERVER}, {'equal_value': True, 'allOrAnyChildren': True, id: 'test2', 'path': 'test2', 'display_name': 'test2', 'name': '', 'type': VSAObjects.SERVER}]

For VSAObjects, check constants file

noam412 commented 3 years ago

Hey i forgot to update, i found a way around it using the self._vmContent attribute in order to get the properties in the right format, and after that i used the self._set_subclient_properties in order to update the content. Thanks for the reply though! We can close this issue.