Start of change

Create or update system variables

Use this operation to create or update z/OSMF system variables in the system variable pool.

HTTP method and URI path

POST /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.

Description

This operation creates or updates system variables specified in the request body. If the system variable pool does not exist, this operation creates the pool and adds the variables to it. If there is no request body and the pool does not already exist, the operation creates an empty pool. If there is no request body and the pool already exists, no action is taken. If a variable appears in the request body multiple times, the value of the last occurrence is used as the value of the variable.

On successful completion, HTTP status code 204 (No content) is returned, indicating that the system variables were created or updated with the new value.

Authorization requirements

See Authorization requirements.

Request content

The request content is expected to contain an array of JSON objects. See Table 1.
Table 1. Fields in a JSON object for the create or update system variables request
Field name Type Required or optional Description
name String Required Descriptive name for the variable
value String Required Value for the variable
description String Optional Description of the variable

HTTP status codes

On successful completion, HTTP status code 204 (no content) is returned.

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

Table 2. HTTP error response codes for a create or update system variables request
HTTP error status code Reason Code Description
401   Submitter of the request is not authorized to invoke the task to create the system variables
404 Requested sysplex-name.sysname-name was not found
404 1 Requested system-name was not found

Response content

None.

Example HTTP interaction

In the following example, the POST method is used to create the system variables.
Figure 1. Sample request to create system variables
POST /zosmf/variables/rest/1.0/variables/systems/sysplex-name.system-name
The request body is as follows:
Figure 2. Sample request from a create system variables request
[
  {"name" : "var1","value":"value1","description":"description of the variable"}, 
  {"name" : "var2","value":"value2","description":"description of the variable},....
]

End of change