Module restbase

Base module for rest api based handlers

  • License: Inmanta EULA

  • Version: 2.4.2

Typedefs

typedef restbase::config_operation_t
  • Base type string

  • Type constraint (self in ['merge', 'remove'])

Entities

entity restbase::ConfigElement

Parents: std::Entity

This is a base entity for any entity that is part of a config tree.

It defines the _operation attribute, which allows the user of the model to express that some part of the configuration should be absent from the api.

attribute restbase::config_operation_t _operation='merge'

An operation which describes what the handler should do with this part of config. Possible values are: - remove: The handler should make sure this part of the configuration doesn’t exist in the api. - merge: The handler should make sure this part is present in the api.

Plugins

restbase.as_bool(value: 'any') 'bool'

Converts a value to a boolean, raise a PluginException if it fails to do so.

Parameters:

value – The value to convert

restbase.is_bool(value: 'any') 'bool'

Check whether a value can be converted to a boolean.

Parameters:

value – The value to check

restbase.is_int(value: 'any') 'bool'

Check whether a value can be converted to an integer.

Parameters:

value – The value to check

restbase.is_number(value: 'any') 'bool'

Check whether a value can be converted to a number (float).

Parameters:

value – The value to check

restbase.validate_type(value: 'any', type_ref: 'string') 'bool'

Use the type definition at :param type_ref: to validate :param value: Returns whether the validation was successful.

Parameters:
  • value – The value to validate

  • type_ref – The reference to the type definition to use for validation