Module netapp_ontap.resources.capacity_pool
Copyright © 2022 NetApp Inc. All rights reserved.
Overview
Capacity pool licenses are installed on and managed by the license manager. Each ONTAP node that is using the capacity pools licensing model is associated with a capacity pool license from which capacity is leased for data aggregates. This API is used to retrieve information about associations between ONTAP nodes in the cluster and capacity pool licenses. It also reports how much capacity each node is consuming from the capacity pool.
Examples
Retrieving a collection of capacity pools associated with the cluster
This example retrieves a collection that contains two capacity pool licenses, each of which is associated with an HA pair of nodes in a four-node cluster.
from netapp_ontap import HostConnection
from netapp_ontap.resources import CapacityPool
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
print(list(CapacityPool.get_collection()))
[
CapacityPool(
{
"license_manager": {
"uuid": "4ea7a442-86d1-11e0-ae1c-112233445566",
"_links": {
"self": {
"href": "/api/cluster/licensing/license-managers/4ea7a442-86d1-11e0-ae1c-112233445566"
}
},
},
"nodes": [
{
"node": {
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563411",
"name": "node-1",
},
"used_size": 1099511627776,
},
{
"node": {
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412",
"name": "node-2",
},
"used_size": 1099511627776,
},
],
"serial_number": "390000100",
"_links": {
"self": {"href": "/api/cluster/licensing/capacity-pools/390000100"}
},
}
),
CapacityPool(
{
"license_manager": {
"uuid": "4ea7a442-86d1-11e0-ae1c-112233445566",
"_links": {
"self": {
"href": "/api/cluster/licensing/license-managers/4ea7a442-86d1-11e0-ae1c-112233445566"
}
},
},
"nodes": [
{
"node": {
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563413",
"name": "node-3",
},
"used_size": 2199023255552,
},
{
"node": {
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563414",
"name": "node-4",
},
"used_size": 2199023255552,
},
],
"serial_number": "390000101",
"_links": {
"self": {"href": "/api/cluster/licensing/capacity-pools/390000101"}
},
}
),
]
Retrieving information about nodes associated with a specific capacity pool license
This example retrieves information about the nodes that are associated with a capacity pool license of the serial number 390000100.
from netapp_ontap import HostConnection
from netapp_ontap.resources import CapacityPool
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = CapacityPool(serial_number=390000100)
resource.get()
print(resource)
CapacityPool(
{
"license_manager": {
"uuid": "4ea7a442-86d1-11e0-ae1c-112233445566",
"_links": {
"self": {
"href": "/api/cluster/licensing/license-managers/4ea7a442-86d1-11e0-ae1c-112233445566"
}
},
},
"nodes": [
{
"node": {
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563411",
"name": "node-1",
},
"used_size": 1099511627776,
},
{
"node": {
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412",
"name": "node-2",
},
"used_size": 1099511627776,
},
],
"serial_number": "390000100",
"_links": {"self": {"href": "/api/cluster/licensing/capacity-pools/390000100"}},
}
)
Classes
class CapacityPool (*args, **kwargs)
-
Information on a capacity pool license and how it is associated with the cluster.
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 count_collection(*args, connection: HostConnection = None, **kwargs) -> int
-
Fetch a count of all objects of this type from the host.
This calls GET on the object to determine the number of records. It is more efficient than calling get_collection() because it will not construct any objects. Query parameters can be passed in as kwargs to determine a count of objects that match some filtered criteria.
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 count 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. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host. These query parameters can affect the count. A return_records query param will be ignored.
Returns
On success, returns an integer count of the objects of this type. On failure, returns -1.
Raises
NetAppRestError
: If the API call returned a status code >= 400, or if there is no connection available to use either passed in or on the library. def find(*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves a collection of capacity pools.
Learn more
Related ONTAP commands
system license show-status
system license show
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, None will be returned. 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 or None if no matches were found.Raises
NetAppRestError
: If the API call returned more than 1 matching resource. def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[Resource]
-
Retrieves a collection of capacity pools.
Learn more
Related ONTAP commands
system license show-status
system license show
Fetch a list of all objects of this type from the host.
This is a lazy fetch, making API calls only as necessary when the result of this call is iterated over. For instance, if max_records is set to 5, then iterating over the collection causes an API call to be sent to the server once for every 5 records. If the client stops iterating before getting to the 6th record, then no additional API calls are made.
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. This would be not be raised when get_collection() is called, but rather when the result is iterated.
Methods
def get(self, **kwargs) -> NetAppResponse
-
Retrieves information about the capacity pool.
Learn more
Related ONTAP commands
system license show-status
system license show
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 CapacityPoolSchema (*, 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 CapacityPool object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.base.SchemaABC
Class variables
-
license_manager GET POST PATCH
-
The license_manager field of the capacity_pool.
-
links GET
-
The links field of the capacity_pool.
-
nodes GET POST PATCH
-
Nodes in the cluster associated with this capacity pool.
-
serial_number GET POST PATCH
-
Serial number of the capacity pool license.
Example: 390000100