Filesystems/{filesystemName}/file/{path}: DELETE

Deletes a file from the specified GPFS file system.

Availability

Available with IBM Storage Scale Erasure Code Edition only.

Description

The DELETE filesystems/{filesystemName}/file/{path} request deletes a file from the specified GPFS file system.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/filesystems/{filesystemName}/file/{path}
where
file/{path}
Specifies the directory location in the GPFS file system from where the file must be deleted. Required.

Request headers


Accept: application/json

Parameters

Table 1. List of parameters
Parameter name Description and applicable keywords Required/Optional
filesystemName Name of the GPFS file system from which the file must be deleted. Required
path The directory location. The path that is provided is relative to the file system's mount point.  

Request data

No request data.

Response data

{
  "{
  "status": {
    "code": Return Code,
    "message": "String"
  },
  "jobs": [
    {
      "result": {
        "commands": "Array",
        "progress": "Array",
        "exitCode": Integer,
        "stderr": "Array",
        "stdout": "Array"
      },
      "request": {
        "type": "POST| GET | PUT | DELETE",
        "url": "String",
        "data": "String"
      },
      "jobId": Integer,
      "submitted": "Date and Time",
      "completed": "Date and Time",
      "runtime": Integer,
      "status": "RUNNING | CANCELLING | CANCELLED | COMPLETED | FAILED ",
      "pids": "Integer"
    }
  ]
}    }
  ]
}
"status":
Return status.
"message": "ReturnMessage"
The return message.
"code": ReturnCode
The return code.
"jobs"
An array that comprises details on the jobs that were run.
"result":
Specifies the job results.
"commands": commands executed
Specifies the commands that were issued for the job.
"progress":"Job progress "
Specifies the progress of the job.
"exitCode":"exit codes"
Specifies the exit code of the command. A value zero indicates success while any other zero indicates failure.
"stderr":"CLI messages"
Specifies the CLI messages received from stderr.
"stdout":"CLI messages"
Specifies the CLI messages from stdout.
result
Specifies the job results.
"type": "GET | POST | PUT| DELETE
Specifies the HTTP request type.
"URL" : "URL"
Specifies the URL through which the job is submitted.
"Data" : "request data"
Specifies the request data. Optional.
"jobId": "ID",
Specifies the unique ID of the job.
"submitted": "Date and Time"
Specifies the date and time at which the job was submitted.
"completed": "Date and Time"
Specifies the date and time at which the job was completed.
"runtime": "Duration"
Specifies the duration for which the job ran.
"status":"RUNNING | COMPLETED | FAILED"
Specifies the status of the job.
"pids":"Process ID"
Specifies the process IDs of all the active sub processes that manage the job.

Examples

The following example shows how to delete a file that exists in the path 2Fmyfile.img in the file system gpfs2:

Request data:
 curl -k -u admin:admin001 -X DELETE --header 'accept:application/json' 
'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs2/file/2Fmyfile.img'

Response data:

Note: In the JSON data that is returned, the return code indicates whether the command is successful. The response code 200 indicates that the command successfully retrieved the information. Error code 400 represents an invalid request and 500 represents internal server error.
{
  "jobs" : [ {
    "jobId" : 1000000000002,
    "status" : "COMPLETED",
    "submitted" : "2021-01-30 18:01:45,173",
    "completed" : "2021-01-30 18:01:45,737",
    "runtime" : 566,
    "request" : {
      "type" : "DELETE",
      "url" : "scalemgmt/v2/filesystems/gpfs2/file/2Fmyfile.img"
      "data": " "
    },
    "result" : {
      "progress" : [ ],
      "commands" : [ "rm -rf filename" ],
      "stdout" : [ " " ],
      "stderr" : [ ],
      "exitCode" : 0
    },
    "pids" : [ ]
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully."
  }
}