address.delete()
# Logging variables
- self.object_ids = [address['address_id']]
+ self.event_objects = {'Address': [address['address_id']]}
self.message = 'Address %d deleted' % address['address_id']
return 1
raise PLCInvalidArgument, "No such address type"
address_type = address_types[0]
address_type.delete()
- self.object_ids = [address_type['address_type_id']]
+ self.event_objects = {'AddressType': [address_type['address_type_id']]}
return 1
raise PLCPermissionDenied, "Address must be associated with one of your sites"
address.remove_address_type(address_type)
- self.object_ids = [address['address_id']]
+ self.event_objects = {'Address' : [address['address_id']],
+ 'AddressType': [address_type['address_type_id']]}
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Node'
-
-
def call(self, auth, conf_file_id, node_id_or_hostname):
# Get configuration file
conf_files = ConfFiles(self.api, [conf_file_id])
conf_file.remove_node(node)
# Log affected objects
- self.object_ids = [conf_file_id, node['node_id']]
+ self.event_objects = {'ConfFile': [conf_file_id],
+ 'Node': [node['node_id']]}
return 1
conf_file.remove_nodegroup(nodegroup)
# Log affected objects
- self.object_ids = [conf_file_id, nodegroup['nodegroup_id']]
+ self.event_objects = {'ConfFile': [conf_file_id],
+ 'NodeGroup': [nodegroup['nodegroup_id']]}
return 1
key.delete()
# Logging variables
- self.object_ids = [key['key_id']]
+ self.event_objects = {'Key': [key['key_id']]}
self.message = 'Key %d deleted' % key['key_id']
return 1
message = messages[0]
message.delete()
- self.object_ids = [message['message_id']]
+ self.event_objects = {'Message': [message['message_id']]}
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Node'
-
-
def call(self, auth, node_id_or_hostname):
# Get account information
nodes = Nodes(self.api, [node_id_or_hostname])
node.delete()
# Logging variables
- self.object_ids = [node['node_id']]
+ self.event_objects = {'Node': [node['node_id']]}
self.message = "Node %d deleted" % node['node_id']
return 1
nodegroup.remove_node(node)
# Logging variables
- self.object_ids = [nodegroup['nodegroup_id']]
+ self.event_objects = {'NodeGroup': [nodegroup['nodegroup_id']],
+ 'Node': [node['node_id']]}
self.message = 'node %d deleted from node group %d' % \
(node['node_id'], nodegroup['nodegroup_id'])
returns = Parameter(int, '1 if successful')
- object_type = 'Node'
-
-
def call(self, auth, node_id_or_hostname, pcu_id):
# Get node
nodes = Nodes(self.api, [node_id_or_hostname])
pcu.remove_node(node)
# Logging variables
- self.object_ids = [pcu['pcu_id']]
+ self.event_objects = {'PCU': [pcu['pcu_id']],
+ 'Node': [node['node_id']]}
self.message = 'Node %d removed from PCU %d' % \
(node['node_id'], pcu['pcu_id'])
nodegroup.delete()
# Logging variables
- self.object_ids = [nodegroup['nodegroup_id']]
+ self.event_objects = {'NodeGroup': [nodegroup['nodegroup_id']]}
self.message = 'Node group %d deleted' % nodegroup['nodegroup_id']
return 1
nodenetwork.delete()
# Logging variables
- self.object_ids = [nodenetwork['nodenetwork_id']]
+ self.event_objects = {'NodeNetwork': [nodenetwork['nodenetwork_id']]}
self.message = "Node network %d deleted" % nodenetwork['nodenetwork_id']
return 1
pcu.delete()
# Logging variables
- self.object_ids = [pcu['pcu_id']]
+ self.event_objects = {'PCU': [pcu['pcu_id']]}
self.message = 'PCU %d deleted' % pcu['pcu_id']
return 1
peer.delete()
# Log affected objects
- self.object_ids = [peer['peer_id']]
+ self.event_objects = {'Peer': [peer['peer_id']]}
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Person'
-
-
def call(self, auth, person_id_or_email):
# Get account information
persons = Persons(self.api, [person_id_or_email])
person.delete()
# Logging variables
- self.object_ids = [person['person_id']]
+ self.event_objects = {'Person': [person['person_id']]}
self.message = 'Person %d deleted' % person['person_id']
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Site'
-
-
def call(self, auth, person_id_or_email, site_id_or_login_base):
# Get account information
persons = Persons(self.api, [person_id_or_email])
site.remove_person(person)
# Logging variables
- self.object_ids = [site['site_id']]
+ self.event_objects = {'Site': [site['site_id']],
+ 'Person': [person['person_id']]}
self.message = 'Person %d deleted from site %d ' % \
(person['person_id'], site['site_id'])
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
-
def call(self, auth, person_id_or_email, slice_id_or_name):
# Get account information
persons = Persons(self.api, [person_id_or_email])
if slice['slice_id'] in person['slice_ids']:
slice.remove_person(person)
- self.object_ids = [slice['slice_id']]
+ self.event_objects = {'Slice': [slice['slice_id']],
+ 'Person': [person['person_id']]}
return 1
role = roles[0]
role.delete()
- self.object_ids = [role['role_id']]
+ self.event_objects = {'Role': [role['role_id']]}
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Person'
-
-
def call(self, auth, role_id_or_name, person_id_or_email):
# Get role
roles = Roles(self.api, [role_id_or_name])
person.remove_role(role)
# Logging variables
- self.object_ids = [person['person_id']]
+ self.event_objects = {'Person': [person['person_id']],
+ 'Role': [role['role_id']]}
self.message = "Role %d revoked from person %d" % \
(role['role_id'], person['person_id'])
returns = Parameter(int, '1 if successful')
- object_type = 'Site'
-
-
def call(self, auth, site_id_or_login_base):
# Get account information
sites = Sites(self.api, [site_id_or_login_base])
site.delete()
# Logging variables
- self.object_ids = [site['site_id']]
+ self.event_objects = {'Site': [site['site_id']]}
self.message = 'Site %d deleted' % site['site_id']
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
-
def call(self, auth, slice_id_or_name):
slices = Slices(self.api, [slice_id_or_name])
if not slices:
raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
slice.delete()
- self.object_ids = [slice['slice_id']]
+ self.event_objects = {'Slice': [slice['slice_id']]}
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
-
def call(self, auth, slice_attribute_id):
slice_attributes = SliceAttributes(self.api, [slice_attribute_id])
if not slice_attributes:
raise PLCPermissioinDenied, "Not allowed to delete the specified attribute"
slice_attribute.delete()
- self.object_ids = [slice_attribute['slice_attribute_id']]
+ self.event_objects = {'SliceAttribute': [slice_attribute['slice_attribute_id']]}
return 1
attribute_type = attribute_types[0]
attribute_type.delete()
- self.object_ids = [attribute_type['attribute_type_id']]
+ self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Node'
-
-
def call(self, auth, slice_id_or_name, node_id_or_hostname_list):
# Get slice information
slices = Slices(self.api, [slice_id_or_name])
slice.sync()
- self.object_ids = [node['node_id'] for node in nodes]
+ self.event_objects = {'Node': [node['node_id'] for node in nodes],
+ 'Slice': [slice['slice_id']]}
return 1
Body = body)
# Logging variables
- self.object_type = "Person"
- self.object_ids = [person['person_id'] for person in persons]
+ self.event_objects = {'Person': [person['person_id'] for person in persons]}
self.message = subject
return 1
returns = Parameter(int, '1 if successful')
- object_type = 'Node'
-
def call(self, auth, node_id_or_hostname):
# Get account information
nodes = Nodes(self.api, [node_id_or_hostname])
# Ignore socket errors
pass
+ self.event_objects = {'Node': [node['node_id']]}
self.message = "RebootNode called"
return 1
returns = Parameter(int, '1 if verification_key is valid')
- object_type = 'Person'
-
def call(self, auth, person_id_or_email, verification_key = None, verification_expires = None):
# Get account information
persons = Persons(self.api, [person_id_or_email])
print >> log, "Warning: No message template '%s'" % message_id
# Logging variables
- self.object_ids = [person['person_id']]
+ self.event_objects = {'Person': [person['person_id']]}
self.message = message_id
return 1
returns = Parameter(int, 'New slice_id (> 0) if successful')
- object_type = 'Slice'
-
def call(self, auth, name, slice_fields = {}):
slice_fields['name'] = name
return AddSlice.call(self, auth, slice_fields)
returns = Parameter(int, 'Returns 1 if successful, a fault otherwise.')
- object_type = 'Slice'
-
-
def call(self, auth, slice_name):
return DeleteSlice.call(self, auth, slice_name)
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
-
-
-
def call(self, auth, slice_name, nodes_list):
return AddSliceToNodes.call(self, auth, slice_name, nodes_list)
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
-
-
-
def call(self, auth, slice_name, nodes_list):
return DeleteSliceFromNodes.call(self, auth, slice_name, nodes_list)
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
def call(self, auth, slice_name, slice_expires):
slice_fields = {}
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
def call(self, auth, slice_name, url, description):
slice_fields = {}
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
def call(self, auth, slice_name, user_list):
for user in user_list:
returns = Parameter(int, '1 if successful')
- object_type = 'Slice'
-
def call(self, auth, slice_name, user_list):
for user in user_list:
DeletePersonFromSlice.call(self, auth, user, slice_name)