NFS/exports/{exportPath}: PUT

Modifies an existing NFS export.

Availability

Available on all IBM Spectrum Scale™ editions.

Description

The PUT nfs/export/exportPath request modifies an existing NFS export. For more information about the fields in the data structures that are returned, see mmnfs command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/nfs/exports/exportPath
where
nfs/exports
Specifies the NFS export as the resource. Required.
exportPath
Specifies the NFS export, which you need to modify. Required.

Request headers

Accept: application/json

Request parameters

The following parameters can be used in the request URL to customize the request:
Table 1. List of request parameters
Parameter name Description and applicable keywords Required/optional
exportPath The path of the NFS export. The export path is relative to file system's mount point. The path of the file or directory is specified with forward slashes (/). For example: mnt/gpfs0/rest01. The forward slashes in the path are encoded to %2F in the request URL. Required.
body Body of the request that contains the required parameters to be passed on to theIBM Spectrum Scale system to perform the requested operation. Required.

Request data

{      
         "nfsadd": "New client",
         "nfschange": "Change export",
         "nfsremove": "Remove NFS client",
         "nfspostion": "NFS position"
} 
Detailed explanation of the fields are given in the following list:
"nfsadd": "New client"
Adds a new client declaration for the specified path. Client options can be a list of one or more client definitions.
"nfschange": "Change export"
Modifies an existing client declaration for the specified path. Client options can be a list of one or more client definitions.
"nfsremove": "Remove NFS client"
Removes the NFS client specified by client from the export configuration for the path.
"nfspostion": "NFS position"
It reorders the client declaration section within the export declaration file. This option can be used only together with --nfsadd or --nfschange.

Response data

{
    "status": {
      "code":ReturnCode",
      "message":"ReturnMessage"
   },
   jobs: [
      {
         "result":"", 
           { 
             "commands":"String",
             "progress":"String,
             "exitCode":"Exit code",
             "stderr":"Error",
             "stdout":"String",
           },
         "request":" ",
           {
             "type":"{GET | POST | PUT | DELETE}",
             "url":"URL",
             "data":""",
           }
         "jobId":"ID",
         "submitted":"Time",
         "completed":Time",
         "status":"Job status",
         }   
        ],
   }
For more information about the fields in the following data structures, see the links at the end of this topic.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.
"jobs":
An array of elements that describe jobs. Each element describes one job.
"result"
"commands":"String'
Array of commands that are run in this job.
"progress":"String'
Progress information for the request.
"exitCode":"Exit code"
Exit code of command. Zero is success, nonzero denotes failure.
"stderr":"Error"
CLI messages from stderr.
"stdout":"String"
CLI messages from stdout.
"request"
"type":"{GET | POST | PUT | DELETE}"
HTTP request type.
"url":"URL"
The URL through which the job is submitted.
"data":" "
Optional.
"jobId":"ID",
The unique ID of the job.
"submitted":"Time"
The time at which the job was submitted.
"completed":Time"
The time at which the job was completed.
"status":"RUNNING | COMPLETED | FAILED"
Status of the job.

Examples

The following example modifies the NFS export /mnt/gpfs0/fset1 that is configured in the system.

Request URL:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json' 
-d '{
  "nfsadd": "198.51.100.10:443(sectype=sys,krb5)",
  "nfschange": "198.51.100.11:443(sectype=sys,krb5)",
  "nfsremove": "198.51.100.21:443",
  "nfsposition": "1"
}' "https://198.51.100.1:443/scalemgmt/v2/nfs/exports/mnt%2Fgpfs0%2Ffs1"
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.
{
  "status": {
    "code": "200",
    "message": "..."
  },
  "job": [
    {
      "result": {},
      "request": {
        "type": "PUT",
        "url": "/scalemgmt/v2/nfs/exports/mnt%2Fgpfs0%2Ffs1",
        "data": "{ 
          "nfsadd": "198.51.100.10:443(sectype=sys,krb5)",
          "nfschange": "198.51.100.11:443(sectype=sys,krb5)",
          "nfsremove": "198.51.100.21:443",
          "nfsposition": "1""}"
      },
      "jobId": "12345",
      "submitted": "2016-11-14 10.35.56",
      "completed": "2016-11-14 10.35.56",
      "status": "COMPLETED"
    }
  ]
}