REST API call to disable backup is failing

Last post 11-13-2017, 7:35 AM by Rushabh. 2 replies.
Sort Posts: Previous Next
  • REST API call to disable backup is failing
    Posted: 11-13-2017, 2:24 AM

    Hi,

     

    We are trying to automate backup disable process using REST API call. While supplying xml to provide Description, we are getting success but when we use same type of xml for "Activity Control" activities, it is throwing error of "Invoke-WebRequest : {"errorMessage":"Failed to set activity control on Client.","errorCode":1}". We are using powershell 5.0 and our commvault version is 11. Below is our XML which we are using for REST API call.

    $body = "<App_SetClientPropertiesRequest>
    <association>
    <entity>
    <clientName>$decom_server</clientName>
    </entity>
    </association>
    <clientProperties>
    <clientProps>
    <clientActivityControl>
    <activityControlOptions>
    <activityType>BACKUP</activityType>
    <enableActivityType>false</enableActivityType>
    </activityControlOptions>
    </clientActivityControl>
    </clientProps>
    </clientProperties>
    </App_SetClientPropertiesRequest>"
    $service = "/Client/$clientID" 
    $action = "POST"
    $headers["Accept"] = "application/json" 
    $headers["Authtoken"] = $token 
    $APIURLaction = "$APIURL$service" 
    $result = Invoke-WebRequest -Uri $APIURLaction -Headers $headers -Method $action -UseBasicParsing -Body $body 
     
    Error Message:
    Invoke-WebRequest : {"errorMessage":"Failed to set activity control on Client.","errorCode":1}
    At C:\Powershell Scripts\comvalut_automation.ps1:70 char:11
    + $result = Invoke-WebRequest -Uri $APIURLaction -Headers $headers -Met ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

     

  • Re: REST API call to disable backup is failing
    Posted: 11-13-2017, 7:05 AM

    Hi,

    You need to also include 

    <enableAfterADelay> in the request XML.

    Example:

    <App_SetClientPropertiesRequest>
    <association>
    <entity>
    <clientName>testcs</clientName>
    </entity>
    </association>
    <clientProperties>
    <clientProps>
    <clientActivityControl>
    <activityControlOptions>
    <activityType>BACKUP</activityType>
    <enableActivityType>false</enableActivityType>
    <enableAfterADelay>false</enableAfterADelay>
    </activityControlOptions>
    </clientActivityControl>
    </clientProps>
    </clientProperties>
    </App_SetClientPropertiesRequest>
  • Re: REST API call to disable backup is failing
    Posted: 11-13-2017, 7:35 AM

    Excellent. That did the job. It is working after setting that parameter. Thanks for your time and help. 

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2019 Commvault | All Rights Reserved. | Legal | Privacy Policy