Take over ownership of historical compute resources¶
Register workspace ownership for historical computing instances. Only super_admin of the workspace can be called, and this operation does not transfer the owner.
POST $CLOUDSIGMA_API_BASE/compute-resources/{resource_id}/adopt-legacy-ownership
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region.
Confirm that the current role is super_admin in the workspace.
First Query the computing instance details to confirm that the target is a historical resource that needs to be repaired. Prepare the personal access token, target workspace ID, and computing resource ID that can access the target workspace.
Request parameters¶
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"
Registration uses the current trusted role and no other owners can be specified. The request ID and tracking ID are subject to server records. When the same and valid ownership record already exists, the original result can be returned.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Compute resource ID. |
Successful response¶
{
"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
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
response data. |
|
string |
The workspace ID to which the resource belongs. |
|
string |
Resource type. |
|
string |
Compute 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¶
When there are other owners, or the ownership record is inactive or duplicate, the interface rejects the request.
{
"code": "OWNERSHIP_REPAIR_FAILED",
"msg": "服务器内部错误",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
Empty on error. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |