You use the VMware Cloud APIs to retrieve a Health Report for your VMware Site Recovery SDDC.

Retrieve an API token for your organization

The API token is a form of authentication similar to a user name and password for a specific organization on VMware Cloud Services.

An API token expires in 6 months by default. You can change the TTL when you create the API token.

Procedure

  1. Log in to https://vmc.vmware.com/.
  2. Click your user name at the top right and then switch to the organization that you want to use.
  3. Navigate to My Account > API Tokens > Generate a New API Token .
  4. Enter the token name, TTL, scopes, and so on.
    In the scopes box select All Roles.
  5. Click Generate.

What to do next

After the API token is generated, copy and record the token value.

Retrieve an authentication token by using an API token

You must have a valid authentication token to use the VMware Cloud APIs.

Prerequisites

Verify that you have retrieved an API token.

Procedure

  1. (Optional) For Linux, use the following command to obtain authentication token.
    export REFRESH_TOKEN=...
    export AUTH_TOKEN=$(curl "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize" -X POST -d "api_token=$REFRESH_TOKEN" | jq -r .access_token)
    export DRAAS_BACKEND_URL=https://vmc.vmware.com
    export ORG_ID=...
    export SDDC_ID=...
  2. (Optional) For Windows Powershell, use the following command.
    $REFRESH_TOKEN="..."
    $AUTH_TOKEN=Invoke-WebRequest -Method Post -Uri "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize" -Body @{"api_token" = $REFRESH_TOKEN} | ConvertFrom-Json | Select-Object -ExpandProperty access_token
    $DRAAS_BACKEND_URL="https://vmc.vmware.com"
    $ORG_ID="..."
    $SDDC_ID="..."

Retrieve a Health Report for your VMware Site Recovery SDDC

After you acquire the authentication token, you can check the health reports for your SDDCs.

Procedure

  1. To retrieve the health report history list in JSON format, copy the following curl item.
    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports" -X GET -H "csp-auth-token: $AUTH_TOKEN"

    To retrieve a single health report, select one report id from the API history list.

    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}" -X GET -H "csp-auth-token: $AUTH_TOKEN"

    To format the JSON output for easier readability, you can add jq command.

    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}" -X GET -H "csp-auth-token: $AUTH_TOKEN" | jq . 

    You can redirect the result to a JSON file.

    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}" -X GET -H "csp-auth-token: $AUTH_TOKEN" | jq . > example.json
  2. To retrieve the details of a health report in JSON format, select one report id from the API history result.
    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}/details" -X GET -H "csp-auth-token: $AUTH_TOKEN"

    To format the JSON output for easier readability, you can add jq command.

    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}/details" -X GET -H "csp-auth-token: $AUTH_TOKEN" | jq . 

    You can redirect the result to a JSON file.

    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}/details" -X GET -H "csp-auth-token: $AUTH_TOKEN" | jq . > example.json
  3. To retrieve the health report in html format, select one report id from the API history result.
    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}/details/html" -X GET -H "csp-auth-token: $AUTH_TOKEN"
    You can redirect the result to an html file.
    curl "https://vmc.vmware.com/api/vsr-guardrails/{{org-id}}/deployments/{{sddc-id}}/site-recovery-health-reports/{{report-id}}/details/html" -X GET -H "csp-auth-token: $AUTH_TOKEN" > example.html