Access Method Services Interface

You can use the Access Method Service (IDCAMS) to provide a REST/JSON interface to IDCAMS. You can use this operation to create a new zFS filesystem.

HTTP method and URI path

PUT /zosmf/restfiles/ams
where:
  • /zosmf/restfiles specifies the z/OS data set and file REST interface
  • /ams indicates a request for Access Method Services (IDCAMS) services.

Input Content

Input content in a json document:
Table 1. Input Content
Property Description Required
input one or more input lines <= 255 in length Yes
JSONversion:1 JSON Version No
Note: The size of all input lines plus the number of input lines must be <= 8K.

Response Body

If the request is successfully executed, will return 200 status code (IDCAMS RC<=4). In all cases an application/json document will be returned:
Table 2. Response
Property Description Required
rc Return code from IDCAMS. Yes
output One or more input lines <= 255 in length. Yes
JSONversion JSON Version. No

Required authorizations

See Required authorizations.

Usage considerations

See Usage considerations for the z/OSMF REST services.

Expected response

On completion, the service returns an HTTP response, which includes a status code indicating whether your request completed. Status code 200 OK indicates success. A status code of 4nn or 5nn indicates that an error has occurred. For more details, see Error handling.

For errors, the HTTP response includes error information as a JSON error report document. See Error report document.

Example

Refer to Figure 1 for an example of IDCAMS Access Methods Services.
Figure 1. IDCAMS Access Methods Services
request:
PUT https://zosmf1.yourco.com/zosmf/restfiles/ams  HTTP/1.1
	Content-Type: application/json
	Content-Length: nn
	{
		"input":[
		"DEFINE CLUSTER(NAME (EXAMPL1.KSDS) VOLUMES(VSER05)) -",
		"DATA  (KILOBYTES (50 5))"],
		"JSONversion":1
	}