Support AutoSupport messages endpoint overview
Overview
Use this API to invoke and retrieve AutoSupport messages from the nodes in the cluster.
This API supports POST and GET calls. Use a POST call to invoke AutoSupport and a GET call to retrieve AutoSupport messages.
Examples
Invoking an AutoSupport on all nodes in the cluster
The following example invokes an AutoSupport on every node in the cluster.
Note that AutoSupport is invoked on all nodes in the cluster if the node
parameter is omitted. Also, note that the subject
line is the same when invoking on all nodes.
By default, the response is an empty object. If return_records=true
is passed in the request, the response includes information about the node and the index of the invoked AutoSupport message.
# The API:
POST /support/autosupport/messages
# The call:
curl -X POST "https://<mgmt-ip>/api/support/autosupport/messages?return_records=true" -H "accept: application/hal+json" -H "Content-Type: application/json" -d "{ \"message\": \"test_msg\", \"type\": \"all\"}"
# The response:
201 CREATED
{
"num_records": 2,
"records": [
{
"index": 4,
"node": {
"name": "node1",
"uuid": "092e0298-f250-11e8-9a05-005056bb6666",
"_links": {
"self": {
"href": "/api/cluster/nodes/092e0298-f250-11e8-9a05-005056bb6666"
}
}
},
"_links": {
"self": {
"href": "/api/support/autosupport/messages/092e0298-f250-11e8-9a05-005056bb6666/4"
}
}
},
{
"index": 2,
"node": {
"name": "node2",
"uuid": "e47d2630-f250-11e8-b186-005056bb5cab",
"_links": {
"self": {
"href": "/api/cluster/nodes/e47d2630-f250-11e8-b186-005056bb5cab"
}
}
},
"_links": {
"self": {
"href": "/api/support/autosupport/messages/e47d2630-f250-11e8-b186-005056bb5cab/2"
}
}
}
],
"_links": {
"self": {
"href": "/api/support/autosupport/messages/"
}
}
}
Invoking an AutoSupport on a single node
The following examples invoke an AutoSupport on a single node in the cluster.
Note that AutoSupport is invoked on all nodes in the cluster if the node
parameter is omitted. You can specify the node-name with either node
or node.name
parameter. You can also specify UUID of the node with the node.uuid
parameter.
By default, the response is an empty object. If return_records=true
is passed in the request, the response includes information about the node and the index of the invoked AutoSupport message.
# The API: POST /support/autosupport/messages # The call: curl -X POST "https://<mgmt-ip>/api/support/autosupport/messages?return_records=true" -H "accept: application/hal+json" -H "Content-Type: application/json" -d "{ \"message\": \"test_msg\", \"type\": \"test\", \"node\": { \"name\": \"node1\" }}" # The response: 201 CREATED { "num_records": 1, "records": [ { "index": 8, "node": { "name": "node1", "uuid": "092e0298-f250-11e8-9a05-005056bb6666", "_links": { "self": { "href": "/api/cluster/nodes/092e0298-f250-11e8-9a05-005056bb6666" } } }, "_links": { "self": { "href": "/api/support/autosupport/messages/092e0298-f250-11e8-9a05-005056bb6666/8" } } } ], "_links": { "self": { "href": "/api/support/autosupport/messages/" } } }
# The call: curl -X POST "https://<mgmt-ip>/api/support/autosupport/messages?return_records=true" -H "accept: application/hal+json" -H "Content-Type: application/json" -d "{ \"message\": \"test_msg\", \"type\": \"test\", \"node.name\":\"node2\"}" # The response: 201 CREATED { "num_records": 1, "records": [ { "index": 4, "node": { "name": "node2", "uuid": "e47d2630-f250-11e8-b186-005056bb5cab", "_links": { "self": { "href": "/api/cluster/nodes/e47d2630-f250-11e8-b186-005056bb5cab" } } }, "_links": { "self": { "href": "/api/support/autosupport/messages/e47d2630-f250-11e8-b186-005056bb5cab/4" } } } ], "_links": { "self": { "href": "/api/support/autosupport/messages/" } } }
# The call: curl -X POST "https://<mgmt-ip>/api/support/autosupport/messages?return_records=true" -H "accept: application/hal+json" -H "Content-Type: application/json" -d "{ \"message\": \"test_msg\", \"type\": \"test\", \"node.uuid\":\"092e0298-f250-11e8-9a05-005056bb6666\"}" # The response: 201 CREATED { "num_records": 1, "records": [ { "index": 5, "node": { "name": "node1", "uuid": "092e0298-f250-11e8-9a05-005056bb6666", "_links": { "self": { "href": "/api/cluster/nodes/092e0298-f250-11e8-9a05-005056bb6666" } } }, "_links": { "self": { "href": "/api/support/autosupport/messages/092e0298-f250-11e8-9a05-005056bb6666/5" } } } ], "_links": { "self": { "href": "/api/support/autosupport/messages/" } } }
Retrieving AutoSupport messages from all nodes in the cluster
The following example retrieves AutoSupport messages from every node in the cluster. Note that if the fields=* parameter is not specified, only node, index, and destination fields are returned. Filters can be added on the fields to limit the results.
# The API:
GET /support/autosupport/messages
# The call:
curl -X GET "https://<mgmt-ip>/api/support/autosupport/messages?fields=*&return_timeout=15" -H "accept: application/hal+json"
# The response:
200 OK
{
"records": [
{
"node": {
"uuid": "092e0298-f250-11e8-9a05-005056bb6666",
"name": "node1",
"_links": {
"self": {
"href": "/api/cluster/nodes/092e0298-f250-11e8-9a05-005056bb6666"
}
}
},
"index": 1,
"destination": "smtp",
"subject": "USER_TRIGGERED (TEST:test_msg)",
"state": "ignore",
"generated_on": "2019-03-28T10:18:04-04:00",
"_links": {
"self": {
"href": "/api/support/autosupport/messages/092e0298-f250-11e8-9a05-005056bb6666/1/smtp"
}
}
},
{
"node": {
"uuid": "092e0298-f250-11e8-9a05-005056bb6666",
"name": "node1",
"_links": {
"self": {
"href": "/api/cluster/nodes/092e0298-f250-11e8-9a05-005056bb6666"
}
}
},
"index": 1,
"destination": "http",
"subject": "USER_TRIGGERED (TEST:test_msg)",
"state": "sent_successful",
"generated_on": "2019-03-28T10:18:04-04:00",
"_links": {
"self": {
"href": "/api/support/autosupport/messages/092e0298-f250-11e8-9a05-005056bb6666/1/http"
}
}
},
{
"node": {
"uuid": "092e0298-f250-11e8-9a05-005056bb6666",
"name": "node1",
"_links": {
"self": {
"href": "/api/cluster/nodes/092e0298-f250-11e8-9a05-005056bb6666"
}
}
},
"index": 1,
"destination": "noteto",
"subject": "USER_TRIGGERED (TEST:test_msg)",
"state": "ignore",
"generated_on": "2019-03-28T10:18:04-04:00",
"_links": {
"self": {
"href": "/api/support/autosupport/messages/092e0298-f250-11e8-9a05-005056bb6666/1/noteto"
}
}
},
{
"node": {
"uuid": "e47d2630-f250-11e8-b186-005056bb5cab",
"name": "node2",
"_links": {
"self": {
"href": "/api/cluster/nodes/e47d2630-f250-11e8-b186-005056bb5cab"
}
}
},
"index": 1,
"destination": "smtp",
"subject": "USER_TRIGGERED (TEST:test_msg)",
"state": "ignore",
"generated_on": "2019-03-28T10:18:06-04:00",
"_links": {
"self": {
"href": "/api/support/autosupport/messages/e47d2630-f250-11e8-b186-005056bb5cab/1/smtp"
}
}
},
{
"node": {
"uuid": "e47d2630-f250-11e8-b186-005056bb5cab",
"name": "node2",
"_links": {
"self": {
"href": "/api/cluster/nodes/e47d2630-f250-11e8-b186-005056bb5cab"
}
}
},
"index": 1,
"destination": "http",
"subject": "USER_TRIGGERED (TEST:test_msg)",
"state": "sent_successful",
"generated_on": "2019-03-28T10:18:06-04:00",
"_links": {
"self": {
"href": "/api/support/autosupport/messages/e47d2630-f250-11e8-b186-005056bb5cab/1/http"
}
}
},
{
"node": {
"uuid": "e47d2630-f250-11e8-b186-005056bb5cab",
"name": "node2",
"_links": {
"self": {
"href": "/api/cluster/nodes/e47d2630-f250-11e8-b186-005056bb5cab"
}
}
},
"index": 1,
"destination": "noteto",
"subject": "USER_TRIGGERED (TEST:test_msg)",
"state": "ignore",
"generated_on": "2019-03-28T10:18:06-04:00",
"_links": {
"self": {
"href": "/api/support/autosupport/messages/e47d2630-f250-11e8-b186-005056bb5cab/1/noteto"
}
}
}
],
"num_records": 6,
"_links": {
"self": {
"href": "/api/support/autosupport/messages?fields=*&return_timeout=15"
}
}
}
Retrieving AutoSupport messages from a specific node and has 'sent_successful' state
The following example retrieves AutoSupport messages from a specific node in the cluster.
Note that if the fields=*
parameter is not specified, only node, index, and destination fields are returned.
This example uses a filter on the node.name
and state
fields. You can add filters to any fields in the response.
# The API:
GET /support/autosupport/messages
# The call:
curl -X GET "https://<mgmt-ip>/api/support/autosupport/messages?node.name=node1&state=sent_successful&fields=*&return_timeout=15" -H "accept: application/hal+json"
# The response:
200 OK
{
"records": [
{
"node": {
"uuid": "092e0298-f250-11e8-9a05-005056bb6666",
"name": "node1",
"_links": {
"self": {
"href": "/api/cluster/nodes/092e0298-f250-11e8-9a05-005056bb6666"
}
}
},
"index": 1,
"destination": "http",
"subject": "USER_TRIGGERED (TEST:test_msg)",
"state": "sent_successful",
"generated_on": "2019-03-28T10:18:04-04:00",
"_links": {
"self": {
"href": "/api/support/autosupport/messages/092e0298-f250-11e8-9a05-005056bb6666/1/http"
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/support/autosupport/messages?node.name=node1&state=sent_successful&fields=*&return_timeout=15"
}
}
}