ironic.api.controllers.v1.utils.
allow_agent_version_in_heartbeat
()[source]¶Check if agent version is allowed to be passed into heartbeat.
Version 1.36 of the API added the ability for agents to pass their version information to Ironic on heartbeat.
ironic.api.controllers.v1.utils.
allow_allocation_backfill
()[source]¶Check if backfilling allocations is allowed.
Version 1.58 of the API added support for backfilling allocations.
ironic.api.controllers.v1.utils.
allow_allocation_update
()[source]¶Check if updating an existing allocation is allowed or not.
Version 1.57 of the API added support for updating an allocation.
ironic.api.controllers.v1.utils.
allow_allocations
()[source]¶Check if accessing allocation endpoints is allowed.
Version 1.52 of the API exposed allocation endpoints and allocation_uuid field for the node.
ironic.api.controllers.v1.utils.
allow_bios_interface
()[source]¶Check if we should support bios interface and endpoints.
Version 1.40 of the API added support for bios interface.
ironic.api.controllers.v1.utils.
allow_build_configdrive
()[source]¶Check if building configdrive is allowed.
Version 1.56 of the API added support for building configdrive.
ironic.api.controllers.v1.utils.
allow_deploy_templates
()[source]¶Check if accessing deploy template endpoints is allowed.
Version 1.55 of the API exposed deploy template endpoints.
ironic.api.controllers.v1.utils.
allow_detail_query
()[source]¶Check if passing a detail=True query string is allowed.
Version 1.43 allows a user to pass the detail query string to list the resource with all the fields.
ironic.api.controllers.v1.utils.
allow_dynamic_drivers
()[source]¶Check if dynamic driver API calls are allowed.
Version 1.30 of the API added support for all of the driver composition related calls in the /v1/drivers API.
ironic.api.controllers.v1.utils.
allow_dynamic_interfaces
()[source]¶Check if dynamic interface fields are allowed.
Version 1.31 of the API added support for viewing and setting the fields
in V31_FIELDS
on the node object.
ironic.api.controllers.v1.utils.
allow_expose_conductors
()[source]¶Check if accessing conductor endpoints is allowed.
Version 1.49 of the API exposed conductor endpoints and conductor field for the node.
ironic.api.controllers.v1.utils.
allow_expose_events
()[source]¶Check if accessing events endpoint is allowed.
Version 1.54 of the API added the events endpoint.
ironic.api.controllers.v1.utils.
allow_field
(field)[source]¶Check if a field is allowed in the current version.
ironic.api.controllers.v1.utils.
allow_inject_nmi
()[source]¶Check if Inject NMI is allowed for the node.
Version 1.29 of the API allows Inject NMI for the node.
ironic.api.controllers.v1.utils.
allow_inspect_abort
()[source]¶Check if inspection abort is allowed.
Version 1.41 of the API added support for inspection abort
ironic.api.controllers.v1.utils.
allow_inspect_wait_state
()[source]¶Check if inspect wait is allowed for the node.
Version 1.39 of the API adds ‘inspect wait’ state to substitute ‘inspecting’ state during asynchronous hardware inspection.
ironic.api.controllers.v1.utils.
allow_links_node_states_and_driver_properties
()[source]¶Check if links are displayable.
Version 1.14 of the API allows the display of links to node states and driver properties.
ironic.api.controllers.v1.utils.
allow_node_rebuild_with_configdrive
()[source]¶Check if we should support node rebuild with configdrive.
Version 1.35 of the API added support for node rebuild with configdrive.
ironic.api.controllers.v1.utils.
allow_port_advanced_net_fields
()[source]¶Check if we should return local_link_connection and pxe_enabled fields.
Version 1.19 of the API added support for these new fields in port object.
ironic.api.controllers.v1.utils.
allow_port_internal_info
()[source]¶Check if accessing internal_info is allowed for the port.
Version 1.18 of the API exposes internal_info readonly field for the port.
ironic.api.controllers.v1.utils.
allow_port_is_smartnic
()[source]¶Check if port is_smartnic field is allowed.
Version 1.53 of the API added is_smartnic field to the port object.
ironic.api.controllers.v1.utils.
allow_port_physical_network
()[source]¶Check if port physical network field is allowed.
Version 1.34 of the API added the physical network field to the port object. We also check whether the target version of the Port object supports the physical_network field as this may not be the case during a rolling upgrade.
ironic.api.controllers.v1.utils.
allow_portgroup_mode_properties
()[source]¶Check if mode and properties can be added to/queried from a portgroup.
Version 1.26 of the API added mode and properties fields to portgroup object.
ironic.api.controllers.v1.utils.
allow_portgroups
()[source]¶Check if we should support portgroup operations.
Version 1.23 of the API added support for PortGroups.
ironic.api.controllers.v1.utils.
allow_portgroups_subcontrollers
()[source]¶Check if portgroups can be used as subcontrollers.
Version 1.24 of the API added support for Portgroups as subcontrollers
ironic.api.controllers.v1.utils.
allow_raid_config
()[source]¶Check if RAID configuration is allowed for the node.
Version 1.12 of the API allows RAID configuration for the node.
ironic.api.controllers.v1.utils.
allow_ramdisk_endpoints
()[source]¶Check if heartbeat and lookup endpoints are allowed.
Version 1.22 of the API introduced them.
ironic.api.controllers.v1.utils.
allow_remove_chassis_uuid
()[source]¶Check if chassis_uuid can be removed from node.
Version 1.25 of the API added support for chassis_uuid removal
ironic.api.controllers.v1.utils.
allow_rescue_interface
()[source]¶Check if we should support rescue and unrescue operations and interface.
Version 1.38 of the API added support for rescue and unrescue.
ironic.api.controllers.v1.utils.
allow_reset_interfaces
()[source]¶Check if passing a reset_interfaces query string is allowed.
ironic.api.controllers.v1.utils.
allow_soft_power_off
()[source]¶Check if Soft Power Off is allowed for the node.
Version 1.27 of the API allows Soft Power Off, including Soft Reboot, for the node.
ironic.api.controllers.v1.utils.
allow_storage_interface
()[source]¶Check if we should support storage_interface node and driver fields.
Version 1.33 of the API added support for storage interfaces.
ironic.api.controllers.v1.utils.
allow_traits
()[source]¶Check if traits are allowed for the node.
Version 1.37 of the API allows traits for the node.
ironic.api.controllers.v1.utils.
allow_vifs_subcontroller
()[source]¶Check if node/vifs can be used.
Version 1.28 of the API added support for VIFs to be attached to Nodes.
ironic.api.controllers.v1.utils.
allow_volume
()[source]¶Check if volume connectors and targets are allowed.
Version 1.32 of the API added support for volume connectors and targets
ironic.api.controllers.v1.utils.
apply_jsonpatch
(doc, patch)[source]¶Apply a JSON patch, one operation at a time.
If the patch fails to apply, this allows us to determine which operation failed, making the error message a little less cryptic.
Parameters: |
|
---|---|
Returns: | The result of the patch operation. |
Raises: | PatchError if the patch fails to apply. |
Raises: | wsme.exc.ClientSideError if the patch adds a new root attribute. |
ironic.api.controllers.v1.utils.
check_allow_driver_detail
(detail)[source]¶Check if getting detailed driver info is allowed.
Version 1.30 of the API allows this.
ironic.api.controllers.v1.utils.
check_allow_filter_by_conductor
(conductor)[source]¶Check if filtering nodes by conductor is allowed.
Version 1.49 of the API allows filtering nodes by conductor.
ironic.api.controllers.v1.utils.
check_allow_filter_by_conductor_group
(conductor_group)[source]¶Check if filtering nodes by conductor_group is allowed.
Version 1.46 of the API allows filtering nodes by conductor_group.
ironic.api.controllers.v1.utils.
check_allow_filter_by_fault
(fault)[source]¶Check if filtering nodes by fault is allowed.
Version 1.42 of the API allows filtering nodes by fault.
ironic.api.controllers.v1.utils.
check_allow_filter_by_owner
(owner)[source]¶Check if filtering nodes by owner is allowed.
Version 1.50 of the API allows filtering nodes by owner.
ironic.api.controllers.v1.utils.
check_allow_filter_driver_type
(driver_type)[source]¶Check if filtering drivers by classic/dynamic is allowed.
Version 1.30 of the API allows this.
ironic.api.controllers.v1.utils.
check_allow_specify_driver
(driver)[source]¶Check if filtering nodes by driver is allowed.
Version 1.16 of the API allows filter nodes by driver.
ironic.api.controllers.v1.utils.
check_allow_specify_fields
(fields)[source]¶Check if fetching a subset of the resource attributes is allowed.
Version 1.8 of the API allows fetching a subset of the resource attributes, this method checks if the required version is being requested.
ironic.api.controllers.v1.utils.
check_allow_specify_resource_class
(resource_class)[source]¶Check if filtering nodes by resource_class is allowed.
Version 1.21 of the API allows filtering nodes by resource_class.
ironic.api.controllers.v1.utils.
check_allowed_fields
(fields)[source]¶Check if fetching a particular field is allowed.
This method checks if the required version is being requested for fields that are only allowed to be fetched in a particular API version.
ironic.api.controllers.v1.utils.
check_allowed_portgroup_fields
(fields)[source]¶Check if fetching a particular field of a portgroup is allowed.
This method checks if the required version is being requested for fields that are only allowed to be fetched in a particular API version.
ironic.api.controllers.v1.utils.
check_for_invalid_fields
(fields, object_fields)[source]¶Check for requested non-existent fields.
Check if the user requested non-existent fields.
Parameters: | fields – A list of fields requested by the user |
---|---|
Object_fields: | A list of fields supported by the object. |
Raises: | InvalidParameterValue if invalid fields were requested. |
ironic.api.controllers.v1.utils.
check_for_invalid_state_and_allow_filter
(provision_state)[source]¶Check if filtering nodes by provision state is allowed.
Version 1.9 of the API allows filter nodes by provision state.
ironic.api.controllers.v1.utils.
check_policy
(policy_name)[source]¶Check if the specified policy is authorised for this request.
Policy_name: | Name of the policy to check. |
---|---|
Raises: | HTTPForbidden if the policy forbids access. |
ironic.api.controllers.v1.utils.
disallowed_fields
()[source]¶Generator of fields not allowed in the current request.
ironic.api.controllers.v1.utils.
get_controller_reserved_names
(cls)[source]¶Get reserved names for a given controller.
Inspect the controller class and return the reserved names within it. Reserved names are names that can not be used as an identifier for a resource because the names are either being used as a custom action or is the name of a nested controller inside the given class.
Parameters: | cls – The controller class to be inspected. |
---|
ironic.api.controllers.v1.utils.
get_patch_values
(patch, path)[source]¶Get the patch values corresponding to the specified path.
If there are multiple values specified for the same path, for example
[{'op': 'add', 'path': '/name', 'value': 'abc'},
{'op': 'add', 'path': '/name', 'value': 'bca'}]
return all of them in a list (preserving order)
Parameters: |
|
---|---|
Returns: | list of values for the specified path in the patch. |
ironic.api.controllers.v1.utils.
get_request_return_fields
(fields, detail, default_fields)[source]¶Calculate fields to return from an API request
The fields query and detail=True query can not be passed into a request at the same time. To use the detail query we need to be on a version of the API greater than 1.43. This function raises an InvalidParameterValue exception if either of these conditions are not met.
If these checks pass then this function will return either the fields passed in or the default fields provided.
Parameters: |
|
---|---|
Raises: | InvalidParameterValue if there is an invalid combination of query strings or API version. |
Returns: | ‘fields’ passed in value or ‘default_fields’ |
ironic.api.controllers.v1.utils.
get_rpc_allocation
(allocation_ident)[source]¶Get the RPC allocation from the allocation UUID or logical name.
Parameters: | allocation_ident – the UUID or logical name of an allocation. |
---|---|
Returns: | The RPC allocation. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | AllocationNotFound if the allocation is not found. |
ironic.api.controllers.v1.utils.
get_rpc_allocation_with_suffix
(allocation_ident)[source]¶Get the RPC allocation from the allocation UUID or logical name.
If HAS_JSON_SUFFIX flag is set in the pecan environment, try also looking for allocation_ident with ‘.json’ suffix. Otherwise identical to get_rpc_allocation.
Parameters: | allocation_ident – the UUID or logical name of an allocation. |
---|---|
Returns: | The RPC allocation. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | AllocationNotFound if the allocation is not found. |
ironic.api.controllers.v1.utils.
get_rpc_deploy_template
(template_ident)[source]¶Get the RPC deploy template from the UUID or logical name.
Parameters: | template_ident – the UUID or logical name of a deploy template. |
---|---|
Returns: | The RPC deploy template. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | DeployTemplateNotFound if the deploy template is not found. |
ironic.api.controllers.v1.utils.
get_rpc_deploy_template_with_suffix
(template_ident)[source]¶Get the RPC deploy template from the UUID or logical name.
If HAS_JSON_SUFFIX flag is set in the pecan environment, try also looking for template_ident with ‘.json’ suffix. Otherwise identical to get_rpc_deploy_template.
Parameters: | template_ident – the UUID or logical name of a deploy template. |
---|---|
Returns: | The RPC deploy template. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | DeployTemplateNotFound if the deploy template is not found. |
ironic.api.controllers.v1.utils.
get_rpc_node
(node_ident)[source]¶Get the RPC node from the node uuid or logical name.
Parameters: | node_ident – the UUID or logical name of a node. |
---|---|
Returns: | The RPC Node. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | NodeNotFound if the node is not found. |
ironic.api.controllers.v1.utils.
get_rpc_node_with_suffix
(node_ident)[source]¶Get the RPC node from the node uuid or logical name.
If HAS_JSON_SUFFIX flag is set in the pecan environment, try also looking for node_ident with ‘.json’ suffix. Otherwise identical to get_rpc_node.
Parameters: | node_ident – the UUID or logical name of a node. |
---|---|
Returns: | The RPC Node. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | NodeNotFound if the node is not found. |
ironic.api.controllers.v1.utils.
get_rpc_portgroup
(portgroup_ident)[source]¶Get the RPC portgroup from the portgroup UUID or logical name.
Parameters: | portgroup_ident – the UUID or logical name of a portgroup. |
---|---|
Returns: | The RPC portgroup. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | PortgroupNotFound if the portgroup is not found. |
ironic.api.controllers.v1.utils.
get_rpc_portgroup_with_suffix
(portgroup_ident)[source]¶Get the RPC portgroup from the portgroup UUID or logical name.
If HAS_JSON_SUFFIX flag is set in the pecan environment, try also looking for portgroup_ident with ‘.json’ suffix. Otherwise identical to get_rpc_portgroup.
Parameters: | portgroup_ident – the UUID or logical name of a portgroup. |
---|---|
Returns: | The RPC portgroup. |
Raises: | InvalidUuidOrName if the name or uuid provided is not valid. |
Raises: | PortgroupNotFound if the portgroup is not found. |
ironic.api.controllers.v1.utils.
handle_patch_port_like_extra_vif
(rpc_object, api_object, patch)[source]¶Handle a Patch request that modifies .extra[‘vif_port_id’].
This handles attach/detach of VIFs via the VIF port ID in a port or port group’s extra[‘vif_port_id’] field.
Parameters: |
|
---|
ironic.api.controllers.v1.utils.
handle_post_port_like_extra_vif
(p_dict)[source]¶Handle a Post request that sets .extra[‘vif_port_id’].
This handles attach of VIFs via specifying the VIF port ID in a port or port group’s extra[‘vif_port_id’] field.
Parameters: | p_dict – a dictionary with field names/values for the port or port group |
---|---|
Returns: | VIF or None |
ironic.api.controllers.v1.utils.
initial_node_provision_state
()[source]¶Return node state to use by default when creating new nodes.
Previously the default state for new nodes was AVAILABLE. Starting with API 1.11 it is ENROLL.
ironic.api.controllers.v1.utils.
is_path_removed
(patch, path)[source]¶Returns whether the patch includes removal of the path (or subpath of).
Parameters: |
|
---|---|
Returns: | True if path or subpath being removed, False otherwise. |
ironic.api.controllers.v1.utils.
is_path_updated
(patch, path)[source]¶Returns whether the patch includes operation on path (or its subpath).
Parameters: |
|
---|---|
Returns: | True if path or subpath being patched, False otherwise. |
ironic.api.controllers.v1.utils.
is_valid_logical_name
(name)[source]¶Determine if the provided name is a valid hostname.
ironic.api.controllers.v1.utils.
is_valid_node_name
(name)[source]¶Determine if the provided name is a valid node name.
Check to see that the provided node name is valid, and isn’t a UUID.
Parameters: | name – the node name to check. |
---|---|
Returns: | True if the name is valid, False otherwise. |
ironic.api.controllers.v1.utils.
vendor_passthru
(ident, method, topic, data=None, driver_passthru=False)[source]¶Call a vendor passthru API extension.
Call the vendor passthru API extension and process the method response to set the right return code for methods that are asynchronous or synchronous; Attach the return value to the response object if it’s being served statically.
Parameters: |
|
---|---|
Returns: | A WSME response object to be returned by the API. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.