Module netapp_ontap.resources.chassis
Copyright © 2019 NetApp Inc. All rights reserved.
Retrieving chassis information
The chassis GET API retrieves all of the chassis information in the cluster.
Examples
1) Retrieve a list of chassis from the cluster
The following example shows the response with a list of chassis in the cluster:
# The API:
/api/cluster/chassis
# The call:
curl -X GET "https://<mgmt-ip>/api/cluster/chassis" -H "accept: application/hal+json"
# The response:
{
"records": [
{
"id": "021352005981",
"_links": {
"self": {
"href": "/api/cluster/chassis/021352005981"
}
}
},
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/cluster/chassis"
}
}
}
2) Retrieve a specific chassis from the cluster
The following example shows the response of the requested chassis. If there is no chassis with the requested id, an error is returned.
# The API:
/api/cluster/chassis/{id}
# The call:
curl -X GET "https://<mgmt-ip>/api/cluster/chassis/021352005981" -H "accept: application/hal+json"
# The response:
{
"id": "021352005981",
"state": "ok",
"nodes": [
{
"name": "node-1",
"uuid": "6ede364b-c3d0-11e8-a86a-00a098567f31",
"_links": {
"self": {
"href": "/api/cluster/nodes/6ede364b-c3d0-11e8-a86a-00a098567f31"
}
}
}
],
"frus": [
{
"id": "PSU2",
"type": "psu",
"state": "ok"
},
{
"id": "PSU1",
"type": "psu",
"state": "ok"
},
{
"id": "Fan2",
"type": "fan",
"state": "ok"
},
{
"id": "Fan3",
"type": "fan",
"state": "ok"
},
{
"id": "Fan1",
"type": "fan",
"state": "ok"
}
],
"_links": {
"self": {
"href": "/api/cluster/chassis/021352005981"
}
}
}
Classes
class Chassis (*args, **kwargs)
-
Allows interaction with Chassis 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
Static methods
def find(*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves a collection of chassis.
Related ONTAP commands
system chassis show
system chassis fru show
Learn more
Find an instance of an object on the host given a query.
The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found or if more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to find a bar for a particular foo, the foo.name value should be passed.
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 be sent as query parameters to the host.
Returns
A
Resource
object containing the details of the object.Raises
NetAppRestError
: If the API call did not return exactly 1 matching resource. def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> typing.Iterable
-
Retrieves a collection of chassis.
Related ONTAP commands
system chassis show
system chassis fru show
Learn more
Fetch a list of all objects of this type from the host.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
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. max_records
- The maximum number of records to return per call
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A list of
Resource
objectsRaises
NetAppRestError
: If there is no connection available to use either passed in or on the library.
Methods
def get(self, **kwargs) -> NetAppResponse
-
Retrieves a specific chassis.
Related ONTAP commands
system chassis show
system chassis fru show
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
Inherited members
class ChassisSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the Chassis object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var frus
-
List of frus in chassis
var id
-
The id field of the chassis.
Example: 2.1352005981E10
var nodes
-
List of nodes in chassis
var opts
var shelves
-
List of shelves in chassis
var state
-
The state field of the chassis.
Valid choices:
- ok
- error