Nodes/health/config/webhook/addEventWebhook: POST
Adds a webhook event URL for monitoring node health status.
Availability
Available on all IBM Storage Scale editions.
Description
The POST nodes/health/config/webhook/addEventWebhook request adds a webhook event URL for health event monitoring. 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/nodes/health/config/webhook/addEventWebhook
where:- webhook
- Specifies the webhook event as the resource. Required.
Request headers
Accept: application/json
Request data
The details of the parameters are provided in the following list.
- "webhookurl: "Event URL"
- The webhook event URL that is to be added.
Response data
{
"jobs": [
{
"jobId": "Job ID",
"status": "RUNNING | COMPLETED | FAILED",
"submitted": "Time",
"completed": "Time",
"runtime": "Time",
"request": {
"type": "POST | GET | PUT | DELETE",
"url": "URL"
},
"result": {
"progress" [],
" commands" [],
" stdout" [] ,
},
"pids": [],
}
],
"status": {
"code": Return Code,
"message": "Return Message."
}
}
For more information about the fields in the following data structures, see the link at the end of the topic.
- "jobs":
- An array of elements that describe jobs. Each element describes one job.
- "jobId": "ID",
- The unique ID of the job.
- "status": RUNNING | COMPLETED | FAILED
- Return status.
- "submitted": "Time"
- The date and time at which the job was submitted.
- "completed": "Time"
- The date and time at which the job was completed.
- "runtime" : "Duration"
- The duration for which the job ran.
- "request"
- The request details.
- "type" : "GET | POST | PUT | DELETE "
- The HTTP request type.
- URL
- The request URL.
- "result"
- The request result.
- "progress": "string"
- Progress information for the request.
- "commands": "string"
- Array of commands that are run in this job.
- "stdout" : "string"
- CLI messages from stdout.
- "pids": "Process ID"
- The process IDs of all the active sub processes that manage the job.
- status
- The status of the request message.
- "message": "ReturnMessage",
- The return message.
- "code": ReturnCode
- The return code.
Examples
The following example shows how to add a webhook event URL.
Request data:
curl -k -u admin:admin001 -X POST --header 'content-type:application/json' --header 'accept:application/json' -d '{ \
"webhookurl": "http://www.ibm.com" \
}' 'https://198.51.100.1:443/scalemgmt/v2/nodes/health/config/webhook/addEventWebhook'
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.
{
"jobs": [
{
"jobId": 1000000000001,
"status": "COMPLETED",
"submitted": "2021-05-03 01:51:23,674",
"completed": "2021-05-03 01:51:24,853",
"runtime": 1179,
"request": {
"type": "POST",
"url": "/scalemgmt/v2/nodes/health/config/webhook/addEventWebhook"
},
"result": {
"progress": [],
"commands": [
"mmhealth config webhook add 'http://www.ibm.com' "
],
"stdout": [
"Successfully connected to http://www.ibm.com",
"Webhook URL http://www.ibm.com successfully linked to the health event monitoring system.",
"Webhook UUID is 6d863ddb-8a3a-4d4f-adab-225a37e8b4a3",
"info: Successfully connected to http://www.ibm.com\nWebhook URL http://www.ibm.com successfully linked to the health event monitoring system.\nWebhook UUID is 6d863ddb-8a3a-4d4f-adab-225a37e8b4a3\n"
],