Start of change

Import system variables

Use this operation to import z/OSMF system variables from a file.

HTTP method and URI path

POST /zosmf/variables/rest/<version>/systems/<sysplex-name>.<system-name>/actions/import
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 imports system variables from a file. The file must be accessible by the authenticated user. The file contains variable definitions in comma-separated value (CSV) format, where each row consists of the variable name, value and description. There should be no header row in the file. The variables imported from the file are processed in the same way as variables that are specified with the create system variables API.

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

Authorization requirements

See Authorization requirements.

Request content

The request content is expected to contain a JSON object. See Table 1.

Table 1. Request content for the import system variables request
Field name Type Required or optional Description
variables-import-file String Required Path to the CSV-formatted file containing the variables to import

HTTP status codes

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

If the system variable pool does not exist for the requested system, HTTP status code 204 is returned.

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

Table 2. HTTP error response codes for a create system variables request
HTTP error status code Description
400 Request body is not syntactically correct
400 Specified file was either not found or could not be opened
400 Specified file has an incorrect format
401 Submitter of the request is not authorized to add or delete system variables
404 Requested system was not found
500 A server error occurred during processing of the request.

Response content

None.

Example HTTP interaction

In the following example, the POST method is used to import system variables from a file.
Figure 1. Sample request to import system variables
POST /zosmf/variables/rest/1.0/systems/TESTPLEX.TESTNODE/actions/import
The request body is as follows:
Figure 2. Sample request body for an import system variables request
{ "variables-import-file": "/u/testuser/variables.csv" }

End of change