Share via


Delete a Subscription for a Notification

 

Applies To: Windows Azure Pack

Used by the Service Management API to notify a resource provider that a subscription to a plan is to be deleted. This allows the resource provider to do any internal work needed to delete the subscription before the Service Management API deletes the subscription. Every resource provider that uses the subscription will receive the deletion request. The Service Management API will not delete the subscription until every resource provider completes its subscription deletion operations.

Request

Replace <NotificationEndpoint> with the endpoint address for the Windows Azure Pack Custom Resource Provider Notification REST API. Replace <Id> with the identifier of the subscription to delete.

Method

Request URI

HTTP version

DELETE

http://<NotificationEndpoint>/subscriptions/<Id>

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes required and optional request headers.

Request header

Description

Authorization: Basic

Required. The basic authorization token.

x-ms-principal-id

Required. The principal identifier.

x-ms-client-request-id

Optional. The client request identifier.

x-ms-client-session-id

Optional. The client session identifier.

x-ms-principal-liveid

Optional. The principal Live identifier.

Request Body

None.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

Return status code 200 (OK) if the operation is successful. Status code 202 can be returned if the operation is running asynchronously.

For information about status codes, see Status and Error Codes (Windows Azure Pack Service Management).

Response Headers

The response for this operation includes standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Body

None.

Example

The following code example shows a Delete Subscription request.

DELETE https://<NotificationEndpoint>/subscriptions/685a05ed-3a6f-4c3a-b70c-924a1307834f HTTP/1.1
Referer: https://<Computer>:30004/subscriptions/685a05ed-3a6f-4c3a-b70c-924a1307834f
Accept-Language: en-US
x-ms-client-request-id: d736255e-1e94-4193-b91c-858ff2ab2094-2013-07-25 06:15:02Z
x-ms-client-session-id: be02e255-38de-4e86-9690-b3a3e3037e4c
x-ms-principal-id: <COMPUTER>\Administrator
x-ms-principal-liveid: <COMPUTER>\Administrator
x-ms-request-id: 4df159a4ade947f784b8547f7f073c6b.2013-07-25T06:15:04.0804669Z
Authorization: Basic <encoded username and password>
Host: <Computer>:30010
Content-Length: 0

Remarks

When calling TBD, the Service Management API waits one minute for a response. If no response is received the subscription is marked as being out of synchronization.

Asynchronous operations are supported. If the delete operation will take more than a minute to complete, the resource provider can return 202 (Accepted) and set its internal representation of Subscription (Notification Endpoint Object).LifecycleState to Deleting. Once the resource provider has completed the delete operation, it should set its representation of Subscription (Notification Endpoint Object).LifecycleState to Deleted .The Service Management API will check Subscription (Notification Endpoint Object).LifecycleState for operation completion every 10 seconds using TBD.

See Also

Windows Azure Pack Custom Resource Provider Notification REST API Reference