Get system variables

Use this operation to get the z/OSMF variables or system symbols from a selected system.

HTTP method and URI path

GET /zosmf/variables/rest/<version>/systems/<sysplex-name>.<system-name>
GET/zosmf/variables/rest/<version>/systems/local
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. For system symbols, we only support the local sysplex-name here.
  • <system-name> identifies the system.
  • <local> indicates the API to retrieve the variable/symbol value from the local system which the z/OSMF server is running on.
Table 1. Request Parameters
Parameter Required/Optional Description
var-name Optional
The name of a z/OSMF variable or a system symbol.
  • System symbol name, the name that is assigned to a symbol, a character string. Note that in IEASYMxx, the symbol name begins with an ampersand (&) and optionally ends with a period (.). For this REST API, the ampersand (&) and the period (.) are omitted. System symbols should usually be specified in uppercase. There are places, for example, operator commands, where system symbols can be specified in lowercase.
  • z/OSMF variable name, the name that is assigned to a z/OSMF variable, a character string.

If you omit the var-name in the request, all the z/OSMF variable values/symbol values defined in the system are returned.

If you need to specify more than one var-name in the request, you can use the array format parameter, for example:
/zosmf/variables/rest/<version>/systems/<sysplex-name>.<system-name>? var-name =name1&var-name=name2&var-name=name3&var-name=name4&…
source Optional
Identify the var-name that represents a z/OSMF variable name or a system symbol name. Valid values for the source are:
  • variable
    Indicates that the var-name is a z/OSMF variable name. This is the default.
  • symbol
    Indicates that the var-name is a system symbol name.

Description

This operation retrieves z/OSMF variables from the variable pool or system symbols and returns them in a list.

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

For general requirements, see Authorization requirements.

Unlike the other z/OSMF Variables services, a get variables request does not require the client to have READ access to ZOSMF.VARIABLES.SYSTEM.ADMIN resource profile in the ZMFAPLA class.

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 2. HTTP error response codes for a get system variables request
HTTP error status code Description
404 Requested system was not found.
404 The system identifier in the URI of the request is not valid.
500 A server error occurred during processing of the request.

Response content

On successful completion, the service returns a response body, which contains a JSON object with details about the system variables. See Table 3 and Table 4. If no system variables match the filter criteria, HTTP status code 200 (OK) is returned with an empty array.
Table 3. Get system variables request response body
Field name Type Description
system-variable-list Array of objects List of z/OSMF variable value.
system-symbol-list Array of objects List of system symbol value.
Note: Either “system-variable-list” or “system-symbol-list” is returned in the response, not both.
Table 4. Get system variables request: objects
Field name Type Description
name String Descriptive name for the variable/symbol.
value String Value for the variable/symbol.
description String Description of the variable. For the system-symbol-list, this field is reserved for future use.