Module netapp_ontap.resources.mediator
Copyright © 2026 NetApp Inc. All rights reserved.
This file has been automatically generated based on the ONTAP REST API documentation.
Overview
You can use this API to add, modify or remove a mediator in a MetroCluster IP configuration or a SnapMirror active sync configuration. You can also use this API to get the status and details of the existing mediator. The GET operation returns the status of the mediator along with the mediator details. The DELETE operation removes the mediator. The POST operation adds the mediator. The PATCH operation modifies the local and remote proxy options. SnapMirror active sync supports two types of mediators: 1. ONTAP Mediator: This is the traditional mediator used in SnapMirror active sync, and is hosted on-premises. It requires deployment at a third, neutral site. 2. ONTAP cloud mediator: This mediator is hosted in BlueXP SaaS and is primarily designed for SnapMirror active sync. It eliminates the need for a third site and provides enhanced scalability and availability.
Adding a mediator
A mediator can be added by issuing a POST request on /cluster/mediators. Parameters are provided in the body of the POST request. There are no optional parameters for adding a mediator to a MetroCluster IP configuration.
Required configuration fields (MetroCluster)
These fields are always required for any POST /cluster/mediators request.
ip_address- Specifies the IP address of the mediator.user- Specifies a user name credential.password- Specifies a password credential.
Required configuration fields (SnapMirror active sync: ONTAP Mediator, ONTAP cloud mediator)
These fields are required for any POST /cluster/mediators request.
type- (defaults to "on-prem" if omitted) Specifies the type of mediator. For the ONTAP Mediator, the value of type has to be "on-prem". For the ONTAP cloud mediator, the value of type has to be "cloud".peer_cluster.name- Specifies the name of the peer cluster.ip_address- (only applicable to the ONTAP Mediator) Specifies the IP address of the mediator.user- (only applicable to the ONTAP Mediator) Specifies the user name credential.password- (only applicable to the ONTAP Mediator) Specifies a password credential.ca_certificate- (optional if the certificate is already installed, only applicable to the ONTAP Mediator) Specifies the CA certificate for the ONTAP Mediator.bluexp_org_id- (only applicable to the ONTAP cloud mediator) Specifies the BlueXP organization ID.service_account_client_id- (only applicable to the ONTAP cloud mediator) Specifies the client ID of the service account.service_account_client_secret- (only applicable to the ONTAP cloud mediator) Specifies the client secret of the service account.bluexp_account_token- (only applicable to the ONTAP cloud mediator) Specifies the BlueXP service account token. This field is mutually exclusive with theservice_account_client_idandservice_account_client_secretpair, meaning either the token or the client-id and client-secret pair is allowed.use_http_proxy_local- (optional, defaults to false if omitted, only applicable for ONTAP cloud mediator) Specifies if a HTTP proxy should be used on the ONTAP cluster.use_http_proxy_remote- (optional, defaults to false if omitted, only applicable for ONTAP cloud mediator) Specifies if a HTTP proxy should be used on the peer ONTAP cluster.strict_cert_validation- (optional, defaults to false if omitted, only applicable for ONTAP cloud mediator) Specifies if strict validation of certificates is performed while making REST API calls to the ONTAP Cloud Mediator.
Polling the setup job
After a successful POST /cluster/mediators is issued, an HTTP status code of 202 (Accepted) is returned along with a job UUID and a link in the body of the response. The setup job continues asynchronously and can be monitored by using the job UUID and the /cluster/jobs API. The "message" field in the response of the GET /cluster/jobs/{uuid} request shows the current step in the job, and the "state" field shows the overall state of the job.
Deleting a mediator
A mediator can be deleted by issuing a DELETE to /cluster/mediators/{uuid}. Parameters are provided in the body of the DELETE request. There are no optional parameters for deleting a mediator in a MetroCluster IP configuration.
Required configuration fields (MetroCluster)
These fields are always required for any DELETE /cluster/mediators/{uuid} request.
user- Specifies a user name credential.password- Specifies a password credential.
Required configuration fields (SnapMirror active sync: ONTAP Mediator, ONTAP cloud mediator)
No fields are required in the body of the DELETE /cluster/mediators/{uuid} request for a mediator in SnapMirror active sync configuration.
Polling the delete job
After a successful DELETE /cluster/mediators/{uuid} is issued, an HTTP status code of 202 (Accepted) is returned along with a job UUID and a link in the body of the response. The delete job continues asynchronously and can be monitored by using the job UUID and the /cluster/jobs API. The "message" field in the response of the GET /cluster/jobs/{uuid} request shows the current step in the job, and the "state" field shows the overall state of the job.
Modify a mediator
An ONTAP cloud mediator can be modified by issuing a PATCH to /cluster/mediators/{uuid}. Parameters are provided in the body of the PATCH request. Currently there are only 2 parameters which can be modified.
Fields which can be modified
These fields can be modified by any PATCH /cluster/mediators/{uuid} request.
use-http-proxy-local- Specifies if the local cluster should use http-proxy server while making REST API calls to mediator.use-http-proxy-remote- Specifies if the remote cluster should use http-proxy while making REST API calls to mediator.
Polling the modify job
After a successful PATCH /cluster/mediators/{uuid} is issued, an HTTP status code of 202 (Accepted) is returned along with a link in the body of the response. The modify response can be monitored by using the /cluster/jobs API. The "message" field in the response of the GET /cluster/jobs/{uuid} request shows the current step in the job, and the "state" field shows the overall state of the job.
Examples
Setting up a mediator for a four-node MetroCluster and a SnapMirror active sync configuration
This example shows the POST body when setting up a mediator for a four-node MetroCluster IP configuration and a SnapMirror active sync configuration. For MetroCluster, the only prerequisite is that MetroCluster IP is configured.
# API
/api/cluster/mediators
POST body included from file (MetroCluster)
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator()
resource.ip_address = "1.1.1.1"
resource.user = "username"
resource.password = "password"
resource.post(hydrate=True)
print(resource)
POST body included from file (SnapMirror active sync: ONTAP Mediator)
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator()
resource.peer_cluster.name = "C2_sti230-vsim-sr092w_cluster"
resource.ip_address = "172.18.48.61"
resource.user = "username"
resource.password = "password"
resource.post(hydrate=True)
print(resource)
POST body included from file (SnapMirror active sync: ONTAP cloud mediator)
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator()
resource.peer_cluster.name = "C2_sti230-vsim-sr092w_cluster"
resource.type = "cloud"
resource.bluexp_org_id = "your-bluexp-org-id"
resource.service_account_client_id = "your-account-client-id"
resource.service_account_client_secret = "your-account-client-secret"
resource.use_http_proxy_local = True
resource.use_http_proxy_remote = True
resource.strict_cert_validation = True
resource.post(hydrate=True)
print(resource)
Inline POST body (MetroCluster)
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator()
resource.ip_address = "1.1.1.1"
resource.user = "username"
resource.password = "password"
resource.post(hydrate=True)
print(resource)
Inline POST body (SnapMirror active sync: ONTAP Mediator)
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator()
resource.peer_cluster.name = "C2_sti230-vsim-sr092w_cluster"
resource.ip_address = "172.18.48.61"
resource.user = "username"
resource.password = "password"
resource.post(hydrate=True)
print(resource)
Inline POST body (SnapMirror active sync: ONTAP cloud mediator)
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator()
resource.peer_cluster.name = "C2_sti230-vsim-sr092w_cluster"
resource.type = "cloud"
resource.bluexp_org_id = "your-bluexp-org-id"
resource.service_account_client_id = "your-account-client-id"
resource.service_account_client_secret = "your-account-client-secret"
resource.use_http_proxy_local = True
resource.use_http_proxy_remote = True
resource.strict_cert_validation = True
resource.post(hydrate=True)
print(resource)
POST Response
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 07:40:59 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 189
Content-Type: application/hal+json
{
"job": {
"uuid": "f567b48b-fca6-11ea-acaf-005056bb47c1",
"_links": {
"self": {
"href": "/api/cluster/jobs/f567b48b-fca6-11ea-acaf-005056bb47c1"
}
}
}
}
Monitoring the job progress
Use the link provided in the response to the POST request to fetch information for the mediator setup job.
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Job
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Job(uuid="f567b48b-fca6-11ea-acaf-005056bb47c1")
resource.get()
print(resource)
Job status response
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 07:41:29 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 189
Content-Type: application/hal+json
{
"uuid": "f567b48b-fca6-11ea-acaf-005056bb47c1",
"description": "POST /api/cluster/mediators/",
"state": "running",
"start_time": "2020-09-22T03:41:00-04:00",
"_links": {
"self": {
"href": "/api/cluster/jobs/f567b48b-fca6-11ea-acaf-005056bb47c1"
}
}
}
Final status of a successful Mediator add
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 07:43:38 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 358
Content-Type: application/hal+json
{
"uuid": "f567b48b-fca6-11ea-acaf-005056bb47c1",
"description": "POST /api/cluster/mediators/",
"state": "success",
"message": "success",
"code": 0,
"start_time": "2020-09-22T03:41:00-04:00",
"end_time": "2020-09-22T03:42:10-04:00",
"_links": {
"self": {
"href": "/api/cluster/jobs/f567b48b-fca6-11ea-acaf-005056bb47c1"
}
}
}
Retrieving the existing mediator configurations
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
print(list(Mediator.get_collection()))
Response
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 08:53:18 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 320
Content-Type: application/hal+json
{
"records": [
{
"uuid": "f89e8906-fca6-11ea-acaf-005056bb47c1",
"_links": {
"self": {
"href": "/api/cluster/mediators/f89e8906-fca6-11ea-acaf-005056bb47c1"
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/cluster/mediators"
}
}
}
Retrieving a specific mediator using the UUID
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator(uuid="f89e8906-fca6-11ea-acaf-005056bb47c1")
resource.get()
print(resource)
Response (MetroCluster)
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 08:59:40 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 347
Content-Type: application/hal+json
{
"uuid": "f89e8906-fca6-11ea-acaf-005056bb47c1",
"ip_address": "10.234.173.40",
"port": 31784,
"reachable": true,
"peer_cluster": {
"name": "mcc_siteB",
"uuid": "38779fd1-fc6b-11ea-9421-005056bb21d8"
},
"peer_mediator_connectivity": "connected",
"strict_cert_validation": "true",
"_links": {
"self": {
"href": "/api/cluster/mediators/f89e8906-fca6-11ea-acaf-005056bb47c1"
}
}
}
Response (SnapMirror active sync: ONTAP Mediator)
{
"uuid": "cc44f61f-ffd5-11ef-aaa6-005056ae32ff",
"ip_address": "172.18.48.61",
"port": 31784,
"reachable": true,
"peer_cluster": {
"name": "C2_sti232-vsim-sr089o_cluster",
"uuid": "ece8d7c6-fd8f-11ef-b8b3-005056aec21e"
},
"peer_mediator_connectivity": "connected",
"local_mediator_connectivity": "connected",
"type": "on_prem",
"_links": {
"self": {
"href": "/api/cluster/mediators/cc44f61f-ffd5-11ef-aaa6-005056ae32ff"
}
}
}
Response (SnapMirror active sync: ONTAP cloud mediator)
{
"uuid": "b9ba4e5b-ff14-11ef-82a4-005056ae1bc8",
"ip_address": "0.0.0.0",
"reachable": true,
"peer_cluster": {
"name": "C2_sti232-vsim-sr089o_cluster",
"uuid": "ece8d7c6-fd8f-11ef-b8b3-005056aec21e"
},
"peer_mediator_connectivity": "connected",
"local_mediator_connectivity": "connected",
"use_http_proxy_local": true,
"use_http_proxy_remote": true,
"type": "cloud",
"_links": {
"self": {
"href": "/api/cluster/mediators/b9ba4e5b-ff14-11ef-82a4-005056ae1bc8"
}
}
}
Deleting a configured mediator using the UUID (MetroCluster)
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator(uuid="{uuid}")
resource.delete(body={"user": "username", "password": "password"})
Response
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 09:13:52 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 189
Content-Type: application/hal+json
{
"job": {
"uuid": "eeb71ccd-fcb3-11ea-acaf-005056bb47c1",
"_links": {
"self": {
"href": "/api/cluster/jobs/eeb71ccd-fcb3-11ea-acaf-005056bb47c1"
}
}
}
}
Deleting a configured mediator using the UUID (SnapMirror active sync: ONTAP Mediator, ONTAP cloud mediator)
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator(uuid="{uuid}")
resource.delete()
Response
{
"job": {
"uuid": "0661a77a-ff16-11ef-82a4-005056ae1bc8",
"_links": {
"self": {
"href": "/api/cluster/jobs/0661a77a-ff16-11ef-82a4-005056ae1bc8"
}
}
}
}
Monitoring the job progress
Use the link provided in the response to the DELETE request to fetch information for the delete job.
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Job
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Job(uuid="eeb71ccd-fcb3-11ea-acaf-005056bb47c1")
resource.get()
print(resource)
Job status response
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 09:14:20 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 316
Content-Type: application/hal+json
{
"uuid": "eeb71ccd-fcb3-11ea-acaf-005056bb47c1",
"description": "DELETE /api/cluster/mediators/f89e8906-fca6-11ea-acaf-005056bb47c1",
"state": "running",
"start_time": "2020-09-22T05:13:52-04:00",
"_links": {
"self": {
"href": "/api/cluster/jobs/eeb71ccd-fcb3-11ea-acaf-005056bb47c1"
}
}
}
Final status of the Mediator DELETE job
HTTP/1.1 202 Accepted
Date: Tue, 22 Sep 2020 09:21:46 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 396
Content-Type: application/hal+json
{
"uuid": "eeb71ccd-fcb3-11ea-acaf-005056bb47c1",
"description": "DELETE /api/cluster/mediators/f89e8906-fca6-11ea-acaf-005056bb47c1",
"state": "success",
"message": "success",
"code": 0,
"start_time": "2020-09-22T05:13:52-04:00",
"end_time": "2020-09-22T05:14:24-04:00",
"_links": {
"self": {
"href": "/api/cluster/jobs/eeb71ccd-fcb3-11ea-acaf-005056bb47c1"
}
}
}
Modifying a configured Mediator using the uuid
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Mediator
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Mediator(uuid="{uuid}")
resource.use_http_proxy_local = True
resource.use_http_proxy_remote = True
resource.strict_cert_validation = True
resource.patch()
Response
HTTP/1.1 202 Accepted
Date: Thu, 06 Mar 2025 10:10:10 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 189
Content-Type: application/hal+json
{
"job": {
"uuid": "3016e8e9-fa73-11ef-9d41-005056ae10ae",
"_links": {
"self": {
"href": "/api/cluster/jobs/3016e8e9-fa73-11ef-9d41-005056ae10ae"
}
}
}
}
Monitoring the job progress
Use the link provided in the response to the PATCH request to fetch information for the modify job.
Request
from netapp_ontap import HostConnection
from netapp_ontap.resources import Job
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Job(uuid="3016e8e9-fa73-11ef-9d41-005056ae10ae")
resource.get()
print(resource)
Job status response
HTTP/1.1 202 Accepted
Date: Thu, 06 Mar 2025 10:10:22 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Location: /api/cluster/metrocluster
Content-Length: 395
Content-Type: application/hal+json
{
"uuid": "3016e8e9-fa73-11ef-9d41-005056ae10ae",
"description": "PATCH /api/cluster/mediators/a9a812bf-f7f8-11ef-a923-005056ae10ae",
"state": "success",
"message": "success",
"code": 0,
"start_time": "2025-03-06T05:10:10-05:00",
"end_time": "2025-03-06T05:10:10-05:00",
"_links": {
"self": {
"href": "/api/cluster/jobs/3016e8e9-fa73-11ef-9d41-005056ae10ae"
}
}
}
Classes
class Mediator (*args, **kwargs)-
Mediator information
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-
Returns a count of all Mediator resources that match the provided query
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
HostConnectionobject 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('Mediator')] = None, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse-
Deletes the mediator.
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
HostConnectionobject 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
NetAppResponseobject containing the details of the HTTP response.Raises
NetAppRestError: If the API call returned a status code >= 400 def fast_get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[RawResource]-
Returns a list of RawResources that represent Mediator resources that match the provided query
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
HostConnectionobject 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
raw- return a list of
netapp_ontap.resource.RawResourceobjects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server. **kwargs- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A list of
ResourceobjectsRaises
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 find (*args, connection: HostConnection = None, **kwargs) -> Resource-
"Retrieves a Mediator configured in the cluster."
Related ONTAP commands
storage iscsi-initiator 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, 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
HostConnectionobject 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
Resourceobject 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 Mediator configured in the cluster."
Related ONTAP commands
storage iscsi-initiator show
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
HostConnectionobject 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
raw- return a list of
netapp_ontap.resource.RawResourceobjects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server. **kwargs- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A list of
ResourceobjectsRaises
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('Mediator')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse-
Modifies the mediator configuration.
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
HostConnectionobject 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
NetAppResponseobject containing the details of the HTTP response.Raises
NetAppRestError: If the API call returned a status code >= 400 def post_collection (records: Iterable[ForwardRef('Mediator')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[Mediator], NetAppResponse]-
Creates and connect a mediator.
Learn more
Send this collection of objects to the host as a creation request.
Args
records- A list of
Resourceobjects 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
HostConnectionobject 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
Resourceobjects 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 aNetAppResponseobject 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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse-
Deletes the mediator.
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.
connection- The
HostConnectionobject 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
NetAppResponseobject 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 Mediator state and configuration."
Related ONTAP commands
storage iscsi-initiator 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
NetAppResponseobject containing the details of the HTTP response.Raises
NetAppRestError: If the API call returned a status code >= 400 or if not all of the keys required are present and config.STRICT_GET has been set to True. def patch (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse-
Modifies the mediator configuration.
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.
connection- The
HostConnectionobject 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 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
NetAppResponseobject 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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse-
Creates and connect a mediator.
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.
connection- The
HostConnectionobject 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 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
NetAppResponseobject containing the details of the HTTP response.Raises
NetAppRestError: If the API call returned a status code >= 400
Inherited members
class MediatorSchema (*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)-
The fields of the Mediator object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.base.SchemaABC
- abc.ABC
Class variables
-
bluexp_account_token: str POST -
BlueXP account token. This field is only applicable to the ONTAP cloud mediator.
-
bluexp_org_id: str POST -
BlueXP organization ID. This field is only applicable to the ONTAP cloud mediator.
-
ca_certificate: str POST -
CA certificate for ONTAP Mediator. This is optional if the certificate is already installed.
-
dr_group: MetroclusterDrGroup -
The dr_group field of the mediator.
-
ip_address: str GET POST -
The IP address of the mediator.
Example: 10.10.10.7
-
local_mediator_connectivity: str GET -
Indicates the mediator connectivity status of the local cluster. Possible values are connected, unreachable, unusable and down-high-latency. This field is only applicable to the mediators in SnapMirror active sync configuration.
Example: connected
-
password: str POST -
The password used to connect to the REST server on the mediator.
Example: mypassword
-
peer_cluster: ClusterPeer GET POST -
The peer_cluster field of the mediator.
-
peer_mediator_connectivity: str GET -
Indicates the mediator connectivity status of the peer cluster. Possible values are connected, unreachable, unknown and down-high-latency.
Example: connected
-
port: Size GET POST -
The REST server's port number on the mediator.
Example: 31784
-
reachable: bool GET -
Indicates the connectivity status of the mediator.
Example: true
-
service_account_client_id: str POST -
Client ID of the BlueXP service account. This field is only applicable to the ONTAP cloud mediator.
-
service_account_client_secret: str POST -
Client secret token of the BlueXP service account. This field is only applicable to the ONTAP cloud mediator.
-
strict_cert_validation: bool GET POST PATCH -
Indicates if strict validation of certificates is performed while making REST API calls to the mediator. This field is only applicable to the ONTAP Cloud Mediator.
Example: true
-
type: str GET POST -
Mediator type. This field is only applicable to the mediators in SnapMirror active sync configuration.
Valid choices:
- cloud
- on_prem
-
use_http_proxy_local: bool GET POST PATCH -
Indicates if the local cluster should use an http-proxy server while making REST API calls to the mediator. This field is only applicable to the ONTAP cloud mediator.
Example: true
-
use_http_proxy_remote: bool POST PATCH -
Indicates if the remote cluster should use an http-proxy server while making REST API calls to the mediator. This field is only applicable to the ONTAP cloud mediator.
Example: true
-
user: str POST -
The username used to connect to the REST server on the mediator.
Example: myusername
-
uuid: str GET -
The unique identifier for the mediator service.