ironic_inspector.api_tools module

Generic Rest Api tools.

ironic_inspector.api_tools.limit_field(value)[source]

Fetch the pagination limit field from flask.request.args.

Returns:

the limit

ironic_inspector.api_tools.marker_field(value)[source]

Fetch the pagination marker field from flask.request.args.

Returns:

an uuid

ironic_inspector.api_tools.raises_coercion_exceptions(fn)[source]

Convert coercion function exceptions to utils.Error.

Raises:

utils.Error when the coercion function raises an AssertionError or a ValueError

ironic_inspector.api_tools.request_field(field_name)[source]

Decorate a function that coerces the specified field.

Parameters:

field_name – name of the field to fetch

Returns:

a decorator

ironic_inspector.api_tools.state_field(value)[source]

Fetch the pagination state field from flask.request.args.

Returns:

list of the state(s)