Module netapp_ontap.resources.autosupport
Copyright © 2019 NetApp Inc. All rights reserved.
Overview
AutoSupport is NetApp's call home mechanism. AutoSupport sends configuration details, status details, and error reporting details to NetApp.
This endpoint supports both GET and PATCH calls. GET is used to retrieve AutoSupport configuration details for the cluster and PATCH is used to modify the AutoSupport configuration of the cluster. GET calls can also be used to check AutoSupport connectivity.Examples
Configuring 'to' addresses
The following example configures AutoSupport to send emails to 'to' addresses.
# The API:
PATCH /support/autosupport
# The call:
curl -X PATCH "https://<mgmt-ip>/api/support/autosupport" -H "accept: application/hal+json" -H "Content-Type: application/json" -d "{ \"to\": [ \"abc@netapp.com\", \"xyz@netapp.com\" ]}"
# The response:
200 OK
{}
Configuring 'SMTP' transport
The following example configures AutoSupport to use 'SMTP' transport. The default transport is 'HTTPS'.
# The API:
PATCH /support/autosupport
# The call:
curl -X PATCH "https://<mgmt-ip>/api/support/autosupport" -H "accept: application/hal+json" -H "Content-Type: application/json" -d "{ \"transport\": \"smtp\"}"
# The response:
200 OK
{}
Retrieving the AutoSupport configuration
The following example retrieves AutoSupport configuration for the cluster.
# The API:
GET /support/autosupport
# The call:
curl -X GET "https://<mgmt-ip>/api/support/autosupport" -H "accept: application/hal+json" OR
curl -X GET "https://<mgmt-ip>/api/support/autosupport?fields=*" -H "accept: application/hal+json"
# The response:
200 OK
{
"enabled": true,
"mail_hosts": [
"mailhost"
],
"from": "Postmaster",
"to": [
"abc@netapp.com",
"xyz@netapp.com"
],
"contact_support": true,
"transport": "smtp",
"proxy_url": "",
"is_minimal": false,
"_links": {
"self": {
"href": "/api/support/autosupport"
}
}
}
Retrieving AutoSupport connectivity issues
The following example retrieves AutoSupport connectivity issues for the cluster. The fields=issues
parameter must be specified, for the response to return any connectivity issues. The corrective_action
section might contain commands which needs to be executed on the ONTAP CLI.
# The API:
GET /support/autosupport
# The call:
curl -X GET "https://<mgmt-ip>/api/support/autosupport?fields=issues" -H "accept: application/hal+json"
# The response:
200 OK
{
"issues": [
{
"node": {
"name": "node3",
"uuid": "0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc",
"_links": {
"self": {
"href": "/api/cluster/nodes/0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc"
}
}
},
"issue": {
"message": "SMTP connectivity check failed for destination: mailhost. Error: Could not resolve host - 'mailhost'",
"code": "53149746"
},
"corrective_action": {
"message": "Check the hostname of the SMTP server",
"code": "53149746"
}
},
{
"node": {
"name": "node3",
"uuid": "0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc",
"_links": {
"self": {
"href": "/api/cluster/nodes/0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc"
}
}
},
"issue": {
"message": "AutoSupport OnDemand is disabled when \"-transport\" is not set to \"https\".",
"code": "53149740"
},
"corrective_action": {
"message": "Run \"system node autosupport modify -transport https -node <node name>\" to set \"-transport\" to \"https\".",
"code": "53149740"
}
}
],
"_links": {
"self": {
"href": "/api/support/autosupport"
}
}
}
Retrieving AutoSupport configuration and connectivity issues
The following example retrieves AutoSupport configuration and connectivity issues on the cluster. Use fields=*,issues
parameter to return both configuration and connectivity issues.
# The API:
GET /support/autosupport
# The call:
curl -X GET "https://<mgmt-ip>/api/support/autosupport?fields=*%2Cissues" -H "accept: application/hal+json"
# The response:
200 OK
{
"enabled": true,
"mail_hosts": [
"mailhost"
],
"from": "Postmaster",
"to": [
"abc@netapp.com",
"xyz@netapp.com"
],
"contact_support": true,
"transport": "smtp",
"proxy_url": "",
"is_minimal": false,
"issues": [
{
"node": {
"name": "node3",
"uuid": "0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc",
"_links": {
"self": {
"href": "/api/cluster/nodes/0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc"
}
}
},
"issue": {
"message": "SMTP connectivity check failed for destination: mailhost. Error: Could not resolve host - 'mailhost'",
"code": "53149746"
},
"corrective_action": {
"message": "Check the hostname of the SMTP server",
"code": "53149746"
}
},
{
"node": {
"name": "node3",
"uuid": "0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc",
"_links": {
"self": {
"href": "/api/cluster/nodes/0ecfd0a6-f1b3-11e8-9d9f-005056bbaadc"
}
}
},
"issue": {
"message": "AutoSupport OnDemand is disabled when \"-transport\" is not set to \"https\".",
"code": "53149740"
},
"corrective_action": {
"message": "Run \"system node autosupport modify -transport https -node <node name>\" to set \"-transport\" to \"https\".",
"code": "53149740"
}
}
],
"_links": {
"self": {
"href": "/api/support/autosupport"
}
}
}
Classes
class Autosupport (*args, **kwargs)
-
Allows interaction with Autosupport objects on the host
Initialize the instance of the resource.
Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:
MyResource(name='foo').name == 'foo'
Args
*args
- Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
**kwargs
- each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.
Ancestors
Methods
def get(self, **kwargs) -> NetAppResponse
-
Retrieves the AutoSupport configuration of the cluster and if requested, returns any connectivity issues with the AutoSupport configuration.
Important note: * The issues field consists of a list of objects containing details of the node that has a connectivity issue, the issue description, and corrective action you can take to address the issue. When not empty, this indicates a connection issue to the HTTP/S, SMTP, or AutoSupport On Demand server.Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *issues
Related ONTAP commands
system node autosupport show -instance
system node autosupport check show-details
Learn more
Fetch the details of the object from the host.
Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def patch(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Updates the AutoSupport configuration for the entire cluster.
Related ONTAP commands
system node autosupport modify
Learn more
Send the difference in the object's state to the host as a modification request.
Calculates the difference in the object's state since the last time we interacted with the host and sends this in the request body.
Args
hydrate
- If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
- If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
- If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
- If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400
Inherited members
class AutosupportSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the Autosupport object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var contact_support
-
Specifies whether to send the AutoSupport messages to vendor support.
Example: true
var enabled
-
Specifies whether the AutoSupport daemon is enabled. When this setting is disabled, delivery of all AutoSupport messages is turned off.
Example: true
var from_
-
The email address from which the AutoSupport messages are sent.
Example: postmaster@netapp.com
var is_minimal
-
Specifies whether the system information is collected in compliant form, to remove private data or in complete form, to enhance diagnostics.
Example: true
var issues
-
A list of nodes in the cluster with connectivity issues to HTTP/SMTP/AOD AutoSupport destinations along with the corresponding error descriptions and corrective actions.
var mail_hosts
-
The name of the mail server(s) used to deliver AutoSupport messages via SMTP.
Example: ["mailhost1.example.com","mailhost2.example.com"]
var opts
var partner_addresses
-
The list of partner address(es).
Example: ["user1@eng.netapp.com","user2@eng.netapp.com"]
var proxy_url
-
Proxy server for AutoSupport message delivery via HTTP/S. Optionally specify a username/password for authentication with the proxy server.
Example: https://proxy.company.com
var to
-
The email address(es) to which the AutoSupport messages are sent.
Example: ["example1@netapp.com","example2@netapp.com"]
var transport
-
The name of the transport protocol used to deliver AutoSupport messages.
Valid choices:
- smtp
- http
- https