You can use this operation to delete a UNIX file or directory.
HTTP method and URI path
DELETE /zosmf/restfiles/fs/<file-pathname>
where:
/zosmf/restfiles specifies the z/OS data set and file REST interface
/fs indicates a UNIX file or directory.
<file-pathname> is the name of the file or directory you are going to delete.
Request Body
None.
Standard headers
None.
Custom headers
X-IBM-Option:An optional parameter for deleting a directory. If it is not specified, only
the empty directory can be deleted. If it is specified as recursive, it means all the files and
sub-directories will be deleted.
On completion, the service returns an HTTP response, which includes a status code
indicating whether your request completed. Status code 204 indicates success. A
status code of 4nn or 5nn indicates that an error
has occurred. For more details, see Error handling.
If the request is successfully executed, status code 204 indicates success and no content
returned is returned.
Example request
In the following example, the DELETE method is used to delete a UNIX file.