Filesystems/{filesystemName}/filesets/{filesetName}/snapshots: GET

Gets information about snapshots of a specific fileset.

Availability

Available on all IBM Spectrum Scale™ editions.

Description

The GET filesystems/{filesystemName}/filesets/{filesetName}/snapshots request gets information about snapshots in the specified fileset. For more information about the fields in the data structures that are returned, see the topics mmcrsnapshot command and mmlssnapshot command.

Request URL

https://IP of API server:<port>/scalemgmt/v2/filesystems/filesystemName/filesets/filesetName/snapshots
where
filesystems/filesystemName
Specifies the file system to which the fileset belongs. Required.
filesets/filesetName
Specifies the fileset of which the snapshot is taken. Required.
snapshots
Specifies snapshot as the resource of this GET call. Required.

Request headers

Content-Type: application/json
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
filesystemName The file system name. You can also use keywords such as :all:, :all_local:, or :all_remote: Required.
filesetName The fileset name. This is the path of the fileset. Required.
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.

Request data

No request data.

Response data

{  
   "status": {
      "code":ReturnCode,
      "message":"ReturnMessage"
   },
    "paging": 
    {
    "next": "URL"
    },
   snapshots: [
      {
            "snapshotName":"Snapshot"
            "filesystemName":"Device",
            "filesetName":"Fileset",
            "oid":"ID",
            "snapID":"ID",
            "status":"Status"
            "created":"DateTime",
            "quotas":"Quotas",
            "snapType":"Type",
      }
   ]
}
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.
"paging"
The URL to retrieve the next page. Paging is enabled when more than 1000 objects are returned by the query.
"snapshotName":"Snapshot"
The snapshot name.
"filesystemName":"Device"
The file system that is the target of the snapshot.
"filesetName":"Fileset"
For a fileset snapshot, the fileset that is a target of the snapshot.
"oid":"ID"
Internal identifier that is used for paging.
"snapID":"ID"
The snapshot ID.
"status":"Status"
The snapshot status.
"created":"DateTime"
The date and time when the snapshot was created.
"quotas":"Quotas"
Any quotas that are applied to the fileset.
"snapType":"Type"
The AFM type of the snapshot, including "afm_snap", "afm_recovery", "afm_failover", "afm_rpo", "afm_baserpo", and "Invalid".

Examples

The following example gets information about the snapshots of the fileset myFset1, which belongs to the file system gpfs0.

Request data:
curl -k -u admin:admin001 -X GET --header 'accept:application/json' 
'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/filesets/myFset1/snapshots'
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.
{
  "snapshots" : [ {
      "filesetName" : "myFset1",
      "filesystemName" : "gpfs0",
      "snapshotName" : "mySnap1"
    }
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully"
  }
}
Using the field parameter ":all:" returns entire details of the snapshot 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/filesystems/gpfs0/filesets/myFset1/snapshots?fields=:all:'
{
  "snapshots" : [ {
      "created" : "2017-03-21 15:52:14,000",
      "filesetName" : "myFset1",
      "filesystemName" : "gpfs0",
      "oid" : 2,
      "quotas" : "",
      "snapID" : 2,
      "snapType" : "",
      "snapshotName" : "mySnap1",
      "status" : "Valid"
    }
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully"
  }
}