ironic.api.functions module

ironic.api.functions module

class ironic.api.functions.FunctionArgument(name, datatype, mandatory, default)[source]

Bases: object

An argument definition of an api entry

datatype = None

Data type

default = None

Default value if argument is omitted

mandatory = None

True if the argument is mandatory

name = None

argument name

resolve_type(registry)[source]
class ironic.api.functions.FunctionDefinition(func)[source]

Bases: object

An api entry definition

arguments = None

The function arguments (list of FunctionArgument)

body_type = None

If the body carry the datas of a single argument, its type

doc = None

Function documentation

extra_options = None

Dictionnary of protocol-specific options.

static get(func)[source]

Returns the FunctionDefinition of a method.

get_arg(name)[source]

Returns a FunctionArgument from its name

ignore_extra_args = None

True if extra arguments should be ignored, NOT inserted in the kwargs of the function and not raise UnknownArgument exceptions

name = None

Function name

resolve_types(registry)[source]
return_type = None

Return type

set_arg_types(argspec, arg_types)[source]
set_options(body=None, ignore_extra_args=False, status_code=200, rest_content_types=('json', 'xml'), **extra_options)[source]
status_code = None

Status code

ironic.api.functions.getargspec(f)[source]
ironic.api.functions.iswsmefunction(f)[source]
ironic.api.functions.sig

alias of ironic.api.functions.signature

class ironic.api.functions.signature(*types, **options)[source]

Bases: object

Decorator that specify the argument types of an exposed function.

Parameters:
  • return_type – Type of the value returned by the function
  • argN – Type of the Nth argument
  • body – If the function takes a final argument that is supposed to be the request body by itself, its type.
  • status_code – HTTP return status code of the function.
  • ignore_extra_args – Allow extra/unknow arguments (default to False)

Most of the time this decorator is not supposed to be used directly, unless you are not using WSME on top of another framework.

If an adapter is used, it will provide either a specialised version of this decororator, either a new decorator named @wsexpose that takes the same parameters (it will in addition expose the function, hence its name).

ironic.api.functions.wrapfunc(f)[source]
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.