'hrn':xrn.get_hrn(),
})
-def delete_slice(api, xrn, creds):
- hrn, type = urn_to_hrn(xrn)
+def DeleteSliver(api, xrn, creds, call_id):
+ if Callids().already_handled(call_id): return ""
+ (hrn, type) = urn_to_hrn(xrn)
slicename = hrn_to_pl_slicename(hrn)
slices = api.plshell.GetSlices(api.plauth, {'name': slicename})
if not slices:
api.plshell.DeleteSliceFromNodes(api.plauth, slicename, slice['node_ids'])
return 1
-def create_slice(api, xrn, creds, xml, users, call_id):
+def CreateSliver(api, xrn, creds, xml, users, call_id):
"""
Verify HRN and initialize the slice record in PLC if necessary.
"""
- if Callids().already_handled(call_id): return False
+ if Callids().already_handled(call_id): return ""
hrn, type = urn_to_hrn(xrn)
peer = None
api.plshell.DeleteSliceFromNodes(api.plauth, slice.name, deleted_nodes)
network.updateSliceTags()
- # print network.toxml()
-
- return True
+ # xxx - check this holds enough data for the client to understand what's happened
+ return network.toxml()
def ListResources(api, creds, options,call_id):
if Callids().already_handled(call_id): return ""
f = open(sys.argv[1])
xml = f.read()
f.close()
- create_slice(api, "plc.princeton.iias", xml, 'call-id-iias')
+ CreateSliver(api, "plc.princeton.iias", xml, 'call-id-iias')
if __name__ == "__main__":
main()