Retrieving server details using the Common REST API


You can use the Common REST API (CRA) to retrieve server details for a specific product using the servers endpoint. This endpoint retrieves the server details and returns a JSON.

Before you begin

Retrieving the list of systems using the systems endpoint

The servers endpoint uses the GET method to retrieve server details for a product. Use the following URL structure:

https://<hostName>:<portNumber>/cra/serviceGateway/services/products/<productName>/servers

In SPE2410, we have deprecated the serviceName parameter from the URL. However, you can still use the existing URL. 

https://<hostName>:<portNumber>/cra/serviceGateway/services/<serviceName>/products/<productName>/servers

The variables represent the following values:

  • <hostName> is the name of the mainframe host where the CRA server is running.
  • <portNumber> is the port number of the CRA server.
  • (Optional) <serviceName> is the service name you use to log in to a service. For more information, see To retrieve a list of services.

    Important

    By default, the service name is the one you have logged in to work with the API.

  • <productName> is the name of the product as it appears on the list. For more information, see Retrieving-a-list-of-installed-products-using-the-Common-REST-API.

Authorization

Name

Located in

Description

Authorization

header

Authorization token formatted as 'Bearer [token]'

Header parameters

This endpoint accepts the following query parameters:

Parameter

Description

serviceName

(Optional) Requested service

productName

(mandatory) Requested product

context

Context for the view

Default: *

server

Usually is the PAS ID

Default: *

sort

Sorting control string

Generates an ORDER statement. You can sort up to 4 parameters

Example: sort A.D&B.A

A and B represent the IDs from a get view definition request.

filter

Generates a QWHERE clause

Example: filter APPLID=CMF&SYSNAME=S*

Authorization

User token

Response body

On successful completion, the response body contains a JSON object containing the server data:

Property

Type

Description

productName

string

Product name

viewName

string

View name

context

string

Context of the server

system

string

Only if sent as a path parameter

server

string

Only if sent as a path parameter

history

boolean

Indicates whether the returned data is historical

startrow

integer

1-based index of the first row of data

rowcount

integer

Total number of rows returned for this request

totalrowcount

integer

Total number of rows available

rc

integer

Return code:

  • 2 = data
  • 4 = data and error messages
  • 8 or greater = error messages with no data

Important

The data returned on return code 4 is likely to be incomplete.

servers

list of servers

Each list item is a server

HTTP status and reason codes

The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and the associated error message.

Error Code

Explanation

200

Successful completion

403

Unauthorized. The authorization token is missing, invalid, or expired

404

The path is not valid. Most likely because the service in the URL does not exist.

Example

Request

The request example uses the following values:

  • <hostName> = myCRAhost
  • <portNumber> = 443
  • <serviceName> = Mva
  • <productName> = PLEXMGR
GET https://myCRAhost:443/cra/serviceGateway/services/Mva/products/PLEXMGR/servers
Authorization: Bearer {authToken}
Content-Type: application/x-www-form-urlencoded

Response

200 OK
Content-type: application/json
{
   "productName": "PLEXMGR",
   "viewName": "plex",
   "context": "*",
   "startRow": "1",
   "rowCount": 28,
   "totalrowcount": 28,
   "rc": 0,
   "history": false,
   "servers": [
       "PLEXMGR",
       "X32D",
       "MVE07171",
       "XTS32PAS",
       "X32F",
       "M32F",
       "M32D",
       "TSHD"
    ]
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*