The ironicclient.v1.portgroup Module

The ironicclient.v1.portgroup Module

class ironicclient.v1.portgroup.Portgroup(manager, info, loaded=False)[source]

Bases: ironicclient.common.base.Resource

class ironicclient.v1.portgroup.PortgroupManager(api)[source]

Bases: ironicclient.common.base.CreateManager

delete(portgroup_id)[source]

Delete the Portgroup from the DB.

Parameters:portgroup_id – The UUID or name of a portgroup.
get(portgroup_id, fields=None)[source]

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.
Returns:

a Portgroup object.

get_by_address(address, fields=None)[source]

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.
Returns:

a Portgroup object.

list(node=None, address=None, limit=None, marker=None, sort_key=None, sort_dir=None, detail=False, fields=None)[source]

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.
Returns:

A list of portgroups.

Raises:

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

list_ports(portgroup_id, marker=None, limit=None, sort_key=None, sort_dir=None, detail=False, fields=None)[source]

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.
Returns:

A list of ports.

resource_class

alias of Portgroup

update(portgroup_id, patch)[source]

Update the Portgroup.

Parameters:
  • portgroup_id – The UUID or name of a portgroup.
  • patch – The patch request with updates.
Creative Commons Attribution 3.0 License

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