Start of change

Export system variables

Use this operation to export z/OSMF system variables for a specific system to a file.

HTTP method and URI path

POST /zosmf/variables/rest/<version>/systems/<sysplex-name>.<system-name>/actions/export
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 exports system variables, for the system identified in the URI, to a CSV file specified by the request body. It creates the file if it does not exist. Files created by this API can be imported with the import 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 export system variables request
Field name Type Required or optional Description
variables-export-file String Required Path to the file to contain the exported system variables. The file must be accessible to the authenticated user.
overwrite Boolean Optional Indicates whether or not the file should be written to if it already exists. If the value is false and the file exists, the call returns with a status code 400. The value defaults to false if it is not specified.

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 Path is not accessible for writing
400 File exists, but the request did not indicate that it should be written to
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 export system variables from a file.
Figure 1. Sample request to export system variables
POST /zosmf/variables/rest/1.0/systems/TESTPLEX.TESTNODE/actions/export
The request body is as follows:
Figure 2. Sample request body for an export system variables request
{ "variables-export-file": "/u/testuser/backup-variables.csv", "overwrite":true }

End of change