List z/OS UNIX Filesystems
You can use the list z/OS UNIX filesystems operation to list all mounted filesystems, or the specific filesystem mounted at a given path, or the filesystem with a given Filesystem name.
HTTP method and URI path
GET /zosmf/restfiles/mfs/
GET /zosmf/restfiles/mfs/?path=file-path-name
GET /zosmf/restfiles/mfs/?fsname=file-system-name
where:
- /zosmf/restfiles specifies the z/OS® data set and file REST interface
- /mfs indicates a Unix System Services filesystem(s) request.
A trailing "/" may optionally be specified.
Query parameters
- path
- This parameter identifies the UNIX directory that contains the files and directories to be listed. This parameter may not be specified if the 'fsname' parameter is specified. It can consist a directory or fully qualified path name in the UNIX file system structure. A fully qualified file name can be up to 1023 bytes long. You cannot use wildcard characters for this parameter.
- fsname
- This parameter identifies the fully qualified filesystem name to be listed. For zFS filesystems, this is the data set name of the aggregate. This parameter may not be specified if the 'path' parameter is specified.
Headers
- X-IBM-MAX-Items
- This header value specifies the maximum number of items to return. To request that all items be returned, set this header to 0. If you omit this header, or specify an incorrect value, up to 1000 items are returned by default.
Required authorizations
Usage considerations
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. Status code 404 indicates that the specified filesystem was not found. A JSON response document with no filesystem items will be returned. 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 renaming a data set and PDS member.
Figure 1. List UNIX Filesystems
If more items than specified by X-IBM-Max-Items (or the default of 1000) match the request,
then the following top-level attribute will be added to the top-level document:JSON response document:
Request:
GET https://zosmf1.yourco.com/zosmf/restfiles/mfs/?path=/usr/local HTTP/1.1
GET https://zosmf1.yourco.com/zosmf/restfiles/mfs/?fsname=OMVS.USR.LOCAL.ZFS HTTP/1.1
JSON response document:
{"items":[
{ "name":"OMVS.USR.LOCAL.ZFS",
"mountpoint":"/usr/local",
"fstname":"ZFS",
"status":"active",
"mode":["acl","synchonly"],
"dev":52,
"fstype":1,
"bsize":1024,
"bavail":5615,
"blocks":9600,
"sysname":"SYSNAME1",
"readibc":2,
"writeibc":0,
"diribc":0
}
],"JSONversion":1}
For a non-specific request to list all filesystems, the following top-level attributes are also returned:
returnedRows - the number of filesystem items returned
totalRows - the total number of filesystems
"moreRows":true
- JSON response attributes:
- These attributes are the mnt3_* values returned from the w_getmntent() C-Library API.