Module netapp_ontap.resources.aggregate
Copyright © 2019 NetApp Inc. All rights reserved.
Retrieving storage aggregate information
The Storage Aggregate GET API retrieves all data aggregates in the cluster. System owned root aggregates are not included in the output. This API also supports specific queries, in addition to queries on aggregate body properties, which affect the output of the API. The parameters for these queries are "recommend" and "show_spares". Using the "recommend" query returns the list of aggregates that are recommended for creation in the cluster. The "show_spares" query returns a response outside of the records body, which includes the groups of usable spares in the cluster. The collection GET returns the aggregate identifiers, UUID and name, and the node on which the aggregate resides. The instance GET, by default, returns all of the properties defined in the aggregates object, except advanced properties. The properties "space.footprint" and "space.block_storage.inactive_user_data" are considered advanced properties and only returned when requested using the "fields" query parameter.
Creating storage aggregates
When the POST command is issued with no properties, the system evaluates the cluster attached storage, determines the optimal aggregate layout and configures the aggregates. This layout is completely controlled by the system. To view the recommended optimal layout rather than creating it, use the GET endpoint, setting the "recommend" query to 'true'. Alternatively, POST can be used with specific properties to create an aggregate as requested. At a minimum, the aggregate name, disk count, and the node where it should reside are required if any properties are provided. When using POST with input properties, three properties are required. These are: - name - node.name or node.uuid - block_storage.primary.disk_count
Remaining properties are optional
The following properties can be specified in POST:
- name - Name of the aggregate.
- node.name and node.uuid - Node on which the aggregate will be created.
- block_storage.primary.disk_count - Number of disks to be used to create the aggregate.
- block_storage.mirror.enabled - Specifies whether or not the aggregate should be created using SyncMirror.
- block_storage.primary.checksum_style - Checksum style of the disks to be use for the aggregate.
- block_storage.primary.disk_class - Class of disks to be use to for the aggregate.
- block_storage.primary.raid_size - Desired RAID size of the aggregate.
- block_storage.primary.raid_type - Desired RAID type of the aggregate.
- snaplock_type - SnapLock type to use on the aggregate.
Updating storage aggregates
The PATCH operation is used to modify properties of the aggregate. There are several properties that can be modified on an aggregate. Only one property can be modified for each PATCH request. The list of patchable properties with a brief description for each is as follows:
- name - This property can be changed to rename the aggregate.
- node.name and node.uuid - Either property can be updated in order to relocate the aggregate to a different node in the cluster.
- block_storage.mirror.enabled - This property can be changed from 'false' to 'true' in order to mirror the aggregate, if the system is capable of doing so.
- block_storage.primary.disk_count - This property can be updated to increase the number of disks in an aggregate.
- block_storage.primary.raid_size - This property can be updated to set the desired RAID size.
- block_storage.primary.raid_type - This property can be updated to set the desired RAID type.
- cloud_storage.tiering_fullness_threshold - This property can be updated to set the desired tiering fullness threshold if using FabricPool.
Deleting storage aggregates
If volumes exist on an aggregate, they must be deleted or moved before the aggregate can be deleted. See the /storage/volumes API for details on moving or deleting volumes.
Examples
Retrieving a list of aggregates from the cluster
The following example shows the response with a list of data aggregates in the cluster:
# The API:
/api/storage/aggregates
# The call:
curl -X GET "https://<mgmt-ip>/api/storage/aggregates" -H "accept: application/json"
# The response:
{
"records": [
{
"uuid": "19425837-f2fa-4a9f-8f01-712f626c983c",
"name": "test1",
"node": {
"uuid": "caf95bec-f801-11e8-8af9-005056bbe5c1",
"name": "node-1",
},
},
{
"uuid": "4a7e4139-ca7a-420b-9a11-3f040d2189fd",
"name": "test4",
"node": {
"uuid": "4046dda8-f802-11e8-8f6d-005056bb2030",
"name": "node-2",
},
}
],
"num_records": 2,
}
Retrieving a specific aggregate from the cluster
The following example shows the response of the requested aggregate. If there is no aggregate with the requested UUID, an error is returned.
# The API:
/api/storage/aggregates/{uuid}
# The call:
curl -X GET "https://<mgmt-ip>/api/storage/aggregates/870dd9f2-bdfa-4167-b692-57d1cec874d4" -H "accept: application/json"
# The response:
{
"uuid": "19425837-f2fa-4a9f-8f01-712f626c983c",
"name": "test1",
"node": {
"uuid": "caf95bec-f801-11e8-8af9-005056bbe5c1",
"name": "node-1",
},
"home_node": {
"uuid": "caf95bec-f801-11e8-8af9-005056bbe5c1",
"name": "node-1",
},
"space": {
"block_storage": {
"size": 235003904,
"available": 191942656,
"used": 43061248,
"full_threshold_percent": 98
},
"cloud_storage": {
"used": 0
},
"efficiency": {
"savings": 1408029,
"ratio": 6.908119720880661,
"logical_used": 1646350
},
"efficiency_without_snapshots": {
"savings": 0,
"ratio": 1,
"logical_used": 737280
}
},
"state": "online",
"snaplock_type": "non_snaplock",
"create_time": "2018-12-04T15:40:38-05:00",
"data_encryption": {
"software_encryption_enabled": false,
"drive_protection_enabled": false
},
"block_storage": {
"primary": {
"disk_count": 6,
"disk_class": "solid_state",
"raid_type": "raid_dp",
"raid_size": 24,
"checksum_style": "block"
},
"hybrid_cache": {
"enabled": false
},
"mirror": {
"enabled": false,
"state": "unmirrored"
}
},
"plexes": [
{
"name": "plex0",
}
],
"cloud_storage": {
"attach_eligible": false
},
}
Retrieving a list of aggregates recommended for creation from the cluster
The following example shows the response with a list of recommended data aggregates in the cluster. Note: Each aggregate UUID provided in this response is not guaranteed to be the same UUID for the aggregate if it is created.
# The API:
/api/storage/aggregates
# The call:
curl -X GET "https://<mgmt-ip>/api/storage/aggregates?recommend=true&fields=*" -H "accept: application/json"
# The response:
{
"records": [
{
"uuid": "795bf7c2-fa4b-11e8-ba65-005056bbe5c1",
"name": "node_2_SSD_1",
"node": {
"uuid": "4046dda8-f802-11e8-8f6d-005056bb2030",
"name": "node-2",
},
"space": {
"block_storage": {
"size": 1116180480
}
},
"block_storage": {
"primary": {
"disk_count": 23,
"disk_class": "solid_state",
"raid_type": "raid_dp"
},
"hybrid_cache": {
"enabled": false
},
"mirror": {
"enabled": false
}
},
},
{
"uuid": "795c0a15-fa4b-11e8-ba65-005056bbe5c1",
"name": "node_1_SSD_1",
"node": {
"uuid": "caf95bec-f801-11e8-8af9-005056bbe5c1",
"name": "node-1",
},
"space": {
"block_storage": {
"size": 176238592
}
},
"block_storage": {
"primary": {
"disk_count": 5,
"disk_class": "solid_state",
"raid_type": "raid_dp"
},
"hybrid_cache": {
"enabled": false
},
"mirror": {
"enabled": false
}
},
}
],
"num_records": 2,
}
Updating an aggregate in the cluster
The following example shows the workflow of adding disks to the aggregate.
Step 1: Check the current disk count on the aggregate.
# The API:
/api/storage/aggregates
# The call:
curl -X GET "https://<mgmt-ip>/api/storage/aggregates/19425837-f2fa-4a9f-8f01-712f626c983c?fields=block_storage.primary.disk_count" -H "accept: application/json"
# The response:
{
"uuid": "19425837-f2fa-4a9f-8f01-712f626c983c",
"name": "test1",
"block_storage": {
"primary": {
"disk_count": 6
}
},
}
Step 2: Update the aggregate with the new disk count in 'block_storage.primary.disk_count'. The response to PATCH is a job unless the request is invalid.
# The API:
/api/storage/aggregates
# The call:
curl -X PATCH "https://<mgmt-ip>/api/storage/aggregates/19425837-f2fa-4a9f-8f01-712f626c983c" -H "accept: application/hal+json" -d "{\"block_storage\": {\"primary\": {\"disk_count\": 8}}}"
# The response:
{
"job": {
"uuid": "c103d15e-730b-11e8-a57f-005056b465d6",
"_links": {
"self": {
"href": "/api/cluster/jobs/c103d15e-730b-11e8-a57f-005056b465d6"
}
}
}
}
Step 3: Wait for the job to finish, then call GET to see the reflected change.
# The API:
/api/storage/aggregates
# The call:
curl -X GET "https://<mgmt-ip>/api/storage/aggregates/19425837-f2fa-4a9f-8f01-712f626c983c?fields=block_storage.primary.disk_count" -H "accept: application/json"
# The response:
{
"uuid": "19425837-f2fa-4a9f-8f01-712f626c983c",
"name": "test1",
"block_storage": {
"primary": {
"disk_count": 8
}
},
}
Classes
class Aggregate (*args, **kwargs)
-
Allows interaction with Aggregate 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 delete_collection(*args, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Deletes the aggregate specified by the UUID. This request starts a job and returns a link to that job.
Related ONTAP commands
storage aggregate delete
Learn more
Delete all objects in a collection which match the given query.
All records on the host which match the query will be deleted.
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 delete 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. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def find(*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves the collection of aggregates for the entire cluster.
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. *space.block_storage.inactive_user_data
*space.footprint
Related ONTAP commands
storage aggregate 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 the collection of aggregates for the entire cluster.
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. *space.block_storage.inactive_user_data
*space.footprint
Related ONTAP commands
storage aggregate 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. def patch_collection(body: dict, *args, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Updates the aggregate specified by the UUID with the properties in the body. This request starts a job and returns a link to that job.
Related ONTAP commands
storage aggregate add-disks
storage aggregate mirror
storage aggregate modify
storage aggregate relocation start
storage aggregate rename
Learn more
Patch all objects in a collection which match the given query.
All records on the host which match the query will be patched with the provided body.
Args
body
- A dictionary of name/value pairs to set on all matching members of the collection.
*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 patch 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. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400
Methods
def delete(self, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Deletes the aggregate specified by the UUID. This request starts a job and returns a link to that job.
Related ONTAP commands
storage aggregate delete
Learn more
Send a deletion request to the host for this object.
Args
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 def get(self, **kwargs) -> NetAppResponse
-
Retrieves the aggregate specified by the UUID. The recommend query cannot be used for this operation.
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. *space.block_storage.inactive_user_data
*space.footprint
Related ONTAP commands
storage aggregate 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 def patch(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Updates the aggregate specified by the UUID with the properties in the body. This request starts a job and returns a link to that job.
Related ONTAP commands
storage aggregate add-disks
storage aggregate mirror
storage aggregate modify
storage aggregate relocation start
storage aggregate rename
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 def post(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Automatically creates aggregates based on an optimal layout recommended by the system. Alternatively, properties can be provided to create an aggregate according to the requested specification. This request starts a job and returns a link to that job.
Required properties
Properties are not required for this API. The following properties are only required if you want to specify properties for aggregate creation: *
name
- Name of the aggregate. *node.name
ornode.uuid
- Node on which the aggregate will be created. *block_storage.primary.disk_count
- Number of disks to be used to create the aggregate.Default values
If not specified in POST, the following default values are assigned. The remaining unspecified properties will receive system dependent default values. *
block_storage.mirror.enabled
- false *snaplock_type
- non_snaplockRelated ONTAP commands
storage aggregate auto-provision
storage aggregate create
Example:
POST /api/storage/aggregates {"node": {"name": "node1"}, "name": "test", "block_storage": {"primary": {"disk_count": "10"}}}
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.
**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 AggregateSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the Aggregate object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var block_storage
-
The block_storage field of the aggregate.
var cloud_storage
-
The cloud_storage field of the aggregate.
var create_time
-
Timestamp of aggregate creation
Example: 2018-01-01T16:00:00.000+0000
var data_encryption
-
The data_encryption field of the aggregate.
var dr_home_node
-
The dr_home_node field of the aggregate.
var home_node
-
The home_node field of the aggregate.
var links
-
The links field of the aggregate.
var name
-
Aggregate name
Example: node1_aggr_1
var node
-
The node field of the aggregate.
var opts
var snaplock_type
-
SnapLock type
Valid choices:
- non_snaplock
- compliance
- enterprise
var space
-
The space field of the aggregate.
var state
-
Operational state of the aggregate
Valid choices:
- online
- onlining
- offline
- offlining
- relocating
- unmounted
- restricted
- inconsistent
- failed
- unknown
var uuid
-
Aggregate UUID