Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start-PPDMprotection not working as expected #5

Closed
XtremeBaumer opened this issue Oct 18, 2022 · 2 comments
Closed

Start-PPDMprotection not working as expected #5

XtremeBaumer opened this issue Oct 18, 2022 · 2 comments

Comments

@XtremeBaumer
Copy link

XtremeBaumer commented Oct 18, 2022

Hi,

I have identified 2 issues with this function.

  1. Parameter $PolicyObject does not set policy id correctly (protection_policies.psm1).
'byPolicyObject' {
        $StageID = ($PolicyObject.stages | Where-Object type -eq PROTECTION).id
        $BackupType = ($PolicyObject.stages | Where-Object type -eq PROTECTION).operations.backupType
        $PolicyID = $Policy.id
      }

should be:

'byPolicyObject' {
        $StageID = ($PolicyObject.stages | Where-Object type -eq PROTECTION).id
        $BackupType = ($PolicyObject.stages | Where-Object type -eq PROTECTION).operations.backupType
        $PolicyID = $PolicyObject.id
      }
  1. The response is empty, even though the policy is being restarted.
[
  "Tue, 18 Oct 2022 11:01:56 GMT",
  null
]

This is fixed in the same function. Remove .Date:

  end {  
    if (!$noop.IsPresent) {

      switch ($PsCmdlet.ParameterSetName) {
        default {
          write-output $response #was write-output $response.Date
        } 
      }   
    }
  }

Perhaps it would be even better to use write-output $response.Results instead of returning the whole response

XtremeBaumer pushed a commit to XtremeBaumer/PPDM-pwsh that referenced this issue Oct 20, 2022
@bottkars
Copy link
Owner

bottkars commented Dec 6, 2022

Thanks for bringing that up.

Point 1 is fixed in 19.12.1
I don't get Point 2:

The POST response does not return a result, only response headers:
image
Thus , the Header Response will pe scoped to response, and decided to use .date as the output.
If Unsuceesfull, an error will be thrown

@bottkars bottkars closed this as completed Dec 6, 2022
@XtremeBaumer
Copy link
Author

Actually I am getting a different response, which also matches what Dell lists in the documentation.

Can't upload a picture, but the result looks like thi:

Key   : Access-Control-Allow-Methods
Value : {PUT, POST, GET, OPTIONS, DELETE}

Key   : Access-Control-Max-Age
Value : {3600}

Key   : Access-Control-Allow-Headers
Value : {x-requested-with}

Key   : X-Frame-Options
Value : {SAMEORIGIN}

Key   : X-XSS-Protection
Value : {1; mode=block}

Key   : X-Content-Type-Options
Value : {nosniff}

Key   : Content-Security-Policy
Value : {script-src 'self'; object-src 'self'; style-src 'self' 'unsafe-inline'; frame-ancestors 'self'}

Key   : Date
Value : {Tue, 06 Dec 2022 11:57:36 GMT}

Key   : Strict-Transport-Security
Value : {max-age=31536000 ; includeSubDomains}

Key   : Keep-Alive
Value : {timeout=60}

Key   : Referrer-Policy
Value : {no-referrer}

Key   : x-dell-log-trace-id
Value : {TRACE_ID:98da8750a9c3e7f1}

Key   : Transfer-Encoding
Value : {chunked}

Key   : Content-Type
Value : {application/json}

results : {@{stageId=1728aff2-7149-2933-c26e-fa31ac6454ef; status=202; activityId=7c6f5852-835a-49b6-9737-a8682276eb3c}}

And the results : {@{stageId=1728aff2-7149-2933-c26e-fa31ac6454ef; status=202; activityId=7c6f5852-835a-49b6-9737-a8682276eb3c}} is of interest if you want to query for exactly these manually started jobs.

To get this output, I removed .date and am using PPDM Version: 19.12.0-19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants