Skip to content

Commit f78a764

Browse files
committed
Revert "Adding Latest code from CVS to github"
This reverts commit 227bdb6.
1 parent 227bdb6 commit f78a764

File tree

14 files changed

+32
-180
lines changed

14 files changed

+32
-180
lines changed
5.19 KB
Binary file not shown.

Modules/Commvault.CommCell/Commvault.CommCell.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ function Set-CVSubclient {
655655
}
656656
}
657657
"@
658-
PS C:\>$propobj = $req | ConvertFrom-Json
658+
PS C:\>$propobj = $prop | ConvertFrom-Json
659659
PS C:\>Set-CVSubclient -body $propobj
660660
661661
.OUTPUTS
4.08 KB
Binary file not shown.
4.29 KB
Binary file not shown.

Modules/Commvault.JobManager/Commvault.JobManager.psm1

Lines changed: 24 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function Get-CVJob {
299299

300300

301301
function Get-CVJobDetail {
302-
<#
302+
<#
303303
.SYNOPSIS
304304
Gets extended details for a job.
305305
@@ -309,9 +309,6 @@ function Get-CVJobDetail {
309309
.PARAMETER Id
310310
Gets extended details for the job specified by Id.
311311
312-
.PARAMETER InfoType
313-
Gets additional job information.
314-
315312
.PARAMETER JobObject
316313
Gets extended details for the job specified by piped JobObject.
317314
@@ -333,9 +330,6 @@ function Get-CVJobDetail {
333330
.EXAMPLE
334331
Get-CVJobDetail -Id 175 | Select-Object -ExpandProperty progressInfo
335332
336-
.EXAMPLE
337-
Get-CVJobDetail -Id 175 InfoType 1
338-
339333
.OUTPUTS
340334
Outputs [PSCustomObject] containing result.
341335
@@ -352,91 +346,53 @@ function Get-CVJobDetail {
352346
[ValidateNotNullorEmpty()]
353347
[Int32] $Id,
354348

355-
[Parameter(Mandatory = $False, ParameterSetName = 'ById', ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)]
356-
[ValidateNotNullorEmpty()]
357-
[Int32] $InfoType,
358-
359349
[Parameter(Mandatory = $True, ParameterSetName = 'ByObject', ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)]
360350
[ValidateNotNullorEmpty()]
361351
[System.Object] $JobObject
362352
)
363353

364-
begin {
365-
Write-Debug -Message "$($MyInvocation.MyCommand): begin"
354+
begin { Write-Debug -Message "$($MyInvocation.MyCommand): begin"
366355

367356
try {
368-
if ($InfoType -eq 0) {
369-
$sessionObj = Get-CVSessionDetail $MyInvocation.MyCommand.Name
370-
$endpointSave = $sessionObj.requestProps.endpoint
371-
}
372-
else {
373-
$sessionObj = Get-CVSessionDetail 'GetJobById'
374-
$endpointSave = $sessionObj.requestProps.endpoint
375-
}
357+
$sessionObj = Get-CVSessionDetail $MyInvocation.MyCommand.Name
358+
$endpointSave = $sessionObj.requestProps.endpoint
376359
}
377360
catch {
378361
throw $_
379362
}
380363
}
381364

382-
process {
383-
Write-Debug -Message "$($MyInvocation.MyCommand): process"
365+
process { Write-Debug -Message "$($MyInvocation.MyCommand): process"
384366

385367
try {
386-
if ($InfoType -gt 0) {
387-
if ($PSCmdlet.ParameterSetName -eq 'ById') {
388-
$job_id = $Id
389-
}
390-
else {
391-
$job_id = $JobObject.jobId
392-
}
393-
$sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{jobId}', ($job_id))
394-
$sessionObj.requestProps.endpoint = -join ($sessionObj.requestProps.endpoint, "/AdvancedDetails?infoType=", $InfoType)
395-
$body = ''
396-
$headerObj = Get-CVRESTHeader $sessionObj
397-
$payload = @{ }
398-
$payload.Add('headerObject', $headerObj)
399-
$payload.Add('body', $body)
400-
$validate = ''
401-
402-
$response = Submit-CVRESTRequest $payload $validate
368+
$sessionObj.requestProps.endpoint = $endpointSave
403369

404-
if ($response.IsValid) {
405-
Write-Output $response.Content
406-
}
370+
$headerObj = Get-CVRESTHeader $sessionObj
371+
$jobObj = @{ }
372+
if ($PSCmdlet.ParameterSetName -eq 'ById') {
373+
$jobObj.Add('jobId', $Id)
407374
}
408375
else {
409-
$sessionObj.requestProps.endpoint = $endpointSave
410-
411-
$headerObj = Get-CVRESTHeader $sessionObj
412-
$jobObj = @{ }
413-
if ($PSCmdlet.ParameterSetName -eq 'ById') {
414-
$jobObj.Add('jobId', $Id)
415-
}
416-
else {
417-
$jobObj.Add('jobId', $JobObject.jobId)
418-
}
419-
$body = $jobObj | ConvertTo-Json -Depth 10
420-
$payload = @{ }
421-
$payload.Add('headerObject', $headerObj)
422-
$payload.Add('body', $body)
423-
$validate = 'job'
424-
425-
$response = Submit-CVRESTRequest $payload $validate
426-
427-
if ($response.IsValid) {
428-
Write-Output $response.Content.job.jobDetail
429-
}
376+
$jobObj.Add('jobId', $JobObject.jobId)
430377
}
378+
$body = $jobObj | ConvertTo-Json -Depth 10
379+
$payload = @{ }
380+
$payload.Add('headerObject', $headerObj)
381+
$payload.Add('body', $body)
382+
$validate = 'job'
431383

384+
$response = Submit-CVRESTRequest $payload $validate
385+
386+
if ($response.IsValid) {
387+
Write-Output $response.Content.job.jobDetail
388+
}
432389
}
433390
catch {
434391
throw $_
435392
}
436393
}
437394

438-
end {
439-
Write-Debug -Message "$($MyInvocation.MyCommand): end"
395+
end { Write-Debug -Message "$($MyInvocation.MyCommand): end"
440396
}
441397
}
442398

@@ -583,75 +539,7 @@ function Resume-CVJob {
583539
end { Write-Debug -Message "$($MyInvocation.MyCommand): end"
584540
}
585541
}
586-
function Resubmit-CVJob {
587-
<#
588-
.SYNOPSIS
589-
Resubmit the job specified by job Id.
590-
591-
.DESCRIPTION
592-
Resubmit the job specified by job Id.
593-
594-
.PARAMETER JobId
595-
Resubmit the job specified by JobId.
596-
597-
.EXAMPLE
598-
Resubmit-CVJob -JobId 78
599-
600-
.OUTPUTS
601-
Outputs [PSCustomObject] containing result.
602-
603-
.NOTES
604-
Author: Jnanesh D
605-
Company: Commvault
606-
#>
607-
[CmdletBinding()]
608-
[OutputType([PSCustomObject])]
609-
param(
610-
[Parameter(Mandatory = $True)]
611-
[ValidateNotNullorEmpty()]
612-
[Int32] $JobId
613-
)
614-
615-
begin { Write-Debug -Message "$($MyInvocation.MyCommand): begin"
616-
617-
try {
618-
$sessionObj = Get-CVSessionDetail $MyInvocation.MyCommand.Name
619-
$endpointSave = $sessionObj.requestProps.endpoint
620-
}
621-
catch {
622-
throw $_
623-
}
624-
}
625-
626-
process { Write-Debug -Message "$($MyInvocation.MyCommand): process"
627-
628-
try {
629-
$sessionObj.requestProps.endpoint = $endpointSave
630-
$sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{jobId}', $JobId)
631-
632-
$headerObj = Get-CVRESTHeader $sessionObj
633-
$body = ''
634-
$payload = @{ }
635-
$payload.Add('headerObject', $headerObj)
636-
$payload.Add('body', $body)
637-
638-
$response = Submit-CVRESTRequest $payload 'jobIds'
639-
640-
if ($response.IsValid) {
641-
Write-Output $response.Content
642-
}
643-
else {
644-
Write-Information -InformationAction Continue -MessageData "INFO: $($MyInvocation.MyCommand): resume request was not succesfully submitted for job [$JobId]"
645-
}
646-
}
647-
catch {
648-
throw $_
649-
}
650-
}
651-
652-
end { Write-Debug -Message "$($MyInvocation.MyCommand): end"
653-
}
654-
}
542+
655543

656544
function Stop-CVJob {
657545
<#
@@ -1769,4 +1657,4 @@ function PrepareSendLogFilesBodyJson ($PrepInputs) {
17691657
catch {
17701658
throw $_
17711659
}
1772-
}
1660+
}
4.3 KB
Binary file not shown.

Modules/Commvault.Policies/Commvault.Policies.psm1

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,34 +1075,9 @@ function Add-CVBlackoutWindow {
10751075
Switch to Force override of default 'WhatIf' confirmation behavior.
10761076
10771077
.EXAMPLE
1078-
PS C:\>$props = @"
1079-
{
1080-
"operationWindow": {
1081-
"endDate": 1521691200,
1082-
"name": "Holiday_1",
1083-
"startDate": 1520485200,
1084-
"operations": [
1085-
1,
1086-
2
1087-
],
1088-
"dayTime": [
1089-
{
1090-
"startTime": 46800,
1091-
"endTime": 50400,
1092-
"dayOfWeek": [
1093-
1,
1094-
2
1095-
]
1096-
}
1097-
]
1098-
},
1099-
"entity": {
1100-
"clientGroupId": 0,
1101-
"clientId": 2
1102-
}
1103-
}"@
1104-
PS C:\>$propobj = $prop | ConvertFrom-Json
1105-
PS C:\>$propobj | Add-CVBlackoutWindow -Force
1078+
PS C:\>$props = Get-CVBlackoutWindow -Name 'My Blackout Rule'
1079+
PS C:\>$props.name='Your Blackout Rule'
1080+
PS C:\>$props | Add-CVBlackoutWindow -Force
11061081
11071082
.OUTPUTS
11081083
Outputs [PSCustomObject] containing job submission result.
@@ -1136,7 +1111,7 @@ function Add-CVBlackoutWindow {
11361111

11371112
try {
11381113
$sessionObj.requestProps.endpoint = $endpointSave
1139-
if ($Force -or ($PSCmdlet.ShouldProcess($Properties.operationWindow.name))) {
1114+
if ($Force -or $PSCmdlet.ShouldProcess($Properties.name)) {
11401115
ProcessBlackoutWindowUpdate $sessionObj $Properties $False
11411116
}
11421117
else {
@@ -1378,9 +1353,7 @@ function ProcessBlackoutWindowUpdate([System.Object] $Session, [System.Object] $
13781353
if (HasProperty $Properties 'dayTime') {
13791354
$opWin.Add('dayTime', $Properties.dayTime)
13801355
}
1381-
if (HasProperty $Properties "operationWindow"){
1382-
$opWin = $Properties.operationWindow
1383-
}
1356+
13841357
$entity = $Properties.entity
13851358
$body.Add('operationWindow', $opWin)
13861359
$body.Add('entity', $entity)
4.13 KB
Binary file not shown.

Modules/Commvault.RESTSession/Commvault.RESTSession.psm1

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -855,16 +855,7 @@ function GetAPIDetail ([String] $Request) {
855855
Body = ''
856856

857857
}
858-
859-
'Resubmit-CVJob' = @{
860-
861-
Description = 'Resubmit the specified job'
862-
Endpoint = 'Job/{jobId}/action/resubmit'
863-
Method = 'Post'
864-
Body = ''
865-
866-
}
867-
858+
868859
'Resume-CVJob' = @{
869860

870861
Description = 'Resume the specified job'
@@ -1144,7 +1135,7 @@ function GetAPIDetail ([String] $Request) {
11441135
'Backup-CVSQLSubclient' = @{
11451136

11461137
Description = 'Backup SQL instance subclients'
1147-
Endpoint = 'v2/sql/instances/{instanceId}/backup?subclient={subclientId}'
1138+
Endpoint = 'v2/sql/instances/{instanceId}/backup?subClientId={subclientId}'
11481139
Method = 'Post'
11491140
Body = ''
11501141
}
4.47 KB
Binary file not shown.

0 commit comments

Comments
 (0)