Module netapp_ontap.resources.fc_interface
Copyright © 2019 NetApp Inc. All rights reserved.
Overview
Fibre Channel (FC) interfaces are the logical endpoints for FC network connections to an SVM. An FC interface provides FC access to storage within the interface SVM using either Fibre Channel Protocol or NVMe over FC (NVMe/FC).
The Fibre Channel interface REST API allows you to create, delete, update, and discover FC interfaces, and obtain status information for FC interfaces.
An FC interface is created on an FC port which is located on a cluster node. The FC port must be specified to identify the location of the interface for a POST or PATCH request that relocates an interface. You can identify the port by supplying either the node and port names or the port UUID.
Examples
Creating an FC interface using the port node and name to identify the location
This example uses the return_records
query parameter to retrieve the newly created FC interface in the POST response.
# The API:
POST /api/network/fc/interfaces
# The call:
curl -X POST 'https://<mgmt-ip>/api/network/fc/interfaces?return_records=true' -H 'accept: application/hal+json' -d '{ "svm": { "name": "svm1" }, "name": "lif1", "location": { "port": { "name": "0a", "node": { "name": "node1" } } }, "data_protocol": "fcp" }'
# The response:
{
"num_records": 1,
"records": [
{
"svm": {
"uuid": "cf300f5c-db83-11e8-bd46-005056bba0e0",
"name": "svm1",
"_links": {
"self": {
"href": "/api/svm/svms/cf300f5c-db83-11e8-bd46-005056bba0e0"
}
}
},
"uuid": "f6045b92-dec7-11e8-a733-005056bba0e0",
"name": "lif1",
"location": {
"node": {
"uuid": "bafe9b9f-db81-11e8-bd46-005056bba0e0",
"name": "node1",
"_links": {
"self": {
"href": "/api/cluster/nodes/bafe9b9f-db81-11e8-bd46-005056bba0e0"
}
}
},
"port": {
"uuid": "300c1ae3-db82-11e8-bd46-005056bba0e0",
"name": "0a",
"node": {
"name": "node1"
},
"_links": {
"self": {
"href": "/api/network/fc/ports/300c1ae3-db82-11e8-bd46-005056bba0e0"
}
}
}
},
"enabled": true,
"state": "down",
"data_protocol": "fcp",
"wwpn": "20:04:00:50:56:bb:a0:e0",
"wwnn": "20:00:00:50:56:bb:a0:e0",
"port_address": "9da2cb1",
"_links": {
"self": {
"href": "/api/network/fc/interfaces/f6045b92-dec7-11e8-a733-005056bba0e0"
}
}
}
]
}
Creating an FC interface using the port UUID to identify the location
This example uses the return_records
query parameter to retrieve the newly created FC interface in the POST response.
# The API:
POST /api/network/fc/interfaces
# The call:
curl -X POST 'https://<mgmt-ip>/api/network/fc/interfaces?return_records=true' -H 'accept: application/hal+json' -d '{ "svm": { "name": "svm3" }, "name": "lif2", "location": { "port": { "uuid": "24bb636a-db83-11e8-9a49-005056bb1ec6" } }, "data_protocol": "fc_nvme" }'
# The response:
{
"num_records": 1,
"records": [
{
"svm": {
"uuid": "a5060466-dbab-11e8-bd46-005056bba0e0",
"name": "svm3",
"_links": {
"self": {
"href": "/api/svm/svms/a5060466-dbab-11e8-bd46-005056bba0e0"
}
}
},
"uuid": "cdeb5591-dec9-11e8-a733-005056bba0e0",
"name": "lif2",
"location": {
"node": {
"uuid": "e85aa147-db83-11e8-9a48-005056bb1ec6",
"name": "node3",
"_links": {
"self": {
"href": "/api/cluster/nodes/e85aa147-db83-11e8-9a48-005056bb1ec6"
}
}
},
"port": {
"uuid": "24bb636a-db83-11e8-9a49-005056bb1ec6",
"name": "1b",
"node": {
"name": "node3"
},
"_links": {
"self": {
"href": "/api/network/fc/ports/24bb636a-db83-11e8-9a49-005056bb1ec6"
}
}
}
},
"enabled": true,
"state": "down",
"data_protocol": "fc_nvme",
"wwpn": "20:05:00:50:56:bb:a0:e0",
"wwnn": "20:02:00:50:56:bb:a0:e0",
"port_address": "612e202b",
"_links": {
"self": {
"href": "/api/network/fc/interfaces/cdeb5591-dec9-11e8-a733-005056bba0e0"
}
}
}
]
}
Retrieving all properties for all FC interfaces
This example uses the fields
query parameter to retrieve all properties.
# The API:
GET /api/network/fc/interfaces
# The call:
curl -X GET 'https://<mgmt-ip>/api/network/fc/interfaces?fields=*' -H 'accept: application/hal+json'
# The response:
{
"records": [
{
"svm": {
"uuid": "a5060466-dbab-11e8-bd46-005056bba0e0",
"name": "svm3",
"_links": {
"self": {
"href": "/api/svm/svms/a5060466-dbab-11e8-bd46-005056bba0e0"
}
}
},
"uuid": "cdeb5591-dec9-11e8-a733-005056bba0e0",
"name": "lif2",
"location": {
"node": {
"uuid": "e85aa147-db83-11e8-9a48-005056bb1ec6",
"name": "node3",
"_links": {
"self": {
"href": "/api/cluster/nodes/e85aa147-db83-11e8-9a48-005056bb1ec6"
}
}
},
"port": {
"uuid": "24bb636a-db83-11e8-9a49-005056bb1ec6",
"name": "1b",
"node": {
"name": "node3"
},
"_links": {
"self": {
"href": "/api/network/fc/ports/24bb636a-db83-11e8-9a49-005056bb1ec6"
}
}
}
},
"enabled": true,
"state": "down",
"data_protocol": "fc_nvme",
"wwpn": "20:05:00:50:56:bb:a0:e0",
"wwnn": "20:02:00:50:56:bb:a0:e0",
"port_address": "612e202b",
"_links": {
"self": {
"href": "/api/network/fc/interfaces/cdeb5591-dec9-11e8-a733-005056bba0e0"
}
}
},
{
"svm": {
"uuid": "cf300f5c-db83-11e8-bd46-005056bba0e0",
"name": "svm1",
"_links": {
"self": {
"href": "/api/svm/svms/cf300f5c-db83-11e8-bd46-005056bba0e0"
}
}
},
"uuid": "f6045b92-dec7-11e8-a733-005056bba0e0",
"name": "lif1",
"location": {
"node": {
"uuid": "bafe9b9f-db81-11e8-bd46-005056bba0e0",
"name": "node1",
"_links": {
"self": {
"href": "/api/cluster/nodes/bafe9b9f-db81-11e8-bd46-005056bba0e0"
}
}
},
"port": {
"uuid": "300c1ae3-db82-11e8-bd46-005056bba0e0",
"name": "0a",
"node": {
"name": "node1"
},
"_links": {
"self": {
"href": "/api/network/fc/ports/300c1ae3-db82-11e8-bd46-005056bba0e0"
}
}
}
},
"enabled": true,
"state": "down",
"data_protocol": "fcp",
"wwpn": "20:04:00:50:56:bb:a0:e0",
"wwnn": "20:00:00:50:56:bb:a0:e0",
"port_address": "9da2cb1",
"_links": {
"self": {
"href": "/api/network/fc/interfaces/f6045b92-dec7-11e8-a733-005056bba0e0"
}
}
}
],
"num_records": 2,
"_links": {
"self": {
"href": "/api/network/fc/interfaces?fields=*"
}
}
}
Retrieving a list of selected FC interfaces
This example uses property query parameters to retrieve FC interfaces configured for the FC Protocol that are set to up.
# The API:
GET /api/network/fc/interfaces
# The call:
curl -X GET 'https://<mgmt-ip>/api/network/fc/interfaces?data_protocol=fcp&state=up' -H 'accept: application/hal+json'
# The response:
{
"records": [
{
"svm": {
"uuid": "cf300f5c-db83-11e8-bd46-005056bba0e0",
"name": "svm1",
"_links": {
"self": {
"href": "/api/svm/svms/cf300f5c-db83-11e8-bd46-005056bba0e0"
}
}
},
"uuid": "f6045b92-dec7-11e8-a733-005056bba0e0",
"name": "lif1",
"state": "up",
"data_protocol": "fcp",
"_links": {
"self": {
"href": "/api/network/fc/interfaces/f6045b92-dec7-11e8-a733-005056bba0e0"
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/network/fc/interfaces?data_protocol=fcp&state=up"
}
}
}
Retrieving a specific FC interface
# The API:
GET /api/network/fc/interfaces/{uuid}
# The call:
curl -X GET 'https://<mgmt-ip>/api/network/fc/interfaces/cdeb5591-dec9-11e8-a733-005056bba0e0' -H 'accept: application/hal+json'
# The response:
{
"svm": {
"uuid": "a5060466-dbab-11e8-bd46-005056bba0e0",
"name": "svm3",
"_links": {
"self": {
"href": "/api/svm/svms/a5060466-dbab-11e8-bd46-005056bba0e0"
}
}
},
"uuid": "cdeb5591-dec9-11e8-a733-005056bba0e0",
"name": "lif2",
"location": {
"node": {
"uuid": "e85aa147-db83-11e8-9a48-005056bb1ec6",
"name": "node3",
"_links": {
"self": {
"href": "/api/cluster/nodes/e85aa147-db83-11e8-9a48-005056bb1ec6"
}
}
},
"port": {
"uuid": "24bb636a-db83-11e8-9a49-005056bb1ec6",
"name": "1b",
"node": {
"name": "node3"
},
"_links": {
"self": {
"href": "/api/network/fc/ports/24bb636a-db83-11e8-9a49-005056bb1ec6"
}
}
}
},
"enabled": true,
"state": "down",
"data_protocol": "fc_nvme",
"wwpn": "20:05:00:50:56:bb:a0:e0",
"wwnn": "20:02:00:50:56:bb:a0:e0",
"port_address": "612e202b",
"_links": {
"self": {
"href": "/api/network/fc/interfaces/cdeb5591-dec9-11e8-a733-005056bba0e0"
}
}
}
Disabling an FC interface
When updating certain properties or deleting an FC interface, the interface must first be disabled using the following:
# The API:
PATCH /api/network/fc/interfaces/{uuid}
# The call:
curl -X PATCH 'https://<mgmt-ip>/api/network/fc/interfaces/f6045b92-dec7-11e8-a733-005056bba0e0' -H 'accept: application/hal+json' -d '{ "enabled": false }'
Moving the FC interface to a new node and port
To move an FC interface to another node or port, the destination FC port must be specified in a PATCH request. Either the port UUID or node and port names can be used to identify the port.
Note that only FC interfaces configured for the FC Protocol can be moved. FC interfaces configured for NVMe/FC cannot be moved. The interface must also be set to the disabled state before being moved.
# The API:
PATCH /api/network/fc/interfaces/{uuid}
# The call:
curl -X PATCH 'https://<mgmt-ip>/api/network/fc/interfaces/f6045b92-dec7-11e8-a733-005056bba0e0' -H 'accept: application/hal+json' -d '{ "location": { "port": { "uuid": "a1dc7aa5-db83-11e8-9ef7-005056bbbbcc" } } }'
Deleting an FC interface
An FC interface must be disabled before being deleted.
# The API:
DELETE /api/network/fc/interfaces/{uuid}
# The call:
curl -X DELETE 'https://<mgmt-ip>/api/network/fc/interfaces/f6045b92-dec7-11e8-a733-005056bba0e0' -H 'accept: application/hal+json'
Classes
class FcInterface (*args, **kwargs)
-
A Fibre Channel (FC) interface is the logical endpoint for FC network connections to an SVM. An FC interface provides FC access to storage within the interface SVM using either Fibre Channel Protocol or NVMe over Fibre Channel (NVMe/FC).
An FC interface is created on an FC port which is located on a cluster node. The FC port must be specified to identify the location of the interface for a POST or PATCH operation that relocates an interface. You can identify the port by supplying either the node and port names or the port UUID.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 an FC interface.
Related ONTAP commands
network interface 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 FC interfaces.
Related ONTAP commands
network interface show
vserver fcp interface 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 FC interfaces.
Related ONTAP commands
network interface show
vserver fcp interface show
Learn more
Fetch a list of all objects of this type from the host.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. max_records
- The maximum number of records to return per call
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A list of
Resource
objectsRaises
NetAppRestError
: If there is no connection available to use either passed in or on the library. def patch_collection(body: dict, *args, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Updates an FC interface.
Related ONTAP commands
network interface 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 an FC interface.
Related ONTAP commands
network interface 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 a Fibre Channel interface.
Related ONTAP commands
network interface show
vserver fcp interface 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 an FC interface.
Related ONTAP commands
network interface 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 an FC interface.
Required properties
svm.uuid
orsvm.name
- Existing SVM in which to create the FC interface.name
- Name of the FC interface.location.port.uuid
or bothlocation.port.name
andlocation.port.node.name
- FC port on which to create the FC interface.data_protocol
- Data protocol for the FC interface.
Default property values
If not specified in POST, the following default property values are assigned. *
enabled
- trueRelated ONTAP commands
network interface 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 FcInterfaceSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the FcInterface object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var comment
-
A user configurable comment. Optional in POST; valid in PATCH. To clear a prior comment, set the property to an empty string in PATCH.
var data_protocol
-
The data protocol for which the FC interface is configured. Required in POST.
Valid choices:
- fcp
- fc_nvme
var enabled
-
The administrative state of the FC interface. The FC interface can be disabled to block all FC communication with the SVM through this interface. Optional in POST and PATCH; defaults to true (enabled) in POST.
var links
-
The links field of the fc_interface.
var location
-
The location field of the fc_interface.
var name
-
The name of the FC interface. Required in POST; optional in PATCH.
Example: lif1
var opts
var port_address
-
The port address of the FC interface. Each FC port in an FC switched fabric has its own unique FC port address for routing purposes. The FC port address is assigned by a switch in the fabric when that port logs in to the fabric. This property refers to the address given by a switch to the FC interface when the SVM performs a port login (PLOGI).
This is useful for obtaining statistics and diagnostic information from FC switches.
This is a hexadecimal encoded numeric value.Example: 5060F
var state
-
The current operational state of the FC interface. The state is set to down if the interface is not enabled.
If the node hosting the port is down or unavailable, no state value is returned.Valid choices:
- up
- down
var svm
-
The svm field of the fc_interface.
var uuid
-
The unique identifier of the FC interface. Required in the URL.
Example: 1cd8a442-86d1-11e0-ae1c-123478563412
var wwnn
-
The world wide node name (WWNN) of the FC interface SVM. The WWNN is generated by ONTAP when Fibre Channel Protocol or the NVMe service is created for the FC interface SVM.
Example: 20:00:00:50:56:b4:13:01
var wwpn
-
The world wide port name (WWPN) of the FC interface. The WWPN is generated by ONTAP when the FC interface is created.
Example: 20:00:00:50:56:b4:13:a8