ironicclient.v1.portgroup module¶
- class ironicclient.v1.portgroup.PortgroupManager(api)[source]¶
- Bases: - CreateManager- delete(portgroup_id, os_ironic_api_version=None, global_request_id=None)[source]¶
- 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, fields=None, os_ironic_api_version=None, global_request_id=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. 
- 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 - Portgroupobject.
 
 - get_by_address(address, fields=None, os_ironic_api_version=None, global_request_id=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. 
- 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 - Portgroupobject.
 
 - list(node=None, address=None, limit=None, marker=None, sort_key=None, sort_dir=None, detail=False, fields=None, os_ironic_api_version=None, global_request_id=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. 
- 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, marker=None, limit=None, sort_key=None, sort_dir=None, detail=False, fields=None, os_ironic_api_version=None, global_request_id=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. 
- 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. 
 
 - update(portgroup_id, patch, os_ironic_api_version=None, global_request_id=None)[source]¶
- 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. 
 
 
 
