Example #1
0
	def _remove(self):
		elems = self.info()['elements']
		conns = self.info()['connections']
		get_backend_core_proxy().topology_remove(self.topology_id)
		for e in elems:
			get_element_info(e).set_exists(False)
		for c in conns:
			get_connection_info(c).set_exists(False)
Example #2
0
	def _remove(self):
		elems = [get_element_info(e) for e in self.info()['elements']]
		conns = [get_connection_info(c) for c in self.info()['connections']]
		for e in elems:
			e.set_exists(None)
		for c in conns:
			c.set_exists(None)
		get_backend_core_proxy().topology_remove(self.topology_id)
Example #3
0
 def _remove(self):
     elems = [get_element_info(e) for e in self.info()['elements']]
     conns = [get_connection_info(c) for c in self.info()['connections']]
     for e in elems:
         e.set_exists(None)
     for c in conns:
         c.set_exists(None)
     get_backend_core_proxy().topology_remove(self.topology_id)
Example #4
0
	def _remove(self):
		elems = self.info()['elements']
		conns = self.info()['connections']
		get_backend_core_proxy().topology_remove(self.topology_id)
		for e in elems:
			get_element_info(e).set_exists(False)
		for c in conns:
			get_connection_info(c).set_exists(False)
Example #5
0
def get_network_list():
    """
	get the list of networks
	:return: list of networks
	:rtype: list(dict)
	"""
    return get_backend_core_proxy().network_list()
Example #6
0
def get_network_list():
	"""
	get the list of networks
	:return: list of networks
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().network_list()
Example #7
0
def _template_id(tech, name):
    """
	get template id by tech and name
	:param tech: template tech
	:param name: template name
	:return: template id
	"""
    return get_backend_core_proxy().template_id(tech, name)
Example #8
0
def get_template_list(tech=None):
    """
	get the list of all templates
	:param str tech: filter for tech if wanted
	:return: list of templates
	:rtype: list(dict)
	"""
    return get_backend_core_proxy().template_list(tech)
Example #9
0
def get_site_list(organization=None):
	"""
	get the list of sites
	:param organization: if not None, filter by this organization.
	:return: list of sites, filtered if requested
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().site_list(organization)
Example #10
0
def get_profile_list(type=None):
	"""
	get the list of all profile
	:param str type: filter for type if wanted
	:return: list of profiles
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().profile_list(type)
Example #11
0
def get_profile_list(tech=None):
    """
	get the list of all profile
	:param str tech: filter for tech if wanted
	:return: list of profiles
	:rtype: list(dict)
	"""
    return get_backend_core_proxy().profile_list(tech)
Example #12
0
def _profile_id(tech, name):
    """
	get profile id by tech and name
	:param tech: profile tech
	:param name: profile name
	:return: profile id
	"""
    return get_backend_core_proxy().profile_id(tech, name)
Example #13
0
def _template_id(tech, name):
    """
	get template id by tech and name
	:param tech: template tech
	:param name: template name
	:return: template id
	"""
    return get_backend_core_proxy().template_id(tech, name)
Example #14
0
def _template_id(type, name):
	"""
	get template id by type and name
	:param type: template type
	:param name: template name
	:return: template id
	"""
	return get_backend_core_proxy().template_id(type, name)
Example #15
0
def get_site_list(organization=None):
    """
	get the list of sites
	:param organization: if not None, filter by this organization.
	:return: list of sites, filtered if requested
	:rtype: list(dict)
	"""
    return get_backend_core_proxy().site_list(organization)
Example #16
0
def get_template_list(type=None):
	"""
	get the list of all templates
	:param str type: filter for type if wanted
	:return: list of templates
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().template_list(type)
Example #17
0
def _profile_id(type, name):
	"""
	get profile id by tech and name
	:param type: profile type
	:param name: profile name
	:return: profile id
	"""
	return get_backend_core_proxy().profile_id(type, name)
Example #18
0
	def _modify(self, attrs):
		orga = None
		if ('organization' in attrs) and (self.get_organization_name() != attrs['organization']):
			orga = self.get_organization_name()
		res = get_backend_core_proxy().site_modify(self.name, attrs)
		if orga is not None:
			get_organization_info(orga).invalidate_info()
			get_organization_info(attrs['organization']).invalidate_info()
		return res
Example #19
0
 def _modify(self, attrs):
     site = None
     if ('site' in attrs) and (self.get_site_name() != attrs['site']):
         site = self.get_site_name()
     res = get_backend_core_proxy().host_modify(self.name, attrs)
     if site is not None:
         get_site_info(site).invalidate_info()
         get_site_info(attrs['site']).invalidate_info()
     return res
Example #20
0
	def _modify(self, attrs):
		site = None
		if ('site' in attrs) and (self.get_site_name() != attrs['site']):
			site = self.get_site_name()
		res = get_backend_core_proxy().host_modify(self.name, attrs)
		if site is not None:
			get_site_info(site).invalidate_info()
			get_site_info(attrs['site']).invalidate_info()
		return res
Example #21
0
	def _modify(self, attrs):
		orga = None
		if ('organization' in attrs) and (self.get_organization_name() != attrs['organization']):
			orga = self.get_organization_name()
		res = get_backend_core_proxy().site_modify(self.name, attrs)
		if orga is not None:
			get_organization_info(orga).invalidate_info()
			get_organization_info(attrs['organization']).invalidate_info()
		return res
Example #22
0
def get_host_list(site=None, organization=None):
    """
	get the list of hosts, filtered by site or organization, if requested.
	:param str site: site filter
	:param str organization: organization filter
	:return: list of hosts
	:rtype: list(dict)
	"""
    return get_backend_core_proxy().host_list(site, organization)
Example #23
0
def get_network_instance_list(network=None, host=None):
	"""
	get the list of network instances
	:param network: filter by network
	:param host: filter by host
	:return: list of network instances
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().network_instance_list(network, host)
Example #24
0
def get_network_instance_list(network=None, host=None):
    """
	get the list of network instances
	:param network: filter by network
	:param host: filter by host
	:return: list of network instances
	:rtype: list(dict)
	"""
    return get_backend_core_proxy().network_instance_list(network, host)
Example #25
0
	def create(el1, el2, attrs):
		"""
		create connection
		:param ElementInfo el1:
		:param ElementInfo el2:
		:param dict attrs: connection attributes
		:return:
		"""
		return get_backend_core_proxy().connection_create(el1.get_id(), el2.get_id(), attrs)
Example #26
0
def get_host_list(site=None, organization=None):
	"""
	get the list of hosts, filtered by site or organization, if requested.
	:param str site: site filter
	:param str organization: organization filter
	:return: list of hosts
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().host_list(site, organization)
Example #27
0
	def create(el1, el2, attrs):
		"""
		create connection
		:param ElementInfo el1:
		:param ElementInfo el2:
		:param dict attrs: connection attributes
		:return:
		"""
		return get_backend_core_proxy().connection_create(el1.get_id(), el2.get_id(), attrs)
Example #28
0
def get_topology_list(full=False, organization_filter=None, username_filter=None):
	"""
	get the list of topologies
	:param bool full: expand children info
	:param str organization_filter: list of organizations
	:param str username_filter: username to filter for
	:return: list of topologies
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().topology_list(full=full, organization_filter=organization_filter, username_filter=username_filter)
Example #29
0
	def set_permission(self, user, role):
		"""
		set the permission of a user
		:param str user: username of target user
		:param str role: role as in topology_role
		"""
		res = get_backend_core_proxy().topology_set_permission(self.topology_id, user, role)
		if self._info is not None:
			self._info['permissions'][user] = role
		return res
Example #30
0
	def create(top, type, parent_id, attrs):
		"""

		:param TopologyInfo top: target topology
		:param str type: element type
		:param str parent_id: id of parent element. None if no parent.
		:param attrs: element attrs
		:return:
		"""
		return get_backend_core_proxy().element_create(top.get_id(), type, parent_id, attrs)
Example #31
0
def get_topology_list(full=False, organization_filter=None, username_filter=None):
	"""
	get the list of topologies
	:param bool full: expand children info
	:param str organization_filter: list of organizations
	:param str username_filter: username to filter for
	:return: list of topologies
	:rtype: list(dict)
	"""
	return get_backend_core_proxy().topology_list(full=full, organization_filter=organization_filter, username_filter=username_filter)
Example #32
0
	def set_permission(self, user, role):
		"""
		set the permission of a user
		:param str user: username of target user
		:param str role: role as in topology_role
		"""
		res = get_backend_core_proxy().topology_set_permission(self.topology_id, user, role)
		if self._info is not None:
			self._info['permissions'][user] = role
		return res
Example #33
0
	def create(top, type, parent_id, attrs):
		"""

		:param TopologyInfo top: target topology
		:param str type: element type
		:param str parent_id: id of parent element. None if no parent.
		:param attrs: element attrs
		:return:
		"""
		return get_backend_core_proxy().element_create(top.get_id(), type, parent_id, attrs)
Example #34
0
	def create(el1, el2, attrs):
		"""
		create connection
		:param ElementInfo el1:
		:param ElementInfo el2:
		:param dict attrs: connection attributes
		:return:
		"""
		conn = get_backend_core_proxy().connection_create(el1.get_id(), el2.get_id(), attrs)
		get_connection_info(conn['id']).invalidate_info()
		return conn
Example #35
0
	def _action(self, action, params):
		elems = self.info()['elements']
		conns = self.info()['connections']
		res = get_backend_core_proxy().topology_action(self.topology_id, action, params)
		for e in elems:
			get_element_info(e).invalidate_info()
			get_element_info(e).invalidate_exists()
		for c in conns:
			get_connection_info(c).invalidate_info()
			get_connection_info(c).invalidate_exists()
		return res
Example #36
0
	def _action(self, action, params):
		elems = self.info()['elements']
		conns = self.info()['connections']
		res = get_backend_core_proxy().topology_action(self.topology_id, action, params)
		for e in elems:
			get_element_info(e).invalidate_info()
			get_element_info(e).invalidate_exists()
		for c in conns:
			get_connection_info(c).invalidate_info()
			get_connection_info(c).invalidate_exists()
		return res
Example #37
0
    def create(el1, el2, attrs):
        """
		create connection
		:param ElementInfo el1:
		:param ElementInfo el2:
		:param dict attrs: connection attributes
		:return:
		"""
        conn = get_backend_core_proxy().connection_create(
            el1.get_id(), el2.get_id(), attrs)
        get_connection_info(conn['id']).invalidate_info()
        return conn
Example #38
0
	def create(top, type, parent_id, attrs):
		"""

		:param TopologyInfo top: target topology
		:param str type: element type
		:param str parent_id: id of parent element. None if no parent.
		:param attrs: element attrs
		:return:
		"""
		element = get_backend_core_proxy().element_create(top.get_id(), type, parent_id, attrs)
		get_element_info(element['id']).invalidate_info()
		return element
Example #39
0
    def create(top, type, parent_id, attrs):
        """

		:param TopologyInfo top: target topology
		:param str type: element type
		:param str parent_id: id of parent element. None if no parent.
		:param attrs: element attrs
		:return:
		"""
        element = get_backend_core_proxy().element_create(
            top.get_id(), type, parent_id, attrs)
        get_element_info(element['id']).invalidate_info()
        return element
Example #40
0
 def _modify(self, attrs):
     return get_backend_core_proxy().network_modify(self.kind, attrs)
Example #41
0
 def _fetch_info(self, fetch=False):
     return get_backend_core_proxy().network_info(self.kind)
Example #42
0
 def create(kind, attrs):
     res = get_backend_core_proxy().network_create(kind, attrs)
     get_network_list.invalidate()
     return res
Example #43
0
	def create(kind, attrs):
		res = get_backend_core_proxy().network_create(kind, attrs)
		get_network_list.invalidate()
		return res
Example #44
0
	def _fetch_info(self, fetch=False):
		return get_backend_core_proxy().network_instance_info(self.niid)
Example #45
0
 def _remove(self):
     get_backend_core_proxy().network_instance_remove(self.niid)
Example #46
0
 def _fetch_info(self, fetch=False):
     return get_backend_core_proxy().network_instance_info(self.niid)
Example #47
0
	def _remove(self):
		get_backend_core_proxy().network_remove(self.kind)
Example #48
0
	def _modify(self, attrs):
		return get_backend_core_proxy().profile_modify(self.profile_id, attrs)
Example #49
0
	def _modify(self, attrs):
		return get_backend_core_proxy().network_modify(self.kind, attrs)
Example #50
0
	def _remove(self):
		get_backend_core_proxy().profile_remove(self.profile_id)
		_profile_id.invalidate()
Example #51
0
 def _remove(self):
     get_backend_core_proxy().network_remove(self.kind)
Example #52
0
	def _modify(self, attrs):
		return get_backend_core_proxy().network_instance_modify(self.niid, attrs)
Example #53
0
 def create(network, host_name, attrs):
     res = get_backend_core_proxy().network_instance_create(
         network, host_name, attrs)
     get_network_instance_list.invalidate()
     return res
Example #54
0
 def _fetch_info(self, fetch=False):
     return get_backend_core_proxy().profile_info(self.profile_id)
Example #55
0
 def _modify(self, attrs):
     return get_backend_core_proxy().network_instance_modify(
         self.niid, attrs)
Example #56
0
 def _modify(self, attrs):
     return get_backend_core_proxy().profile_modify(self.profile_id, attrs)
Example #57
0
	def create(network, host_name, attrs):
		res = get_backend_core_proxy().network_instance_create(network, host_name, attrs)
		get_network_instance_list.invalidate()
		return res
Example #58
0
 def _remove(self):
     get_backend_core_proxy().profile_remove(self.profile_id)
     _profile_id.invalidate()
Example #59
0
	def _remove(self):
		get_backend_core_proxy().network_instance_remove(self.niid)
Example #60
0
	def _fetch_info(self, fetch=False):
		return get_backend_core_proxy().network_info(self.kind)