from PLC.Keys import Key, Keys
from PLC.Persons import Person, Persons
from PLC.Auth import Auth
+from PLC.SFA import SFA
can_update = lambda (field, value): field in ['key_type','key']
person.add_key(key, commit = True)
# Logging variables
- self.event_objects = {'Person': [person['person_id']],
- 'Key': [key['key_id']]}
- self.message = 'Key %d added to person %d' % \
- (key['key_id'], person['person_id'])
+ self.event_objects = {'Person': [person['person_id']],
+ 'Key': [key['key_id']]}
+ self.message = 'Key %d added to person %d' % \
+ (key['key_id'], person['person_id'])
+ # sync with the geni db
+ sfa = SFA()
+ sfa.update_record(person, 'person')
+
return key['key_id']
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
from PLC.Auth import Auth
+from PLC.SFA import SFA
can_update = lambda (field, value): field in \
['name', 'abbreviated_name', 'login_base',
site = Site(self.api, site_fields)
site.sync()
- # Logging variables
- self.event_objects = {'Site': [site['site_id']]}
+ # Logging variables
+ self.event_objects = {'Site': [site['site_id']]}
self.message = 'Site %d created' % site['site_id']
- return site['site_id']
+ sfa = SFA()
+ sfa.update_record(site, 'site', site['login_base'])
+
+ return site['site_id']
from PLC.SliceTags import SliceTags
from PLC.Methods.AddSliceTag import AddSliceTag
from PLC.Methods.UpdateSliceTag import UpdateSliceTag
+from PLC.SFA import SFA
can_update = ['name', 'instantiation', 'url', 'description', 'max_nodes']
else:
UpdateSliceTag(self.api).__call__(auth,slice_tags[0]['slice_tag_id'],value)
- self.event_objects = {'Slice': [slice['slice_id']]}
+ self.event_objects = {'Slice': [slice['slice_id']]}
self.message = "Slice %d created" % slice['slice_id']
-
+
+ sfa = SFA()
+ sfa.update_record(slice, 'slice', site['login_base'])
return slice['slice_id']
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Auth import Auth
+from PLC.SFA import SFA
class DeletePerson(Method):
"""
person.delete()
- # Logging variables
- self.event_objects = {'Person': [person['person_id']]}
- self.message = 'Person %d deleted' % person['person_id']
+ # Logging variables
+ self.event_objects = {'Person': [person['person_id']]}
+ self.message = 'Person %d deleted' % person['person_id']
+
+ sfa = SFA()
+ sfa.delete_record(person, 'person')
return 1
from PLC.Nodes import Node, Nodes
from PLC.PCUs import PCU, PCUs
from PLC.Auth import Auth
+from PLC.SFA import SFA
class DeleteSite(Method):
"""
site.delete()
- # Logging variables
- self.event_objects = {'Site': [site['site_id']]}
- self.message = 'Site %d deleted' % site['site_id']
+ # Logging variables
+ self.event_objects = {'Site': [site['site_id']]}
+ self.message = 'Site %d deleted' % site['site_id']
+ sfa = SFA()
+ sfa.delete_record(site, 'site')
+
return 1
from PLC.Parameter import Parameter, Mixed
from PLC.Slices import Slice, Slices
from PLC.Auth import Auth
+from PLC.SFA import SFA
class DeleteSlice(Method):
"""
slice.delete()
self.event_objects = {'Slice': [slice['slice_id']]}
+ sfa = SFA()
+ sfa.delete_record(slice, 'slice')
+
return 1