component_submitter package

Submodules

component_submitter.api module

class component_submitter.api.ExecSubmitterThread(q, *args, **kwargs)[source]

Bases: threading.Thread

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

exception component_submitter.api.RequestError(message, status_code=None, payload=None)[source]

Bases: Exception

status_code = 400
to_dict()[source]
component_submitter.api.handle_request_error(error)[source]
component_submitter.api.info_app(id_app)[source]

API function to get the information on a given id

component_submitter.api.keyboardInterrupt()[source]
component_submitter.api.launch()[source]

API functions to launch a application

Params intput:path to the file wanted
Params params:dictionary with the update of input.
component_submitter.api.list_app()[source]

API function to list all the running aplications

component_submitter.api.list_thread()[source]

API call to query the info on the thread being executed

component_submitter.api.query(id_app)[source]

API call to query running services

component_submitter.api.threads_management()[source]
component_submitter.api.undeploy(id_app)[source]

API function to undeploy the application with a specific ID

component_submitter.api.unhandle_request_error(error)[source]
component_submitter.api.update(id_app)[source]

API function to update the application with a specific ID

component_submitter.command_line_interface module

MiCADO Command Line Interface

Component to create the command line interface that will talk to the submitter to launch, update, undeploy the application

component_submitter.micado_parser module

class component_submitter.micado_parser.MiCADOParser[source]

Bases: object

MiCADO class that is going to take care of parsing the topology template, check if the file is correct and Readable by MiCADO submitter. The set_template method is returning the topology template object.

set_template(path, parsed_params=None)[source]

set_template is the method that will parse the tosca template and return the object topology object.

Params:path, parsed_params
Type:string, dictionary
Returns:template
Raises:Exception
parsed_params: dictionary containing the input to change
path: local or remote path to the file to parse (it needs to be reachable.)

component_submitter.micado_validator module

MiCADO Submission Engine TOSCA Validator

Validate ToscaTemplate objects to ensure syntactic and semantic compatibility with custom defined and TOSCA normative types.

Further validates a ToscaTemplate which has already passed validation steps set out by the OpenStack ToscaParser. Currently validation checks exist for repositories and the requirements and relationships of custom defined types.

exception component_submitter.micado_validator.MultiError(error_set, msg=None)[source]

Bases: component_submitter.micado_validator.ValidationError

Errors occured during validation…

exception component_submitter.micado_validator.ValidationError[source]

Bases: Exception

Base error for validation

component_submitter.micado_validator.validate_relationship_properties(node)[source]

Validate relationship properties

Checks that relationships defined properties required by their definition in TOSCA normative or custom types. Returns errors if not.

component_submitter.micado_validator.validate_relationships(node)[source]

Validate relationships

Checks that relationships used in node definitions correctly reference relationships defined in TOSCA normative or custom types. Returns errors if not.

component_submitter.micado_validator.validate_repositories(node, repositories)[source]

Validate repository names

Checks to see if repositories have been defined at the top level, and if nodes reference those repositories correctly. Returns errors if not.

component_submitter.micado_validator.validate_requirements(node)[source]

Validate requirements and their syntax

Checks that requirements in custom_types and in node definitions are defined as one-item lists and that node definition requirements correctly reference requirements defined in custom_types. Returns errors if not.

component_submitter.micado_validator.validation(tpl)[source]

The validation process

Runs validation steps on the given TOSCA Template, and builds an error list. Raises a MultiError on failed validation. On success, says so.

Parameters:tpl (ToscaTemplate <toscaparser.tosca_template.ToscaTemplate>) – The ToscaTemplate to validate
Raises:TypeError, MultiError
Usage:
>>> from micado_validator import Validator
Successful validation:
>>> Validator().validation(<toscaparser.tosca_template.ToscaTemplate>)
'ToscaTemplate passed compatibility validation'
Errors during validation:
>>> Validator(<toscaparser.tosca_template.ToscaTemplate>)
micado_validator.MultiError:
----
(...list of errors...)

component_submitter.plugins_gestion module

class component_submitter.plugins_gestion.PluginsGestion[source]

Bases: object

get_plugin(plugin_name)[source]

Given the name of a plugin, returns the plugin’s class and an instance of the plugin, or (None, None) if the plugin isn’t listed in the available plugins.

component_submitter.submitter_config module

MiCADO Submitter Engine Submitter Config

A module allowing the configuration of the whole submitter

class component_submitter.submitter_config.SubmitterConfig(testing=None)[source]

Bases: object

This is the SubmitterConfig, in charge of the configuration of the whole submitter. It has __init__(), get_list_adaptors(), _retrieve_custom_type(), _reading_config(), _check_re(), _list_for_re(), mapping(), _look_through_template(), _find_get_input(), _contains_inputs(), get_SubmitterConfig(), get_dict() and get_node_from_type().

Optional testing parameter can be passed to __init__ to define which key_config files to take for test purposes.

get_list_adaptors()[source]

return list of adaptors to use

mapping(template=None)[source]

component_submitter.submitter_engine module

class component_submitter.submitter_engine.SubmitterEngine[source]

Bases: object

SubmitterEngine class that is the main one that is used to treat with the application.

get_status(app_id)[source]

method to retrieve the status of the differents adaptor

launch(path_to_file, id_app, parsed_params=None)[source]

Launch method, that will call the in-method egine to execute the application Creating empty list for the whole class adaptor and executed adaptor :params: path_to_file, parsed_params :types: string, dictionary .. note:

For the time being we only have one "workflow engine" but we could extend this
launch method to accept another parameter to be able to choose which engine to
launch
query(query, app_id)[source]
undeploy(id_app, force=False)[source]

Undeploy method will remove the application from the infrastructure. :params: id :type: string

update(id_app, path_to_file, parsed_params=None)[source]

Update method that will be updating the application we want to update.

Params id:id of the application we want to update
Params type:string
Params path_to_file:
 path to the template file
Params type:string
Params parse_params:
 dictionary containing the value we want to use as the value of the input section
Params type:dictionary
component_submitter.submitter_engine.logger = <Logger submitter.component_submitter.submitter_engine (INFO)>

define the Handler which write message to sys.stderr

component_submitter.utils module

component_submitter.utils.dump_order_yaml(data, path)[source]

Dump the dictionary to a Docker-Compose file

component_submitter.utils.get_yaml_data(path)[source]

Retrieve the yaml dictionary form a yaml file and return it

component_submitter.utils.id_generator(size=8, chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]

Generate an ID

Module contents