Cancel data subscription¶
Cancel an accepted data subscription. Upon success, the subscription database in the target workspace is deleted and the subscription record is restored to a reacceptable invitation.
POST $CLOUDSIGMA_API_BASE/data-share/subscriptions/{id}/unsubscribe
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the data subscription list and confirm the subscription to be canceled.
Set the operation-specific values used in the request:
$SUBSCRIPTION_ID: The subscription ID to be canceled, taken from the response of query data subscription list.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/data-share/subscriptions/$SUBSCRIPTION_ID/unsubscribe" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameters |
Type |
Description |
|---|---|---|
|
integer |
A subscription ID greater than |
Successful response¶
Returns 200 on success, data is null.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
Fixed to |
Error response¶
{
"code": "ErrSubscriptionNotFound",
"msg": "数据订阅不存在",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Use the ID from the subscription list. |
|
|
The current identity does not have the permission to delete subscriptions. |
Request permission to delete data subscriptions. |
|
|
The subscription does not exist or does not belong to the current workspace. |
Verify subscription ID and workspace. |
|
|
The subscription status has changed and cannot be canceled at this time. |
Refresh the subscription list and try again. |
|
|
Data sharing and writing are temporarily under maintenance or migration access. |
Try again later. |
|
|
The server failed to cancel the subscription. |
Try again later. |
Follow-up operations¶
Query data subscription list, confirm that the status of the record has been restored to a re-acceptable subscription invitation.