When there is a need to remove a resource, a REST DELETE request should be sent to the /aps/2/resources/{ID}
URL of the APS controller, where {ID} is the resource ID.
The controller, in turn, will request the unprovision method on the application service by forwarding
the DELETE request to the URL similar to https://endpoint/service1/{ID}
, where service1 is
the application service responsible for the resource type and ID represents
the identifier of the APS resource that must be deleted.
An application can remove a requested resource synchronously (within a few seconds) or may request the APS controller to switch to the asynchronous mode, similar to the algorithm described in the Provisioning Resources document.
In this document:
The DELETE operation sent from a user requires the APS controller to resend it to the APS application endpoint as in the following diagram.
Examples of the REST messages are presented below.
Request to the APS controller:
DELETE /aps/2/resources/7ab1be46-a02c-414c-a44a-88b199ba9047
Request from the APS controller to the application service, assuming that /vpscloud/
represents the application
endpoint base URL and vpses
is the resource factory (application service):
DELETE /vpscloud/vpses/7ab1be46-a02c-414c-a44a-88b199ba9047
Response from the application service to the APS controller:
HTTP/1.1 204 No Content
Response from the APS controller:
HTTP/1.1 204 No Content
If the application cannot remove the requested resource immediately, it can return the 202 Accepted code to request more time for completion.
The APS controller changes the resource status to aps:deleted
and requests the task manager
to schedule a task triggering the next request for the DELETE operation.
This continues until the application returns the 204 No Content status to the APS controller.