ironicclient.v1.portgroup module¶
-
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:
limit > 0, the maximum number of portgroups to return.
limit == 0, return the entire list of portgroups.
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:
limit > 0, the maximum number of ports to return.
limit == 0, return the entire list of ports.
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.
-