Retrieving system details using the Common REST API
Before you begin
- You must have the CRA installed and running. For more information, see Installing-and-configuring-the-Common-REST-API.
- Log in to the service and acquire a token. For more information, see Logging-in-to-a-service-using-the-Common-REST-API.
Retrieving the list of systems using the systems endpoint
The systems endpoint uses the GET method to retrieve system details for a product. Use the following URL structure:
https://<hostName>:<portNumber>/cra/serviceGateway/services/products/<productName>/systems
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>/systems
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.
- <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 header 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 system data:
Property | Type | Description |
---|---|---|
context | string | Context of the system |
history | boolean | Indicates whether the returned data is historical |
rc | integer | Return code:
|
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 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
Authorization: Bearer {authToken}
Content-Type: application/x-www-form-urlencoded
Response
Content-type: application/json
{
"rc": 0,
"startRow": 1,
"systems": [
"SJSC",
"SJSD",
"SJSF"
],
"context": "*",
"history": false,
"rowCount": 3,
"totalRowCount": 3
}