Hello,
you just need to send a POST request with the following in the request body.
sample body
{
"newCopyName": "secondary",
"storagePolicyCopyInfo": {
"StoragePolicyCopy": {
"copyId": <copyId>,
"storagePolicyId": <storagePolicyId>
},
"copyType": "SYNCHRONOUS",
"isDefault": "SET_FALSE",
"isSnapCopy": "DO_NOT_CHANGE",
"extendedFlags": {
"useGlobalStoragePolicy": "SET_TRUE"
},
"retentionRules": {
"retainBackupDataForDays": 7,
"retainBackupDataForCycles": 1,
"retainArchiverDataForDays": -1
},
"useGlobalPolicy": {
"storagePolicyId": <storagePolicyId>,
"storagePolicyName": "storagePolicyName"
},
"startTime": {
"time": -1
},
"sourceCopy": {
"copyId": <copyId>,
"copyName": "<copyName>"
},
"dedupeFlags": {
"enableDASHFull": "SET_TRUE"
}
}
}
example
change retainBackupDataForDays for backup destination name “secondary”
curl --location 'http://WebConsoleHostName/webconsole/api/StoragePool?Action=copyEdit' \
--header 'Accept: application/json' \
--header 'Authtoken: QSDK token would be auto set after POST Login is called.'' \
--header 'Content-Type: application/json' \
--data-raw '{
"newCopyName": "secondary",
"storagePolicyCopyInfo": {
"StoragePolicyCopy": {
"copyId": 1085,
"storagePolicyId": 52
},
"copyType": "SYNCHRONOUS",
"isDefault": "SET_FALSE",
"isSnapCopy": "DO_NOT_CHANGE",
"extendedFlags": {
"useGlobalStoragePolicy": "SET_TRUE"
},
"retentionRules": {
"retainBackupDataForDays": 7,
"retainBackupDataForCycles": 1,
"retainArchiverDataForDays": -1
},
"useGlobalPolicy": {
"storagePolicyId": 27,
"storagePolicyName": "cvstu"
},
"startTime": {
"time": -1
},
"sourceCopy": {
"copyId": 1082,
"copyName": "Primary"
},
"dedupeFlags": {
"enableDASHFull": "SET_TRUE"
}
}
}'
if you need, you can get info for Storage Policy use next GET request
GET {{ServerUrl}}/V2/StoragePolicy
example
curl --location 'http://WebConsoleHostName/webconsole/api/V2/StoragePolicy' \
--header 'Authtoken: {{Token}}' \
--header 'Accept: application/json'
and get “storagePolicyId” from output
example
...
"policies": l
{
"numberOfStreams": 100,
"storagePolicy": {
"storagePolicyName": "PlanName",
"storagePolicyId": 18
}
...
]
...
and get details for policy by id (storagePolicyId) use next GET request
GET {{ServerUrl}}/V2/StoragePolicy/18?propertyLevel=10
example
curl --location 'http://WebConsoleHostName/webconsole/api/V2/StoragePolicy/18?propertyLevel=10' \
--header 'Authtoken: {{Token}}' \
--header 'Accept: application/json'
and use the received data to form the desired POST request.
More details about API this https://api.commvault.com/#08b3c816-735b-46ce-a5f5-879629a6c504
thank you so much! This helped a lot!