Cloud

For the cloud collection resource, you can use an object value to return another value for the same object.

Getting a {cloudProviderInfoId}

IBM Spectrum Protect Plus assigns an ID {cloudProviderInfoId} to each object storage server or repository server.

Method and URI: To get the ID of the folder in the datacenter folder (the root folder), use a GET method and a URI:

GET     https://{hostname|IP}/api/cloud

Path: Response body (JSON) > clouds > name & id

Example: Assume that you have an object storage server that is named BlueMachines - IBM COS - Singapore. A Python snippet that is similar to the following example can be used to request the {cloudProviderInfoId} of the object storage server, 3:

object_name = "BlueMachines - IBM COS - Singapore"

_response = requests.get('https://' + spp_ipv4 + '/api/cloud',
    headers={...}, verify=...)

_response_json = json.loads(_response.text)         # Convert to JSON

_response_json_object = _response_json['clouds']    # Get the specific object

for keys in _response_json_object:
    if keys['name'] == object_name:
        object_id = int(keys['id']))

print(object_id)
3

Getting a {cloudProviderInfoHref}

IBM Spectrum Protect Plus assigns a URL {cloudProviderInfoHref} to each object storage server or repository server.

Method and URI: To convert the value of an object for an identity, use a GET method with a URI:

GET     https://{hostname|IP}/api/cloud

Path: Response body (JSON) > clouds > name & href.

Example: Assume that you have an object storage server that is named BlueMachines - IBM COS - Singapore. A Python snippet that is similar to the following example can be used to request the {cloudProviderInfoHref} of the object storage server, https://10.0.0.100/api/cloud/3:

object_name = "BlueMachines - IBM COS - Singapore"

_response = requests.get('https://' + spp_ipv4 + '/api/cloud',
    headers={...}, verify=...)

_response_json = json.loads(_response.text)         # Convert to JSON

_response_json_object = _response_json['clouds']    # Get the specific object

for keys in _response_json_object:
    if keys['name'] == object_name:
        object_href = keys['links']['self']['href']

print(object_href)
https://10.0.0.100/api/cloud/3