Filesystems/{filesystemName}/watches: GET

Gets a list of clustered watches in a file system.

Availability

Available on all IBM Storage Scale editions.

Description

The GET filesystems/{filesystemName}/watches request gets a list of clustered watches in a file system. For more information about the fields in the data structures that are returned, see mmwatch command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/filesystems/{filesystemName}/watches
where
filesystems/filesystemName
Specifies the file system to which the watches belong.
watches
Specifies clustered watches as the target of the GET request.

Request headers


Accept: application/json

Parameters

The following parameters can be used in the request URL to customize the request:
Table 1. List of 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",
    "fields": "Fields",
    "filter": "Filters",
    "baseUrl": "Base URL",
    "lastId": "ID of the last element",
  },
   watches: [
      {
      "oid": OID,
      "id": "ID of the file system watch",
      "device": "Device name",
      "fileset": "Fileset name",
      "path": "Path of the clustered watch",
      "type": "Type of the clustered watch",
      "events": "List of watched events",
      "eventHandler": "Event handler. Only Kafkasink is supported",
      "sinkBrokers": "List of sing brokers",
      "sinkTopic": "Sink topic",
      "degraded": "Degraded status of the clustred watch",
      "state": "The state of the clustered watch",
      "nodeStatus": [
        {
          "node": "Cluster node name",
          "status": "Clustered watch status on the node",
          "processType": "Process type"
        }
      ],
      "description": "description"
    }
   ],
}
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":
Paging details.
"next": "URL",
The URL to retrieve the next page. Paging is enabled when more than 1000 objects would be returned by the query.
"fields": "Fields",
The fields used in the original request.
"filter": "Filters",
The filter used in the original request.
"baseUrl": "Base URL",
The URL of the request without any parameters.
"lastId": "ID of the last element",
The ID of the last element that can be used to retrieve the next elements.
"watches":
An array of elements that describe one watch.
"oid": OID
Optional ID.
"id": "ID"
ID of the file system watch.
"device": "Device name"
The device on which the clustered watch is enabled.
"fileset": "Fileset name"
The fileset on which the clustered watch is enabled.
"path": "Path"
Path of the clustered watch.
"type": "Type of the clustered watch"
Possible values are: FILESYSTEM, INODESPACE, INODE, FILESET, INCOMPLETE, FSYS, FSET
"events": "Events"
List of events that are watched.
"eventHandler": "Event handler"
Only Kafkasink is supported.
"sinkBrokers": "List of sink brokers"
Includes a comma-separated list of broker:port pairs for the sink Kafka cluster, which is the external Kafka cluster where the events are sent.
"sinkTopic": "Sink topic"
The topic that producers write to in the sink Kafka cluster.
"degraded": "Degraded staus"
Degraded status of the clustered watch.
"state": "State"
The state of the clustered watch.
description": "Description"
Description of the clustered watch.
"nodeStatus":"Node status"
Details of the status of the node.
"node": "Node name"
Name of the node.
"status": "Clustered watch status on the node"
"processType": "Process type"
Process type.

Examples

The following example gets information about the clustered watches in 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/watches'
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.
{
  "status": {
    "code": 200,
    "message": "..."
  },
  "paging": {
    "next": "https://localhost:443/scalemgmt/v2/filesystems/gpfs0/filesets?lastId=10001",
    "fields": "period,restrict,sensorName",
    "filter": "usedInodes>100,maxInodes>1024",
    "baseUrl": "/scalemgmt/v2/perfmon/sensor/config",
    "lastId": 10001
  },
  "watches": [
    {
      "oid": 0,
      "id": "CLW1595574252",
      "device": "gpfs0",
      "fileset": "fset1",
      "path": "/mnt/gpfs0",
      "type": "INODE",
      "events": "[\"IN_ACCESS\", \"IN_ATTRIB\"]",
      "eventHandler": "kafkasink",
      "sinkBrokers": "[\"198.51.100.5:8000\"]",
      "sinkTopic": "topic1",
      "degraded": false,
      "state": "Active",
      "nodeStatus": [
        {
          "node": "node1",
          "status": "status",
          "processType": "processType"
        }
      ],
      "description": "description"
    }
  ]
}