MiCADO Client

Higher-level client for both submitter interaction and launching ability

class micado.client.MicadoClient(*args, **kwargs)

Bases: object

The MiCADO Client

Builds and communicates with a MiCADO Master node

Usage with a launcher:

  1. >>> from micado import MicadoClient
    >>> client = MicadoClient(launcher="openstack")
    >>> client.master.create(
    ...     auth_url='yourendpoint',
    ...     project_id='project_id',
    ...     image='image_name or image_id',
    ...     flavor='flavor_name or flavor_id',
    ...     network='network_name or network_id',
    ...     keypair='keypair_name or keypair_id',
    ...     security_group='security_group_name or security_group_id'
    ... )
    >>> client.applications.list()
    >>> client.master.destroy()
    
  2. >>> from micado import MicadoClient
    >>> client = MicadoClient(launcher="openstack")
    >>> master_id = client.master.create(
    ...     auth_url='yourendpoint',
    ...     project_id='project_id',
    ...     image='image_name or image_id',
    ...     flavor='flavor_name or flavor_id',
    ...     network='network_name or network_id',
    ...     keypair='keypair_name or keypair_id',
    ...     security_group='security_group_name or security_group_id'
    ... )
    >>> client.applications.list()
    >>> << store your master_id >>
    >>> << exit >>
    >>> -------------------------------------------------------------
    >>> << start >>
    >>> ...
    >>> master_id = << retrieve master_id >>
    >>> client = MicadoClient(launcher="openstack")
    >>> client.master.attach(master_id = master_id)
    >>> client.applications.list()
    >>> client.master.destroy()
    

Usage without a launcher i.e. MiCADO master is already created independently from the client library.

>>> from micado import MicadoClient
>>> client = MicadoClient(
...     endpoint="https://micado/toscasubmitter/",
...     version="v2.0",
...     verify=False,
...     auth=("ssl_user", "ssl_pass")
... )
>>> client.applications.list()
Parameters:
  • auth_url (string) – Authentication URL for the NOVA resource.
  • image (string) – Name or ID of the image resource.
  • flavor (string) – Name or ID of the flavor resource.
  • network (string) – Name or ID of the network resource.
  • keypair (string) – Name or ID of the keypair resource.
  • security_group (string, optional) – name or ID of the security_group resource. Defaults to ‘all’.
  • region (string, optional) – Name of the region resource. Defaults to None.
  • user_domain_name (string, optional) – Define the user_domain_name. Defaults to ‘Default’
  • project_id (string, optional) – ID of the project resource. Defaults to None.
  • micado_user (string, optional) – MiCADO username. Defaults to admin.
  • micado_password (string, optional) – MiCADO password. Defaults to admin.
  • endpoint (string) – Full URL to API endpoint (omit version). Required.
  • version (string, optional) – MiCADO API Version (minimum v2.0). Defaults to ‘v2.0’.
  • verify (bool, optional) – Verify certificate on the client-side. OR (str): Path to cert bundle (.pem) to verfiy against. Defaults to True.
  • auth (tuple, optional) – Basic auth credentials (<user>, <pass>). Defaults to None.
applications
classmethod from_master()

Usage: Ensure MICADO_API_ENDPOINT and MICADO_API_VERSION environment variables are set, then:

>>> from micado import MicadoClient
>>> client = MicadoClient.from_master()
master