Retrieving system details using the Common REST API


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

Before you begin

Retrieving the list of systems using the systems endpoint

The systems endpoint uses the GET method to retrieve system details for a product. Use a URL based on the following structure:

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

The variables represent the following values:

Authorization

Name

Located in

Description

Authorization

header

Authorization token formatted as 'Bearer [token]'

Header parameters

This endpoint accepts the following header parameters:

Parameter

Description

serviceName

(mandatory) 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 system data:

Property

Type

Description

context

string

Context of the system

history

boolean

Indicates whether the returned data is historical

rc

integer

Return code:

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


Note

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

rowCount

integer

Total number of rows returned for this request

systems

list of systems

Each list item is a system

startRow

integer

1-based index of the first row of data

totalRowCount

integer

Total number of rows available

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 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/systems
Authorization: Bearer {authToken}
Content-Type: application/x-www-form-urlencoded

Response

200 OK
Content-type: application/json
{
 "rc": 0,
 "startRow": 1,
 "systems": [
 "SJSC",
 "SJSD",
 "SJSF"
 ],
 "context": "*",
 "history": false,
 "rowCount": 3,
 "totalRowCount": 3
}

 

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