Getting information for databases

You can get a list of application servers that host databases. Or, you can specify one application server and obtain information about the specified application server.

Method and URI

To get information about all application instances of a specific application, use a GET method and a URI:

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

To get information about a specific application instance, use a GET method and a URI:

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

To get information about databases of a certain application instance, use a GET method and a URI:

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

To get information about a specific database of a certain application instance, use a GET method and a URI:

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

Tip

To get an {applicationName} value based on the type of the application, follow the instructions in Getting an {applicationName}. To get an {applicationInstanceId} value based on the name of the application instance, follow the instructions in Getting an {applicationInstanceId}.

Parameters

Parameter 1: from

  • Value: hlo

  • Type: System string. Required.

Example 1: Get information about application instances

Assume that you want to see a list of Db2 application servers that are registered with IBM Spectrum Protect Plus.

A Python snippet that is similar to the following example can be used to request information about all Db2 application instances:

application_name = "db2"

requests.get('https://' + spp_ipv4 + '/api/application/' + application_name
    + '/instance'
    headers={...}, verify=...)
_images/reference_db2_get1.png

Figure 28 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the navigation pane, click Manage Protection > Databases > Db2. You can get other types of applications in a similar way.

_images/reference_db2_get02.png

Figure 29 Click Manage application servers and you can see a list of application servers.

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK). You can get information about application instances of other types of applications in a similar way.

{
    "links": {...},
    "total": 2,
    "instances": [
        {
            "links": {...},
            "id": "f794d5b0234ffa5271738a4bd9fbd905",
            "type": "db2",
            "osType": "linux",
            "isOwnerNode": false,
            "host": "10.7.7.1",
            "name": "db2dallas1.bluemachines.com / db2americas",
            "applicationFullName": "IBM Db2",
            "version": "11.1.3",
            "providerNodeId": "1001",
            "sessionId": 1571343979215,
            "jobId": "1005",
            "resourceType": "applicationinstance",
            "rbacPath": "root:0/app:0/app.type:db2/appinst:f794d5b0234ffa5271738a
↪4bd9fbd905",
            "appServerVmInfos": [
                {
                    "appServerId": "1001",
                    "appServerName": "10.7.7.1",
                    "vmId": null,
                    "vmName": null,
                    "vmLocation": null,
                    "hypervisorServerId": null,
                    "hypervisorServerName": null,
                    "hypervisorHost": null
                }
            ],
            "capabilities": {
                "resolveLogBackupLocations": false,
                "presnapshot": null,
                "snapshot": null,
                "postsnapshot": null,
                "enablelogbackup": null,
                "disablelogbackup": null,
                "logtruncate": null,
                "recordbackup": null,
                "masking": null,
                "prerestore": null,
                "restore": null,
                "postrestore": null,
                "restorecleanup": null
            },
            "location": "/db2dallas1.bluemachines.com / db2americas",
            "metadataPath": "/DBINST:f794d5b0234ffa5271738a4bd9fbd905",
            "storageProfiles": []
        },
        {
            "links": {...},
            "id": "26e734b8e0ac6e3afa52ba1cd2bd6e93",
            "type": "db2",
            "osType": "aix",
            "isOwnerNode": false,
            "host": "10.0.7.2",
            "name": "db2singapore1.bluemachines.com / db2apac",
            ...
        }
    ]
}

Example 2: Get information about databases

Assume that you want to get information about all databases in the following Db2 application instance:

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

  • {applicationInstanceId}: f794d5b0234ffa5271738a4bd9fbd905

A Python snippet that is similar to the following example can be used to request information about all databases in the application instance:

application_name = "db2"
application_instance_id = "f794d5b0234ffa5271738a4bd9fbd905"

requests.get('https://' + spp_ipv4 + '/api/application/' + application_name
    + '/instance/' + application_instance_id + '/applicationview/'
    headers={...}, verify=...)
_images/reference_db2_get3.png

Figure 30 Click the application instance and you can see the databases in it.

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK). You can get information about application instances of other types of applications in a similar way.

{
    "links": {...,}
    "total": 2,
    "contents": [
        {
            "links": {...},
            "name": "DB_SALES",
            "type": "db2",
            "resourceType": "database",
            "id": "b91891e551ee0ac0765472ac0e3ba041",
            "host": "10.7.7.1",
            "providerNodeId": "1001",
            "sessionId": 1571343979215,
            "jobId": "1005",
            "rbacPath": "root:0/app:0/app.type:db2/appinst:f794d5b0234ffa5271738
↪a4bd9fbd905/appdb:b91891e551ee0ac0765472ac0e3ba041",
            "usedSize": 0,
            "totalSize": 0,
            "dataVolumeIds": [],
            "logVolumeIds": [],
            "eligibility": {
                "backup": {
                    "eligible": true,
                    "reason": ""
                },
                "logbackup": {
                    "eligible": true,
                    "reason": ""
                }
            },
            "metadataPath": "/DBINST:f794d5b0234ffa5271738a4bd9fbd905/DB:b91891e
↪551ee0ac0765472ac0e3ba041",
            "storageProfiles": [],
            "paths": [],
            "location": "/db2dallas1.bluemachines.com / db2americas/DB_SALES"
        },
        {
            "links": {...},
            "name": "DB_SERVICES",
            "type": "db2",
            "resourceType": "database",
            "id": "8c52d9437edfe68896ef9d1d91f77bfd",
            ...
        }
    ]
}

Example 3: Get information about a specific database

Assume that you want to get information about the following database:

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

  • {applicationInstanceId}: f794d5b0234ffa5271738a4bd9fbd905

  • Database name: DB_SALES

A Python snippet that is similar to the following example can be used to request information about all databases in the application instance:

application_name = "db2"
application_instance_id = "f794d5b0234ffa5271738a4bd9fbd905"

requests.get('https://' + spp_ipv4 + '/api/application/' + application_name
    + '/instance/' + application_instance_id + '/applicationview/'
    headers={...}, verify=...)

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK). You can get information about application instances of other types of applications in a similar way.

{
    "links": {...,}
    "total": 2,
    "contents": [
        {
            "links": {...},
            "name": "DB_SALES",
            "type": "db2",
            "resourceType": "database",
            "id": "b91891e551ee0ac0765472ac0e3ba041",
            "host": "10.7.7.1",
            "providerNodeId": "1001",
            "sessionId": 1571343979215,
            "jobId": "1005",
            "rbacPath": "root:0/app:0/app.type:db2/appinst:f794d5b0234ffa5271738
↪a4bd9fbd905/appdb:b91891e551ee0ac0765472ac0e3ba041",
            "usedSize": 0,
            "totalSize": 0,
            "dataVolumeIds": [],
            "logVolumeIds": [],
            "eligibility": {
                "backup": {
                    "eligible": true,
                    "reason": ""
                },
                "logbackup": {
                    "eligible": true,
                    "reason": ""
                }
            },
            "metadataPath": "/DBINST:f794d5b0234ffa5271738a4bd9fbd905/DB:b91891e
↪551ee0ac0765472ac0e3ba041",
            "storageProfiles": [],
            "paths": [],
            "location": "/db2dallas1.bluemachines.com / db2americas/DB_SALES"
        },
        {
            "links": {...},
            "name": "DB_SERVICES",
            "type": "db2",
            "resourceType": "database",
            "id": "8c52d9437edfe68896ef9d1d91f77bfd",
            ...
        }
    ]
}