Module netapp_ontap.resources.ip_service_policy
Copyright © 2019 NetApp Inc. All rights reserved.
Overview
Service policies are named groupings that define what services are supported by an IP interface. The network IP service-policies GET API retrieves and displays relevant information pertaining to the service policies configured in the cluster. The API retrieves the list of all service policies configured in the cluster or a specific service policy.
Examples
Retrieving all service policies in the cluster
The following output shows the collection of all service policies configured in a 2-node cluster. By default (without 'field=*' parameter), only the UUID and name fields are shown for each entry.
# The API:
/api/network/ethernet/ip/service-policies
# The call:
curl -X GET "https://<mgmt-ip>/api/network/ip/service-policies" -H "accept: application/hal+json"
# The response:
{
"records": [
{
"uuid": "e4e2f193-c1a3-11e8-bb9d-005056bb88c8",
"name": "net-intercluster",
"_links": {
"self": {
"href": "/api/network/ip/service-policies/e4e2f193-c1a3-11e8-bb9d-005056bb88c8"
}
}
},
{
"uuid": "e4e3f6da-c1a3-11e8-bb9d-005056bb88c8",
"name": "net-route-announce",
"_links": {
"self": {
"href": "/api/network/ip/service-policies/e4e3f6da-c1a3-11e8-bb9d-005056bb88c8"
}
}
},
{
"uuid": "e5111111-c1a3-11e8-bb9d-005056bb88c8",
"name": "vserver-route-announce",
"_links": {
"self": {
"href": "/api/network/ip/service-policies/e5111111-c1a3-11e8-bb9d-005056bb88c8"
}
}
},
{
"uuid": "e6111111-c1a3-11e8-bb9d-005056bb88c8",
"name": "data-route-announce",
"_links": {
"self": {
"href": "/api/network/ip/service-policies/e6111111-c1a3-11e8-bb9d-005056bb88c8"
}
}
}
],
"num_records": 4,
"_links": {
"self": {
"href": "/api/network/ip/service-policies/?return_records=true&return_timeout=15"
}
}
}
Retrieving a specific service policy (scope=svm)
The following output displays the response when a specific "svm" scoped service policy is requested. Among other parameters, the response contains the svm parameters associated with the service policy. The system returns an error when there is no service policy with the requested UUID.
# The API:
/api/network/ip/service-policies
# The call:
curl -X GET "http://<mgmt-ip>/api/network/ip/service-policies/dad323ff-4ce0-11e9-9372-005056bb91a8?fields=*" -H "accept: application/hal+json"
# The response:
{
"uuid": "dad323ff-4ce0-11e9-9372-005056bb91a8",
"name": "default-data-files",
"scope": "svm",
"svm": {
"uuid": "d9060680-4ce0-11e9-9372-005056bb91a8",
"name": "vs0",
"_links": {
"self": {
"href": "/api/svm/svms/d9060680-4ce0-11e9-9372-005056bb91a8"
}
}
},
"ipspace": {
"uuid": "45ec2dee-4ce0-11e9-9372-005056bb91a8",
"name": "Default",
"_links": {
"self": {
"href": "/api/network/ipspaces/45ec2dee-4ce0-11e9-9372-005056bb91a8"
}
}
},
"services": [
"data_core",
"data_nfs",
"data_cifs",
"data_flexcache"
],
"_links": {
"self": {
"href": "/api/network/ip/service-policies/dad323ff-4ce0-11e9-9372-005056bb91a8"
}
}
}
Retrieving a specific service policy (scope=svm) when requesting commonly used fields
The following output displays the response when commonly used fields are requested for a specific "svm" scoped service policy. Among other parameters, the response contains the svm parameters associated with the service policy. The system returns an error when there is no service policy with the requested UUID.
# The API:
/api/network/ip/service-policies
# The call:
curl -X GET "https://<mgmt-ip>/api/network/ip/service-policies/e0889ce6-1e6a-11e9-89d6-005056bbdc04?fields=name,scope,svm.name,ipspace.name" -H "accept: application/hal+json"
# The response:
{
"uuid": "e0889ce6-1e6a-11e9-89d6-005056bbdc04",
"name": "test_policy",
"scope": "svm",
"svm": {
"name": "vs0",
},
"ipspace": {
"name": "Default",
},
"_links": {
"self": {
"href": "/api/network/ip/service-policies/e0889ce6-1e6a-11e9-89d6-005056bbdc04"
}
}
}
Retrieving a specific service policy (scope=cluster)
The following output displays the response when a specific cluster-scoped service policy is requested. The SVM object is not included for cluster-scoped service policies. A service policy with a scope of "cluster" is associated with an IPspace. The system returns an error when there is no service policy with the requested UUID.
# The API:
/api/network/ip/service-policies
# The call:
curl -X GET "https://<mgmt-ip>/api/network/ip/service-policies/4c6b72b9-0f6c-11e9-875d-005056bb21b8?fields=*" -H "accept: application/hal+json"
# The response:
{
"uuid": "4c6b72b9-0f6c-11e9-875d-005056bb21b8",
"name": "net-intercluster",
"scope": "cluster",
"ipspace": {
"uuid": "4051f13e-0f6c-11e9-875d-005056bb21b8",
"name": "Default",
"_links": {
"self": {
"href": "/api/network/ipspaces/4051f13e-0f6c-11e9-875d-005056bb21b8"
}
}
},
"services": [
"intercluster_core"
],
"_links": {
"self": {
"href": "/api/network/ip/service-policies/4c6b72b9-0f6c-11e9-875d-005056bb21b8"
}
}
}
Retrieving a specific service policy (scope=cluster) when requesting commonly used fields
The following output displays the response when commonly used fields are requested for a specific "cluster" scoped service policy. The SVM object is not included for cluster-scoped service policies. A service policy with a scope of "cluster" is associated with an IPspace. The system returns an error when there is no service policy with the requested UUID.
# The API:
/api/network/ip/service-policies
# The call:
curl -X GET "https://<mgmt-ip>/api/network/ip/service-policies/4c6b72b9-0f6c-11e9-875d-005056bb21b8?fields=name,scope,ipspace.name" -H "accept: application/hal+json"
# The response:
{
"uuid": "4c6b72b9-0f6c-11e9-875d-005056bb21b8",
"name": "net-intercluster",
"scope": "cluster",
"ipspace": {
"name": "Default",
},
"services": [
"intercluster_core"
],
"_links": {
"self": {
"href": "/api/network/ip/service-policies/4c6b72b9-0f6c-11e9-875d-005056bb21b8"
}
}
}
Classes
class IpServicePolicy (*args, **kwargs)
-
Allows interaction with IpServicePolicy 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 find(*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves a collection of service policies.
Related ONTAP commands
network interface service-policy 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 a collection of service policies.
Related ONTAP commands
network interface service-policy 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.
Methods
def get(self, **kwargs) -> NetAppResponse
-
Retrieves a specific service policy.
Related ONTAP commands
network interface service-policy 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
Inherited members
class IpServicePolicySchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the IpServicePolicy object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var ipspace
-
The ipspace field of the ip_service_policy.
var links
-
The links field of the ip_service_policy.
var name
-
The name field of the ip_service_policy.
Example: default-intercluster
var opts
var scope
-
The scope field of the ip_service_policy.
var services
-
The services field of the ip_service_policy.
var svm
-
The svm field of the ip_service_policy.
var uuid
-
The uuid field of the ip_service_policy.
Example: 1cd8a442-86d1-11e0-ae1c-123478563412