Start of change

Get system variables

Use this operation to get all of the z/OSMF system variables.

HTTP method and URI path

GET /zosmf/variables/rest/<version>/systems/<sysplex-name>.<system-name>
In this request, the URI path variables are described, as follows:
  • <version> identifies the version of the z/OSMF system variables service. The following value is valid: 1.0.
  • <sysplex-name> identifies the sysplex.
  • <system-name> identifies the system.

Query parameters

You can specify the following query parameter on the request to control which system variables are retrieved:
name=var-name
Specifies the name of the system variable or variables. The variable var-name can be the full name of the system variable or a partial name with the * wildcard character as a suffix or prefix, for example, abc* or *abc. When specifying multiple variable name filters, separate them with &, for example, ?name=abc*&name=*def

Description

This operation retrieves system variables from the system variable pool and returns them in a list. You can filter the returned list by using a variable name as the query parameter.

On successful completion, HTTP status code 200 is returned, along with a response body, which is described in Response content.

Request content

None.

Authorization requirements

See Authorization requirements.

HTTP status codes

On successful completion, HTTP status code 200 (OK) is returned.

If the system variable pool does not exist for the requested system, HTTP status code 200 is returned with an empty array of variables.

Otherwise, the following HTTP status codes are returned for the indicated errors.

Table 1. HTTP error response codes for a get variables request
HTTP error status code Reason Code Description
401   The submitter of the request is not authorized to invoke the task to get the system variables
404 1 Requested system was not found
404 2 Requested system variable pool was not found

Response content

On successful completion, the service returns a response body, which contains a JSON object with details about the system variables. See Table 2 and Table 3. If no system variables match the filter criteria, HTTP status code 200 (OK) is returned with an empty array.

Table 2. Get system variables request response body
Field name Type Description
variables Array of objects A list of one or more variables retrieved from system variable pool. See Table 3.
Table 3. Get system variables request: objects
Field name Type Description
name String Descriptive name for the variable
value String Value for the variable
description String Description of the variable

Example HTTP interaction

In the following example, the GET method is used to get all of the system variables on a system.
Figure 1. Sample request to get system variables
GET /zosmf/variables/rest/1.0/variables/systems./<sysplex-name>.<system-name>
Figure 2. Sample response from a get system variables request
{variables: [
{"name":"sample1", "value":"20", "Description":"Description":"value of sample1"}, 
 {...  }
 ]
}

End of change