Diagnostic/snap: GET

Lists the GPFS snap files comprising the diagnostic data that is collected by the gpfs.snap command.

Availability

Available on all IBM Storage Scale editions.

Description

The GET diagnostic/snap request gets a list of the GPFS snap files that are available in the default snap directory. For more information about the fields in the returned data structure, see gpfs.snap command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/diagnostic/snap
where
diagnostic/snap
Returns the list of GPFS snap files. Required.

Request headers

Accept: application/json

Parameters

No parameters.

Request data

No request data.

Response data

{
  "snaps": [
    {
      "name": "string",
      "size": integer ,
      "timestamp": {
        "date": Time
      },
      "uploaded": true | false
    }
 ],
  "status": {
    "code": ReturnCode,
    "message": "ReturnMessage."
  }
}

The details of the parameters are provided in the following list:

snaps
An array of all the snap files that are taken using either the GUI or the REST API.
name
Name of the .tar file that comprises the snap files.
size
Size of the .tar file.
timestamp
The time when the snap file was created.
uploaded
Indicates whether the snap has been successfully uploaded to the PMR.
status
The HTTP status code.
message
The detailed success or error message.

Examples

The following example lists the GPFS snap files.

Request data:
curl -k -u user:password -X GET --header 'accept:application/json' --header 'Authorization: Basic YWRtaW46YWRtaW4wMDE=' 'https://198.51.100.1:443/scalemgmt/v2/diagnostic/snap
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.
{
  "snaps": [
    {
      "name": "/tmp/gpfs.snapOut/3/all.20210128174912.616684.tar",
      "size": 21913600,
      "timestamp": {
        "date": 1611852706089
      },
      "uploaded": false
    },
    {
      "name": "/tmp/gpfs.snapOut/3/all.20210128174417.604073.tar",
      "size": 20203520,
      "timestamp": {
        "date": 1611852410934
      },
      "uploaded": false
    },
    {
      "name": "/tmp/gpfs.snapOut/397370/all.20210128091305.397370.tar",
      "size": 18176000,
      "timestamp": {
        "date": 1611821720755
      },
      "uploaded": false
    },
    {
      "name": "/tmp/gpfs.snapOut/384977/all.20210128090839.384977.tar",
      "size": 18565120,
      "timestamp": {
        "date": 1611821474759
      },
      "uploaded": false
    }
  ],
  "status": {
    "code": 200,
    "message": "The request finished successfully."
  }
}