Module netapp_ontap.resources.cloud_target

Copyright © 2019 NetApp Inc. All rights reserved.

Retrieving a collection of cloud targets

The cloud targets GET API retrieves all cloud targets defined in the cluster.

Creating cloud targets

The cluster administrator tells ONTAP how to connect to a cloud target. The following pre-requisites must be met before creating an object store configuration in ONTAP. A valid data bucket or container must be created with the object store provider. This assumes that the user has valid account credentials with the object store provider to access the data bucket. The ONTAP node must be able to connect to the object store.
This includes: - Fast, reliable connectivity to the object store. - An inter-cluster LIF (logical interface) must be configured on the cluster. ONTAP verifies connectivity prior to saving this configuration information. - If SSL/TLS authentication is required, then valid certificates must be installed. - FabricPool license (required for all object stores except SGWS).

Deleting cloud targets

If a cloud target is used by an aggregate, then the aggregate must be deleted before the cloud target can be deleted.

Classes

class CloudTarget (*args, **kwargs)

Allows interaction with CloudTarget 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 cloud target specified by the UUID. This request starts a job and returns a link to that job.

  • storage aggregate object-store config 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 cloud targets in the cluster.

  • storage aggregate object-store config 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 cloud targets in the cluster.

  • storage aggregate object-store config 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 objects

Raises

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 cloud target specified by the UUID with the fields in the body. This request starts a job and returns a link to that job.

  • storage aggregate object-store config modify

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 cloud target specified by the UUID. This request starts a job and returns a link to that job.

  • storage aggregate object-store config 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 cloud target specified by the UUID.

  • storage aggregate object-store config 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 cloud target specified by the UUID with the fields in the body. This request starts a job and returns a link to that job.

  • storage aggregate object-store config 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

def post(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse

Creates a cloud target.

Required properties

  • name - Name for the cloud target.
  • owner - Owner of the target: fabricpool, snapmirror.
  • provider_type - Type of cloud provider: AWS_S3, Azure_Cloud, SGWS, IBM_COS, AliCloud, GoogleCloud.
  • server - Fully qualified domain name of the object store server. Required when provider_type is one of the following: SGWS, IBM_COS, AliCloud.
  • container - Data bucket/container name.
  • access_key - Access key ID if provider_type is not Azure_Cloud and authentication_type is key.
  • secret_password - Secret access key if provider_type is not Azure_Cloud and authentication_type is key.
  • azure_account - Azure account if provider_type is Azure_Cloud.
  • azure_private_key - Azure access key if provider_type is Azure_Cloud.
  • cap_url - Full URL of the request to a CAP server for retrieving temporary credentials if authentication_type is cap.
  • svm.name or svm.uuid - Name or UUID of SVM if owner is snapmirror.
  • snapmirror_use - Use of the cloud target if owner is snapmirror: data, metadata.
  • authentication_type - Authentication used to access the target: key, cap, ec2_iam.
  • ssl_enabled - SSL/HTTPS enabled or disabled.
  • port - Port number of the object store that ONTAP uses when establishing a connection.
  • ipspace - IPspace to use in order to reach the cloud target.

Default property values

  • authentication_type
  • ec2_iam - if running in Cloud Volumes ONTAP in AWS
  • key - in all other cases.
  • server
  • s3.amazonaws.com - if provider_type is AWS_S3
  • blob.core.windows.net - if provider_type is Azure_Cloud
  • storage.googleapis.com - if provider_type is GoogleCloud
  • ssl_enabled - true
  • port
  • 443 if ssl_enabled is true and provider_type is not SGWS
  • 8082 if ssl_enabled is true and provider_type is SGWS
  • 80 if ssl_enabled is false and provider_type is not SGWS
  • 8084 if ssl_enabled is false and provider_type is SGWS
  • ipspace - Default
  • certificate_validation_enabled - true
  • ignore_warnings - false
  • check_only - false
  • storage aggregate object-store config create

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 CloudTargetSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

The fields of the CloudTarget object

Ancestors

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

Class variables

var access_key

Access key ID for AWS_S3 and other S3 compatible provider types.

var authentication_type

Authentication used to access the target. Snapmirror does not yet support CAP. Required in POST.

Valid choices:

  • key
  • cap
  • ec2_iam
var azure_account

Azure account

var azure_private_key

Azure access key

var cap_url

This parameter is available only when auth-type is CAP. It specifies a full URL of the request to a CAP server for retrieving temporary credentials (access-key, secret-pasword, and session token) for accessing the object store.

Example: https://123.45.67.89:1234/CAP/api/v1/credentials?agency=myagency&mission=mymission&role=myrole

var certificate_validation_enabled

Is SSL/TLS certificate validation enabled? The default value is true. This can only be modified for SGWS and IBM_COS provider types.

var container

Data bucket/container name

Example: bucket1

var ipspace

The ipspace field of the cloud_target.

The links field of the cloud_target.

var name

Cloud target name

var opts
var owner

Owner of the target. Allowed values are FabricPool or SnapMirror. A target can be used by only one feature.

Valid choices:

  • fabricpool
  • snapmirror
var port

Port number of the object store that ONTAP uses when establishing a connection. Required in POST.

var provider_type

Type of cloud provider. Allowed values depend on owner type. For FabricPool, AliCloud, AWS_S3, Azure_Cloud, GoggleCloud, IBM_COS, and SGWS are allowed. For SnapMirror, the valid values are AWS_S3 or SGWS.

var secret_password

Secret access key for AWS_S3 and other S3 compatible provider types.

var server

Fully qualified domain name of the object store server. Required on POST. For Amazon S3, server name must be an AWS regional endpoint in the format s3.amazonaws.com or s3-.amazonaws.com, for example, s3-us-west-2.amazonaws.com. The region of the server and the bucket must match. For Azure, if the server is a "blob.core.windows.net" or a "blob.core.usgovcloudapi.net", then a value of azure-account followed by a period is added in front of the server.

var snapmirror_use

Use of the cloud target by SnapMirror.

Valid choices:

  • data
  • metadata
var ssl_enabled

SSL/HTTPS enabled or not

var svm

The svm field of the cloud_target.

var used

The amount of cloud space used by all the aggregates attached to the target, in bytes. This field is only populated for FabricPool targets. The value is recalculated once every 5 minutes.

var uuid

Cloud target UUID