Module netapp_ontap.resources.fc_port

Copyright © 2023 NetApp Inc. All rights reserved.

This file has been automatically generated based on the ONTAP REST API documentation.

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 requests are not supported. You must physically add and remove FC adapters to ONTAP nodes to create and remove ports from the ONTAP cluster.

Performance monitoring

Performance of an FC port can be monitored by observing the metric.* and statistics.* properties. These properties show the performance of an FC port in terms of IOPS, latency, and throughput. The metric.* properties denote an average, whereas statistics.* properties denote a real-time monotonically increasing value aggregated across all nodes.

Examples

Retrieving all FC ports

from netapp_ontap import HostConnection
from netapp_ontap.resources import FcPort

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

[
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b20f8-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0a",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b23f7-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b23f7-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0b",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b25ba-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b25ba-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0c",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b2748-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b2748-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0d",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b28c2-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b28c2-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0e",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b2a7b-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b2a7b-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0f",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b2e2b-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b2e2b-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "1b",
        }
    ),
]


Retrieving all FC ports with state online

The state query parameter is used to perform the query.

from netapp_ontap import HostConnection
from netapp_ontap.resources import FcPort

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

[
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b20f8-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0a",
            "state": "online",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b23f7-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b23f7-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0b",
            "state": "online",
        }
    ),
    FcPort(
        {
            "_links": {
                "self": {
                    "href": "/api/network/fc/ports/931b25ba-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "931b25ba-b047-11e8-9af3-005056bb838e",
            "node": {
                "name": "node1",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/3c768e01-1abc-4b3b-b7c0-629ceb62a497"
                    }
                },
                "uuid": "3c768e01-1abc-4b3b-b7c0-629ceb62a497",
            },
            "name": "0c",
            "state": "online",
        }
    ),
]


Retrieving an FC port

from netapp_ontap import HostConnection
from netapp_ontap.resources import FcPort

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FcPort(uuid="931b20f8-b047-11e8-9af3-005056bb838e")
    resource.get()
    print(resource)

FcPort(
    {
        "transceiver": {
            "manufacturer": "ACME",
            "part_number": "1000",
            "form_factor": "SFP",
            "capabilities": [4, 8],
        },
        "_links": {
            "self": {
                "href": "/api/network/fc/ports/931b20f8-b047-11e8-9af3-005056bb838e"
            }
        },
        "uuid": "931b20f8-b047-11e8-9af3-005056bb838e",
        "wwnn": "50:0a:09:80:bb:83:8e:00",
        "statistics": {
            "timestamp": "2019-04-09T05:50:42+00:00",
            "iops_raw": {"other": 3, "write": 0, "read": 0, "total": 3},
            "throughput_raw": {"write": 0, "read": 0, "total": 0},
            "latency_raw": {"other": 38298, "write": 0, "read": 0, "total": 38298},
            "status": "ok",
        },
        "node": {
            "name": "node1",
            "_links": {
                "self": {
                    "href": "/api/cluster/nodes/5a534a72-b047-11e8-9af3-005056bb838e"
                }
            },
            "uuid": "5a534a72-b047-11e8-9af3-005056bb838e",
        },
        "speed": {"maximum": "8", "configured": "auto"},
        "name": "0a",
        "wwpn": "50:0a:09:82:bb:83:8e:00",
        "description": "Fibre Channel Target Adapter 0a (ACME Fibre Channel Adapter, rev. 1.0.0, 8G)",
        "state": "online",
        "supported_protocols": ["fcp"],
        "physical_protocol": "fibre_channel",
        "fabric": {
            "name": "55:0e:b1:a0:20:40:80:00",
            "port_address": "52100",
            "connected_speed": 8,
            "switch_port": "ssan-g620-03:1",
            "connected": True,
        },
        "enabled": True,
        "metric": {
            "duration": "PT15S",
            "timestamp": "2019-04-09T05:50:15+00:00",
            "iops": {"other": 0, "write": 0, "read": 0, "total": 0},
            "throughput": {"write": 0, "read": 0, "total": 0},
            "latency": {"other": 0, "write": 0, "read": 0, "total": 0},
            "status": "ok",
        },
    }
)


Disabling an FC port

If an active FC interface exists on an FC port, the port cannot be disabled.

from netapp_ontap import HostConnection
from netapp_ontap.resources import FcPort

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FcPort(uuid="931b20f8-b047-11e8-9af3-005056bb838e")
    resource.enabled = False
    resource.patch()

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 count_collection (*args, connection: HostConnection = None, **kwargs) -> int

Returns a count of all FcPort 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 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 find (*args, connection: HostConnection = None, **kwargs) -> Resource

Retrieves FC ports.

Expensive properties

There is an added computational 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. See Requesting specific fields to learn more. * fabric.name * statistics.* * metric.*

  • 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, 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 FC ports.

Expensive properties

There is an added computational 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. See Requesting specific fields to learn more. * fabric.name * statistics.* * metric.*

  • network fcp adapter 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 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('FcPort')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse

Updates an FC port.

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

Methods

def get (self, **kwargs) -> NetAppResponse

Retrieves an FC port.

Expensive properties

There is an added computational 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. See Requesting specific fields to learn more. * fabric.name * statistics.* * metric.*

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

Updates an FC port.

  • 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.
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 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 FcPortSchema (*, 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 FcPort object

Ancestors

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

Class variables

description: str GET

A description of the FC port.

Example: Fibre Channel Target Adapter 0a (ACME Fibre Channel Adapter, rev. 1.0.0, 8G)

enabled: bool GET POST PATCH

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.

fabric: FcPortFabric GET POST PATCH

The fabric field of the fc_port.

interface_count: Size GET

The number of FC interfaces currently provisioned on this port. This property is not supported in an SVM context.

The links field of the fc_port.

metric: PerformanceMetricReducedThroughput GET

The metric field of the fc_port.

name: str GET

The FC port name.

Example: 0a

node: Node GET POST PATCH

The node field of the fc_port.

physical_protocol: str GET

The physical network protocol of the FC port.

Valid choices:

  • fibre_channel
  • ethernet
speed: FcPortSpeed GET POST PATCH

The speed field of the fc_port.

state: str GET

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
statistics: PerformanceMetricRawReducedThroughput GET

The statistics field of the fc_port.

supported_protocols: List[str] GET

The network protocols supported by the FC port.

transceiver: FcPortTransceiver GET POST PATCH

The transceiver field of the fc_port.

uuid: str GET

The unique identifier of the FC port.

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

wwnn: str GET

The base world wide node name (WWNN) for the FC port.

Example: 20:00:00:50:56:b4:13:a8

wwpn: str GET

The base world wide port name (WWPN) for the FC port.

Example: 20:00:00:50:56:b4:13:a8