Hi all,
My manager wants to know the backup files list for a specific backup jobId via RESTful API through automation.
At first, I thought it could be done using POST /QCommand, but I found out that data browse XML files cannot be run using POST /QCommand. To browse data, we need to use the POST Browse API.
So I went to the POST Browse API documentation and used the following XML as a data payload for a Python script:
<databrowse_BrowseRequest opType="Browse">
<entity _type_="0" appName="Windows File System" backupsetName="xxx_TEST" clientName="xx.xxx.xxx.xxx" subclientName="AUTO_xxx"/>
<mode mode="2"/>
<queries type="DATA">
<dataParam>
<paging pageSize="4294967295" skipNode="0"/>
</dataParam>
</queries>
<paths path="\"/>
<timeRange fromTime="0" toTime="1722328554"/>
</databrowse_BrowseRequest>
I want to browse the backup task for all of its directories and files. The paths are under the clientName, which is an IP port: xx.xxx.xxx.xxx. I want to know if the <paths path="\"/> in the above XML payload is correct for obtaining all directories and files related to a specific backup jobId for that IP port.
It is supposed to provide a backup file list for each backup job in Commvault.
However, I only get the following response with CommVault backup time and the path’s last modification time:
{
"databrowse_BrowseResponseList": {
"browseResponses": {
"session": {
"_sessionId": "1722328852-xxxxx"
},
"browseResult": {
"dataResultSet": {
"flags": {
"_isPseudo": "1",
"_directory": "1",
"_isFake": "0",
"_snap": "0"
},
"advancedData": {
"subclient": {
"__type_": "7",
"_applicationId": "1204"
},
"sourceCommServer": {
"__type_": "1",
"_commCellId": "2"
},
"advConfig": {
"browseAdvancedConfigResp": {
"_commcellNumber": "10xxxxxx"
},
"_recallRequest": "0"
},
"browseMetaData": {
"indexing": {
"_folderSize": "4416051765"
},
"dmStubData": {
"_guid": "myguid"
}
},
"_backupJobId": "599924",
"_referenceTime": "1722221890",
"_offset": "0",
"_archiveGroupId": "132",
"_objectGuid": "objectguid",
"_backupTime": "1722221890",
"_archiveFileId": "1780713"
},
"_displayName": "\\\\xx.xxx.xxx.xxx",
"_displayPath": "\\\\xx.xxx.xxx.xxx",
"_path": "UNC-NT_xx.xxx.xxx.xxx",
"_size": "4416051765",
"_modificationTime": "1720175456",
"_name": "UNC-NT_xx.xxx.xxx.xxx"
},
"_queryId": ""
},
"_respType": "0",
"_workerId": "12230",
"_doClientSideSortingAndPaging": "0"
}
}
}
Does anyone have any suggestions on how to get the backup file list with Python and RestAPi via XML payload?