# ironicclient.v1.portgroup module

class ironicclient.v1.portgroup.Portgroup(manager: ManagerProtocol, info: dict[str, Any], loaded: bool = False)

  Bases: `Resource`

class ironicclient.v1.portgroup.PortgroupManager(api: SessionClient)

  Bases: `CreateManager`[`Portgroup`]

  delete(portgroup_id: str, os_ironic_api_version: str | None = None, global_request_id: str | None = None) → None

    Delete the Portgroup from the DB.

    Parameters:

      - portgroup_id – The UUID or name of a portgroup.

      - os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

      - global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

  get(portgroup_id: str, fields: list[str] | None = None, os_ironic_api_version: str | None = None, global_request_id: str | None = None) → Portgroup | None

    Get a port group with the specified identifier.

    Parameters:

      - portgroup_id – The UUID or name of a portgroup.

      - fields – Optional, a list with a specified set of fields of the resource to be returned. Can not be used when ‘detail’ is set.

      - os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

      - global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

    Returns:

      a `Portgroup` object.

  get_by_address(address: str, fields: list[str] | None = None, os_ironic_api_version: str | None = None, global_request_id: str | None = None) → Portgroup

    Get a port group with the specified MAC address.

    Parameters:

      - address – The MAC address of a portgroup.

      - fields – Optional, a list with a specified set of fields of the resource to be returned. Can not be used when ‘detail’ is set.

      - os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

      - global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

    Returns:

      a `Portgroup` object.

  list(node: str | None = None, address: str | None = None, limit: int | None = None, marker: str | None = None, sort_key: str | None = None, sort_dir: str | None = None, detail: bool = False, fields: list[str] | None = None, shards: list[str] | None = None, os_ironic_api_version: str | None = None, global_request_id: str | None = None) → list[Portgroup]

    Retrieve a list of portgroups.

    Parameters:

      - node – Optional, UUID or name of a node, to get the portgroups for that node.

      - address – Optional, MAC address of a portgroup, to get the portgroup which has this MAC address.

      - marker – Optional, the UUID of a portgroup, eg the last portgroup from a previous result set. Return the next result set.

      - limit –

        The maximum number of results to return per

          request, if:

        1. limit > 0, the maximum number of portgroups to return.

        2. limit == 0, return the entire list of portgroups.

        3. limit == None, the number of items returned respect the maximum imposed by the Ironic API (see Ironic’s api.max_limit option).

      - sort_key – Optional, field used for sorting.

      - sort_dir – Optional, direction of sorting, either ‘asc’ (the default) or ‘desc’.

      - detail – Optional, boolean whether to return detailed information about portgroups.

      - fields – Optional, a list with a specified set of fields of the resource to be returned. Can not be used when ‘detail’ is set.

      - shards – Optional, a list of shards to filter portgroups by. Only portgroups associated with nodes in these shards will be returned.

      - os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

      - global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

    Returns:

      A list of portgroups.

    Raises:

      InvalidAttribute if a subset of fields is requested with detail option set.

  list_ports(portgroup_id: str, marker: str | None = None, limit: int | None = None, sort_key: str | None = None, sort_dir: str | None = None, detail: bool = False, fields: list[str] | None = None, os_ironic_api_version: str | None = None, global_request_id: str | None = None) → list[Portgroup]

    List all the ports for a given portgroup.

    Parameters:

      - portgroup_id – Name or UUID of the portgroup.

      - marker – Optional, the UUID of a port, eg the last port from a previous result set. Return the next result set.

      - limit –

        The maximum number of results to return per

          request, if:

        1. limit > 0, the maximum number of ports to return.

        2. limit == 0, return the entire list of ports.

        3. limit param is NOT specified (None), the number of items returned respect the maximum imposed by the Ironic API (see Ironic’s api.max_limit option).

      - sort_key – Optional, field used for sorting.

      - sort_dir – Optional, direction of sorting, either ‘asc’ (the default) or ‘desc’.

      - detail – Optional, boolean whether to return detailed information about ports.

      - fields – Optional, a list with a specified set of fields of the resource to be returned. Can not be used when ‘detail’ is set.

      - os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

      - global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

    Returns:

      A list of ports.

  resource_class

    alias of `Portgroup`

  update(portgroup_id: str, patch: list[dict[str, Any]], os_ironic_api_version: str | None = None, global_request_id: str | None = None) → Portgroup

    Update the Portgroup.

    Parameters:

      - portgroup_id – The UUID or name of a portgroup.

      - patch – The patch request with updates.

      - os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

      - global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

this page last updated: 2026-07-16 03:09:15

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug