netapp_ontap.resources.port API documentation
Description: Copyright &copy; 2026 NetApp Inc. All rights reserved …

# Module `netapp_ontap.resources.port`

Copyright © 2026 NetApp Inc. All rights reserved.

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

## Overview

A port is a physical or virtual Ethernet network device. Physical ports may be combined into Link Aggregation Groups (LAGs or ifgrps), or divided into Virtual LANs (VLANs).
GET (collection), GET (instance), and PATCH APIs are available for all port types. POST and DELETE APIs are available for "lag" (ifgrp) and "vlan" port types.

## Retrieving network port information

The network ports GET API retrieves and displays relevant information pertaining to the ports configured in the cluster. The API retrieves the list of all ports configured in the cluster, or specifically requested ports. The fields returned in the response vary for different ports and configurations.

## Examples

### Retrieving all ports in the cluster

The following output displays the UUID, name, and port type for all ports configured in a 2-node cluster. The port types are physical, vlan, lag (ifgrp), and p-vlan (available in select environments only).

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(list(Port.get_collection(fields="uuid,name,type")))

Try it out

    [
        Port(
            {
                "name": "e0a",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/2d2c90c0-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "type": "physical",
                "uuid": "2d2c90c0-f70d-11e8-b145-005056bb5b8e",
            }
        ),
        Port(
            {
                "name": "e0b",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/2d3004da-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "type": "physical",
                "uuid": "2d3004da-f70d-11e8-b145-005056bb5b8e",
            }
        ),
        Port(
            {
                "name": "e0c",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/2d34a2cb-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "type": "physical",
                "uuid": "2d34a2cb-f70d-11e8-b145-005056bb5b8e",
            }
        ),
        Port(
            {
                "name": "e0d",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/2d37189f-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "type": "physical",
                "uuid": "2d37189f-f70d-11e8-b145-005056bb5b8e",
            }
        ),
        Port(
            {
                "name": "e0a",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/35de5d8b-f70d-11e8-abdf-005056bb7fc8"
                    }
                },
                "type": "physical",
                "uuid": "35de5d8b-f70d-11e8-abdf-005056bb7fc8",
            }
        ),
        Port(
            {
                "name": "e0b",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/35de78cc-f70d-11e8-abdf-005056bb7fc8"
                    }
                },
                "type": "physical",
                "uuid": "35de78cc-f70d-11e8-abdf-005056bb7fc8",
            }
        ),
        Port(
            {
                "name": "e0c",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/35dead3c-f70d-11e8-abdf-005056bb7fc8"
                    }
                },
                "type": "physical",
                "uuid": "35dead3c-f70d-11e8-abdf-005056bb7fc8",
            }
        ),
        Port(
            {
                "name": "e0d",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/35deda90-f70d-11e8-abdf-005056bb7fc8"
                    }
                },
                "type": "physical",
                "uuid": "35deda90-f70d-11e8-abdf-005056bb7fc8",
            }
        ),
        Port(
            {
                "name": "e0c-100",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/42e25145-f97d-11e8-ade9-005056bb7fc8"
                    }
                },
                "type": "vlan",
                "uuid": "42e25145-f97d-11e8-ade9-005056bb7fc8",
            }
        ),
        Port(
            {
                "name": "a0a",
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/569e0abd-f97d-11e8-ade9-005056bb7fc8"
                    }
                },
                "type": "lag",
                "uuid": "569e0abd-f97d-11e8-ade9-005056bb7fc8",
            }
        ),
    ]

### Retrieving a specific physical port

The following output displays the response when a specific physical port is requested. The system returns an error when there is no port with the requested UUID. Also, the "speed" field for the physical port is set only if the state of the port is up.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port(uuid="2d37189f-f70d-11e8-b145-005056bb5b8e")
        resource.get(fields="*")
        print(resource)

Try it out

    Port(
        {
            "name": "e0d",
            "broadcast_domain": {
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/broadcast-domains/36434bec-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "name": "Default",
                "ipspace": {"name": "Default"},
                "uuid": "36434bec-f70d-11e8-b145-005056bb5b8e",
            },
            "node": {
                "name": "user-cluster-01",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/faa56898-f70c-11e8-b145-005056bb5b8e"
                    }
                },
                "uuid": "faa56898-f70c-11e8-b145-005056bb5b8e",
            },
            "mac_address": "00:50:56:bb:62:2d",
            "speed": 1000,
            "enabled": True,
            "_links": {
                "self": {
                    "href": "/api/network/ethernet/ports/2d37189f-f70d-11e8-b145-005056bb5b8e"
                }
            },
            "state": "up",
            "type": "physical",
            "uuid": "2d37189f-f70d-11e8-b145-005056bb5b8e",
            "reachability": "not_repairable",
            "mtu": 1500,
            "reachable_broadcast_domains": [
                {
                    "_links": {
                        "self": {
                            "href": "/api/network/ethernet/broadcast-domains/36434bec-f70d-11e8-b145-005056bb5b8e"
                        }
                    },
                    "name": "Default",
                    "ipspace": {"name": "Default"},
                    "uuid": "36434bec-f70d-11e8-b145-005056bb5b8e",
                },
                {
                    "_links": {
                        "self": {
                            "href": "/api/network/ethernet/broadcast-domains/df640ccf-72c4-11ea-b31d-005056bbfb29"
                        }
                    },
                    "name": "Default-1",
                    "ipspace": {"name": "Default"},
                    "uuid": "df640ccf-72c4-11ea-b31d-005056bbfb29",
                },
            ],
        }
    )

### Retrieving a specific VLAN port

The following output displays the response when a specific VLAN port is requested. The system returns an error when there is no port with the requested UUID. Also, the "speed" field for a VLAN port is always set to zero if the state of the port is up. If the state of the port is down, the "speed" field is unset and not reported back.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port(uuid="42e25145-f97d-11e8-ade9-005056bb7fc8")
        resource.get(fields="*")
        print(resource)

Try it out

    Port(
        {
            "vlan": {
                "base_port": {
                    "name": "e0e",
                    "node": {"name": "user-cluster-02"},
                    "_links": {
                        "self": {
                            "href": "/api/network/ethernet/ports/35deff03-f70d-11e8-abdf-005056bb7fc8"
                        }
                    },
                    "uuid": "35deff03-f70d-11e8-abdf-005056bb7fc8",
                },
                "tag": 100,
            },
            "name": "e0e-100",
            "broadcast_domain": {
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/broadcast-domains/36434bec-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "name": "Default",
                "ipspace": {"name": "Default"},
                "uuid": "36434bec-f70d-11e8-b145-005056bb5b8e",
            },
            "node": {
                "name": "user-cluster-02",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/6042cf47-f70c-11e8-abdf-005056bb7fc8"
                    }
                },
                "uuid": "6042cf47-f70c-11e8-abdf-005056bb7fc8",
            },
            "mac_address": "00:50:56:bb:52:2f",
            "speed": 0,
            "enabled": True,
            "_links": {
                "self": {
                    "href": "/api/network/ethernet/ports/42e25145-f97d-11e8-ade9-005056bb7fc8"
                }
            },
            "state": "up",
            "type": "vlan",
            "uuid": "42e25145-f97d-11e8-ade9-005056bb7fc8",
            "reachability": "ok",
            "mtu": 1500,
            "reachable_broadcast_domains": [
                {
                    "_links": {
                        "self": {
                            "href": "/api/network/ethernet/broadcast-domains/36434bec-f70d-11e8-b145-005056bb5b8e"
                        }
                    },
                    "name": "Default",
                    "ipspace": {"name": "Default"},
                    "uuid": "36434bec-f70d-11e8-b145-005056bb5b8e",
                }
            ],
        }
    )

### Retrieving a specific LAG port

The following output displays the response when a specific LAG port is requested. The system returns an error when there is no port with the requested UUID. The "lag.active_ports" field is set only if the state of the port is up. Also, the "speed" field for a LAG port is always set to zero if the state of the port is up. If the state of the port is down, the "speed" field is unset and not reported back.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port(uuid="569e0abd-f97d-11e8-ade9-005056bb7fc8")
        resource.get(fields="*")
        print(resource)

Try it out

    Port(
        {
            "name": "a0a",
            "broadcast_domain": {
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/broadcast-domains/36434bec-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "name": "Default",
                "ipspace": {"name": "Default"},
                "uuid": "36434bec-f70d-11e8-b145-005056bb5b8e",
            },
            "node": {
                "name": "user-cluster-02",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/6042cf47-f70c-11e8-abdf-005056bb7fc8"
                    }
                },
                "uuid": "6042cf47-f70c-11e8-abdf-005056bb7fc8",
            },
            "mac_address": "02:50:56:bb:7f:c8",
            "speed": 0,
            "enabled": True,
            "_links": {
                "self": {
                    "href": "/api/network/ethernet/ports/569e0abd-f97d-11e8-ade9-005056bb7fc8"
                }
            },
            "state": "up",
            "type": "lag",
            "uuid": "569e0abd-f97d-11e8-ade9-005056bb7fc8",
            "lag": {
                "mode": "singlemode",
                "member_ports": [
                    {
                        "name": "e0f",
                        "node": {"name": "user-cluster-02"},
                        "_links": {
                            "self": {
                                "href": "/api/network/ethernet/ports/35df318d-f70d-11e8-abdf-005056bb7fc8"
                            }
                        },
                        "uuid": "35df318d-f70d-11e8-abdf-005056bb7fc8",
                    },
                    {
                        "name": "e0g",
                        "node": {"name": "user-cluster-02"},
                        "_links": {
                            "self": {
                                "href": "/api/network/ethernet/ports/35df5bad-f70d-11e8-abdf-005056bb7fc8"
                            }
                        },
                        "uuid": "35df5bad-f70d-11e8-abdf-005056bb7fc8",
                    },
                    {
                        "name": "e0h",
                        "node": {"name": "user-cluster-02"},
                        "_links": {
                            "self": {
                                "href": "/api/network/ethernet/ports/35df9926-f70d-11e8-abdf-005056bb7fc8"
                            }
                        },
                        "uuid": "35df9926-f70d-11e8-abdf-005056bb7fc8",
                    },
                ],
                "distribution_policy": "mac",
                "active_ports": [
                    {
                        "name": "e0f",
                        "_links": {
                            "self": {
                                "href": "/api/network/ethernet/ports/35df318d-f70d-11e8-abdf-005056bb7fc8"
                            }
                        },
                        "uuid": "35df318d-f70d-11e8-abdf-005056bb7fc8",
                    }
                ],
            },
            "reachability": "repairable",
            "mtu": 1500,
            "reachable_broadcast_domains": [
                {
                    "_links": {
                        "self": {
                            "href": "/api/network/ethernet/broadcast-domains/c7934b4f-691f-11ea-87fd-005056bb1ad3"
                        }
                    },
                    "name": "Default",
                    "ipspace": {"name": "Default"},
                    "uuid": "c7934b4f-691f-11ea-87fd-005056bb1ad3",
                }
            ],
        }
    )

### Retrieving all LAG (ifgrp) ports in the cluster

This command retrieves all LAG ports in the cluster (that is, all ports with type=LAG). The example shows how to filter a GET collection based on type.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(
            list(
                Port.get_collection(
                    type="lag",
                    fields="name,enabled,speed,mtu",
                    **{"node.name": "user-cluster-01"}
                )
            )
        )

Try it out

    [
        Port(
            {
                "name": "a0b",
                "node": {"name": "user-cluster-01"},
                "speed": 0,
                "enabled": True,
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/0c226db0-4b63-11e9-8113-005056bbe040"
                    }
                },
                "type": "lag",
                "uuid": "0c226db0-4b63-11e9-8113-005056bbe040",
                "mtu": 1500,
            }
        ),
        Port(
            {
                "name": "a0a",
                "node": {"name": "user-cluster-01"},
                "speed": 0,
                "enabled": True,
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/ports/d3a84153-4b3f-11e9-a00d-005056bbe040"
                    }
                },
                "type": "lag",
                "uuid": "d3a84153-4b3f-11e9-a00d-005056bbe040",
                "mtu": 1500,
            }
        ),
    ]

## Creating VLAN and LAG ports

You can use the network ports POST API to create VLAN and LAG ports. If you supply the optional broadcast domain property, the specified broadcast domain will be assigned to the new port immediately. Otherwise, within a few minutes automatic probing will determine the correct broadcast domain and will assign it to the port. During that period of time, the port will not be capable of hosting interfaces.

## Examples

### Creating a VLAN port

The following output displays the record returned after the creation of a VLAN port on "e0e" and VLAN tag "100".

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port()
        resource.type = "vlan"
        resource.node = {"name": "user-cluster-01"}
        resource.enabled = True
        resource.vlan = {
            "tag": 100,
            "base_port": {"name": "e0e", "node": {"name": "user-cluster-01"}},
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    Port(
        {
            "vlan": {
                "base_port": {
                    "name": "e0e",
                    "node": {"name": "user-cluster-01"},
                    "_links": {
                        "self": {
                            "href": "/api/network/ethernet/ports/2d39df72-f70d-11e8-b145-005056bb5b8e"
                        }
                    },
                    "uuid": "2d39df72-f70d-11e8-b145-005056bb5b8e",
                },
                "tag": 100,
            },
            "node": {
                "name": "user-cluster-01",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/faa56898-f70c-11e8-b145-005056bb5b8e"
                    }
                },
                "uuid": "faa56898-f70c-11e8-b145-005056bb5b8e",
            },
            "enabled": True,
            "_links": {
                "self": {
                    "href": "/api/network/ethernet/ports/88b2f682-fa42-11e8-a6d7-005056bb5b8e"
                }
            },
            "type": "vlan",
            "uuid": "88b2f682-fa42-11e8-a6d7-005056bb5b8e",
        }
    )

### Creating a VLAN port in a specific broadcast domain

The following output displays the record returned after the creation of a VLAN port on "e0e" and VLAN tag "100". Also, the VLAN port is added to the "Default" broadcast domain in the "Default" IPspace.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port()
        resource.type = "vlan"
        resource.node = {"name": "user-cluster-01"}
        resource.broadcast_domain = {"name": "Default", "ipspace": {"name": "Default    "}}
        resource.enabled = True
        resource.vlan = {
            "tag": 100,
            "base_port": {"name": "e0e", "node": {"name": "user-cluster-01"}},
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    Port(
        {
            "vlan": {
                "base_port": {
                    "name": "e0e",
                    "node": {"name": "user-cluster-01"},
                    "_links": {
                        "self": {
                            "href": "/api/network/ethernet/ports/2d39df72-f70d-11e8-b145-005056bb5b8e"
                        }
                    },
                    "uuid": "2d39df72-f70d-11e8-b145-005056bb5b8e",
                },
                "tag": 100,
            },
            "broadcast_domain": {
                "_links": {
                    "self": {
                        "href": "/api/network/ethernet/broadcast-domains/36434bec-f70d-11e8-b145-005056bb5b8e"
                    }
                },
                "name": "Default",
                "ipspace": {"name": "Default"},
                "uuid": "36434bec-f70d-11e8-b145-005056bb5b8e",
            },
            "node": {
                "name": "user-cluster-01",
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/faa56898-f70c-11e8-b145-005056bb5b8e"
                    }
                },
                "uuid": "faa56898-f70c-11e8-b145-005056bb5b8e",
            },
            "enabled": True,
            "_links": {
                "self": {
                    "href": "/api/network/ethernet/ports/88b2f682-fa42-11e8-a6d7-005056bb5b8e"
                }
            },
            "type": "vlan",
            "uuid": "88b2f682-fa42-11e8-a6d7-005056bb5b8e",
        }
    )

### Creating a LAG (ifgrp) port

The following output displays the record returned after the creation of a LAG port with "e0f", "e0g" and "e0h" as member ports.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port()
        resource.type = "lag"
        resource.node = {"name": "user-cluster-01"}
        resource.enabled = True
        resource.lag = {
            "mode": "singlemode",
            "distribution_policy": "mac",
            "member_ports": [
                {"name": "e0f", "node": {"name": "user-cluster-01"}},
                {"name": "e0g", "node": {"name": "user-cluster-01"}},
                {"name": "e0h", "node": {"name": "user-cluster-01"}},
            ],
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    Port(
        {
            "node": {
                "name": "user-cluster-01",
                "uuid": "faa56898-f70c-11e8-b145-005056bb5b8e",
            },
            "enabled": True,
            "type": "lag",
            "uuid": "1807772a-fa4d-11e8-a6d7-005056bb5b8e",
            "lag": {
                "mode": "singlemode",
                "member_ports": [
                    {
                        "name": "e0f",
                        "node": {"name": "user-cluster-01"},
                        "uuid": "2d3c9adc-f70d-11e8-b145-005056bb5b8e",
                    },
                    {
                        "name": "e0g",
                        "node": {"name": "user-cluster-01"},
                        "uuid": "2d40b097-f70d-11e8-b145-005056bb5b8e",
                    },
                    {
                        "name": "e0h",
                        "node": {"name": "user-cluster-01"},
                        "uuid": "2d46d01e-f70d-11e8-b145-005056bb5b8e",
                    },
                ],
                "distribution_policy": "mac",
            },
        }
    )

### Creating a LAG (ifgrp) port in a specific broadcast domain

The following output displays the record returned after the creation of a LAG port with "e0f", "e0g" and "e0h" as member ports. Also, the LAG port is added to the "Default" broadcast domain in the "Default" IPspace.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port()
        resource.type = "lag"
        resource.node = {"name": "user-cluster-01"}
        resource.broadcast_domain = {"name": "Default", "ipspace": {"name": "Default"}}
        resource.enabled = True
        resource.lag = {
            "mode": "singlemode",
            "distribution_policy": "mac",
            "member_ports": [
                {"name": "e0f", "node": {"name": "user-cluster-01"}},
                {"name": "e0g", "node": {"name": "user-cluster-01"}},
                {"name": "e0h", "node": {"name": "user-cluster-01"}},
            ],
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    Port(
        {
            "broadcast_domain": {
                "name": "Default",
                "ipspace": {"name": "Default"},
                "uuid": "36434bec-f70d-11e8-b145-005056bb5b8e",
            },
            "node": {
                "name": "user-cluster-01",
                "uuid": "faa56898-f70c-11e8-b145-005056bb5b8e",
            },
            "enabled": True,
            "type": "lag",
            "uuid": "1807772a-fa4d-11e8-a6d7-005056bb5b8e",
            "lag": {
                "mode": "singlemode",
                "member_ports": [
                    {
                        "name": "e0f",
                        "node": {"name": "user-cluster-01"},
                        "uuid": "2d3c9adc-f70d-11e8-b145-005056bb5b8e",
                    },
                    {
                        "name": "e0g",
                        "node": {"name": "user-cluster-01"},
                        "uuid": "2d40b097-f70d-11e8-b145-005056bb5b8e",
                    },
                    {
                        "name": "e0h",
                        "node": {"name": "user-cluster-01"},
                        "uuid": "2d46d01e-f70d-11e8-b145-005056bb5b8e",
                    },
                ],
                "distribution_policy": "mac",
            },
        }
    )

## Updating ports

You can use the network ports PATCH API to update the attributes of ports.

## Examples

### Updating the broadcast domain of a port

The following PATCH request removes the port from the current broadcast domain and adds it to the specified broadcast domain.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port(uuid="6867efaf-d702-11e8-994f-005056bbc994")
        resource.broadcast_domain = {"name": "Default", "ipspace": {"name": "Default"}}
        resource.patch()

### Updating the admin status of a port

The following PATCH request brings the specified port down.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port(uuid="51d3ab39-d86d-11e8-aca6-005056bbc994")
        resource.enabled = False
        resource.patch()

### Repairing a port

The following PATCH request repairs a port. Only ports that have reachability as "repairable" can be repaired. The "reachability" parameter cannot be patched in the same request as other parameters that might affect the target port's reachability status.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port(uuid="51d3ab39-d86d-11e8-aca6-005056bbc994")
        resource.reachability = "ok"
        resource.patch()

## Deleting ports

You can use the network ports DELETE API to delete VLAN and LAG ports in the cluster. Note that physical ports cannot be deleted. Deleting a port also removes the port from the broadcast domain.

## Example

### Deleting a VLAN port

The network ports DELETE API is used to delete a VLAN port.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Port

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Port(uuid="6867efaf-d702-11e8-994f-005056bbc994")
        resource.delete()

## Classes

`class Port (*args, **kwargs)`

  Allows interaction with Port 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

  - Resource

  ### Static methods

  `def count_collection (*args, connection: HostConnection = None, **kwargs) -> int`

    Returns a count of all Port 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 delete_collection (*args, records: Iterable[ForwardRef('Port')] = 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 a VLAN or LAG.

    ### Related ONTAP commands

    - `network port ifgrp delete`
    - `network port vlan delete`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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 `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 deleted.

    ## Returns

    A `NetAppResponse` object 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 Port 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 `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
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects 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 `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 find (*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieves a collection of ports (physical, VLAN and LAG) for an entire cluster.

    ### Related ONTAP commands

    - `network port show`
    - `network port ifgrp show`
    - `network port vlan show`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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 a collection of ports (physical, VLAN and LAG) for an entire cluster.

    ### Related ONTAP commands

    - `network port show`
    - `network port ifgrp show`
    - `network port vlan show`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects 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 `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('Port')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Updates a port.

    ### Related ONTAP commands

    - `network port broadcast-domain add-ports`
    - `network port broadcast-domain remove-ports`
    - `network port modify`
    - `network port ifgrp add-port`
    - `network port ifgrp remove-port`
    - `network port reachability repair`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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

  `def post_collection (records: Iterable[ForwardRef('Port')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[Port], NetAppResponse]`

    Creates a new VLAN (such as node1:e0a-100) or LAG (ifgrp, such as node2:a0a).

    ### Required properties

    - `node` - Node the port will be created on.
    - `vlan` - This field cannot be specified at the same time as `lag`.
    - `vlan.base_port` - Physical port or LAG the VLAN will be created on.
    - `vlan.tag` - Tag used to identify VLAN on the base port.
    - `lag` - This field cannot be specified at the same time as `vlan`.
    - `lag.mode` - Policy for the LAG that will be created.
    - `lag.distribution_policy` - Indicates how the packets are distributed between ports.
    - `lag.member_ports` - Set of ports the LAG consists of.

    ### Optional properties

    - `type` - Defines if a VLAN or LAG will be created:
    - `broadcast_domain` - The layer-2 broadcast domain the port is associated with. The port will be placed in a broadcast domain if it is not specified. It may take several minutes for the broadcast domain to be assigned. During that period the port cannot host interfaces.

    ### Related ONTAP commands

    - `network port ifgrp create`
    - `network port vlan create`

    ### Learn more

    - `DOC /network/ethernet/ports`

    Send this collection of objects to the host as a creation request.

    ## Args

    `records`
      A list of `Resource` objects 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 `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 list of `Resource` objects 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 a `NetAppResponse` object 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 a VLAN or LAG.

    ### Related ONTAP commands

    - `network port ifgrp delete`
    - `network port vlan delete`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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 `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 `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 the details of a physical port, VLAN, or LAG.

    ### Related ONTAP commands

    - `network port show`
    - `network port ifgrp show`
    - `network port vlan show`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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 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`

    Updates a port.

    ### Related ONTAP commands

    - `network port broadcast-domain add-ports`
    - `network port broadcast-domain remove-ports`
    - `network port modify`
    - `network port ifgrp add-port`
    - `network port ifgrp remove-port`
    - `network port reachability repair`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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

  `def post (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Creates a new VLAN (such as node1:e0a-100) or LAG (ifgrp, such as node2:a0a).

    ### Required properties

    - `node` - Node the port will be created on.
    - `vlan` - This field cannot be specified at the same time as `lag`.
    - `vlan.base_port` - Physical port or LAG the VLAN will be created on.
    - `vlan.tag` - Tag used to identify VLAN on the base port.
    - `lag` - This field cannot be specified at the same time as `vlan`.
    - `lag.mode` - Policy for the LAG that will be created.
    - `lag.distribution_policy` - Indicates how the packets are distributed between ports.
    - `lag.member_ports` - Set of ports the LAG consists of.

    ### Optional properties

    - `type` - Defines if a VLAN or LAG will be created:
    - `broadcast_domain` - The layer-2 broadcast domain the port is associated with. The port will be placed in a broadcast domain if it is not specified. It may take several minutes for the broadcast domain to be assigned. During that period the port cannot host interfaces.

    ### Related ONTAP commands

    - `network port ifgrp create`
    - `network port vlan create`

    ### Learn more

    - `DOC /network/ethernet/ports`

    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 `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

  - `Resource`:
    - `from_dict`
    - `get_collection_url`
    - `get_connection`
    - `instance_location`
    - `path_keys`
    - `poll`
    - `set_connection`
    - `to_dict`
    - `validate_schema`
`class PortSchema (*, 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 Port object

  ### Ancestors

  - netapp_ontap.resource.ResourceSchema
  - marshmallow.schema.Schema
  - marshmallow.base.SchemaABC
  - abc.ABC

  ### Class variables

  `broadcast_domain: BroadcastDomain GET POST PATCH`

    The broadcast_domain field of the port.

  `discovered_devices: List[DeviceDiscoveryData] GET`

    Discovered devices

  `enabled: bool GET POST PATCH`

    The enabled field of the port.

  `flowcontrol_admin: str GET PATCH`

    Requested flow control

    Valid choices:

    - none
    - send
    - receive
    - full
    - pfc
  `interface_count: Size GET`

    Number of interfaces hosted. This field is only applicable for cluster administrators. No value is returned for SVM administrators. If the node hosting a port is not healthy no value will be returned.

  `lag: PortLag GET POST PATCH`

    The lag field of the port.

  `links: SelfLink GET`

    The links field of the port.

  `mac_address: str GET`

    The mac_address field of the port.

    Example: 01:02:03:04:05:06

  `metric: PortMetricsData GET`

    Throughput performance for the Ethernet port.

  `mtu: Size GET`

    MTU of the port in bytes. Set by broadcast domain.

    Example: 1500

  `name: str GET`

    Portname, such as e0a, e1b-100 (VLAN on Ethernet), a0c (LAG/ifgrp), a0d-200 (VLAN on LAG/ifgrp), e0a.pv1 (p-VLAN, in select environments only)

    Example: e1b

  `node: Node GET POST`

    The node field of the port.

  `pfc_queues_admin: List[Size] GET PATCH`

    List of PFC queues

  `rdma_protocols: List[str] GET`

    Supported RDMA offload protocols

  `reachability: str GET PATCH`

    Reachability status of the port. Enum value "ok" is the only acceptable value for a PATCH request to repair a port.

    Valid choices:

    - ok
    - repairable
    - not_repairable
  `reachable_broadcast_domains: List[BroadcastDomain] GET`

    Reachable broadcast domains.

  `speed: Size GET`

    Link speed in Mbps

    Example: 1000

  `state: str GET`

    Operational state of the port. The state is set to 'down' if the operational state of the port is down. The state is set to 'up' if the link state of the port is up and the port is healthy. The state is set to 'up' if the link state of the port is up and configured to ignore health status. The state is 'degraded' if the link state of the port is up, and the port is not healthy.

    Valid choices:

    - up
    - down
    - degraded
  `statistics: PortStatistics GET`

    These are raw performance and error counters for the Ethernet port.

  `type: str GET POST`

    Type of physical or virtual port

    Valid choices:

    - vlan
    - physical
    - lag
    - pvlan
  `uuid: str GET`

    Port UUID

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

  `vlan: PortVlan GET POST`

    The vlan field of the port.