jaychinut's Posts

Thanks for the awesome response! I found it easier to get the pairingid like this: $pairingId = $pairings.List.pairingId.Guid   instead of: $pairingId = $srmConnection.ConnectedPairing.Pairing... See more...
Thanks for the awesome response! I found it easier to get the pairingid like this: $pairingId = $pairings.List.pairingId.Guid   instead of: $pairingId = $srmConnection.ConnectedPairing.PairingId After running the sample code you posted, I got a proper response.  $response = Invoke-RestMethod $recoveryStepsUrl -Method 'GET' -Headers $global:headers -SkipCertificateCheck PS /Users/username/Documents/VMwareAPI> $response list ---- {@{plan_callout_position_spec=; vm_callout_position_spec=; title=Synchronize storage; step_number=1.; child_count=6; depth=0; finish_time=; start_time=; expanded=False; id=4254; progress=0; status=INACTIVE; warnings=; errors=; referred_… I do hope they fix the issue with the PowerCLI cmdlets though.  This is a nice workaround. 
Dear VMware community I am currently exploring the VMware.Sdk.srm module to interact with the SRM REST API for a project involving disaster recovery and business continuity. While navigating this pr... See more...
Dear VMware community I am currently exploring the VMware.Sdk.srm module to interact with the SRM REST API for a project involving disaster recovery and business continuity. While navigating this process, I have encountered a question regarding the retrieval of the 'PlanId' value and the overall usage of this parameter in my scripting efforts. To provide context, I have outlined the steps I have taken so far: 1. I initiate my script by obtaining the pairing ID with the command: ```powershell $pairings = Invoke-SrmGetPairings ``` 2. Following this, I compile a list of recovery plans associated with the obtained pairing ID: ```powershell $plans = Invoke-SrmGetAllRecoveryPlans -pairingId $pairings.List.pairingid.guid ``` 3. From the list of recovery plans, I extract relevant information from a plan named 'PlanName1' using the following line of code: ```powershell $planid = $plans.list | Where-Object { $_.Name -eq "PlanName1" } ``` 4. My intention is to use the 'PlanId' I've gathered in the previous step to retrieve recovery steps for this particular plan. However, when executing the following command, I encounter an error: ```powershell Invoke-SrmGetRecoverySteps -PairingId $pairings.List.pairingid.guid -PlanId $planid.Id -ViewMode test The error looks like this: Invoke-SrmGetRecoverySteps: Error converting value {null} to type 'System.Int64'. Path 'list[0].start_time', line 1, position 213. ``` To clarify my query further, when I inspect the `$planid` variable, it provides the following details: ```powershell Status : READYSTATE Id : DrRecoveryRecoveryPlan:9fzzzzz-23zz-48zz-b2zz-bzzzzzzzzzz:4zzzzzzzz-7zzz-4zzz-9fzz-b7zzzzzzzzz ProtectedSiteName : vcenter1 RecoverySiteName : vcenter2 ProtectedVcGuid : 80zzzzz-95zz-4zzz-9zzzz-f4zzzzzzzz RecoveryVcGuid : 89zzzzz-69zz-4bzz-97zz-5zzzzzzzz Name : RecoveryPlan1 Description : Location : DrFolder:DrRecoveryRootFolder:442zzzzz-77zz-46zz-9fzz-bzzzzzzzz LocationName : Recovery Plans Progress : 0 IsRunning : False ``` In summary, I would greatly appreciate your assistance in clarifying whether the 'Id' property within the `$planid` variable contains the 'PlanId' I should be using in the `Invoke-SrmGetRecoverySteps` command.