Documentation Models

class motey.models.image.Image(name, id=”, parameters={}, capabilities={}, node=None, state=0)[source]

Model object. Represent an image. An image can have execution parameters, required capabilities and the node where it is executed. All of them are optional.

class ImageState[source]
Enum with service states.
  • INITIAL
  • INSTANTIATING
  • RUNNING
  • STOPPING
  • TERMINATED
  • ERROR
static transform(data)[source]

Static method to translate an image dict into a image model.

Parameters:data (dict) – a dict with image data
Returns:the translated image model, None if something goes wrong
motey.models.schemas

alias of motey.models.schemas

class motey.models.service.Service(name, images, id=‘539df43781ac4d76b74dce3d520947c3’, state=0, action=’add’, node_type=’master’, state_message=”)[source]

Model object. Represent a service. A service can have multiple states, action types and service types.

class ServiceAction[source]
Enum with action types.
  • ADD
  • REMOVE
class ServiceState[source]
Enum with service states.
  • INITIAL
  • INSTANTIATING
  • RUNNING
  • STOPPING
  • TERMINATED
  • ERROR
class ServiceType[source]
Enum with service types.
  • MASTER
  • SLAVE
static transform(data)[source]

Static method to translate the service dict data into a service model.

Parameters:data (dict) – service dict to be transformed
Returns:the translated service model, None if something went wrong
class motey.models.systemstatus.SystemStatus[source]

Model which represents the status of the whole system. Possible status values are:

  • used_memory
  • used_cpu
  • network_tx_bytes
  • network_rx_bytes
class motey.models.valinstancestatus.VALInstanceStatus[source]

Model which represents the status of an VAL instance. Possible status values are:

  • name
  • image_name
  • created_at
  • status
  • ip
  • used_memory
  • used_cpu
  • network_tx_bytes
  • network_rx_bytes