Skip to main content
Question

Subclient not updating the vmFilters via API

  • August 31, 2024
  • 2 replies
  • 58 views

Forum|alt.badge.img+7

I am using below api endpoint and updating the filters of the subclient:

https://api.commvault.com/docs/SP32/api/cv/SubclientOperations/update-subclient-properties/

 

      "vmFilter": {
        "children": [
          {
            "allOrAnyChildren": true,
            "description": "",
            "displayName": "Ans_Jen_serv1",
            "equalsOrNotEquals": true,
            "name": "553b108a-dbc8-b7cv-e69n-e35622f6gh70",
            "path": "Ans_Jen_Saurabh",
            "type": 9
          },
          {
            "allOrAnyChildren": true,
            "description": "",
            "displayName": "Ans_Jen_serv2",
            "equalsOrNotEquals": true,
            "name": "503df9ca-c7ca-e09b-333d-fc0787a5c9d0",
            "path": "Ans_Jenkins_Vishak",
            "type": 9
          }
        ]
      },

 

I have updated the payload with the vmFilter children in which I have updated the content and remove Ans_Jen_Serv1. It did get updated successfully. Below is the updated payload when I printed:

"{\"children\": [{\"equalsOrNotEquals\": true, \"displayName\": \"Ans_Jen_serv2\", \"allOrAnyChildren\": true, \"description\": \"\", \"type\": 9, \"path\": \"Ans_Jen_serv2\", \"name\": \"503df9ca-c7ca-e09b-333d-fc0787a5c9d0\"}]}"

But it did not get updated on GUI. The filters are still in place. I tried Deleting but put method is not allowed.

Below is the message on webserver log:
4924  30    08/31 16:37:05 30  ### ProcessMessageRecieved - [MQ for DB syncup] -Cache Query Processed. userId : [1]; operation : [MODIFY]; Time Elapsed : 0 ms
4924  124   08/31 16:37:05 124 admin BuildCSMessageObject - Missing field : [subClientEntity.guid] in node : [SubClientEntity]. Skipping addition of this field in response.
4924  44    08/31 16:37:05 44  ### BuildCSMessageObject - Missing field : [subClientEntity.guid] in node : [SubClientEntity]. Skipping addition of this field in response.
4924  124   08/31 16:37:05 124 admin Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/Subclient/1079] in [678] ms;  HTTP code 'OK'


Update after I added subClientEntity in the payload:
4924  30    08/31 17:18:55 30  ### ProcessMessageRecieved - [MQ for DB syncup] -Cache Query Processed. userId : [1]; operation : [MODIFY]; Time Elapsed : 0 ms
4924  57    08/31 17:18:55 57  admin BuildCSMessageObject - Missing field : [subClientEntity.guid] in node : [SubClientEntity]. Skipping addition of this field in response.
4924  57    08/31 17:18:55 57  admin Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/Subclient/1079] in [692] ms;  HTTP code 'OK'
4924  170   08/31 17:19:12 170 ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request. : /getDomains : AdditionalInfo[ ConsoleType[Unknown]]
4924  170   08/31 17:19:12 170 ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [6] ms;  HTTP code 'OK'
4924  170   08/31 17:19:12 170 admin  - WEBAPI-STARTED processing [GET]:[/CommcellHealthStatus] request. : /CommcellHealthStatus : Parameters : [CommServGUID=5533784E-1611-4B64-A55B-83EB015CC831] : AdditionalInfo[ ConsoleType[WebConsole]]
4924  170   08/31 17:19:12 ### ### Login:GetDomains - No Domains registered
4924  170   08/31 17:19:12 170 admin Invoke - WEBAPI-FINISHED processing [GET]:[/CVWebService.svc/CommcellHealthStatus] in [267] ms;  HTTP code 'OK'
4924  61    08/31 17:20:15 61  _+_PublicSharingUser_  - WEBAPI-STARTED processing [POST]:[/CommServ/GlobalParams] request. : /CommServ/GlobalParams : AdditionalInfo[ ConsoleType[AdminConsole]]
4924  18    08/31 17:20:15 18  _+_PublicSharingUser_  - WEBAPI-STARTED processing [POST]:[/CommServ/GlobalParams] request. : /CommServ/GlobalParams : AdditionalInfo[ ConsoleType[AdminConsole]]
4924  61    08/31 17:20:15 61  _+_PublicSharingUser_ GetGlobalParams - Warning: #0 setting(s) that are not allowed to be queried will be skipped!
4924  18    08/31 17:20:15 18  _+_PublicSharingUser_ GetGlobalParams - Warning: #0 setting(s) that are not allowed to be queried will be skipped!
4924  18    08/31 17:20:15 18  _+_PublicSharingUser_ Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/CommServ/GlobalParams] in [12] ms;  HTTP code 'OK'
4924  61    08/31 17:20:15 61  _+_PublicSharingUser_ Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/CommServ/GlobalParams] in [13] ms;  HTTP code 'OK'
4924  168   08/31 17:20:18 168 _+_PublicSharingUser_  - WEBAPI-STARTED processing [POST]:[/CommServ/GlobalParams] request. : /CommServ/GlobalParams : AdditionalInfo[ ConsoleType[WebConsole]]
4924  168   08/31 17:20:18 168 _+_PublicSharingUser_ GetGlobalParams - Warning: #0 setting(s) that are not allowed to be queried will be skipped!
4924  168   08/31 17:20:18 168 _+_PublicSharingUser_ Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/CommServ/GlobalParams] in [6] ms;  HTTP code 'OK'
 

 

2 replies

CV_GK
Vaulter
Forum|alt.badge.img+7
  • Vaulter
  • September 2, 2024

Can you check EvMgrs.log on CS for above activity?


Forum|alt.badge.img+7

I used this https://api.commvault.com/docs/SP36/api/cv/OpenAPI3/update-vm-group/
if "filters" in res:
    for filter in res["filters"]:
        if "virtualMachines" in filter:
            filter["virtualMachines"] = [
                vm for vm in filter["virtualMachines"] 
                if vm.get("name") != "client_name"
                ]

Updated the filters section of the payload using the above.
It removed everything including the content.
I did print the updated payload which I passed through the url and it looked fine. It removed the specific client_name. When the payload is passed it doesn’t get updated as it is. 
This would be the most dangerous thing to do on production.