MiCADO Application¶
Module for managing and representing applications in MiCADO
-
class
micado.models.application.
Application
(client, id=None, info=None, resource=None)¶ Bases:
micado.models.base.Model
Representation of an application deployed in MiCADO
The state of an application can be refreshed with reload()
-
adaptors
¶ Adaptor info for this application
-
-
class
micado.models.application.
Applications
(client)¶ Bases:
micado.models.base.Resource
Model for managing applications in MiCADO
Basic CRUD functionality is implemented here with create(), list()/get(), update() and delete()
-
create
(app_id=None, **kwargs)¶ Creates a new application in MiCADO
Parameters: - app_id (string, optional) – Application ID. Generated if None.
- adt (dict, optional) – YAML dict of Application Description Template. Required if URL is empty. Defaults to None.
- url (string, optional) – URL of YAML ADT. Required if ADT is empty. Defaults to None.
- params (dict, optional) – TOSCA input parameters. Defaults to {}.
- dryrun (bool, optional) – Flag to skip execution of components. Defaults to False.
Usage:
>>> client.applications.create(app_id="stresstest", url="example.com/repo/adt.yaml") "stresstest created successfully"
Returns: ID and status of deployment Return type: dict
-
delete
(app_id)¶ Deletes an application in MiCADO given its ID.
Parameters: app_id (string) – Application ID to delete Usage:
>>> client.applications.delete("stresstest") "stresstest deleted successfully"
Returns: ID and status of deletion Return type: dict
-
get
(app_id)¶ Retrieves info on a specific application, given its ID
Parameters: app_id (string) – Application ID to fetch. Required Usage:
>>> my_app = client.applications.get("stresstest") >>> my_app.id "stresstest" >>> my_app.adaptors {'KubernetesAdaptor': 'Executed', 'OccopusAdaptor': 'Skipped'}
Returns: Relevant information for a single application Return type: Application object
-
list
()¶ Retrieves the available list of applications in MiCADO
Usage:
>>> running_apps = client.applications.list() >>> [app.id for app in running_apps] ["stresstest"]
Returns: Relevant info for all applications Return type: list of Application objects
-
model
¶ alias of
Application
-