Take over ownership of historical computing resources¶
Register workspace ownership for historical computing resources. This operation is for controlled remediation and requires appropriate administrative rights.
POST $CLOUDSIGMA_API_BASE/compute-resources/{resource_id}/adopt-legacy-ownership
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First Query the computing resource details confirm that the target is a historical resource that needs to be repaired.
Set the operation-specific values used in the request:
$RESOURCE_ID: ID of the computing resource whose ownership is to be registered.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/compute-resources/$RESOURCE_ID/adopt-legacy-ownership" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Compute resource ID. |
Successful response¶
Returns 200 and registered ownership information on success.
{
"code": "OK",
"msg": "OK",
"data": {
"workspace_id": "ws-01",
"resource_type": "compute_resource",
"resource_id": "cr-01",
"owner_role_id": "role-owner",
"authorized_role_id": "role-admin",
"status": "active",
"ownership_version": 1,
"idempotent_replay": false
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
ID of the workspace to which the resource belongs. |
|
string |
Resource type. |
|
string |
Computing resource ID. |
|
string |
Owner role ID. |
|
string |
This authorization role ID. |
|
string |
Ownership record status. |
|
integer |
Ownership version number. |
|
boolean |
Whether the replay is idempotent. |
Error response¶
{
"code": "ADOPT_LEGACY_OWNERSHIP_FAILED",
"msg": "服务器内部错误",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
— |
Missing or invalid access credentials. |
Check the regional endpoint, API key, and workspace ID. |
|
|
The current identity does not have permission to perform historical ownership restoration. |
Contact the administrator to confirm remediation permissions and target resources. |
|
|
The computing resource does not exist or does not belong to the current workspace. |
Check |
|
|
The server failed to register ownership. |
Contact the administrator after recording the request time and error message. |