fog05 package

Submodules

fog05.FIMAPI module

class fog05.fimapi.FIMAPI(locator='127.0.0.1:7887', sysid='0', tenantid='0')

Bases: object

This class allow the interaction with fog05 FIM

class FDU(connector=None, sysid='0', tenantid='0')

Bases: object

This class encapsulates the api for interaction with entities

__init__(connector=None, sysid='0', tenantid='0')

Initialize self. See help(type(self)) for accurate signature.

clean(fdu_uuid, node_uuid, wait=False)

Clean an atomic entity instance, this will destroy the instance

Parameters:
  • entity_uuid – entity for which you want to clean an instance
  • node_uuid – destionation node
  • instance_uuid – instance you want to clean
  • wait – optional wait before returning
Returns:

boolean

configure(fdu_uuid, node_uuid, wait=False)

Configure an atomic entity, creation of the instance

Parameters:
  • fdu_uuid – FDU you want to configure
  • node_uuid – destination node
  • instance_uuid – optional if present will use that uuid for the atomic entity instance otherwise will generate a new one
  • wait – optional wait before returning
Returns:

instance uuid or none in case of error

define(fduid, node_uuid, wait=False)
Defines an atomic entity in a node, this method will check
the manifest before sending the definition to the node
Parameters:
  • manifest – dictionary representing the atomic entity manifest
  • node_uuid – destination node uuid
  • wait – if wait that the definition is complete before returning
Returns:

boolean

info(fdu_uuid)
instance_info(fdu_uuid, node_uuid)
list(node_uuid='*')
List all entity element available in the system/teneant
or in a specified node
Parameters:node_uuid – optional node uuid
Returns:dictionary {node uuid: {entity uuid: instance list} list}
migrate(fduid, node_uuid, destination_node_uuid, wait=False)

Live migrate an atomic entity instance between two nodes

The migration is issued when this command is sended,
there is a little overhead for the copy of the base image and the disk image
Parameters:
  • fduid – fdu you want to migrate
  • node_uuid – source node
  • destination_node_uuid – destination node
  • wait – optional wait before returning
Returns:

boolean

offload(fdu_uuid, wait=False)
onboard(descriptor, wait=False)
pause(entity_uuid, node_uuid, instance_uuid, wait=False)

Pause the exectution of an atomic entity instance

Parameters:
  • entity_uuid – entity for which you want to pause the instance
  • node_uuid – destination node
  • instance_uuid – instance you want to pause
  • wait – optional wait before returning
Returns:

boolean

resume(entity_uuid, node_uuid, instance_uuid, wait=False)

Resume the exectution of an atomic entity instance

Parameters:
  • entity_uuid – entity for which you want to resume the instance
  • node_uuid – destination node
  • instance_uuid – instance you want to resume
  • wait – optional wait before returning
Returns:

boolean

run(fdu_uuid, node_uuid, wait=False)

Starting and atomic entity instance

Parameters:
  • fdu_uuid – entity for which you want to run the instance
  • node_uuid – destination node
  • instance_uuid – instance you want to start
  • wait – optional wait before returning
Returns:

boolean

search(search_dict, node_uuid=None)
stop(fdu_uuid, node_uuid, wait=False)

Shutting down an atomic entity instance

Parameters:
  • entity_uuid – entity for which you want toshutdown the instance
  • node_uuid – destination node
  • instance_uuid – instance you want to shutdown
  • wait – optional wait before returning
Returns:

boolean

undefine(fdu_uuid, node_uuid, wait=False)

This method undefine an atomic entity in a node

Parameters:
  • entity_uuid – atomic entity you want to undefine
  • node_uuid – destination node
  • wait – if wait before returning that the entity is undefined
Returns:

boolean

class Flavor(connector=None, sysid='0', tenantid='0')

Bases: object

This class encapsulates the action on flavors

__init__(connector=None, sysid='0', tenantid='0')

Initialize self. See help(type(self)) for accurate signature.

add(descriptor)

Add a computing flavor to a node or all nodes

Parameters:
  • manifest – dictionary representing the manifest for the flavor
  • node_uuid – optional node in which add the flavor
Returns:

boolean

get(flavor_uuid)

Add a computing flavor to a node or all nodes

Parameters:
  • manifest – dictionary representing the manifest for the flavor
  • node_uuid – optional node in which add the flavor
Returns:

boolean

list()

List available entity flavors

Parameters:node_uuid – optional node id
Returns:dictionaty {nodeid: {runtimeid: [flavor list]}}
remove(flavor_uuid)

Remove a flavor from all nodes or a specified node

Parameters:
  • flavor_uuid – flavor to remove
  • node_uuid – optional node from which remove the flavor
Returns:

boolean

search(search_dict, node_uuid=None)
class Image(connector=None, sysid='0', tenantid='0')

Bases: object

This class encapsulates the action on images

__init__(connector=None, sysid='0', tenantid='0')

Initialize self. See help(type(self)) for accurate signature.

add(descriptor)

Adding an image to a node or to all nodes

Parameters:
  • manifest – dictionary representing the manifest for the image
  • node_uuid – optional node in which add the image
Returns:

boolean

get(image_uuid)
list()

List available entity images

Parameters:node_uuid – optional node id
Returns:dictionaty {nodeid: {runtimeid: [images list]}}
remove(image_uuid)

Remove an image for a node or all nodes

Parameters:
  • image_uuid – image you want to remove
  • node_uuid – optional node from which remove the image
Returns:

boolean

search(search_dict, node_uuid=None)
class Manifest

Bases: object

This class encapsulates API for manifests

__init__()

Initialize self. See help(type(self)) for accurate signature.

check(manifest, manifest_type)

This method allow you to check a manifest

Parameters:
  • manifest – a dictionary rapresenting the JSON manifest
  • manifest_type – the manifest type from API.Manifest.Type
Returns:

boolean

class Network(connector=None, sysid='0', tenantid='0')

Bases: object

This class encapsulates the command for Network element interaction

__init__(connector=None, sysid='0', tenantid='0')

Initialize self. See help(type(self)) for accurate signature.

add_connection_point(cp_descriptor)
add_network(manifest)

Add a network element to a node o to all nodes

Parameters:
  • manifest – dictionary representing the manifest of that network element
  • node_uuid – optional the node uuid in which add

the network element :return: boolean

connect_cp_to_network(cp_uuid, net_uuid)
delete_connection_point(cp_uuid)
disconnect_cp(cp_uuid)
list()
List all network element available in the system/teneant or in a
specified node
Parameters:node_uuid – optional node uuid
Returns:dictionary {network uuid: {network manifest dictionary, pluginid, nodes}}
remove_network(net_uuid)

Remove a network element form one or all nodes

Parameters:
  • net_uuid – uuid of the network you want to remove
  • node_uuid – optional node from which remove the network element
Returns:

boolean

search(search_dict, node_uuid=None)
Will search for a network element matching the dictionary in a
single node or in all nodes
Parameters:
  • search_dict – dictionary contains all information to match
  • node_uuid – optional node uuid in which search
Returns:

a dictionary

{node_uuid, network element uuid list} with matches

class Node(connector=None, sysid='0', tenantid='0')

Bases: object

This class encapsulates the command for Node interaction

__init__(connector=None, sysid='0', tenantid='0')

Initialize self. See help(type(self)) for accurate signature.

info(node_uuid)

Provide all information about a specific node

Parameters:node_uuid – the uuid of the node you want info
Returns:a dictionary with all information about the node
list()

Get all nodes in the current system/tenant

Returns:list of tuples (uuid, hostname)
plugins(node_uuid)

Get the list of plugin installed on the specified node

Parameters:node_uuid – the uuid of the node you want info
Returns:a list of the plugins installed in the node with

detailed informations

search(search_dict)
Will search for a node that match information provided
in the parameter
Parameters:search_dict – dictionary contains all information to match
Returns:a list of node matching the dictionary
status(node_uuid)

Provide all status information about a specific node, including network neighbors

Parameters:node_uuid – the uuid of the node you want info
Returns:a dictionary with all information about the node
class Plugin(connector=None, sysid='0', tenantid='0')

Bases: object

This class encapsulates the commands for Plugin interaction

__init__(connector=None, sysid='0', tenantid='0')

Initialize self. See help(type(self)) for accurate signature.

add(manifest, node_uuid=None)

Add a plugin to a node or to all node in the system/tenant

Parameters:
  • manifest – the dictionary representing the plugin manifest
  • node_uuid – optional the node in which add the plugin
Returns:

boolean

info(node_uuid, pluginid)
Same as API.Node.Plugins but can work for all node un the system,

eturn a dictionary with key node uuid and value the plugin list

param node_uuid:
 can be none
return:dictionary {node_uuid, plugin list }
remove(plugin_uuid, node_uuid=None)

Will remove a plugin for a node or all nodes

Parameters:
  • plugin_uuid – the plugin you want to remove
  • node_uuid – optional the node that will remove the plugin
Returns:

boolean

search(search_dict, node_uuid=None)
Will search for a plugin matching the dictionary in a
single node or in all nodes
Parameters:
  • search_dict – dictionary contains all information to match
  • node_uuid – optional node uuid in which search
Returns:

a dictionary with {node_uuid, plugin uuid list} with matches

__init__(locator='127.0.0.1:7887', sysid='0', tenantid='0')

Initialize self. See help(type(self)) for accurate signature.

close()

fog05.yaks_connector module

class fog05.yaks_connector.CLAD(workspace, prefix)

Bases: object

__init__(workspace, prefix)

Initialize self. See help(type(self)) for accurate signature.

add_node_fdu(nodeid, pluginid, fduid, fduinfo)
add_node_information(nodeid, nodeinfo)
add_node_os_info(nodeid, osinfo)
add_node_plugin(nodeid, pluginid, plugininfo)
add_node_status(nodeid, nodestatus)
add_os_eval(nodeid, func_name, func)
add_plugin_eval(nodeid, pluginid, func_name, func)
close()
dict2args(d)
exec_agent_eval(nodeid, func_name, parameters)
exec_os_eval(nodeid, func_name, parameters)
exec_plugin_eval(nodeid, pluginid, func_name, parameters)
get_agent_exec_path(nodeid, func_name)
get_agent_exec_path_with_params(nodeid, func_name, params)
get_all_plugins(nodeid)
get_node_configuration(nodeid)
get_node_configuration_path(nodeid)
get_node_fdu(nodeid, pluginid, fduid)
get_node_fdu_info_path(nodeid, pluginid, fduid)
get_node_info(nodeid)
get_node_info_path(nodeid)
get_node_os_exec_path(nodeid, func_name)
get_node_os_exec_path_with_params(nodeid, func_name, params)
get_node_os_info(nodeid)
get_node_os_info_path(nodeid)
get_node_plugin_eval_path(nodeid, pluginid, func_name)
get_node_plugin_eval_path_with_params(nodeid, pluginid, func_name, params)
get_node_plugin_info_path(nodeid, pluginid)
get_node_plugins_selector(nodeid)
get_node_plugins_subscriber_selector(nodeid)
get_node_runtime_fdus_selector(nodeid, pluginid)
get_node_runtime_fdus_subscriber_selector(nodeid, pluginid)
get_node_runtimes_selector(nodeid)
get_node_selector()
get_node_status(nodeid)
get_node_status_path(nodeid)
observe_node_plugins(nodeid, callback)
observe_node_runtime_fdus(nodeid, pluginid, callback)
observe_node_status(nodeid, callback)
remove_node_fdu(nodeid, pluginid, fduid)
remove_node_status(nodeid)
unregister_eval(path)
unsubscribe(subid)
class fog05.yaks_connector.GAD(workspace, prefix)

Bases: object

__init__(workspace, prefix)

Initialize self. See help(type(self)) for accurate signature.

add_fdu_info(sysid, tenantid, fduid, fduinfo)
add_flavor(sysid, tenantid, flavorid, flvinfo)
add_image(sysid, tenantid, imageid, imginfo)
add_network(sysid, tenantid, netid, netinfo)
add_network_port(sysid, tenantid, portid, portinfo)
add_node_configuration(sysid, tenantid, nodeid, nodeconf)
add_node_fdu(sysid, tenantid, nodeid, fduid, fduinfo)
add_node_flavor(sysid, tenantid, nodeid, flavorid, flvinfo)
add_node_image(sysid, tenantid, nodeid, imageid, imginfo)
add_node_info(sysid, tenantid, nodeid, nodeinfo)
add_node_plugin(sysid, tenantid, nodeid, pluginid, plugininfo)
add_node_status(sysid, tenantid, nodeid, nodestatus)
add_plugin_eval(sysid, tenantid, nodeid, pluginid, func_name, func)
close()
extract_fduid_from_path(path)
extract_node_fduid_from_path(path)
extract_nodeid_from_path(path)
extract_plugin_from_path(path)
extract_tenantid_from_path(path)
extract_userid_from_path(path)
get_all_entities_selector(sysid, tenantid)
get_all_fdu_selector(sysid, tenantid)
get_all_fdus(sysid, tenantid)
get_all_flavor_selector(sysid, tenantid)
get_all_flavors(sysid, tenantid)
get_all_image_selector(sysid, tenantid)
get_all_images(sysid, tenantid)
get_all_network_ports(sysid, tenantid)
get_all_networks(sysid, tenantid)
get_all_networks_selector(sysid, tenantid)
get_all_node_flavor_selector(sysid, tenantid, nodeid)
get_all_node_flavors(sysid, tenantid, nodeid)
get_all_node_image_selector(sysid, tenantid, nodeid)
get_all_node_images(sysid, tenantid, nodeid)
get_all_nodes(sysid, tenantid)
get_all_nodes_selector(sysid, tenantid)
get_all_plugins_ids(sysid, tenantid, nodeid)
get_all_ports_selector(sysid, tenantid)
get_all_tenants_ids(sysid)
get_all_tenants_selector(sysid)
get_all_users_ids(sysid)
get_all_users_selector(sysid)
get_entity_all_instances_selector(sysid, tenantid, entityid)
get_entity_info_path(sysid, tenantid, entityid)
get_entity_instance_info_path(sysid, tenantid, entityid, instanceid)
get_fdu_info(sysid, tenantid, fduid)
get_fdu_info_path(sysid, tenantid, fduid)
get_flavor(sysid, tenantid, flavorid)
get_flavor_info_path(sysid, tenantid, flavorid)
get_image(sysid, tenantid, imageid)
get_image_info_path(sysid, tenantid, imageid)
get_network(sysid, tenantid, netid)
get_network_info_path(sysid, tenantid, networkid)
get_network_port(sysid, tenantid, portid)
get_network_port_info_path(sysid, tenantid, portid)
get_node_configuration_path(sysid, tenantid, nodeid)
get_node_fdu(sysid, tenantid, nodeid, fduid)
get_node_fdu_info_path(sysid, tenantid, nodeid, fduid)
get_node_fdu_selector(sysid, tenantid, nodeid)
get_node_fdus(sysid, tenantid, nodeid)
get_node_flavor(sysid, tenantid, nodeid, flavorid)
get_node_flavor_info_path(sysid, tenantid, nodeid, flavorid)
get_node_image(sysid, tenantid, nodeid, imageid)
get_node_image_info_path(sysid, tenantid, nodeid, imageid)
get_node_info(sysid, tenantid, nodeid)
get_node_info_path(sysid, tenantid, nodeid)
get_node_plugin_eval_path(sysid, tenantid, nodeid, pluginid, func_name)
get_node_plugin_info_path(sysid, tenantid, nodeid, pluginid)
get_node_plugins_selector(sysid, tenantid, nodeid)
get_node_plugins_subscriber_selector(sysid, tenantid, nodeid)
get_node_status(sysid, tenantid, nodeid)
get_node_status_path(sysid, tenantid, nodeid)
get_plugin_info(sysid, tenantid, nodeid, pluginid)
get_sys_config(sysid)
get_sys_configuration_path(sysid)
get_sys_info(sysid)
get_sys_info_path(sysid)
get_tenant_configuration_path(sysid, tenantid)
get_tenant_info_path(sysid, tenantid)
get_user_info_path(sysid, userid)
observe_fdu(sysid, tenantid, fduid, callback)
observe_fdus(sysid, tenantid, callback)
observe_node_fdu(sysid, tenantid, nodeid, fduid, callback)
observe_node_plugins(sysid, tenantid, nodeid, callback)
observe_node_status(sysid, tenantid, nodeid, callback)
remove_fdu_info(sysid, tenantid, fduid)
remove_flavor(sysid, tenantid, flavorid)
remove_image(sysid, tenatid, imageid)
remove_network(sysid, tenantid, netid)
remove_network_port(sysid, tenantid, portid)
remove_node_fdu(sysid, tenantid, nodeid, fduid)
remove_node_flavor(sysid, tenatid, nodeid, flavorid)
remove_node_image(sysid, tenatid, nodeid, imageid)
remove_node_status(sysid, tenantid, nodeid)
unregister_eval(path)
unsubscribe(subid)
class fog05.yaks_connector.Global(workspace)

Bases: object

__init__(workspace)

Initialize self. See help(type(self)) for accurate signature.

close()
class fog05.yaks_connector.LAD(workspace, prefix)

Bases: object

__init__(workspace, prefix)

Initialize self. See help(type(self)) for accurate signature.

add_node_fdu(nodeid, pluginid, fduid, fduinfo)
add_node_flavor(nodeid, pluginid, flvid, flvinfo)
add_node_image(nodeid, pluginid, imgid, imginfo)
add_node_information(nodeid, nodeinfo)
add_node_network(nodeid, pluginid, netid, netinfo)
add_node_os_info(nodeid, osinfo)
add_node_plugin(nodeid, pluginid, plugininfo)
add_node_port(nodeid, pluginid, portid, portinfo)
add_node_status(nodeid, nodestatus)
add_nw_eval(nodeid, nm_uuid, func_name, func)
add_os_eval(nodeid, func_name, func)
add_plugin_eval(nodeid, pluginid, func_name, func)
close()
dict2args(d)
exec_agent_eval(nodeid, func_name, parameters)
exec_nw_eval(nodeid, nm_uuid, func_name, parameters)
exec_os_eval(nodeid, func_name, parameters)
exec_plugin_eval(nodeid, pluginid, func_name, parameters)
find_node_network(nodeid, netid)
get_agent_exec_path(nodeid, func_name)
get_agent_exec_path_with_params(nodeid, func_name, params)
get_all_plugins(nodeid)
get_node_configuration(nodeid)
get_node_configuration_path(nodeid)
get_node_fdu(nodeid, pluginid, fduid)
get_node_fdu_atomic_entity_info(nodeid, pluginid, fduid, atomicid)
get_node_fdu_info_path(nodeid, pluginid, fduid)
get_node_flavor(nodeid, pluginid, flvid)
get_node_flavor_info_path(nodeid, pluginid, flvid)
get_node_image(nodeid, pluginid, imgid)
get_node_image_info_path(nodeid, pluginid, imgid)
get_node_info(nodeid)
get_node_info_path(nodeid)
get_node_netwoks_find_selector(nodeid, netid)
get_node_netwoks_selector(nodeid, pluginid)
get_node_network(nodeid, pluginid, netid)
get_node_network_info_path(nodeid, pluginid, networkid)
get_node_network_managers_selector(nodeid)
get_node_network_port_info_path(nodeid, pluginid, portid)
get_node_networks_port_selector(nodeid, pluginid)
get_node_nw_exec_path(nodeid, net_manager_uuid, func_name)
get_node_nw_exec_path_with_params(nodeid, net_manager_uuid, func_name, params)
get_node_os_exec_path(nodeid, func_name)
get_node_os_exec_path_with_params(nodeid, func_name, params)
get_node_os_info(nodeid)
get_node_os_info_path(nodeid)
get_node_plugin_eval_path(nodeid, pluginid, func_name)
get_node_plugin_eval_path_with_params(nodeid, pluginid, func_name, params)
get_node_plugin_info_path(nodeid, pluginid)
get_node_plugins_selector(nodeid)
get_node_plugins_subscriber_selector(nodeid)
get_node_port(nodeid, pluginid, portid)
get_node_runtime_fdus_selector(nodeid, pluginid)
get_node_runtime_fdus_subscriber_selector(nodeid, pluginid)
get_node_runtimes_selector(nodeid)
get_node_status(nodeid)
get_node_status_path(nodeid)
observe_node_networks(nodeid, pluginid, callback)
observe_node_plugins(nodeid, callback)
observe_node_ports(nodeid, pluginid, callback)
observe_node_runtime_fdus(nodeid, pluginid, callback)
observe_node_status(nodeid, callback)
remove_node_fdu(nodeid, pluginid, fduid)
remove_node_flavor(nodeid, pluginid, flvid)
remove_node_image(nodeid, pluginid, imgid)
remove_node_network(nodeid, pluginid, netid)
remove_node_port(nodeid, pluginid, portid)
remove_node_status(nodeid)
unregister_eval(path)
unsubscribe(subid)
class fog05.yaks_connector.Local(workspace)

Bases: object

__init__(workspace)

Initialize self. See help(type(self)) for accurate signature.

close()
class fog05.yaks_connector.Yaks_Connector(locator)

Bases: object

__init__(locator)

Initialize self. See help(type(self)) for accurate signature.

close()
class fog05.yaks_connector.Yaks_Constraint_Connector(locator)

Bases: object

__init__(locator)

Initialize self. See help(type(self)) for accurate signature.

close()

Module contents