Updated on 2025-02-13 GMT+08:00

Modifying Source Server Information

Function

This API is used to modify the information of a source server in SMS to facilitate server management.

Calling Method

For details, see Calling APIs.

URI

PUT /v3/sources/{source_id}

Table 1 Path parameter

Parameter

Mandatory

Type

Description

source_id

Yes

String

The ID of the source server in SMS.

Minimum length: 0 characters

Maximum length: 255 characters

Request

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

The user token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Minimum length: 1 character

Maximum length: 16,384 characters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

No

String

The new name of the source server.

Minimum length: 0 characters

Maximum length: 255 characters

migprojectid

No

String

The ID of the migration project to which the source server belongs after the modification.

Minimum length: 0 characters

Maximum length: 255 characters

disks

No

Array of PutDisk objects

The disk information.

Array length: 0 to 65,535

volume_groups

No

Array of PutVolumeGroups objects

The volume group information.

Array length: 0 to 65,535

Table 4 PutDisk field description

Parameter

Mandatory

Type

Description

need_migration

No

Boolean

The disk name.

Default value: true

id

Yes

String

The disk ID.

Minimum length: 0 characters

Maximum length: 255 characters

adjust_size

Yes

Long

The new size.

Minimum value: 0

Maximum value: 9223372036854775807

Default value: 0

physical_volumes

No

Array of PutVolume objects

The modified volume information.

Array length: 0 to 65,535

Table 5 PutVolume field description

Parameter

Mandatory

Type

Description

id

No

String

The database ID.

Minimum length: 0 characters

Maximum length: 255 characters

need_migration

No

Boolean

Indicates whether the volume needs to be migrated.

Default value: true

adjust_size

No

Long

The new size.

Minimum value: 0

Maximum value: 9223372036854775807

Default value: 0

Table 6 PutVolumeGroups field description

Parameter

Mandatory

Type

Description

logical_volumes

No

Array of PutLogicalVolume objects

The logical volume information.

Array length: 0 to 65,535

id

Yes

String

The volume group ID.

Minimum length: 0 characters

Maximum length: 255 characters

need_migration

No

Boolean

Indicates whether the volume needs to be migrated.

Default value: true

adjust_size

No

Long

The new size.

Minimum value: 0

Maximum value: 9223372036854775807

Default value: 0

Table 7 PutLogicalVolume field description

Parameter

Mandatory

Type

Description

id

Yes

String

The logical volume ID.

Minimum length: 0 characters

Maximum length: 255 characters

need_migration

No

Boolean

Indicates whether the volume needs to be migrated.

Default value: true

adjust_size

No

Long

The new size.

Minimum value: 0

Maximum value: 9223372036854775807

Default value: 0

Response

Status code: 200

Table 8 Response body parameters

Parameter

Type

Description

-

String

The information about the source server with a specified ID was modified successfully.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

The error code.

Minimum length: 0 characters

Maximum length: 255 characters

error_msg

String

The error message.

Minimum length: 0 characters

Maximum length: 255 characters

encoded_authorization_message

String

Encrypted authorization information.

Minimum length: 0 characters

Maximum length: 65,535 characters

error_param

Array of strings

Invalid parameter.

Minimum length: 0 characters

Maximum length: 65,535 characters

Array length: 1 to 20

details

Array of details objects

The error message.

Array length: 1 to 20

Table 10 details field description

Parameter

Type

Description

error_code

String

The SMS error code.

Minimum length: 0 characters

Maximum length: 65,535 characters

error_msg

String

The SMS error message.

Minimum length: 0 characters

Maximum length: 65,535 characters

Example Request

This example changes the name of the source server with ID dcdbe339-b02d-4578-95a1-9c9c547dxxxx to abcd.

PUT https://{endpoint}/v3/sources/dcdbe339-b02d-4578-95a1-9c9c547dxxxx

{
  "name" : "abcd"
}

Example Response

Status code: 403

Authentication failed.

{
  "error_code" : "SMS.9004",
  "error_msg" : "The current account does not have the permission to execute policy You do not have permission to perform action XXX on resource XXX.",
  "encoded_authorization_message" : "XXXXXX",
  "error_param" : [ "You do not have permission to perform action XXX on resource XXX." ],
  "details" : [ {
    "error_code" : "SMS.9004",
    "error_msg" : "You do not have permission to perform action XXX on resource XXX."
  } ]
}

Status Codes

Status Code

Description

200

The information about the source server with a specified ID was modified successfully.

403

Authentication failed.

Error Codes

For details, see Error Codes.