Application

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

Getting an {applicationName}

To specify the application, use one of the following system values:

Application

{applicationName}

VMware vCenter

vmware

Hyper-V

hyperv

Amazon EC2

awsec2

Office 365

office365

Db2

db2

Exchange Server

exchange

MongoDB

mongo

Oracle Database

oracle

SQL Server

sql

IBM Spectrum Protect Plus

catalog

Getting an {applicationName}

IBM Spectrum Protect Plus assigns a name {applicationInstanceName} to each application instance on an application server.

The [applicationInstanceName} for instances of Db2, SQL Server, MongoDB, and Exchange Server has the following syntax:

{application server FQDN} / {application server name}

The [applicationInstanceName} for Oracle Database instances have the following syntax:

{application server host name} / {application server name}

Example 1: Assume that you installed a Db2 instance, db2americas, on a Linux server, whose FQDN is db2dallas1.bluemachines.com.invalid. The {applicationName} of this Db2 instance is structured as shown:

db2dallas1.bluemachines.com.invalid / db2americas

Example 2: Assume that you installed an Oracle Database instance, Oracle18cDBHome, on a Linux server, whose hostname is oracle-dallas1. The {applicationName} of this Oracle Database instance is structured as shown:

oracle-dallas1 / Oracle18cDBHome

Getting an {applicationInstanceId}

IBM Spectrum Protect Plus assigns an ID, {applicationInstanceId}, to each application instance on an application server.

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

GET     https://{hostname|IP}/api/application/{applicationName}/instance

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

Example: Assume that you registered the following Db2 application instance with IBM Spectrum Protect Plus:

  • {applicationName}: db2

  • {applicationInstanceName}: db2dallas1.bluemachines.com.invalid / db2americas

A Python snippet that is similar to the following example can be used to return its ID, f794d5b0234ffa5271738a4bd9fbd905:

application_name = "db2"
object_name = "db2dallas1.bluemachines.com.invalid / db2americas"

_response = requests.get('https://' + spp_ipv4 + '/api/application/'
    + application_name + '/instance,
    headers=..., verify=...)

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

object_json = _response_json['instances']

for keys in object_json:
    if keys['name'] == object_name:
        object_id = keys['id']

print(object_id)
f794d5b0234ffa5271738a4bd9fbd905

Getting an {applicationDatabaseId}

IBM Spectrum Protect Plus assigns an ID, {applicationDatabaseId}, to each database on an application server.

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

GET     https://{hostname|IP}/api/application/{applicationName}
↪/instance

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

Example: Assume that you registered the following Db2 application instance with IBM Spectrum Protect Plus:

  • {applicationName}: db2

  • {applicationInstanceId}: f794d5b0234ffa5271738a4bd9fbd905

A Python snippet that is similar to the following example can be used to return its ID, b91891e551ee0ac0765472ac0e3ba041:

application_name = "db2"
application_instance_id = "f794d5b0234ffa5271738a4bd9fbd905"
    # db2dallas1.bluemachines.com.invalid / db2americas

object_name = "db2dallas1.bluemachines.com.invalid / db2americas"

_response = requests.get('https://' + spp_ipv4 + '/api/application/'
    + application_name + '/instance,
    headers=..., verify=...)

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

object_json = _response_json['instances']

for keys in object_json:
    if keys['name'] == object_name:
        object_id = keys['links']['self']

print(object_id)
b91891e551ee0ac0765472ac0e3ba041

Getting an {applicationDatabasegroupId} for SQL Server

IBM Spectrum Protect Plus assigns an ID, {applicationDatabasegroupId}, to each AG of SQL Servers.

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

GET     https://{hostname|IP}/api/application/sql/databasegroup

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

Example: Assume that you registered the following SQL Server instances with IBM Spectrum Protect Plus:

  • Availability group name: “bluemachines-ag”

A Python snippet that is similar to the following example can be used to return its ID, 372C4D0A-9069-439A-B356-7501A908270B:

object_name = "bluemachines-ag"

_response = requests.get('https://' + spp_ipv4 + '/api/application/sql'
    + '/databasegroup',
    headers=..., verify=...)

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

object_json = _response_json['databasegroups']

for keys in object_json:
    if keys['name'] == object_name:
        object_id = keys['primaryKey']

print(object_id)
372C4D0A-9069-439A-B356-7501A908270B