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.

HTTP
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

Shell
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

resource_id

string

Yes

Compute resource ID.

Successful response

JSON
{
  "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

code

string

OK on success.

msg

string

OK on success.

data

object

response data.

data.workspace_id

string

The workspace ID to which the resource belongs.

data.resource_type

string

Resource type.

data.resource_id

string

Compute resource ID.

data.owner_role_id

string

Owner role ID.

data.authorized_role_id

string

This authorization role ID.

data.status

string

Ownership record status.

data.ownership_version

integer

Ownership version number.

data.idempotent_replay

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.

JSON
{
  "code": "OWNERSHIP_REPAIR_FAILED",
  "msg": "服务器内部错误",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

Empty on error.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

INVALID_PARAMS

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

ErrForbidden

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

NOT_FOUND

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

500

OWNERSHIP_REPAIR_FAILED

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

OWNERSHIP_REPAIR_FAILED, OWNERSHIP_REPAIR_UNAVAILABLE, ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on