Skip to content

Commit

Permalink
Merge pull request #40 from Commvault/branch1
Browse files Browse the repository at this point in the history
Changing the StoragePolicy Url to V2
  • Loading branch information
Sowmyacv authored Jan 6, 2023
2 parents 4f781f2 + 8958e9e commit 1f33c6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Modules/Commvault.JobManager/Commvault.JobManager.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ function Get-CVJob {
$subclientId = $subclientObj.subclientId
}
}


$sessionObj.requestProps.endpoint += "&hideAdminjobs=false"

if (-not [String]::IsNullOrEmpty($JobFilter)) {
$sessionObj.requestProps.endpoint += '&jobFilter=' + $JobFilter
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Commvault.Policies/Commvault.Policies.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function Get-CVStoragePolicy {
else {
foreach ($policy in $response.Content.policies) {
if (-not [String]::IsNullOrEmpty($Name)) {
if ($Name -eq $policy.storagePolicyName) {
if ($Name -eq $policy.storagePolicy.storagePolicyName) {
$policiesToProcess += $policy
}
}
Expand All @@ -645,7 +645,7 @@ function Get-CVStoragePolicy {
$sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{storagePolicyId}', $policy.storagePolicyAndCopy.storagePolicyId)
}
else {
$sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{storagePolicyId}', $policy.storagePolicyId)
$sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{storagePolicyId}', $policy.storagePolicy.storagePolicyId)
}

$headerObj = Get-CVRESTHeader $sessionObj
Expand Down
2 changes: 1 addition & 1 deletion Modules/Commvault.RESTSession/Commvault.RESTSession.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ function GetAPIDetail ([String] $Request) {
'Get-CVStoragePolicy' = @{

Description = 'Get storage policies'
Endpoint = 'StoragePolicy'
Endpoint = 'V2/StoragePolicy'
Method = 'Get'
Body = ''
}
Expand Down

0 comments on commit 1f33c6b

Please sign in to comment.