from PLC.Filter import Filter
from PLC.Table import Row, Table
from PLC.Interfaces import Interface, Interfaces
-from PLC.LinkTypes import LinkType, LinkTypes
+from PLC.TagTypes import TagType, TagTypes
class Ilink(Row):
"""
primary_key = 'ilink_id'
fields = {
'ilink_id': Parameter(int, "ilink identifier"),
- 'link_type_id': LinkType.fields['link_type_id'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
'src_interface_id': Parameter(int, "source interface identifier"),
'dst_interface_id': Parameter(int, "destination interface identifier"),
'value': Parameter( str, "optional ilink value"),
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from types import StringTypes
-
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.Roles import Role, Roles
-
-class InterfaceSettingType (Row):
-
- """
- Representation of a row in the interface_setting_types table.
- """
-
- table_name = 'interface_setting_types'
- primary_key = 'interface_setting_type_id'
- join_tables = ['interface_setting']
- fields = {
- 'interface_setting_type_id': Parameter(int, "Interface setting type identifier"),
- 'name': Parameter(str, "Interface setting type name", max = 100),
- 'description': Parameter(str, "Interface setting type description", max = 254),
- 'category' : Parameter (str, "Interface setting category", max=64, optional=True),
- 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
- }
-
- def validate_name(self, name):
- if not len(name):
- raise PLCInvalidArgument, "interface setting type name must be set"
-
- conflicts = InterfaceSettingTypes(self.api, [name])
- for setting_type in conflicts:
- if 'interface_setting_type_id' not in self or \
- self['interface_setting_type_id'] != setting_type['interface_setting_type_id']:
- raise PLCInvalidArgument, "interface setting type name already in use"
-
- return name
-
- def validate_min_role_id(self, role_id):
- roles = [row['role_id'] for row in Roles(self.api)]
- if role_id not in roles:
- raise PLCInvalidArgument, "Invalid role"
-
- return role_id
-
-class InterfaceSettingTypes(Table):
- """
- Representation of row(s) from the interface_setting_types table
- in the database.
- """
-
- def __init__(self, api, interface_setting_type_filter = None, columns = None):
- Table.__init__(self, api, InterfaceSettingType, columns)
-
- sql = "SELECT %s FROM interface_setting_types WHERE True" % \
- ", ".join(self.columns)
-
- if interface_setting_type_filter is not None:
- if isinstance(interface_setting_type_filter, (list, tuple, set)):
- # Separate the list into integers and strings
- ints = filter(lambda x: isinstance(x, (int, long)), interface_setting_type_filter)
- strs = filter(lambda x: isinstance(x, StringTypes), interface_setting_type_filter)
- interface_setting_type_filter = Filter(InterfaceSettingType.fields, {'interface_setting_type_id': ints, 'name': strs})
- sql += " AND (%s) %s" % interface_setting_type_filter.sql(api, "OR")
- elif isinstance(interface_setting_type_filter, dict):
- interface_setting_type_filter = Filter(InterfaceSettingType.fields, interface_setting_type_filter)
- sql += " AND (%s) %s" % interface_setting_type_filter.sql(api, "AND")
- elif isinstance (interface_setting_type_filter, StringTypes):
- interface_setting_type_filter = Filter(InterfaceSettingType.fields, {'name':[interface_setting_type_filter]})
- sql += " AND (%s) %s" % interface_setting_type_filter.sql(api, "AND")
- else:
- raise PLCInvalidArgument, "Wrong interface setting type filter %r"%interface_setting_type_filter
-
- self.selectall(sql)
from PLC.Parameter import Parameter
from PLC.Filter import Filter
from PLC.Table import Row, Table
-from PLC.InterfaceSettingTypes import InterfaceSettingType, InterfaceSettingTypes
+from PLC.TagTypes import TagType, TagTypes
class InterfaceSetting(Row):
"""
fields = {
'interface_setting_id': Parameter(int, "Interface setting identifier"),
'interface_id': Parameter(int, "Interface identifier"),
- 'interface_setting_type_id': InterfaceSettingType.fields['interface_setting_type_id'],
- 'name': InterfaceSettingType.fields['name'],
- 'description': InterfaceSettingType.fields['description'],
- 'category': InterfaceSettingType.fields['category'],
- 'min_role_id': InterfaceSettingType.fields['min_role_id'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
'value': Parameter(str, "Interface setting value"),
### relations
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision: 9423 $
-#
-from types import StringTypes
-
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.Roles import Role, Roles
-
-class LinkType (Row):
-
- """
- Representation of a row in the link_types table.
- """
-
- table_name = 'link_types'
- primary_key = 'link_type_id'
- join_tables = ['ilink']
- fields = {
- 'link_type_id': Parameter(int, "ilink type identifier"),
- 'name': Parameter(str, "ilink type name", max = 100),
- 'description': Parameter(str, "ilink type description", max = 254),
- 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
- }
-
- def validate_name(self, name):
- if not len(name):
- raise PLCInvalidArgument, "ilink type name must be set"
-
- conflicts = LinkTypes(self.api, [name])
- for tag_type in conflicts:
- if 'link_type_id' not in self or \
- self['link_type_id'] != tag_type['link_type_id']:
- raise PLCInvalidArgument, "ilink type name already in use"
-
- return name
-
- def validate_min_role_id(self, role_id):
- roles = [row['role_id'] for row in Roles(self.api)]
- if role_id not in roles:
- raise PLCInvalidArgument, "Invalid role"
-
- return role_id
-
-class LinkTypes(Table):
- """
- Representation of row(s) from the link_types table
- in the database.
- """
-
- def __init__(self, api, link_type_filter = None, columns = None):
- Table.__init__(self, api, LinkType, columns)
-
- sql = "SELECT %s FROM link_types WHERE True" % \
- ", ".join(self.columns)
-
- if link_type_filter is not None:
- if isinstance(link_type_filter, (list, tuple, set)):
- # Separate the list into integers and strings
- ints = filter(lambda x: isinstance(x, (int, long)), link_type_filter)
- strs = filter(lambda x: isinstance(x, StringTypes), link_type_filter)
- link_type_filter = Filter(LinkType.fields, {'link_type_id': ints, 'name': strs})
- sql += " AND (%s) %s" % link_type_filter.sql(api, "OR")
- elif isinstance(link_type_filter, dict):
- link_type_filter = Filter(LinkType.fields, link_type_filter)
- sql += " AND (%s) %s" % link_type_filter.sql(api, "AND")
- elif isinstance (link_type_filter, StringTypes):
- link_type_filter = Filter(LinkType.fields, {'name':[link_type_filter]})
- sql += " AND (%s) %s" % link_type_filter.sql(api, "AND")
- else:
- raise PLCInvalidArgument, "Wrong ilink type filter %r"%link_type_filter
-
- self.selectall(sql)
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
-from PLC.LinkTypes import LinkType, LinkTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.Ilinks import Ilink, Ilinks
from PLC.Interfaces import Interface, Interfaces
class AddIlink(Method):
"""
Create a link between two interfaces
- The link has a type, that needs be created beforehand
+ The link has a tag type, that needs be created beforehand
and an optional value.
Returns the new ilink_id (> 0) if successful, faults
# refer to either the id or the type name
Ilink.fields['src_interface_id'],
Ilink.fields['dst_interface_id'],
- Mixed(LinkType.fields['link_type_id'],
- LinkType.fields['name']),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
Ilink.fields['value'],
]
returns = Parameter(int, 'New ilink_id (> 0) if successful')
- def call(self, auth, src_if_id, dst_if_id, link_type_id_or_name, value):
+ def call(self, auth, src_if_id, dst_if_id, tag_type_id_or_name, value):
src_if = Interfaces (self.api, [src_if_id],[interface_id])
if not src_if:
if not dst_if:
raise PLCInvalidArgument, "No such destination interface %r"%dst_if_id
- link_types = LinkTypes(self.api, [link_type_id_or_name])
- if not link_types:
- raise PLCInvalidArgument, "No such ilink type %r"%link_type_id_or_name
- link_type = link_types[0]
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "AddIlink: No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
# checks for existence - with the same type
conflicts = Ilinks(self.api,
- {'link_type_id':link_type['link_type_id'],
+ {'tag_type_id':tag_type['tag_type_id'],
'src_interface_id':src_if_id,
'dst_interface_id':dst_if_id,})
if len(conflicts) :
ilink=conflicts[0]
raise PLCInvalidArgument, "Ilink (%s,%d,%d) already exists and has value %r"\
- %(link_type['name'],src_if_id,dst_if_id,ilink['value'])
+ %(tag_type['name'],src_if_id,dst_if_id,ilink['value'])
if 'admin' not in self.caller['roles']:
# # check permission : it not admin, is the user affiliated with the right site(s) ????
# if self.caller['person_id'] not in site['person_ids']:
# raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = link_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified ilink, requires role %d",required_min_role
ilink = Ilink(self.api)
- ilink['link_type_id'] = link_type['link_type_id']
+ ilink['tag_type_id'] = tag_type['tag_type_id']
ilink['src_interface_id'] = src_if_id
ilink['dst_interface_id'] = dst_if_id
ilink['value'] = value
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
-from PLC.InterfaceSettingTypes import InterfaceSettingType, InterfaceSettingTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.InterfaceSettings import InterfaceSetting, InterfaceSettings
from PLC.Interfaces import Interface, Interfaces
to the specified value.
In general only tech(s), PI(s) and of course admin(s) are allowed to
- do the change, but this is defined in the interface setting type object.
+ do the change, but this is defined in the tag type object.
Returns the new interface_setting_id (> 0) if successful, faults
otherwise.
Auth(),
# no other way to refer to a interface
InterfaceSetting.fields['interface_id'],
- Mixed(InterfaceSettingType.fields['interface_setting_type_id'],
- InterfaceSettingType.fields['name']),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
InterfaceSetting.fields['value'],
]
object_type = 'Interface'
- def call(self, auth, interface_id, interface_setting_type_id_or_name, value):
+ def call(self, auth, interface_id, tag_type_id_or_name, value):
interfaces = Interfaces(self.api, [interface_id])
if not interfaces:
raise PLCInvalidArgument, "No such interface %r"%interface_id
interface = interfaces[0]
- interface_setting_types = InterfaceSettingTypes(self.api, [interface_setting_type_id_or_name])
- if not interface_setting_types:
- raise PLCInvalidArgument, "No such interface setting type %r"%interface_setting_type_id_or_name
- interface_setting_type = interface_setting_types[0]
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
# checks for existence - does not allow several different settings
conflicts = InterfaceSettings(self.api,
{'interface_id':interface['interface_id'],
- 'interface_setting_type_id':interface_setting_type['interface_setting_type_id']})
+ 'tag_type_id':tag_type['tag_type_id']})
if len(conflicts) :
raise PLCInvalidArgument, "Interface %d already has setting %d"%(interface['interface_id'],
- interface_setting_type['interface_setting_type_id'])
+ tag_type['tag_type_id'])
# check permission : it not admin, is the user affiliated with the right site
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] not in site['person_ids']:
raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = interface_setting_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
interface_setting = InterfaceSetting(self.api)
interface_setting['interface_id'] = interface['interface_id']
- interface_setting['interface_setting_type_id'] = interface_setting_type['interface_setting_type_id']
+ interface_setting['tag_type_id'] = tag_type['tag_type_id']
interface_setting['value'] = value
interface_setting.sync()
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.InterfaceSettingTypes import InterfaceSettingType, InterfaceSettingTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'category', 'min_role_id']
-
-class AddInterfaceSettingType(Method):
- """
- Adds a new type of interface setting.
- Any fields specified are used, otherwise defaults are used.
-
- Returns the new interface_setting_id (> 0) if successful,
- faults otherwise.
- """
-
- roles = ['admin']
-
- interface_setting_type_fields = dict(filter(can_update, InterfaceSettingType.fields.items()))
-
- accepts = [
- Auth(),
- interface_setting_type_fields
- ]
-
- returns = Parameter(int, 'New interface_setting_id (> 0) if successful')
-
-
- def call(self, auth, interface_setting_type_fields):
- interface_setting_type_fields = dict(filter(can_update, interface_setting_type_fields.items()))
- interface_setting_type = InterfaceSettingType(self.api, interface_setting_type_fields)
- interface_setting_type.sync()
-
- self.object_ids = [interface_setting_type['interface_setting_type_id']]
-
- return interface_setting_type['interface_setting_type_id']
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision: 9423 $
-#
-
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.LinkTypes import LinkType, LinkTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'category', 'min_role_id']
-
-class AddLinkType(Method):
- """
- Adds a new type of ilink.
- Any fields specified are used, otherwise defaults are used.
-
- Returns the new ilink_id (> 0) if successful,
- faults otherwise.
- """
-
- roles = ['admin']
-
- link_type_fields = dict(filter(can_update, LinkType.fields.items()))
-
- accepts = [
- Auth(),
- link_type_fields
- ]
-
- returns = Parameter(int, 'New ilink_id (> 0) if successful')
-
-
- def call(self, auth, link_type_fields):
- link_type_fields = dict(filter(can_update, link_type_fields.items()))
- link_type = LinkType(self.api, link_type_fields)
- link_type.sync()
-
- self.object_ids = [link_type['link_type_id']]
-
- return link_type['link_type_id']
from PLC.Auth import Auth
from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.NodeTags import NodeTag, NodeTags
can_update = lambda (field, value): field in NodeGroup.fields.keys() and field != NodeGroup.primary_field
accepts = [
Auth(),
NodeGroup.fields['groupname'],
- Mixed(NodeTagType.fields['node_tag_type_id'],
- NodeTagType.fields['tagname']),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
NodeTag.fields['tagvalue'],
]
returns = Parameter(int, 'New nodegroup_id (> 0) if successful')
- def call(self, auth, groupname, node_tag_type_id_or_tagname, tagvalue):
+ def call(self, auth, groupname, tag_type_id_or_tagname, tagvalue):
# locate tag type
- tag_types = NodeTagTypes (self.api,[node_tag_type_id_or_tagname])
+ tag_types = TagTypes (self.api,[tag_type_id_or_tagname])
if not(tag_types):
- raise PLCInvalidArgument, "No such tag type %r"%node_tag_type_id_or_tagname
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_tagname
tag_type=tag_types[0]
nodegroup_fields = { 'groupname' : groupname,
- 'node_tag_type_id' : tag_type['node_tag_type_id'],
+ 'tag_type_id' : tag_type['tag_type_id'],
'tagvalue' : tagvalue }
nodegroup = NodeGroup(self.api, nodegroup_fields)
nodegroup.sync()
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
-from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.NodeTags import NodeTag, NodeTags
from PLC.Nodes import Node, Nodes
# no other way to refer to a node
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
- Mixed(NodeTagType.fields['node_tag_type_id'],
- NodeTagType.fields['tagname']),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
NodeTag.fields['tagvalue'],
]
object_type = 'Node'
- def call(self, auth, node_id, node_tag_type_id_or_name, value):
+ def call(self, auth, node_id, tag_type_id_or_name, value):
nodes = Nodes(self.api, [node_id])
if not nodes:
raise PLCInvalidArgument, "No such node %r"%node_id
node = nodes[0]
- node_tag_types = NodeTagTypes(self.api, [node_tag_type_id_or_name])
- if not node_tag_types:
- raise PLCInvalidArgument, "No such node tag type %r"%node_tag_type_id_or_name
- node_tag_type = node_tag_types[0]
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such node tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
# checks for existence - does not allow several different tags
conflicts = NodeTags(self.api,
{'node_id':node['node_id'],
- 'node_tag_type_id':node_tag_type['node_tag_type_id']})
+ 'tag_type_id':tag_type['tag_type_id']})
if len(conflicts) :
raise PLCInvalidArgument, "Node %d already has tag %d"%(node['node_id'],
- node_tag_type['node_tag_type_id'])
+ tag_type['tag_type_id'])
# check permission : it not admin, is the user affiliated with the right site
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] not in site['person_ids']:
raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = node_tag_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified node tag, requires role %d",required_min_role
node_tag = NodeTag(self.api)
node_tag['node_id'] = node['node_id']
- node_tag['node_tag_type_id'] = node_tag_type['node_tag_type_id']
+ node_tag['tag_type_id'] = tag_type['tag_type_id']
node_tag['tagvalue'] = value
node_tag.sync()
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.Slices import Slice, Slices
from PLC.Nodes import Node, Nodes
from PLC.SliceAttributes import SliceAttribute, SliceAttributes
accepts = [
Auth(),
- Mixed(SliceAttribute.fields['slice_id'],
- SliceAttribute.fields['name']),
- Mixed(SliceAttribute.fields['attribute_type_id'],
- SliceAttribute.fields['name']),
+ Mixed(Slice.fields['slice_id'],
+ Slice.fields['name']),
+ Mixed(SliceAttribute.fields['tag_type_id'],
+ SliceAttribute.fields['tagname']),
Mixed(SliceAttribute.fields['value'],
InitScript.fields['name']),
Mixed(Node.fields['node_id'],
returns = Parameter(int, 'New slice_attribute_id (> 0) if successful')
- def call(self, auth, slice_id_or_name, attribute_type_id_or_name, value, node_id_or_hostname = None, nodegroup_id_or_name = None):
+ def call(self, auth, slice_id_or_name, tag_type_id_or_name, value, node_id_or_hostname = None, nodegroup_id_or_name = None):
slices = Slices(self.api, [slice_id_or_name])
if not slices:
- raise PLCInvalidArgument, "No such slice"
+ raise PLCInvalidArgument, "No such slice %r"%slice_id_or_name
slice = slices[0]
- attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
- if not attribute_types:
- raise PLCInvalidArgument, "No such slice attribute type"
- attribute_type = attribute_types[0]
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] in slice['person_ids']:
elif slice['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
- if attribute_type['min_role_id'] is not None and \
- min(self.caller['role_ids']) > attribute_type['min_role_id']:
+ if tag_type['min_role_id'] is not None and \
+ min(self.caller['role_ids']) > tag_type['min_role_id']:
raise PLCPermissionDenied, "Not allowed to set the specified slice attribute"
# if initscript is specified, validate value
- if attribute_type['name'] in ['initscript']:
+ if tag_type['tagname'] in ['initscript']:
initscripts = InitScripts(self.api, {'enabled': True, 'name': value})
if not initscripts:
- raise PLCInvalidArgument, "No such plc initscript"
+ raise PLCInvalidArgument, "No such plc initscript %r"%value
slice_attribute = SliceAttribute(self.api)
slice_attribute['slice_id'] = slice['slice_id']
- slice_attribute['attribute_type_id'] = attribute_type['attribute_type_id']
+ slice_attribute['tag_type_id'] = tag_type['tag_type_id']
slice_attribute['value'] = unicode(value)
# Sliver attribute if node is specified
if nodegroup_id_or_name is not None:
nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
if not nodegroups:
- raise PLCInvalidArgument, "No such nodegroup"
+ raise PLCInvalidArgument, "No such nodegroup %r"%nodegroup_id_or_name
nodegroup = nodegroups[0]
slice_attribute['nodegroup_id'] = nodegroup['nodegroup_id']
# Check if slice attribute alreay exists
- slice_attributes_check = SliceAttributes(self.api, {'slice_id': slice['slice_id'], 'name': attribute_type['name'], 'value': value})
+ slice_attributes_check = SliceAttributes(self.api, {'slice_id': slice['slice_id'],
+ 'tagname': tag_type['tagname'],
+ 'value': value})
for slice_attribute_check in slice_attributes_check:
if 'node_id' in slice_attribute and slice_attribute['node_id'] == slice_attribute_check['node_id']:
raise PLCInvalidArgument, "Sliver attribute already exists"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'min_role_id']
-
-class AddSliceAttributeType(Method):
- """
- Adds a new type of slice attribute. Any fields specified in
- attribute_type_fields are used, otherwise defaults are used.
-
- Returns the new attribute_type_id (> 0) if successful, faults
- otherwise.
- """
-
- roles = ['admin']
-
- attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items()))
-
- accepts = [
- Auth(),
- attribute_type_fields
- ]
-
- returns = Parameter(int, 'New attribute_id (> 0) if successful')
-
-
- def call(self, auth, attribute_type_fields):
- attribute_type_fields = dict(filter(can_update, attribute_type_fields.items()))
- attribute_type = SliceAttributeType(self.api, attribute_type_fields)
- attribute_type.sync()
-
- self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}
-
- return attribute_type['attribute_type_id']
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['tagname', 'description', 'category', 'min_role_id']
-class AddNodeTagType(Method):
+class AddTagType(Method):
"""
Adds a new type of node tag.
Any fields specified are used, otherwise defaults are used.
roles = ['admin']
- node_tag_type_fields = dict(filter(can_update, NodeTagType.fields.items()))
+ tag_type_fields = dict(filter(can_update, TagType.fields.items()))
accepts = [
Auth(),
- node_tag_type_fields
+ tag_type_fields
]
returns = Parameter(int, 'New node_tag_id (> 0) if successful')
- def call(self, auth, node_tag_type_fields):
- node_tag_type_fields = dict(filter(can_update, node_tag_type_fields.items()))
- node_tag_type = NodeTagType(self.api, node_tag_type_fields)
- node_tag_type.sync()
+ def call(self, auth, tag_type_fields):
+ tag_type_fields = dict(filter(can_update, tag_type_fields.items()))
+ tag_type = TagType(self.api, tag_type_fields)
+ tag_type.sync()
- self.object_ids = [node_tag_type['node_tag_type_id']]
+ self.object_ids = [tag_type['tag_type_id']]
- return node_tag_type['node_tag_type_id']
+ return tag_type['tag_type_id']
"""
Deletes the specified ilink
- Attributes may require the caller to have a particular role in order
- to be deleted, depending on the related ilink type.
+ Attributes may require the caller to have a particular
+ role in order to be deleted, depending on the related tag type.
Admins may delete attributes of any slice or sliver.
Returns 1 if successful, faults otherwise.
if self.caller['person_id'] not in site['person_ids']:
raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = link_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified ilink, requires role %d",required_min_role
Deletes the specified interface setting
Attributes may require the caller to have a particular role in order
- to be deleted, depending on the related interface setting type.
+ to be deleted, depending on the related tag type.
Admins may delete attributes of any slice or sliver.
Returns 1 if successful, faults otherwise.
if self.caller['person_id'] not in site['person_ids']:
raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = interface_setting_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.InterfaceSettingTypes import InterfaceSettingType, InterfaceSettingTypes
-from PLC.Auth import Auth
-
-class DeleteInterfaceSettingType(Method):
- """
- Deletes the specified interface setting type.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(InterfaceSettingType.fields['interface_setting_type_id'],
- InterfaceSettingType.fields['name']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, interface_setting_type_id_or_name):
- interface_setting_types = InterfaceSettingTypes(self.api, [interface_setting_type_id_or_name])
- if not interface_setting_types:
- raise PLCInvalidArgument, "No such interface setting type"
- interface_setting_type = interface_setting_types[0]
-
- interface_setting_type.delete()
- self.object_ids = [interface_setting_type['interface_setting_type_id']]
-
- return 1
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision: 9423 $
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.LinkTypes import LinkType, LinkTypes
-from PLC.Auth import Auth
-
-class DeleteLinkType(Method):
- """
- Deletes the specified ilink type.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(LinkType.fields['link_type_id'],
- LinkType.fields['name']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, link_type_id_or_name):
- link_types = LinkTypes(self.api, [link_type_id_or_name])
- if not link_types:
- raise PLCInvalidArgument, "No such ilink type"
- link_type = link_types[0]
-
- link_type.delete()
- self.object_ids = [link_type['link_type_id']]
-
- return 1
if self.caller['person_id'] not in site['person_ids']:
raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = node_tag_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified node tag, requires role %d",required_min_role
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import Auth
-
-class DeleteSliceAttributeType(Method):
- """
- Deletes the specified slice attribute.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(SliceAttributeType.fields['attribute_type_id'],
- SliceAttributeType.fields['name']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, attribute_type_id_or_name):
- attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
- if not attribute_types:
- raise PLCInvalidArgument, "No such slice attribute type"
- attribute_type = attribute_types[0]
-
- attribute_type.delete()
- self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}
-
- return 1
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.Auth import Auth
-class DeleteNodeTagType(Method):
+class DeleteTagType(Method):
"""
Deletes the specified node tag type.
accepts = [
Auth(),
- Mixed(NodeTagType.fields['node_tag_type_id'],
- NodeTagType.fields['tagname']),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
]
returns = Parameter(int, '1 if successful')
- def call(self, auth, node_tag_type_id_or_name):
- node_tag_types = NodeTagTypes(self.api, [node_tag_type_id_or_name])
- if not node_tag_types:
+ def call(self, auth, tag_type_id_or_name):
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
raise PLCInvalidArgument, "No such node tag type"
- node_tag_type = node_tag_types[0]
+ tag_type = tag_types[0]
- node_tag_type.delete()
- self.object_ids = [node_tag_type['node_tag_type_id']]
+ tag_type.delete()
+ self.object_ids = [tag_type['tag_type_id']]
return 1
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Filter import Filter
-from PLC.Auth import Auth
-from PLC.InterfaceSettingTypes import InterfaceSettingType, InterfaceSettingTypes
-
-class GetInterfaceSettingTypes(Method):
- """
- Returns an array of structs containing details about
- interface setting types.
-
- The usual filtering scheme applies on this method.
- """
-
- roles = ['admin', 'pi', 'user', 'tech', 'node']
-
- accepts = [
- Auth(),
- Mixed([Mixed(InterfaceSettingType.fields['interface_setting_type_id'],
- InterfaceSettingType.fields['name'])],
- Filter(InterfaceSettingType.fields)),
- Parameter([str], "List of fields to return", nullok = True)
- ]
-
- returns = [InterfaceSettingType.fields]
-
- def call(self, auth, interface_setting_type_filter = None, return_fields = None):
- return InterfaceSettingTypes(self.api, interface_setting_type_filter, return_fields)
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision: 9423 $
-#
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Filter import Filter
-from PLC.Auth import Auth
-from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
-
-class GetNodeTagTypes(Method):
- """
- Returns an array of structs containing details about
- node tag types.
-
- The usual filtering scheme applies on this method.
- """
-
- roles = ['admin', 'pi', 'user', 'tech', 'node']
-
- accepts = [
- Auth(),
- Mixed([Mixed(NodeTagType.fields['node_tag_type_id'],
- NodeTagType.fields['tagname'])],
- Filter(NodeTagType.fields)),
- Parameter([str], "List of fields to return", nullok = True)
- ]
-
- returns = [NodeTagType.fields]
-
- def call(self, auth, node_tag_type_filter = None, return_fields = None):
- return NodeTagTypes(self.api, node_tag_type_filter, return_fields)
+++ /dev/null
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Filter import Filter
-from PLC.Auth import Auth
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-
-class GetSliceAttributeTypes(Method):
- """
- Returns an array of structs containing details about slice
- attribute types. If attribute_type_filter is specified and
- is an array of slice attribute type identifiers, or a
- struct of slice attribute type attributes, only slice attribute
- types matching the filter will be returned. If return_fields is
- specified, only the specified details will be returned.
- """
-
- roles = ['admin', 'pi', 'user', 'tech', 'node']
-
- accepts = [
- Auth(),
- Mixed([Mixed(SliceAttributeType.fields['attribute_type_id'],
- SliceAttributeType.fields['name'])],
- Filter(SliceAttributeType.fields)),
- Parameter([str], "List of fields to return", nullok = True)
- ]
-
- returns = [SliceAttributeType.fields]
-
- def call(self, auth, attribute_type_filter = None, return_fields = None):
- return SliceAttributeTypes(self.api, attribute_type_filter, return_fields)
'key': Key.fields['key']
}],
'attributes': [{
- 'name': SliceAttribute.fields['name'],
+ 'tagname': SliceAttribute.fields['tagname'],
'value': SliceAttribute.fields['value']
}]
}]
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
from PLC.Auth import Auth
-from PLC.LinkTypes import LinkType, LinkTypes
+from PLC.TagTypes import TagType, TagTypes
-class GetLinkTypes(Method):
+class GetTagTypes(Method):
"""
Returns an array of structs containing details about
- ilink types.
+ node tag types.
The usual filtering scheme applies on this method.
"""
accepts = [
Auth(),
- Mixed([Mixed(LinkType.fields['link_type_id'],
- LinkType.fields['name'])],
- Filter(LinkType.fields)),
+ Mixed([Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname'])],
+ Filter(TagType.fields)),
Parameter([str], "List of fields to return", nullok = True)
]
- returns = [LinkType.fields]
+ returns = [TagType.fields]
- def call(self, auth, link_type_filter = None, return_fields = None):
- return LinkTypes(self.api, link_type_filter, return_fields)
+ def call(self, auth, tag_type_filter = None, return_fields = None):
+ return TagTypes(self.api, tag_type_filter, return_fields)
attribute_name = value_name = name
type = "string"
- # <resource name="slice_attribute_type">
+ # <resource name="tag_type">
xml.startElement('resource', {'name': unicode(attribute_name)})
# <value name="element_name" type="element_type">
"""
Updates the value of an existing ilink
- Access rights depend on the ilink type.
+ Access rights depend on the tag type.
Returns 1 if successful, faults otherwise.
"""
# if self.caller['person_id'] not in site['person_ids']:
# raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = link_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified ilink, requires role %d",required_min_role
"""
Updates the value of an existing interface setting
- Access rights depend on the interface setting type.
+ Access rights depend on the tag type.
Returns 1 if successful, faults otherwise.
"""
if self.caller['person_id'] not in site['person_ids']:
raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = interface_setting_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.InterfaceSettingTypes import InterfaceSettingType, InterfaceSettingTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'category', 'min_role_id']
-
-class UpdateInterfaceSettingType(Method):
- """
- Updates the parameters of an existing setting type
- with the values in interface_setting_type_fields.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- interface_setting_type_fields = dict(filter(can_update, InterfaceSettingType.fields.items()))
-
- accepts = [
- Auth(),
- Mixed(InterfaceSettingType.fields['interface_setting_type_id'],
- InterfaceSettingType.fields['name']),
- interface_setting_type_fields
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, interface_setting_type_id_or_name, interface_setting_type_fields):
- interface_setting_type_fields = dict(filter(can_update, interface_setting_type_fields.items()))
-
- interface_setting_types = InterfaceSettingTypes(self.api, [interface_setting_type_id_or_name])
- if not interface_setting_types:
- raise PLCInvalidArgument, "No such setting type"
- interface_setting_type = interface_setting_types[0]
-
- interface_setting_type.update(interface_setting_type_fields)
- interface_setting_type.sync()
- self.object_ids = [interface_setting_type['interface_setting_type_id']]
-
- return 1
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision: 9423 $
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.LinkTypes import LinkType, LinkTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'category', 'min_role_id']
-
-class UpdateLinkType(Method):
- """
- Updates the parameters of an existing link type
- with the values in link_type_fields.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- link_type_fields = dict(filter(can_update, LinkType.fields.items()))
-
- accepts = [
- Auth(),
- Mixed(LinkType.fields['link_type_id'],
- LinkType.fields['name']),
- link_type_fields
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, link_type_id_or_name, link_type_fields):
- link_type_fields = dict(filter(can_update, link_type_fields.items()))
-
- link_types = LinkTypes(self.api, [link_type_id_or_name])
- if not link_types:
- raise PLCInvalidArgument, "No such tag type"
- link_type = link_types[0]
-
- link_type.update(link_type_fields)
- link_type.sync()
- self.object_ids = [link_type['link_type_id']]
-
- return 1
if self.caller['person_id'] not in site['person_ids']:
raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
- required_min_role = node_tag_type ['min_role_id']
+ required_min_role = tag_type ['min_role_id']
if required_min_role is not None and \
min(self.caller['role_ids']) > required_min_role:
raise PLCPermissionDenied, "Not allowed to modify the specified node tag, requires role %d",required_min_role
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision: 9423 $
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['tagname', 'description', 'category', 'min_role_id']
-
-class UpdateNodeTagType(Method):
- """
- Updates the parameters of an existing tag type
- with the values in node_tag_type_fields.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- node_tag_type_fields = dict(filter(can_update, NodeTagType.fields.items()))
-
- accepts = [
- Auth(),
- Mixed(NodeTagType.fields['node_tag_type_id'],
- NodeTagType.fields['tagname']),
- node_tag_type_fields
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, node_tag_type_id_or_name, node_tag_type_fields):
- node_tag_type_fields = dict(filter(can_update, node_tag_type_fields.items()))
-
- node_tag_types = NodeTagTypes(self.api, [node_tag_type_id_or_name])
- if not node_tag_types:
- raise PLCInvalidArgument, "No such tag type"
- node_tag_type = node_tag_types[0]
-
- node_tag_type.update(node_tag_type_fields)
- node_tag_type.sync()
- self.object_ids = [node_tag_type['node_tag_type_id']]
-
- return 1
min(self.caller['role_ids']) > slice_attribute['min_role_id']:
raise PLCPermissionDenied, "Not allowed to update the specified attribute"
- if slice_attribute['name'] in ['initscript']:
+ if slice_attribute['tagname'] in ['initscript']:
initscripts = InitScripts(self.api, {'enabled': True, 'name': value})
if not initscripts:
raise PLCInvalidArgument, "No such plc initscript"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'min_role_id']
-
-class UpdateSliceAttributeType(Method):
- """
- Updates the parameters of an existing attribute with the values in
- attribute_type_fields.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items()))
-
- accepts = [
- Auth(),
- Mixed(SliceAttributeType.fields['attribute_type_id'],
- SliceAttributeType.fields['name']),
- attribute_type_fields
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, attribute_type_id_or_name, attribute_type_fields):
- attribute_type_fields = dict(filter(can_update, attribute_type_fields.items()))
-
- attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
- if not attribute_types:
- raise PLCInvalidArgument, "No such attribute"
- attribute_type = attribute_types[0]
-
- attribute_type.update(attribute_type_fields)
- attribute_type.sync()
- self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}
-
- return 1
--- /dev/null
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Auth import Auth
+
+can_update = lambda (field, value): field in \
+ ['tagname', 'description', 'category', 'min_role_id']
+
+class UpdateTagType(Method):
+ """
+ Updates the parameters of an existing tag type
+ with the values in tag_type_fields.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin']
+
+ tag_type_fields = dict(filter(can_update, TagType.fields.items()))
+
+ accepts = [
+ Auth(),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ tag_type_fields
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ def call(self, auth, tag_type_id_or_name, tag_type_fields):
+ tag_type_fields = dict(filter(can_update, tag_type_fields.items()))
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type"
+ tag_type = tag_types[0]
+
+ tag_type.update(tag_type_fields)
+ tag_type.sync()
+ self.object_ids = [tag_type['tag_type_id']]
+
+ return 1
AddInitScript
AddInterface
AddInterfaceSetting
-AddInterfaceSettingType
AddKeyType
-AddLinkType
AddMessage
AddNetworkMethod
AddNetworkType
AddNode
AddNodeGroup
AddNodeTag
-AddNodeTagType
AddNodeToPCU
AddPCU
AddPCUProtocolType
AddSiteAddress
AddSlice
AddSliceAttribute
-AddSliceAttributeType
AddSliceInstantiation
AddSliceToNodes
AddSliceToNodesWhitelist
+AddTagType
AuthCheck
BlacklistKey
BootCheckAuthentication
DeleteInitScript
DeleteInterface
DeleteInterfaceSetting
-DeleteInterfaceSettingType
DeleteKey
DeleteKeyType
-DeleteLinkType
DeleteMessage
DeleteNetworkMethod
DeleteNetworkType
DeleteNodeFromPCU
DeleteNodeGroup
DeleteNodeTag
-DeleteNodeTagType
DeletePCU
DeletePCUProtocolType
DeletePCUType
DeleteSite
DeleteSlice
DeleteSliceAttribute
-DeleteSliceAttributeType
DeleteSliceFromNodes
DeleteSliceFromNodesWhitelist
DeleteSliceInstantiation
+DeleteTagType
GenerateNodeConfFile
GetAddressTypes
GetAddresses
GetEvents
GetIlinks
GetInitScripts
-GetInterfaceSettingTypes
GetInterfaceSettings
GetInterfaces
GetKeyTypes
GetKeys
-GetLinkTypes
GetMessages
GetNetworkMethods
GetNetworkTypes
GetNodeGroups
-GetNodeTagTypes
GetNodeTags
GetNodes
GetPCUProtocolTypes
GetSession
GetSessions
GetSites
-GetSliceAttributeTypes
GetSliceAttributes
GetSliceInstantiations
GetSliceKeys
GetSlices
GetSlicesMD5
GetSlivers
+GetTagTypes
GetWhitelist
NotifyPersons
NotifySupport
UpdateInitScript
UpdateInterface
UpdateInterfaceSetting
-UpdateInterfaceSettingType
UpdateKey
-UpdateLinkType
UpdateMessage
UpdateNode
UpdateNodeGroup
UpdateNodeTag
-UpdateNodeTagType
UpdatePCU
UpdatePCUProtocolType
UpdatePCUType
UpdateSite
UpdateSlice
UpdateSliceAttribute
-UpdateSliceAttributeType
+UpdateTagType
VerifyPerson
system.listMethods
system.methodHelp
fields = {
'nodegroup_id': Parameter(int, "Node group identifier"),
'groupname': Parameter(str, "Node group name", max = 50),
- 'node_tag_type_id': Parameter (int, "Node tag type id"),
+ 'tag_type_id': Parameter (int, "Node tag type id"),
'tagvalue' : Parameter(str, "value that the nodegroup definition is based upon"),
'tagname' : Parameter(str, "Tag name that the nodegroup definition is based upon"),
'conf_file_ids': Parameter([int], "List of configuration files specific to this node group"),
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision: 9423 $
-#
-from types import StringTypes
-
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.Roles import Role, Roles
-
-class NodeTagType (Row):
-
- """
- Representation of a row in the node_tag_types table.
- """
-
- table_name = 'node_tag_types'
- primary_key = 'node_tag_type_id'
- join_tables = ['node_tag']
- fields = {
- 'node_tag_type_id': Parameter(int, "Node tag type identifier"),
- 'tagname': Parameter(str, "Node tag type name", max = 100),
- 'description': Parameter(str, "Node tag type description", max = 254),
- 'category' : Parameter (str, "Node tag category", max=64, optional=True),
- 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
- }
-
- def validate_name(self, name):
- if not len(name):
- raise PLCInvalidArgument, "node tag type name must be set"
-
- conflicts = NodeTagTypes(self.api, [name])
- for tag_type in conflicts:
- if 'node_tag_type_id' not in self or \
- self['node_tag_type_id'] != tag_type['node_tag_type_id']:
- raise PLCInvalidArgument, "node tag type name already in use"
-
- return name
-
- def validate_min_role_id(self, role_id):
- roles = [row['role_id'] for row in Roles(self.api)]
- if role_id not in roles:
- raise PLCInvalidArgument, "Invalid role"
-
- return role_id
-
-class NodeTagTypes(Table):
- """
- Representation of row(s) from the node_tag_types table
- in the database.
- """
-
- def __init__(self, api, node_tag_type_filter = None, columns = None):
- Table.__init__(self, api, NodeTagType, columns)
-
- sql = "SELECT %s FROM node_tag_types WHERE True" % \
- ", ".join(self.columns)
-
- if node_tag_type_filter is not None:
- if isinstance(node_tag_type_filter, (list, tuple, set)):
- # Separate the list into integers and strings
- ints = filter(lambda x: isinstance(x, (int, long)), node_tag_type_filter)
- strs = filter(lambda x: isinstance(x, StringTypes), node_tag_type_filter)
- node_tag_type_filter = Filter(NodeTagType.fields, {'node_tag_type_id': ints, 'tagname': strs})
- sql += " AND (%s) %s" % node_tag_type_filter.sql(api, "OR")
- elif isinstance(node_tag_type_filter, dict):
- node_tag_type_filter = Filter(NodeTagType.fields, node_tag_type_filter)
- sql += " AND (%s) %s" % node_tag_type_filter.sql(api, "AND")
- elif isinstance (node_tag_type_filter, StringTypes):
- node_tag_type_filter = Filter(NodeTagType.fields, {'tagname':[node_tag_type_filter]})
- sql += " AND (%s) %s" % node_tag_type_filter.sql(api, "AND")
- else:
- raise PLCInvalidArgument, "Wrong node tag type filter %r"%node_tag_type_filter
-
- self.selectall(sql)
from PLC.Filter import Filter
from PLC.Table import Row, Table
from PLC.Nodes import Node, Nodes
-from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
+from PLC.TagTypes import TagType, TagTypes
class NodeTag(Row):
"""
'node_tag_id': Parameter(int, "Node tag identifier"),
'node_id': Node.fields['node_id'],
'hostname' : Node.fields['hostname'],
- 'node_tag_type_id': NodeTagType.fields['node_tag_type_id'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
'tagvalue': Parameter(str, "Node tag value"),
- 'tagname': NodeTagType.fields['tagname'],
- 'description': NodeTagType.fields['description'],
- 'category': NodeTagType.fields['category'],
- 'min_role_id': NodeTagType.fields['min_role_id'],
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
}
class NodeTags(Table):
def associate_interfaces(self, auth, field, value):
"""
- Delete interfaces not found in value list (using DeleteNodeNetwor)k
+ Delete interfaces not found in value list (using DeleteInterface)
Add interfaces found in value list (using AddInterface)
Updates interfaces found w/ interface_id in value list (using UpdateInterface)
"""
- assert 'interfacep_ids' in self
+ assert 'interface_ids' in self
assert 'node_id' in self
assert isinstance(value, list)
from PLC.Persons import Person, Persons
from PLC.Keys import Key, Keys
from PLC.Nodes import Node, Nodes
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
+from PLC.TagTypes import TagType, TagTypes
from PLC.SliceAttributes import SliceAttribute, SliceAttributes
from PLC.Slices import Slice, Slices
table_name = 'peers'
primary_key = 'peer_id'
- join_tables = ['peer_site', 'peer_person', 'peer_key', 'peer_node',
- 'peer_slice_attribute_type', 'peer_slice_attribute', 'peer_slice']
+ join_tables = ['peer_site', 'peer_person', 'peer_key', 'peer_node', 'peer_slice']
fields = {
'peer_id': Parameter (int, "Peer identifier"),
'peername': Parameter (str, "Peer name"),
table_name = 'roles'
primary_key = 'role_id'
- join_tables = ['person_role', ('slice_attribute_types', 'min_role_id')]
+ join_tables = ['person_role', ('tag_types', 'min_role_id')]
fields = {
'role_id': Parameter(int, "Role identifier"),
'name': Parameter(str, "Role", max = 100),
+++ /dev/null
-from types import StringTypes
-
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.Roles import Role, Roles
-
-class SliceAttributeType(Row):
- """
- Representation of a row in the slice_attribute_types table. To
- use, instantiate with a dict of values.
- """
-
- table_name = 'slice_attribute_types'
- primary_key = 'attribute_type_id'
- join_tables = ['slice_attribute']
- fields = {
- 'attribute_type_id': Parameter(int, "Slice attribute type identifier"),
- 'name': Parameter(str, "Slice attribute type name", max = 100),
- 'description': Parameter(str, "Slice attribute type description", max = 254),
- 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
- }
-
- def validate_name(self, name):
- if not len(name):
- raise PLCInvalidArgument, "Slice attribute type name must be set"
-
- conflicts = SliceAttributeTypes(self.api, [name])
- for attribute in conflicts:
- if 'attribute_type_id' not in self or \
- self['attribute_type_id'] != attribute['attribute_type_id']:
- raise PLCInvalidArgument, "Slice attribute type name already in use"
-
- return name
-
- def validate_min_role_id(self, role_id):
- roles = [row['role_id'] for row in Roles(self.api)]
- if role_id not in roles:
- raise PLCInvalidArgument, "Invalid role"
-
- return role_id
-
-class SliceAttributeTypes(Table):
- """
- Representation of row(s) from the slice_attribute_types table in the
- database.
- """
-
- def __init__(self, api, attribute_type_filter = None, columns = None):
- Table.__init__(self, api, SliceAttributeType, columns)
-
- sql = "SELECT %s FROM slice_attribute_types WHERE True" % \
- ", ".join(self.columns)
-
- if attribute_type_filter is not None:
- if isinstance(attribute_type_filter, (list, tuple, set)):
- # Separate the list into integers and strings
- ints = filter(lambda x: isinstance(x, (int, long)), attribute_type_filter)
- strs = filter(lambda x: isinstance(x, StringTypes), attribute_type_filter)
- attribute_type_filter = Filter(SliceAttributeType.fields, {'attribute_type_id': ints, 'name': strs})
- sql += " AND (%s) %s" % attribute_type_filter.sql(api, "OR")
- elif isinstance(attribute_type_filter, dict):
- attribute_type_filter = Filter(SliceAttributeType.fields, attribute_type_filter)
- sql += " AND (%s) %s" % attribute_type_filter.sql(api, "AND")
-
- self.selectall(sql)
from PLC.Parameter import Parameter
from PLC.Filter import Filter
from PLC.Table import Row, Table
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
+from PLC.TagTypes import TagType, TagTypes
class SliceAttribute(Row):
"""
'slice_id': Parameter(int, "Slice identifier"),
'node_id': Parameter(int, "Node identifier, if a sliver attribute"),
'nodegroup_id': Parameter(int, "Nodegroup identifier, if a sliver attribute"),
- 'attribute_type_id': SliceAttributeType.fields['attribute_type_id'],
- 'name': SliceAttributeType.fields['name'],
- 'description': SliceAttributeType.fields['description'],
- 'min_role_id': SliceAttributeType.fields['min_role_id'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
'value': Parameter(str, "Slice attribute value"),
}
updated_attributes = filter(lambda x: 'slice_attribute_id' in x, attributes)
for added_attribute in added_attributes:
- if 'attribute_type' in added_attribute:
- type = added_attribute['attribute_type']
- elif 'attribute_type_id' in added_attribute:
- type = added_attribute['attribute_type_id']
+ if 'tag_type' in added_attribute:
+ type = added_attribute['tag_type']
+ elif 'tag_type_id' in added_attribute:
+ type = added_attribute['tag_type_id']
else:
- raise PLCInvalidArgument, "Must specify attribute_type or attribute_type_id"
+ raise PLCInvalidArgument, "Must specify tag_type or tag_type_id"
if 'value' in added_attribute:
value = added_attribute['value']
--- /dev/null
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from types import StringTypes
+
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+from PLC.Roles import Role, Roles
+
+# xxx todo : deleting a tag type should delete the related nodegroup(s)
+
+class TagType (Row):
+
+ """
+ Representation of a row in the tag_types table.
+ """
+
+ table_name = 'tag_types'
+ primary_key = 'tag_type_id'
+ join_tables = ['node_tag']
+ fields = {
+ 'tag_type_id': Parameter(int, "Node tag type identifier"),
+ 'tagname': Parameter(str, "Node tag type name", max = 100),
+ 'description': Parameter(str, "Node tag type description", max = 254),
+ 'category' : Parameter (str, "Node tag category", max=64, optional=True),
+ 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
+ }
+
+ def validate_name(self, name):
+ if not len(name):
+ raise PLCInvalidArgument, "node tag type name must be set"
+
+ conflicts = TagTypes(self.api, [name])
+ for tag_type in conflicts:
+ if 'tag_type_id' not in self or \
+ self['tag_type_id'] != tag_type['tag_type_id']:
+ raise PLCInvalidArgument, "node tag type name already in use"
+
+ return name
+
+ def validate_min_role_id(self, role_id):
+ roles = [row['role_id'] for row in Roles(self.api)]
+ if role_id not in roles:
+ raise PLCInvalidArgument, "Invalid role"
+
+ return role_id
+
+class TagTypes(Table):
+ """
+ Representation of row(s) from the tag_types table
+ in the database.
+ """
+
+ def __init__(self, api, tag_type_filter = None, columns = None):
+ Table.__init__(self, api, TagType, columns)
+
+ sql = "SELECT %s FROM tag_types WHERE True" % \
+ ", ".join(self.columns)
+
+ if tag_type_filter is not None:
+ if isinstance(tag_type_filter, (list, tuple, set)):
+ # Separate the list into integers and strings
+ ints = filter(lambda x: isinstance(x, (int, long)), tag_type_filter)
+ strs = filter(lambda x: isinstance(x, StringTypes), tag_type_filter)
+ tag_type_filter = Filter(TagType.fields, {'tag_type_id': ints, 'tagname': strs})
+ sql += " AND (%s) %s" % tag_type_filter.sql(api, "OR")
+ elif isinstance(tag_type_filter, dict):
+ tag_type_filter = Filter(TagType.fields, tag_type_filter)
+ sql += " AND (%s) %s" % tag_type_filter.sql(api, "AND")
+ elif isinstance (tag_type_filter, StringTypes):
+ tag_type_filter = Filter(TagType.fields, {'tagname':[tag_type_filter]})
+ sql += " AND (%s) %s" % tag_type_filter.sql(api, "AND")
+ else:
+ raise PLCInvalidArgument, "Wrong node tag type filter %r"%tag_type_filter
+
+ self.selectall(sql)
GPG
Ilinks
InitScripts
-InterfaceSettingTypes
InterfaceSettings
Interfaces
KeyTypes
Keys
-LinkTypes
Messages
Method
NetworkMethods
NetworkTypes
NodeGroups
-NodeTagTypes
NodeTags
Nodes
PCUProtocolTypes
Sessions
Shell
Sites
-SliceAttributeTypes
SliceAttributes
SliceInstantiations
Slices
Table
-Test
+TagTypes
sendmail
""".split()
ALTER INDEX nodenetworks_node_id_idx RENAME TO interfaces_node_id_idx;
-ALTER TABLE nodenetwork_setting_types RENAME TO interface_setting_types;
-ALTER TABLE interface_setting_types RENAME COLUMN nodenetwork_setting_type_id TO interface_setting_type_id;
+-- xxx need manual merge -> turn into tag_type
+--ALTER TABLE nodenetwork_setting_types RENAME TO interface_setting_types;
+--ALTER TABLE interface_setting_types RENAME COLUMN nodenetwork_setting_type_id TO interface_setting_type_id;
ALTER TABLE nodenetwork_setting RENAME TO interface_setting;
ALTER TABLE view_nodenetwork_settings RENAME TO view_interface_settings;
ALTER TABLE view_interface_settings RENAME COLUMN nodenetwork_setting_id TO interface_setting_id;
ALTER TABLE view_interface_settings RENAME COLUMN nodenetwork_id TO interface_id;
-ALTER TABLE view_interface_settings RENAME COLUMN nodenetwork_setting_type_id TO interface_setting_type_id;
+-- xxx need manual merge -> turn into tag_type
+--ALTER TABLE view_interface_settings RENAME COLUMN nodenetwork_setting_type_id TO interface_setting_type_id;
ALTER TABLE view_nodenetworks RENAME TO view_interfaces;
ALTER TABLE view_interfaces RENAME COLUMN nodenetwork_id TO interface_id;
----------------------------------------
-- node tags
----------------------------------------
-CREATE TABLE node_tag_types ...
+CREATE TABLE tag_types ...
CREATE TABLE node_tag ...
---------- related views
----------------------------------------
-- ilinks
----------------------------------------
-CREATE TABLE link_types ...
+--CREATE TABLE link_types ...
CREATE TABLE ilink ...
CREATE OR REPLACE VIEW ilinks AS ...
--------------------------------------------------------------------------------
-- node tags
--------------------------------------------------------------------------------
-CREATE TABLE node_tag_types (
+CREATE TABLE tag_types (
- node_tag_type_id serial PRIMARY KEY, -- ID
+ tag_type_id serial PRIMARY KEY, -- ID
tagname text UNIQUE NOT NULL, -- Tag Name
description text, -- Optional Description
category text NOT NULL DEFAULT 'general', -- Free text for grouping tags together
CREATE TABLE node_tag (
node_tag_id serial PRIMARY KEY, -- ID
node_id integer REFERENCES nodes NOT NULL, -- node id
- node_tag_type_id integer REFERENCES node_tag_types, -- tag type id
+ tag_type_id integer REFERENCES tag_types, -- tag type id
tagvalue text -- value attached
) WITH OIDS;
node_tag.node_tag_id,
node_tag.node_id,
nodes.hostname,
-node_tag_types.node_tag_type_id,
-node_tag_types.tagname,
-node_tag_types.description,
-node_tag_types.category,
-node_tag_types.min_role_id,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
node_tag.tagvalue
FROM node_tag
-INNER JOIN node_tag_types USING (node_tag_type_id)
+INNER JOIN tag_types USING (tag_type_id)
INNER JOIN nodes USING (node_id);
--------------------------------------------------------------------------------
GROUP BY node_id;
--------------------------------------------------------------------------------
--- Interface setting types and interfaces settings
+-- Interface settings
--------------------------------------------------------------------------------
-CREATE TABLE interface_setting_types (
- interface_setting_type_id serial PRIMARY KEY, -- Setting Type Identifier
- name text UNIQUE NOT NULL, -- Setting Name
- description text, -- Optional Description
- category text NOT NULL DEFAULT 'general', -- Free text for grouping, e.g. Wifi, or whatever
- min_role_id integer REFERENCES roles DEFAULT 10 -- minimal role required
-) WITH OIDS;
-
CREATE TABLE interface_setting (
interface_setting_id serial PRIMARY KEY, -- Interface Setting Identifier
interface_id integer REFERENCES interfaces NOT NULL,-- the interface this applies to
- interface_setting_type_id integer
- REFERENCES interface_setting_types NOT NULL, -- the setting type
+ tag_type_id integer REFERENCES tag_types NOT NULL, -- the setting type
value text -- value attached
) WITH OIDS;
SELECT
interface_setting.interface_setting_id,
interface_setting.interface_id,
-interface_setting_types.interface_setting_type_id,
-interface_setting_types.name,
-interface_setting_types.description,
-interface_setting_types.category,
-interface_setting_types.min_role_id,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
interface_setting.value
FROM interface_setting
-INNER JOIN interface_setting_types USING (interface_setting_type_id);
+INNER JOIN tag_types USING (tag_type_id);
CREATE OR REPLACE VIEW view_interfaces AS
SELECT
--------------------------------------------------------------------------------
-- ilinks : links between interfaces
--------------------------------------------------------------------------------
-CREATE TABLE link_types (
- link_type_id serial PRIMARY KEY, -- id
- name text UNIQUE NOT NULL, -- link name
- description text, -- optional description
- min_role_id integer REFERENCES roles DEFAULT 10 -- minimal role required
-) WITH OIDS;
-
CREATE TABLE ilink (
ilink_id serial PRIMARY KEY, -- id
- link_type_id integer REFERENCES link_types, -- id of the ilink type
+ tag_type_id integer REFERENCES tag_types, -- id of the tag type
src_interface_id integer REFERENCES interfaces not NULL, -- id of src interface
dst_interface_id integer REFERENCES interfaces NOT NULL, -- id of dst interface
value text -- optional value on the link
) WITH OIDS;
CREATE OR REPLACE VIEW view_ilinks AS
-SELECT * FROM link_types
-INNER JOIN ilink USING (link_type_id);
+SELECT * FROM tag_types
+INNER JOIN ilink USING (tag_type_id);
-- expose node_ids ???
-- -- cannot mention the same table twice in a join ?
-- -- CREATE OR REPLACE VIEW ilink_src_node AS
-- SELECT
--- ilink.link_type_id,
+-- ilink.tag_type_id,
-- ilink.src_interface_id,
-- interfaces.node_id AS src_node_id,
-- ilink.dst_interface_id
-- Node groups
CREATE TABLE nodegroups (
- nodegroup_id serial PRIMARY KEY, -- Group identifier
- groupname text UNIQUE NOT NULL, -- Group name
- node_tag_type_id integer REFERENCES node_tag_types, -- node is in nodegroup if it has this tag defined
- tagvalue text NOT NULL -- with this value attached
+ nodegroup_id serial PRIMARY KEY, -- Group identifier
+ groupname text UNIQUE NOT NULL, -- Group name
+ tag_type_id integer REFERENCES tag_types, -- node is in nodegroup if it has this tag defined
+ tagvalue text NOT NULL -- with this value attached
) WITH OIDS;
-- xxx - first rough implem. similar to former semantics but might be slow
CREATE OR REPLACE VIEW nodegroup_node AS
SELECT nodegroup_id, node_id
-FROM node_tag_types
+FROM tag_types
JOIN node_tag
-USING (node_tag_type_id)
+USING (tag_type_id)
JOIN nodegroups
-USING (node_tag_type_id,tagvalue);
+USING (tag_type_id,tagvalue);
CREATE OR REPLACE VIEW nodegroup_nodes AS
SELECT nodegroup_id,
-- Slice attributes
--------------------------------------------------------------------------------
--- Slice attribute types
-CREATE TABLE slice_attribute_types (
- attribute_type_id serial PRIMARY KEY, -- Attribute type identifier
- name text UNIQUE NOT NULL, -- Attribute name
- description text, -- Attribute description
- min_role_id integer REFERENCES roles DEFAULT 10 -- If set, minimum (least powerful) role that can
- -- set or change this attribute
-) WITH OIDS;
-
-- Slice/sliver attributes
CREATE TABLE slice_attribute (
slice_attribute_id serial PRIMARY KEY, -- Slice attribute identifier
slice_id integer REFERENCES slices NOT NULL, -- Slice identifier
node_id integer REFERENCES nodes, -- Sliver attribute if set
nodegroup_id integer REFERENCES nodegroups, -- Node group attribute if set
- attribute_type_id integer -- Attribute type identifier
- REFERENCES slice_attribute_types NOT NULL,
+ tag_type_id integer REFERENCES tag_types NOT NULL, -- Attribute type identifier
value text
) WITH OIDS;
CREATE INDEX slice_attribute_slice_id_idx ON slice_attribute (slice_id);
CREATE OR REPLACE VIEW view_nodegroups AS
SELECT
nodegroups.*,
-node_tag_types.tagname,
+tag_types.tagname,
COALESCE((SELECT conf_file_ids FROM nodegroup_conf_files
WHERE nodegroup_conf_files.nodegroup_id = nodegroups.nodegroup_id), '{}')
AS conf_file_ids,
COALESCE((SELECT node_ids FROM nodegroup_nodes
WHERE nodegroup_nodes.nodegroup_id = nodegroups.nodegroup_id), '{}')
AS node_ids
-FROM nodegroups INNER JOIN node_tag_types USING (node_tag_type_id);
+FROM nodegroups INNER JOIN tag_types USING (tag_type_id);
CREATE OR REPLACE VIEW view_conf_files AS
SELECT
slice_attribute.slice_id,
slice_attribute.node_id,
slice_attribute.nodegroup_id,
-slice_attribute_types.attribute_type_id,
-slice_attribute_types.name,
-slice_attribute_types.description,
-slice_attribute_types.min_role_id,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
slice_attribute.value
FROM slice_attribute
-INNER JOIN slice_attribute_types USING (attribute_type_id);
+INNER JOIN tag_types USING (tag_type_id);
CREATE OR REPLACE VIEW view_sessions AS
SELECT