Fetch a workload ID linked to the recovery server

  1. Authenticate to the cloud platform via the Python shell.

    The following variables should be available now:

    >>> base_url  # the base URL of the API
    '<the Acronis data center URL>/api/dr/v2'
    >>> auth  # the 'Authorization' header value with the access token
    {'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImMwMD...'}
    >>> tenant_id # the ID of the partner tenant that can be accessed with the token
    'ede9f834-70b3-476c-83d9-736f9f8c7dae'
    
  2. Obtain scoped access token for the customer tenant.

    As a result, the following variables should be available:

    >>> scoped_auth # the 'Authorization' header value with the scoped access token
    {'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImMwMD...'}
    
  3. Fetch the information about the recovery server by its ID and store the information in the recovery_server variable.

    >>> recovery_server = response.json()
    
  4. Read the contents of the recovery.resource_id field:

    >>> recovery_server['recovery']['resource_id'] # identifier of the protected workload
    '04f06cab-a2dc-412d-8284-efc30286d0d8'