Module netapp_ontap.resources.cluster_peer

Copyright © 2022 NetApp Inc. All rights reserved.

Overview

Cluster peering allows administrators of ONTAP systems to establish relationships between two or more independent clusters. When a relationship exists between two clusters, the clusters can exchange user data and configuration information, and coordinate operations. The /cluster/peers endpoint supports create, get, modify, and delete operations using GET, PATCH, POST and DELETE HTTP requests.

Create a cluster peer

You can set up a new cluster peer relationship by issuing a POST request to /cluster/peers. Parameters in the POST body define the settings of the peering relationship. A successful POST request that succeeds in creating a peer returns HTTP status code "201", along with the details of the created peer, such as peer UUID, name, and authentication information. A failed POST request returns an HTTP error code along with a message indicating the reason for the error. This can include malformed requests and invalid operations.

Examples of creating cluster peers

Creating a cluster peer request with an empty request to accept the defaults

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

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

ClusterPeer(
    {
        "_links": {
            "self": {"href": "/api/cluster/peers/86de6c46-bdad-11eb-83cd-005056bb267e"}
        },
        "authentication": {
            "expiry_time": "2021-05-25T20:04:15-04:00",
            "passphrase": "pLznaom1ctesJFq4kt5Qfghf",
        },
        "uuid": "86de6c46-bdad-11eb-83cd-005056bb267e",
        "name": "Clus_fghf",
    }
)

Creating a cluster peer request with a system-generated passphrase that will expire on 05/26/2021 at 12:34:56

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer()
    resource.authentication = {
        "expiry_time": "05/26/2021 12:34:56",
        "generate_passphrase": True,
    }
    resource.post(hydrate=True)
    print(resource)

ClusterPeer(
    {
        "_links": {
            "self": {"href": "/api/cluster/peers/14c817c7-bdad-11eb-83cd-005056bb267e"}
        },
        "authentication": {
            "expiry_time": "2021-05-26T12:34:56-04:00",
            "passphrase": "dZNOKkpVfntNZHf3MjpNF6ht",
        },
        "uuid": "14c817c7-bdad-11eb-83cd-005056bb267e",
        "name": "Clus_F6ht",
    }
)

Creating a cluster peer request with a peer address and the generated passphrase is returned in the response

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer()
    resource.remote = {"ip_addresses": ["1.2.3.4"]}
    resource.post(hydrate=True)
    print(resource)

ClusterPeer(
    {
        "_links": {
            "self": {"href": "/api/cluster/peers/b404cc52-bdae-11eb-812c-005056bb0af1"}
        },
        "authentication": {
            "expiry_time": "2021-05-25T20:28:12-04:00",
            "passphrase": "yDhdOteVGEOhkeXF+DJYwDro",
        },
        "uuid": "b404cc52-bdae-11eb-812c-005056bb0af1",
        "name": "",
    }
)

Creating a cluster peer request with a peer name and the generated passphrase is returned in the response

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer()
    resource.name = "cp_xyz123"
    resource.authentication = {"generate_passphrase": True}
    resource.post(hydrate=True)
    print(resource)

ClusterPeer(
    {
        "_links": {
            "self": {"href": "/api/cluster/peers/125f8dc6-bdb1-11eb-83cd-005056bb267e"}
        },
        "authentication": {
            "expiry_time": "2021-05-25T20:29:38-04:00",
            "passphrase": "eeGTerZlh2qSAt2akpYEcM1c",
        },
        "uuid": "125f8dc6-bdb1-11eb-83cd-005056bb267e",
        "name": "cp_xyz123",
    }
)

Creating a cluster peer request with a name, a peer address, and a passphrase

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer()
    resource.name = "cp_xyz123"
    resource.remote = {"ip_addresses": ["1.2.3.4"]}
    resource.authentication = {"passphrase": "xyz12345"}
    resource.post(hydrate=True)
    print(resource)

ClusterPeer(
    {
        "_links": {
            "self": {"href": "/api/cluster/peers/b404cc52-bdae-11eb-812c-005056bb0af1"}
        },
        "authentication": {"expiry_time": "2021-05-25T20:32:49-04:00"},
        "uuid": "b404cc52-bdae-11eb-812c-005056bb0af1",
    }
)

Creating a cluster peer request with a proposed encryption protocol

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer()
    resource.encryption = {"proposed": "tls-psk"}
    resource.post(hydrate=True)
    print(resource)

ClusterPeer(
    {
        "_links": {
            "self": {"href": "/api/cluster/peers/b33a23a6-bdb1-11eb-83cd-005056bb267e"}
        },
        "authentication": {
            "expiry_time": "2021-05-25T20:34:07-04:00",
            "passphrase": "Gy8SqsXVhcUkS1AfepH7Pslc",
        },
        "uuid": "b33a23a6-bdb1-11eb-83cd-005056bb267e",
        "name": "Clus_Pslc",
    }
)


Creating local intercluster LIFs

The local cluster must have an intercluster LIF on each node for the correct operation of cluster peering. If no local intercluster LIFs exist, you can optionally specify LIFs to be created for each node in the local cluster. These local interfaces, if specified, are created on each node before proceeding with the creation of the cluster peering relationship. Cluster peering relationships are not established if there is an error preventing the LIFs from being created. After local interfaces have been created, do not specify them for subsequent cluster peering relationships.

Local LIF creation fields

  • local_network.ip_addresses - List of IP addresses to assign, one per node in the local cluster.
  • local_network.netmask - IPv4 mask or subnet mask length.
  • local_network.broadcast_domain - Broadcast domain that is in use within the IPspace.
  • local_network.gateway - The IPv4 or IPv6 address of the default router.

Additional information on network routes

When creating LIFs, the network route discovery mechanism might take additional time (1-5 seconds) to become visible in the network outside of the cluster. This delay in publishing the routes might cause an initial cluster peer "create" request to fail. This error disappears with a retry of the same request.

This example shows the POST body when creating four intercluster LIFs on a 4-node cluster before creating a cluster peer relationship.

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer()
    resource.local_network = {
        "interfaces": [
            {"ip_address": "1.2.3.4"},
            {"ip_address": "1.2.3.5"},
            {"ip_address": "1.2.3.6"},
        ],
        "netmask": "255.255.0.0",
        "broadcast_domain": "Default",
        "gateway": "1.2.0.1",
    }
    resource.remote = {"ip_addresses": ["1.2.9.9"]}
    resource.authentication = {"passphrase": "xyz12345"}
    resource.post(hydrate=True)
    print(resource)

ClusterPeer(
    {
        "local_network": {
            "interfaces": [
                {"ip_address": "1.2.3.4"},
                {"ip_address": "1.2.3.5"},
                {"ip_address": "1.2.3.6"},
            ]
        },
        "_links": {
            "self": {"href": "/api/cluster/peers/b404cc52-bdae-11eb-812c-005056bb0af1"}
        },
        "authentication": {"expiry_time": "2021-05-25T21:28:26-04:00"},
        "uuid": "b404cc52-bdae-11eb-812c-005056bb0af1",
    }
)


Examples of retrieving existing cluster peers

You can retrieve peers in a cluster by issuing a GET request to /cluster/peers. It is also possible to retrieve a specific peer when qualified by its UUID to /cluster/peers/{uuid}. A GET request might have no query parameters or a valid cluster UUID. The former retrieves all records while the latter retrieves the record for the cluster peer with that UUID.

Retrieving all cluster peer relationships, both established and pending

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    print(list(ClusterPeer.get_collection()))

[
    ClusterPeer(
        {
            "_links": {
                "interfaces": {
                    "href": "/api/network/ip/interfaces?services=intercluster_core&ipspace.uuid=0bac5ced-a911-11eb-83cd-005056bb267e"
                },
                "self": {
                    "href": "/api/cluster/peers/a6001076-bdb2-11eb-83cd-005056bb267e"
                },
            },
            "uuid": "a6001076-bdb2-11eb-83cd-005056bb267e",
            "name": "Clus_bH6l",
        }
    ),
    ClusterPeer(
        {
            "_links": {
                "interfaces": {
                    "href": "/api/network/ip/interfaces?services=intercluster_core&ipspace.uuid=0bac5ced-a911-11eb-83cd-005056bb267e"
                },
                "self": {
                    "href": "/api/cluster/peers/b404cc52-bdae-11eb-812c-005056bb0af1"
                },
            },
            "uuid": "b404cc52-bdae-11eb-812c-005056bb0af1",
            "name": "remote-cluster",
        }
    ),
]

Retrieving all cluster peer relationships which are not in an available state

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    print(list(ClusterPeer.get_collection(**{"status.state": "!available"})))

[
    ClusterPeer(
        {
            "_links": {
                "interfaces": {
                    "href": "/api/network/ip/interfaces?services=intercluster_core&ipspace.uuid=0bac5ced-a911-11eb-83cd-005056bb267e"
                },
                "self": {
                    "href": "/api/cluster/peers/a6001076-bdb2-11eb-83cd-005056bb267e"
                },
            },
            "status": {"state": "unidentified"},
            "uuid": "a6001076-bdb2-11eb-83cd-005056bb267e",
            "name": "Clus_bH6l",
        }
    )
]

Retrieving information about a single cluster peer relationship

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer(uuid="b404cc52-bdae-11eb-812c-005056bb0af1")
    resource.get()
    print(resource)

ClusterPeer(
    {
        "_links": {
            "interfaces": {
                "href": "/api/network/ip/interfaces?services=intercluster_core&ipspace.uuid=0bac5ced-a911-11eb-83cd-005056bb267e"
            },
            "self": {"href": "/api/cluster/peers/b404cc52-bdae-11eb-812c-005056bb0af1"},
        },
        "ipspace": {
            "name": "Default",
            "uuid": "0bac5ced-a911-11eb-83cd-005056bb267e",
            "_links": {
                "self": {
                    "href": "/api/network/ipspaces/0bac5ced-a911-11eb-83cd-005056bb267e"
                }
            },
        },
        "version": {
            "major": 10,
            "generation": 9,
            "full": "NetApp Release Stormking__9.10.1: Tue May 25 08:08:44 UTC 2021",
            "minor": 1,
        },
        "status": {"state": "available", "update_time": "2021-05-25T19:38:55-04:00"},
        "authentication": {"state": "ok", "in_use": "ok"},
        "uuid": "b404cc52-bdae-11eb-812c-005056bb0af1",
        "encryption": {"state": "tls_psk"},
        "name": "remote-cluster",
        "remote": {
            "name": "remote-cluster",
            "serial_number": "1-80-000011",
            "ip_addresses": ["1.2.3.4"],
        },
    }
)


Examples of updating an existing cluster peer

You can update a cluster peer relationship by issuing a PATCH request to /cluster/peers/{uuid}. As in the CLI mode, you can toggle the proposed encryption protocol, update the passphrase, or specify a new set of stable addresses. All PATCH requests take the parameters that are to be updated in the request body. If generate_passphrase is "true", the passphrase is returned in the PATCH response.

Updating the proposed encryption protocol from tls-psk to none

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer(uuid="b404cc52-bdae-11eb-812c-005056bb0af1")
    resource.authentication = {"passphrase": "xyz12345", "in_use": "ok"}
    resource.encryption = {"proposed": "none"}
    resource.patch()

Updating the passphrase

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer(uuid="b404cc52-bdae-11eb-812c-005056bb0af1")
    resource.authentication = {"passphrase": "xyz12345", "in_use": "ok"}
    resource.patch()

Setting an auto-generated passphrase

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer(uuid="b404cc52-bdae-11eb-812c-005056bb0af1")
    resource.authentication = {"generate_passphrase": True, "in_use": "ok"}
    resource.patch()

Updating remote IP addresses

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer(uuid="b404cc52-bdae-11eb-812c-005056bb0af1")
    resource.remote = {"ip_addresses": ["1.2.3.6"]}
    resource.patch()


An example of deleting an existing cluster peer

You can delete a cluster peer using the HTTP DELETE request.

Deleting a peer with peer UUID "8becc0d4-c12c-11e8-9ceb-005056bbd143"

from netapp_ontap import HostConnection
from netapp_ontap.resources import ClusterPeer

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = ClusterPeer(uuid="b404cc52-bdae-11eb-812c-005056bb0af1")
    resource.delete()

Classes

class ClusterPeer (*args, **kwargs)

Allows interaction with ClusterPeer 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 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 delete_collection(*args, records: Iterable[_ForwardRef('ClusterPeer')] = None, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse

Deletes a cluster peer.

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.
records
Can be provided in place of a query. If so, this list of objects will be deleted from the host.
body
The body of the delete request. This could be a Resource instance or a dictionary 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 be sent as query parameters to the host. Only resources matching this query will be deleted.

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 cluster peers.

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, 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 the collection of cluster peers.

Learn more


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 objects

Raises

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.

def patch_collection(body: dict, *args, records: Iterable[_ForwardRef('ClusterPeer')] = None, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse

Updates a cluster peer instance.

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. The body argument will be ignored if records is provided.
*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.
records
Can be provided in place of a query. If so, this list of objects will be patched on the host.
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 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 post_collection(records: Iterable[_ForwardRef('ClusterPeer')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, connection: HostConnection = None, **kwargs) -> Union[List[ClusterPeer], NetAppResponse]

Creates a peering relationship and, optionally, the IP interfaces it will use. There are two methods used to create a peering relationship: * Provide a remote IP address - Used when creating a new cluster peer relationship with a specific remote cluster. This requires at least one remote intercluster IP address from the remote cluster. * Do not provide a remote IP address - Used when the remote IP address is not provided and when the storage system is ready to accept peering requests from foreign clusters.

Required properties

  • remote.ip_addresses - Addresses of the remote peers. The local peer must be able to reach and connect to these addresses for the request to succeed in creating a peer. Only required when creating a peering relationship by providing a remote IP address.
  • Either set generate_passphrase to "true" or provide a passphrase in the body of the request. Only one of these options is required.
  • name - Name of the peering relationship or name of the remote peer.
  • passphrase - User generated passphrase for use in authentication.
  • generate_passphrase (true/false) - When "true", ONTAP automatically generates a passphrase to authenticate cluster peers.
  • ipspace - IPspace of the local intercluster LIFs. Assumes Default IPspace if not provided.
  • initial_allowed_svms - Local SVMs allowed to peer with the peer cluster's SVMs. Can be modified until the remote cluster accepts this cluster peering relationship.
  • local_network - Fields to create a local intercluster LIF.
  • expiry_time - Duration in ISO 8601 format for which the user-supplied or auto-generated passphrase is valid. Expiration time must not be greater than seven days into the future. ISO 8601 duration format is "PnDTnHnMnS" or "PnW" where n is a positive integer. The "nD", "nH", "nM" and "nS" fields can be dropped if zero. "P" must always be present and "T" must be present if there are any hours, minutes, or seconds fields.
  • encryption_proposed (none/tls-psk) - Encryption mechanism of the communication channel between the two peers.
  • peer_applications - SVM peering applications (SnapMirror, FlexCache or both) for which the SVM peering relationship is set up.

Additional information

As with creating a cluster peer through the CLI, the combinations of options must be valid in order for the create operation to succeed. The following list shows the combinations that will succeed and those that will fail: * A passphrase only (fail) * A peer IP address (fail) * A passphrase with an expiration time > 7 days into the future (fail) * A peer IP address and a passphrase (OK) * generate_passphrase=true (OK) * Any proposed encryption protocol (OK) * An IPspace name or UUID (OK) * A passphrase, peer IP address, and any proposed encryption protocol (OK) * A non empty list of initial allowed SVM peer names or UUIDs. (OK)

Learn more


Send this collection of objects to the host as a creation request.

Args

records
A list of Resource objects to send to the server to be created.
*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 create a bar for a particular foo, the foo.name value should be passed.
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 each object. When hydrate is set to True, poll must also be set to True.
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 be sent as query parameters to the host. Only resources matching this query will be patched.

Returns

A list of Resource objects matching the provided
type which have been created by the host and returned. This is _not_
 
the same list that was provided, so to continue using the object, you
 

should save this list. If poll is set to False, then a NetAppResponse object is returned instead.

Raises

NetAppRestError: If the API call returned a status code >= 400

Methods

def delete(self, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, **kwargs) -> NetAppResponse

Deletes a cluster peer.

Learn more


Send a deletion request to the host for this object.

Args

body
The body of the delete request. This could be a Resource instance or a dictionary 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 get(self, **kwargs) -> NetAppResponse

Retrieves a specific cluster peer instance.

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: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, **kwargs) -> NetAppResponse

Updates a cluster peer instance.

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 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

def post(self, hydrate: bool = False, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, **kwargs) -> NetAppResponse

Creates a peering relationship and, optionally, the IP interfaces it will use. There are two methods used to create a peering relationship: * Provide a remote IP address - Used when creating a new cluster peer relationship with a specific remote cluster. This requires at least one remote intercluster IP address from the remote cluster. * Do not provide a remote IP address - Used when the remote IP address is not provided and when the storage system is ready to accept peering requests from foreign clusters.

Required properties

  • remote.ip_addresses - Addresses of the remote peers. The local peer must be able to reach and connect to these addresses for the request to succeed in creating a peer. Only required when creating a peering relationship by providing a remote IP address.
  • Either set generate_passphrase to "true" or provide a passphrase in the body of the request. Only one of these options is required.
  • name - Name of the peering relationship or name of the remote peer.
  • passphrase - User generated passphrase for use in authentication.
  • generate_passphrase (true/false) - When "true", ONTAP automatically generates a passphrase to authenticate cluster peers.
  • ipspace - IPspace of the local intercluster LIFs. Assumes Default IPspace if not provided.
  • initial_allowed_svms - Local SVMs allowed to peer with the peer cluster's SVMs. Can be modified until the remote cluster accepts this cluster peering relationship.
  • local_network - Fields to create a local intercluster LIF.
  • expiry_time - Duration in ISO 8601 format for which the user-supplied or auto-generated passphrase is valid. Expiration time must not be greater than seven days into the future. ISO 8601 duration format is "PnDTnHnMnS" or "PnW" where n is a positive integer. The "nD", "nH", "nM" and "nS" fields can be dropped if zero. "P" must always be present and "T" must be present if there are any hours, minutes, or seconds fields.
  • encryption_proposed (none/tls-psk) - Encryption mechanism of the communication channel between the two peers.
  • peer_applications - SVM peering applications (SnapMirror, FlexCache or both) for which the SVM peering relationship is set up.

Additional information

As with creating a cluster peer through the CLI, the combinations of options must be valid in order for the create operation to succeed. The following list shows the combinations that will succeed and those that will fail: * A passphrase only (fail) * A peer IP address (fail) * A passphrase with an expiration time > 7 days into the future (fail) * A peer IP address and a passphrase (OK) * generate_passphrase=true (OK) * Any proposed encryption protocol (OK) * An IPspace name or UUID (OK) * A passphrase, peer IP address, and any proposed encryption protocol (OK) * A non empty list of initial allowed SVM peer names or UUIDs. (OK)

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 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 ClusterPeerSchema (*, 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 ClusterPeer object

Ancestors

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

Class variables

authentication GET POST PATCH

The authentication field of the cluster_peer.

encryption GET POST PATCH

The encryption field of the cluster_peer.

initial_allowed_svms GET POST PATCH

The local SVMs allowed to peer with the peer cluster's SVMs. This list can be modified until the remote cluster accepts this cluster peering relationship.

ipspace GET POST PATCH

The ipspace field of the cluster_peer.

The links field of the cluster_peer.

local_network POST

The local_network field of the cluster_peer.

name GET POST PATCH

Optional name for the cluster peer relationship. By default, it is the name of the remote cluster.

Example: cluster2

peer_applications GET POST PATCH

Peering applications against which allowed SVMs are configured.

Example: ["snapmirror","flexcache"]

remote GET POST PATCH

The remote field of the cluster_peer.

status GET POST PATCH

The status field of the cluster_peer.

uuid GET

UUID of the cluster peer relationship. For anonymous cluster peer offers, the UUID will change when the remote cluster accepts the relationship.

Example: 1cd8a442-86d1-11e0-ae1c-123478563412

version GET

The version field of the cluster_peer.