Filesystems/{filesystemName}/snapshots: GET

Gets information about snapshots of a specific file system.

Availability

Available on all IBM Spectrum Scale™ editions.

Description

The GET filesystems/{filesystemName}/snapshots request gets information about snapshots in the specified file system. 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 address or host name of API server>:<port>/scalemgmt/v2/filesystems/filesystemName/snapshots
where
filesystems/filesystemName
Specifies the file system 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.
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 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/snapshots'
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": "..."
  },
  "paging": {
    "next": "https://localhost:443/scalemgmt/v2/filesystems/gpfs0/snapshots?lastId=1001"
  },
  "snapshots": [
    {
        "snapshotName": "snap1",
        "filesystemName": "gpfs0",
        "filesetName": "",
        "oid": "123",
        "snapID": "5",
        "status": "Valid",
        "created": "2017-01-09 14.55.37",
        "quotas": "string",
        "snapType": "string"
    }
  ]
}