SLA policy¶
For the SLA policy collection resource, you can use an object value to return another value for the same object.
Getting an {slapolicyId}
¶
IBM Spectrum Protect Plus assigns an ID {slapolicyId}
to each SLA policy.
Method and URI: To convert the value of an object for an SLA policy, use a GET method with a URI:
GET https://{hostname|IP}/ngp/slapolicy
Path: Response body (JSON) > slapolicies
> name
& id
.
Example: Assume that you added an SLA policy, Gold, to IBM Spectrum Protect Plus. A Python snippet that is similar to the following example can be used to return its {slapolicyId}
value, 2113
:
object_name = "Diamond"
_response = requests.get('https://' + spp_ipv4 + '/ngp/slapolicy',
headers=..., verify=...)
_response_json = json.loads(_response.text) # Convert to JSON
object_json = _response_json['slapolicies']
for keys in object_json:
if keys['name'] == object_name
object_id = keys['id']
print(object_id)
2113