sdn-sense / sense-o-py-client

Other
0 stars 3 forks source link

Possible to reserve/commit service that is in CANCEL-READY via NBI? #3

Closed disprosium8 closed 3 years ago

disprosium8 commented 4 years ago

Track sub task 4a of #1

Also refer to #11 for potential change of plan.


Original:

Attempting to re-initialize an existing service after terminate or cancel. Release/terminate on READY service does work via NBI, but can't force re-init or reinstate afterwards. Is there a way to do this?

endpoint = '/sense/service/89239501-d8c0-4f14-97fa-2c0a9afc0dce/reserve'
url = f"{api_url}/{endpoint}"
res = requests.put(url, headers=api_call_headers, verify=False)
print (res.text, res.status_code)
print ('='*100)
Request unacceptable under status:CANCEL - READY
xi-yang commented 4 years ago

All operations are not exposed to SENSE NBI. But you can use the raw service API. Refer to: https://github.com/xi-yang/StackV.devops/tree/master/testing/scripts

To force retry:

PUT /service/$SVC_INSTANCE_ID/propagate_forcedretry then PUT /service/$SVC_INSTANCE_ID/commit_forced

A new version of code will expose internal exception messages to the REST response body. I hope the client lib can interpret those and provide more meaningful feedback upon failures.