tardis.agents.siteagent module

class tardis.agents.siteagent.SiteAgent(site_adapter: tardis.interfaces.siteadapter.SiteAdapter)[source]

Bases: tardis.interfaces.siteadapter.SiteAdapter

async deploy_resource(resource_attributes: tardis.utilities.attributedict.AttributeDict) tardis.utilities.attributedict.AttributeDict[source]

Abstract method to define the interface to deploy a new resource at a resource provider. :param resource_attributes: Contains describing attributes of the resource, defined in the Drone implementation! :type resource_attributes: AttributeDict :return: Contains updated describing attributes of the resource. :rtype: AttributeDict

property drone_heartbeat_interval: int

Property that returns the configuration parameter drone_heartbeat_interval. It describes the time between two consecutive updates of the drone status. :return: The heartbeat interval of the drone :rtype: int

property drone_minimum_lifetime: int

Property that returns the configuration parameter drone_minimum_lifetime. It describes the minimum lifetime before a drone is automatically going into draining mode. :return: The minimum lifetime of the drone :rtype: int, None

drone_uuid(uuid) str[source]

Returns the drone uuid consisting of the lower case site name and the first 10 bytes of uuid4 due to constraints on length of a full DNS name (253 bytes). :param uuid: The first 10 bytes of a uuid4 :type uuid: str :return: The drone uuid consisting of the lower case site name and the first 10 bytes of uuid4. :rtype: str

handle_exceptions()[source]

Abstract method defining the interface to handle exception occurring during interacting with the resource provider. :return: None

handle_response(response, key_translator: dict, translator_functions: dict, **additional_content)[source]

Method to handle the responses of the resource provider and translating it to a uniform format. :param response: A dictionary containing the response of the resource provider. :type response: dict :param key_translator: A dictionary containing the translation of keys of the original response of the provider in keys of the common format. :type key_translator: dict :param translator_functions: A dictionary containing functions to transform value of the original reponse of the provider into values of the common format. :type translator_functions: dict :param additional_content: Additional content to be put into response, which is not part of the original response of the resource provider. :return: Translated response of the resource provider in a common format. :rtype: dict

property machine_meta_data: tardis.utilities.attributedict.AttributeDict

Property to access the machine_meta_data (like cores, memory and disk) of a resource. :return: The machine_meta_data of a resource. :rtype: AttributeDict

property machine_type: str

Property to access the machine_type (flavour) of a resource and ensuring that all sub-classes of the SiteAdapter have a _machine_type class variable . :return: The machine_type of a resource. :rtype: str

async resource_status(resource_attributes: tardis.utilities.attributedict.AttributeDict) tardis.utilities.attributedict.AttributeDict[source]

Abstract method to define the interface to check the status of resources at a resource provider. :param resource_attributes: Contains describing attributes of the resource, defined in the Drone implementation! :type resource_attributes: AttributeDict :return: Contains updated describing attributes of the resource. :rtype: AttributeDict

property site_name: str

Property to access the site_name of a resource and ensuring that all sub-classes of the SiteAdapter have a _site_name class variable. :return: The site_name of a resource. :rtype: str

async stop_resource(resource_attributes: tardis.utilities.attributedict.AttributeDict)[source]

Abstract method to define the interface to stop resources at a resource provider. :param resource_attributes: Contains describing attributes of the resource, defined in the Drone implementation! :type resource_attributes: AttributeDict :return: Contains updated describing attributes of the resource. :rtype: AttributeDict

async terminate_resource(resource_attributes: tardis.utilities.attributedict.AttributeDict)[source]

Abstract method to define the interface to terminate resources at a resource provider. :param resource_attributes: Contains describing attributes of the resource, defined in the Drone implementation! :type resource_attributes: AttributeDict :return: Contains updated describing attributes of the resource. :rtype: AttributeDict