Solved

Rename a clientname via API

  • 25 August 2021
  • 5 replies
  • 335 views

Userlevel 3
Badge +8

Hello,

I want to rename a client via API, but it doesn’t want to work, I use following:

http://testcommcell.xxx.com:81/SearchSvc/CVWebService.svc/Client/<ClientID>

XML file looks like :

<association>

    <entity>

      <clientName> "<cname>" </clientName>

    </entity>

  </association>

  <clientProperties>

      <clientEntity>

        <clientName> "<cname>_decom_07.10.2021" </clientName>

      </clientEntity>

  </clientProperties>

</App_SetClientPropertiesRequest>

error : <Api_GenericResp errorMessage="Failed to set Client properties." errorCode="1" />

Environment: V11SP20.55

Any idea what I do wrong?

regards Juergen

icon

Best answer by Kcsaby 25 August 2021, 18:32

View original

5 replies

Userlevel 7
Badge +23

Hey @Juergen , thanks for the post!

My initial suspicion is that the cname variable needs to be outside of the quotes, though the generic error message is, well….generic.

I’ll add in some of our folks who are better skilled at our API calls to help.

Userlevel 3
Badge +8

Hi @Mike Struening , thanks for answer.

I think that was bad sample for placeholder, it looks so:

<clientName> "FQDN" </clientName>

and 

<clientName> "FQDN_decom_07.10.2021" </clientName>

rename from FQDN  to FQDN_decom_07.10.2021

I hope that explains better

 

Juergen

Badge +2

Juergen 

Please review the following doc link - there is an example that you can use to change the client’s name

https://documentation.commvault.com/11.24/expert/7051_changing_client_computer_name_using_command_line_interface.html

this is done on a command line but the XML file that is there can be used elsewhere as well as a base of what you wish to do.

qoperation execute -af update_client_name_template.xml -entity/clientName 'old_clientname' -client/clientEntity/clientName 'old_clientname' -entity/newName 'new_clientname'

You can also edit the update_client_name_template.xml for your needs with out all the command line options shown

 

Userlevel 3
Badge +8

Hello @Kcsaby,

Now I got it working! Thank You.

A second problem was the quotes at the name now it looks:

<App_SetClientPropertiesRequest>
  <association>
    <entity>
        <clientName>FQDN</clientName>
        <newName>FQDN_decom_07.10.2021</newName>
    </entity>
  </association>
  <clientProperties>
    <client>
      <clientEntity>
        <clientName>FQDN</clientName>
      </clientEntity>
    </client>
  </clientProperties>
</App_SetClientPropertiesRequest>

Juergen

Badge +2

Glad that worked out for you and I was able to help you.

Ken

Reply