Module netapp_ontap.resources.fc_port
Copyright © 2019 NetApp Inc. All rights reserved.
Overview
Fibre Channel (FC) ports are the physical ports of FC adapters on ONTAP cluster nodes that can be connected to FC networks to provide FC network connectivity. An FC port defines the location of an FC interface within the ONTAP cluster.
The Fibre Channel port REST API allows you to discover FC ports, obtain status information for FC ports, and configure FC port properties. POST and DELETE are not supported. You must physically add and remove FC adapters to ONTAP nodes to create and remove ports from the ONTAP cluster.
Examples
Retrieving all FC ports
# The API:
GET /api/network/fc/ports
# The call:
curl -X GET "https://<mgmt-ip>/api/network/fc/ports" -H "accept: application/hal+json"
# The response:
{
"records": [
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
},
"uuid": "931b20f8-b047-11e8-9af3-005056bb838e",
"name": "0a",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
},
"uuid": "931b23f7-b047-11e8-9af3-005056bb838e",
"name": "0b",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b23f7-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
},
"uuid": "931b25ba-b047-11e8-9af3-005056bb838e",
"name": "0c",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b25ba-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
},
"uuid": "931b2748-b047-11e8-9af3-005056bb838e",
"name": "0d",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b2748-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
},
"uuid": "931b28c2-b047-11e8-9af3-005056bb838e",
"name": "0e",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b28c2-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
},
"uuid": "931b2a7b-b047-11e8-9af3-005056bb838e",
"name": "0f",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b2a7b-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
},
"uuid": "931b2e2b-b047-11e8-9af3-005056bb838e",
"name": "1b",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b2e2b-b047-11e8-9af3-005056bb838e"
}
}
}
[,
"num_records": 8,
"_links": {
"self": {
"href": "/api/network/fc/ports"
}
}
}
Retrieving all FC ports with state online
The state
query parameter is used to perform the query.
# The API:
GET /api/network/fc/ports
# The call:
curl -X GET "https://<mgmt-ip>/api/network/fc/ports?state=online" -H "accept: application/hal+json"
# The response:
{
"records": [
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
}
"uuid": "931b20f8-b047-11e8-9af3-005056bb838e",
"name": "0a",
"state": "online",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
}
"uuid": "931b23f7-b047-11e8-9af3-005056bb838e",
"name": "0b",
"state": "online",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b23f7-b047-11e8-9af3-005056bb838e"
}
}
},
{
"node": {
"name": "node1",
"uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
"_links": {
"self": {
"href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
}
}
}
"uuid": "931b25ba-b047-11e8-9af3-005056bb838e",
"name": "0c",
"state": "online",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b25ba-b047-11e8-9af3-005056bb838e"
}
}
}
[,
"num_records": 3,
"_links": {
"self": {
"href": "/api/network/fc/ports?state=online"
}
}
}
Retrieving an FC port
# The API:
GET /api/network/fc/ports/{uuid}
# The call:
curl -X GET "https://<mgmt-ip>/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e" -H "accept: application/hal+json"
# The response:
{
"node": {
"name": "node1",
"uuid": "5a534a72-b047-11e8-9af3-005056bb838e",
"_links": {
"self": {
"href": "/api/cluster/nodes/5a534a72-b047-11e8-9af3-005056bb838e"
}
}
},
"uuid": "931b20f8-b047-11e8-9af3-005056bb838e",
"name": "0a",
"description": "Fibre Channel Target Adapter 0a (ACME Fibre Channel Adapter, rev. 1.0.0, 8G)",
"enabled": true,
"fabric": {
"connected": true,
"connected_speed": 8,
"name": "55:0e:b1:a0:20:40:80:00",
"port_address": "52100",
"switch_port": "ssan-g620-03:1"
},
"physical_protocol": "fibre_channel",
"speed": {
"maximum": "8",
"configured": "auto"
},
"state": "online",
"supported_protocols": [
"fcp"
],
"transceiver": {
"form_factor": "SFP",
"manufacturer": "ACME",
"capabilities": [
4,
8
],
"part_number": "1000"
},
"wwnn": "50:0a:09:80:bb:83:8e:00",
"wwpn": "50:0a:09:82:bb:83:8e:00",
"_links": {
"self": {
"href": "/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e"
}
}
}
Disabling an FC port
If an active FC interface exists on an FC port, the port cannot be disabled.
# The API:
PATCH /api/network/fc/ports/{uuid}
# The call:
curl -X PATCH "http://<mgmt-ip>/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e" -H "accept: application/hal+json" -d '{ "enabled": false }'
Classes
class FcPort (*args, **kwargs)
-
A Fibre Channel (FC) port is the physical port of an FC adapter on an ONTAP cluster node that can be connected to an FC network to provide FC network connectivity. An FC port defines the location of an FC interface within the ONTAP cluster.
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 FC ports.
Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *fabric.name
Related ONTAP commands
network fcp adapter 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 ports.
Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *fabric.name
Related ONTAP commands
network fcp adapter 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 port.
Related ONTAP commands
network fcp adapter 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 get(self, **kwargs) -> NetAppResponse
-
Retrieves an FC port.
Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *fabric.name
Related ONTAP commands
network fcp adapter 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 port.
Related ONTAP commands
network fcp adapter 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
Inherited members
class FcPortSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the FcPort object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var description
-
A description of the FC port.
Example: Fibre Channel Target Adapter 0a (ACME Fibre Channel Adapter, rev. 1.0.0, 8G)
var enabled
-
The administrative state of the FC port. If this property is set to false, all FC connectivity to FC interfaces are blocked. Optional in PATCH.
var fabric
-
The fabric field of the fc_port.
var links
-
The links field of the fc_port.
var name
-
The FC port name.
Example: 0a
var node
-
The node field of the fc_port.
var opts
var physical_protocol
-
The physical network protocol of the FC port.
Valid choices:
- fibre_channel
- ethernet
var speed
-
The speed field of the fc_port.
var state
-
The operational state of the FC port. - startup - The port is booting up. - link_not_connected - The port has finished initialization, but a link with the fabric is not established. - online - The port is initialized and a link with the fabric has been established. - link_disconnected - The link was present at one point on this port but is currently not established. - offlined_by_user - The port is administratively disabled. - offlined_by_system - The port is set to offline by the system. This happens when the port encounters too many errors. - node_offline - The state information for the port cannot be retrieved. The node is offline or inaccessible.
Valid choices:
- startup
- link_not_connected
- online
- link_disconnected
- offlined_by_user
- offlined_by_system
- node_offline
- unknown
var supported_protocols
-
The network protocols supported by the FC port.
var transceiver
-
The transceiver field of the fc_port.
var uuid
-
The unique identifier of the FC port.
Example: 1cd8a442-86d1-11e0-ae1c-123478563412
var wwnn
-
The base world wide node name (WWNN) for the FC port.
Example: 20:00:00:50:56:b4:13:a8
var wwpn
-
The base world wide port name (WWPN) for the FC port.
Example: 20:00:00:50:56:b4:13:a8