NFS/exports: GET

Gets information about NFS exports configured in the system.

Availability

Available on all IBM Spectrum Scale™ editions.

Description

The GET nfs/exports request gets information about NFS exports. 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
where
nfs/exports
Specifies NFS export as the resource. Required.

Request headers

Accept: application/json

Request data

No request data.

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
fields Comma separated list of fields to be included in response. ':all:' selects all available fields. Optional.
filter Filter objects by expression. For example, 'status=HEALTHY,entityType=FILESET' Optional.

Response data

The following list of attributes are available in the response data:

{      
   "status":
     {
      "code": ReturnCode
      "message": "ReturnMessage",   
    }
  "NfsExports": 
    [
      {
         "filesystemName": "FileSystemName"
         "path": "Path",
         "delegations": "Delegations",
      }],
   nfsClients":[
      {
         "clientName": "String"
         "exportID": "Path",
         "access_type": "none | RW | RO | MDONLY | MDONLY_RO",
         "squash": "root | root_squash | all | all_squash | allsquash | no_root_squash | none"
         "anonUid": "ID",
         "anonGid": "ID",
         "privilegedPort": "True | False"
         "sectype": "sys | krb5 | krb5i | krb5p | None",
         "protocols": "NFS3 | NFS4",
         "transportProtocol": "TCP | UDP"
         "delegations": "none | read | write | readwrite",
         "manageGids": "True | False"
         "nfsCommit": "True | False",
      }
}
"status":
Return status.
"code": ReturnCode,
The HTTP status code that was returned by the request.
"message": "ReturnMessage"
The return message.
"exports":
An array of information about NFS exports. The array contains elements that describe the NFS exports. For more information about the fields in this structure, see the links at the end of this topic.
"filesystemName": "FileSystemName"
The name of the file system to which the export belongs.
"path": "Path",
Specifies the path for the export.
"delegations": "Delegations"
Specifies what delegate file operations are permitted.
nfsClients
"clientName": "String"
The host name or IP address of the NFS server to be accessed.
"exportID": "Path"
The internal unique ID of the export.
"access_type": "none | RW | RO | MDONLY | MDONLY_RO"
Specifies the type of the access for the client.
"squash": "root | root_squash | all | all_squash | allsquash | no_root_squash | none"
Specifies whether the squashing mechanism is applied to the connecting client.
"anonUid": "ID"
This option explicitly sets the UID of the anonymous account.
"anonGid": "ID"
This option explicitly sets the GID of the anonymous account.
"privilegedPort": "True | False"
This option to specify whether a client that uses an ephemeral port must be rejected.
"sectype": "sys | krb5 | krb5i | krb5p | None"
The supported authentication method for the client.
"protocols": "NFS3 | NFS4 "

Supported NFS protocol version.

"transportProtocol": "TCP | UDP"
Specifies the transport layer.
"delegations": "none | read | write | readwrite"
Specifies what delegate file operations are permitted.
"manageGids": "True | False"
Whether this NFS client is allowed to manage GIDs.
"nfsCommit": "True | False"

Whether to commit the transmitted data on the server side.

Examples

The following example gets information about the NFS exports that are configured in the system:

Request URL:
curl -k -u admin:admin001 -X GET --header 'accept:application/json' 
'https://198.51.100.1:443/scalemgmt/v2/nfs/exports'
The request URL with no field or filter parameter returns only the details that uniquely identify the object.
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.
{
  "nfsexports" : [ {
        "path" : "/mnt/gpfs0"
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully"
  }
}
Using the field parameter ":all:" returns entire details of the NFS exports as shown in the following example:
curl -k -u admin:admin001 -X GET --header 'accept:application/json' 
'https://198.51.100.1:443/scalemgmt/v2/nfs/exports?fields=:all:'
{
  "nfsexports" : [ {
       "delegations" : "NONE",
      "filesetName" : "",
      "filesystemName" : "gpfs0",
      "path" : "/mnt/gpfs0"
    },
    "nfsClients" : [ {
      "access_type" : "RW",
      "anonGid" : "-2",
      "anonUid" : "-2",
      "clientName" : "198.51.100.123",
      "delegations" : "NONE",
      "exportid" : "1",
      "manageGids" : false,
      "nfsCommit" : false,
      "privilegedPort" : false,
      "protocols" : "3,4",
      "sectype" : "SYS",
      "squash" : "ROOT_SQUASH",
      "transportProtocol" : "TCP"
    } ]
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully"
  }
}