Module netapp_ontap.resources.metrocluster_diagnostics

Copyright © 2023 NetApp Inc. All rights reserved.

This file has been automatically generated based on the ONTAP REST API documentation.

Overview

You can use this API to initiate a MetroCluster diagnostics operation and fetch the results of a completed diagnostics operation on a MetroCluster over IP configuration. The GET operation retrieves the results of a completed diagnostics operation for the MetroCluster over IP configuration. These can include the overall high level and details for the checks done for different components. By default, the response does not include the details. If the fields query is used in the request, the response will include the details. The POST request can be used to start a MetroCluster diagnostics operation or set up a schedule for the diagnostics to be run periodically.

Details

Details provide a way to view all the checks done on a component and the result of each check. The details of the checks are not included in the response by default. In order to fetch the details, use the fields query parameter.

  • node.details
  • aggregate.details
  • cluster.details

Starting a MetroCluster diagnostics operation

A new MetroCluster diagnostics operation can be started by issuing a POST to /cluster/metrocluster/diagnostics. There are no extra parameters required to initiate a diagnostics operation.

Polling the POST job for status of diagnostics operation

After a successful POST /cluster/diagnostics operation is issued, an HTTP status code of 202 (Accepted) is returned along with a job UUID and a link in the body of the response. The POST job continues asynchronously and can be monitored by using the job UUID and the /cluster/jobs API. The "message" field in the response of the GET /cluster/jobs/{uuid} request shows the current step in the job, and the "state" field shows the overall state of the job.


Examples

Running the diagnostics operation

This example shows the POST request for starting a diagnostic operation for a MetroCluster over IP configuration and the responses returned:

#API
/api/cluster/metrocluster/diagnostics

POST Request

from netapp_ontap import HostConnection
from netapp_ontap.resources import MetroclusterDiagnostics

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = MetroclusterDiagnostics()
    resource.post(hydrate=True)
    print(resource)

POST Response

HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 17:20:53 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster/diagnostics
Content-Length: 189
Content-Type: application/hal+json
{
  "job": {
    "uuid": "f7d3804c-fcf7-11ea-acaf-005056bb47c1",
    "_links": {
      "self": {
        "href": "/api/cluster/jobs/f7d3804c-fcf7-11ea-acaf-005056bb47c1"
      }
    }
  }
}

Monitoring the job progress

Use the link provided in the response to the POST request to fetch information for the diagnostics operation job.

Request

from netapp_ontap import HostConnection
from netapp_ontap.resources import Job

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Job(uuid="f7d3804c-fcf7-11ea-acaf-005056bb47c1")
    resource.get()
    print(resource)


Job status response

HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 17:21:12 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 345
Content-Type: application/hal+json
{
  "uuid": "f7d3804c-fcf7-11ea-acaf-005056bb47c1",
  "description": "POST /api/cluster/metrocluster/diagnostics",
  "state": "running",
  "message": "Checking nodes...",
  "code": 2432853,
  "start_time": "2020-09-22T13:20:53-04:00",
  "_links": {
    "self": {
      "href": "/api/cluster/jobs/f7d3804c-fcf7-11ea-acaf-005056bb47c1"
    }
  }
}

Final status of the diagnostics job

HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 17:29:04 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 372
Content-Type: application/hal+json
{
  "uuid": "f7d3804c-fcf7-11ea-acaf-005056bb47c1",
  "description": "POST /api/cluster/metrocluster/diagnostics",
  "state": "success",
  "message": "success",
  "code": 0,
  "start_time": "2020-09-22T13:20:53-04:00",
  "end_time": "2020-09-22T13:22:04-04:00",
  "_links": {
    "self": {
      "href": "/api/cluster/jobs/f7d3804c-fcf7-11ea-acaf-005056bb47c1"
    }
  }
}

Retrieving the diagnostics operation

Request

from netapp_ontap import HostConnection
from netapp_ontap.resources import MetroclusterDiagnostics

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = MetroclusterDiagnostics()
    resource.get()
    print(resource)

Response

HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 18:04:28 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 1005
Content-Type: application/hal+json
{
  "node": {
    "timestamp": "2020-09-22T13:47:01-04:00",
    "state": "ok",
    "summary": {
      "message": ""
    }
  },
  "interface": {
    "timestamp": "2020-09-22T13:47:01-04:00",
    "state": "ok",
    "summary": {
      "message": ""
    }
  },
  "aggregate": {
    "timestamp": "2020-09-22T13:47:01-04:00",
    "state": "ok",
    "summary": {
      "message": ""
    }
  },
  "cluster": {
    "timestamp": "2020-09-22T13:47:01-04:00",
    "state": "ok",
    "summary": {
      "message": ""
    }
  },
  "connection": {
    "timestamp": "2020-09-22T13:47:01-04:00",
    "state": "ok",
    "summary": {
      "message": ""
    }
  },
  "volume": {
    "timestamp": "2020-09-22T13:47:01-04:00",
    "state": "ok",
    "summary": {
      "message": ""
    }
  },
  "config_replication": {
    "timestamp": "2020-09-22T13:47:01-04:00",
    "state": "ok",
    "summary": {
      "message": ""
    }
  },
  "_links": {
    "self": {
      "href": "/api/cluster/metrocluster/diagnostics"
    }
  }
}

Retrieving check details for the node component

Request

from netapp_ontap import HostConnection
from netapp_ontap.resources import MetroclusterDiagnostics

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = MetroclusterDiagnostics()
    resource.get(fields="node.details")
    print(resource)

Response

HTTP/1.1 200 OK
Date: Thu, 10 Feb 2022 00:05:12 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 4506
Content-Type: application/hal+json
{
  "node": {
    "details": [
      {
        "node": {
          "uuid": "11111111-1111-1111-1111-111111111111",
          "name": "node1",
          "_links": {
            "self": {
              "href": "/api/cluster/nodes/11111111-1111-1111-1111-111111111111"
            }
          }
        },
        "cluster": {
          "uuid": "12121212-1212-1212-1212-121212121212",
          "name": "clusterA",
          "_links": {
            "self": {
              "href": "/api/cluster/12121212-1212-1212-1212-121212121212"
            }
          }
        },
        "timestamp": "2022-02-09T18:47:00-05:00",
        "checks": [
          {
            "name": "node_reachable",
            "result": "ok"
          },
          {
            "name": "metrocluster_ready",
            "result": "ok"
          },
          {
            "name": "local_ha_partner",
            "result": "ok"
          },
          {
            "name": "ha_mirroring_on",
            "result": "ok"
          },
          {
            "name": "ha_mirroring_op_state",
            "result": "ok"
          },
          {
            "name": "symmetric_ha_relationship",
            "result": "ok"
          },
          {
            "name": "remote_dr_partner",
            "result": "ok"
          },
          {
            "name": "dr_mirroring_on",
            "result": "ok"
          },
          {
            "name": "dr_mirroring_op_state",
            "result": "ok"
          },
          {
            "name": "symmetric_dr_relationship",
            "result": "ok"
          },
          {
            "name": "remote_dr_auxiliary_partner",
            "result": "ok"
          },
          {
            "name": "symmetric_dr_auxiliary_relationship",
            "result": "ok"
          },
          {
            "name": "storage_failover_enabled",
            "result": "ok"
          },
          {
            "name": "has_intercluster_lif",
            "result": "ok"
          },
          {
            "name": "node_object_limit",
            "result": "ok"
          },
          {
            "name": "automatic_uso",
            "result": "ok"
          }
        ]
      },
      {
        "node": {
          "uuid": "22222222-2222-2222-2222-222222222222",
          "name": "node2",
          "_links": {
            "self": {
              "href": "/api/cluster/nodes/22222222-2222-2222-2222-222222222222"
            }
          }
        },
        "cluster": {
          "uuid": "23232323-2323-2323-2323-232323232323",
          "name": "clusterB",
          "_links": {
            "self": {
              "href": "/api/cluster/23232323-2323-2323-2323-232323232323"
            }
          }
        },
        "timestamp": "2022-02-09T18:47:00-05:00",
        "checks": [
          {
            "name": "node_reachable",
            "result": "ok"
          },
          {
            "name": "metrocluster_ready",
            "result": "ok"
          },
          {
            "name": "local_ha_partner",
            "result": "ok"
          },
          {
            "name": "ha_mirroring_on",
            "result": "ok"
          },
          {
            "name": "ha_mirroring_op_state",
            "result": "ok"
          },
          {
            "name": "symmetric_ha_relationship",
            "result": "ok"
          },
          {
            "name": "remote_dr_partner",
            "result": "ok"
          },
          {
            "name": "dr_mirroring_on",
            "result": "ok"
          },
          {
            "name": "dr_mirroring_op_state",
            "result": "ok"
          },
          {
            "name": "symmetric_dr_relationship",
            "result": "ok"
          },
          {
            "name": "remote_dr_auxiliary_partner",
            "result": "ok"
          },
          {
            "name": "symmetric_dr_auxiliary_relationship",
            "result": "ok"
          },
          {
            "name": "storage_failover_enabled",
            "result": "ok"
          },
          {
            "name": "has_intercluster_lif",
            "result": "ok"
          },
          {
            "name": "node_object_limit",
            "result": "ok"
          },
          {
            "name": "automatic_uso",
            "result": "ok"
          }
        ]
      }
    ]
  },
  "_links": {
    "self": {
      "href": "/api/cluster/metrocluster/diagnostics"
    }
  }
}
### Retrieving check details for the volume component
#### Request
```python
from netapp_ontap import HostConnection
from netapp_ontap.resources import MetroclusterDiagnostics

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = MetroclusterDiagnostics()
    resource.get(fields="volume.details")
    print(resource)

Response

HTTP/1.1 200 OK
Cache-Control: no-cache,no-store,must-revalidate
Connection: close
Date: Fri, 08 Apr 2022 20:07:38 GMT
Server: libzapid-httpd
Vary: Accept-Encoding
Content-Length: 928
Content-Type: application/hal+json
Client-Date: Fri, 08 Apr 2022 20:07:42 GMT
Client-Peer: 172.21.138.189:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /CN=sti75-vsim-ucs180f0e_siteA/C=US
Client-SSL-Cert-Subject: /CN=sti75-vsim-ucs180f0e_siteA/C=US
Client-SSL-Cipher: ECDHE-RSA-AES256-GCM-SHA384
Client-SSL-Socket-Class: IO::Socket::SSL
Client-SSL-Warning: Peer certificate not verified
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors: 'self'
X-Content-Type-Options: nosniff
{
  "volume": {
    "details": [
      {
        "checks": [
          {
            "name": "unmirrored_flexgroups",
            "result": "ok",
          }
        ]
      },
      {
        "checks": [
          {
            "name": "mixed_flexgroups",
            "result": "ok",
          }
        ]
      }
    ]
  },
  "_links": {
    "self": {
      "href": "/api/cluster/metrocluster/diagnostics"
    }
  }
}
  • metrocluster check run
  • metrocluster check show
  • metrocluster check node show
  • metrocluster check aggregate show
  • metrocluster check cluster show

Classes

class MetroclusterDiagnostics (*args, **kwargs)

Allows interaction with MetroclusterDiagnostics 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 results of a completed diagnostic operation for the MetroCluster configuration.

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 post (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse

Start a MetroCluster diagnostic operation or set up a schedule for the diagnostics to be run periodically.

Learn more


Send this object to the host as a creation request.

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.
connection
The HostConnection object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
**kwargs
Any key/value pairs passed will normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

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 MetroclusterDiagnosticsSchema (*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

The fields of the MetroclusterDiagnostics object

Ancestors

  • netapp_ontap.resource.ResourceSchema
  • marshmallow.schema.Schema
  • marshmallow.base.SchemaABC

Class variables

aggregate: MetroclusterDiagnosticsAggregate GET POST PATCH

The aggregate field of the metrocluster_diagnostics.

cluster: MetroclusterDiagnosticsCluster GET POST PATCH

The cluster field of the metrocluster_diagnostics.

config_replication: MetroclusterDiagnosticsConfigreplication GET POST PATCH

The config_replication field of the metrocluster_diagnostics.

connection: MetroclusterDiagnosticsConnection GET POST PATCH

The connection field of the metrocluster_diagnostics.

interface: MetroclusterDiagnosticsInterface GET POST PATCH

The interface field of the metrocluster_diagnostics.

node: MetroclusterDiagnosticsNode GET POST PATCH

The node field of the metrocluster_diagnostics.

volume: MetroclusterDiagnosticsVolume GET POST PATCH

The volume field of the metrocluster_diagnostics.