Create the sliver[s] (slice) at this aggregate.
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 ""
reg_objects = __get_registry_objects(slice_xrn, creds, users)
- hrn, type = urn_to_hrn(slice_xrn)
+ (hrn, type) = urn_to_hrn(slice_xrn)
peer = None
slices = Slices(api)
peer = slices.get_peer(hrn)
api.plshell.BindObjectToPeer(api.plauth, 'slice', slice.id, peer,
slice.peer_id)
- # print network.toxml()
-
- return True
+ # xxx - check this holds enough data for the client to understand what's happened
+ return network.toxml()
def renew_slice(api, xrn, creds, expiration_time):
# XX not implemented at this interface
return 1
-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: