Thresholds: GET
Gets a list of all threshold rules that are configured in the IBM Spectrum Scale™ cluster.
Availability
Available on all IBM Spectrum Scale editions.
Description
The GET thresholds request gets a list of all threshold rules that are configured in the system. For more information about the fields in the data structures that are returned, see mmhealth command .
Request URL
https://<IP address or host name of API server>:<port>/scalemgmt/v2/thresholds
where- thresholds
- Specifies the threshold rules that are configured in the cluster as the resource of this GET call. Required.
Request headers
Content-Type: application/json
Accept: application/json
Request data
No request data.
Request parameters
The following parameters can be used in the request URL to customize the
request:
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
{
"status": {
"code": "200",
"message": "..."
},
"thresholds": [
{
"ruleName": "Name",
"frequency": "Frequency",
"tags": "Tags",
"userActionWarn": "Warning message",
"userActionError": "Error message",
"type": "metric",
"metric": "Metric name",
"metricOp": "Metric operation",
"sensitivity": "Sensitivity",
"computation": "value",
"duration": "Duration",
"filterBy": "Filter by",
"groupBy": "Group by",
"errorLevel": "Error level",
"warnLevel": "Warning level",
"direction": "Direction",
"hysteresis": "Hysterisis"
}
]
}
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.
- "thresholds":
- "ruleName":"Name"
- The name of the threshold rule.
- "frequency":"Time"
- The frequency in which the threshold values are evaluated.
- "tags": "tags"
- Maps events to components such as pool_data, pool_meta-data, fset_inode, and thresholds.
- "userActionWarn": "Warning message"
- A user-defined message that is included in the warning message.
- "userActionError": "Error message"
- A user-defined message that is included in the error message.
- "type": "metric | measurement"
- The type of the threshold, either metric or measurement.
- "metric": "Metric name"
- The metric for which the threshold rule is defined.
- "metricOp": "sum | avg | min | max | rate"
- The metric operation or the aggregator that is used for the threshold rule.
- "sensitivity": "Sensitivity"
- The sample interval value in seconds.
- "computation": "Computation criteria"
- A rule consists of a computation element performs a computation on the collected data. There are four computation criteria defined: value, stats (max, min, median, and percentile), zimonstatus, and gpfsCapacityUtil. Currently, only 'value' is supported.
- "duration": "Collection duration"
- Duration of collection time (in seconds).
- "filterBy": "Filter by"
- Filters the result based on the filter key.
- "groupBy": "Group by"
- Groups the result based on the group key.
- "errorLevel": "Error level"
- The threshold error limit that is defined for the metric. The value can be a percentage or an integer, depending on the metric on which the threshold value is being set.
- "warnLevel": "Warning level"
- The threshold warning limit that is defined for the metric. The value can be a percentage or an integer, depending on the metric on which the threshold value is being set.
- "direction": "High | Low"
- The direction for the threshold limit.
- "hysteresis": "Hysterisis"
- The percentage that the observed value must be above or below the current threshold level to switch back to the previous state.
Examples
The following example gets the list of threshold rules that are defined in the system.
Request URL:
curl -k -u admin:admin001 -X GET --header 'accept:application/json'
'https://198.51.100.1:443/scalemgmt/v2/thresholds?fields=:all:'
Note: The
field ':all:' selects all available fields.
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": "..."
},
"thresholds": [
{
"ruleName": "string",
"frequency": "300",
"tags": "300",
"userActionWarn": "The cpu usage has exceeded the warning level. ",
"userActionError": "The cpu usage has exceeded the threshold level. ",
"type": "metric",
"metric": "cpu_user",
"metricOp": "avg",
"sensitivity": "300",
"computation": "value",
"duration": "300",
"filterBy": "gpfs_fs_name=gpfs0",
"groupBy": "gpfs_fs_name=gpfs0",
"errorLevel": "90.0",
"warnLevel": "80.0",
"direction": "high",
"hysteresis": "5.0"
}
]
}