Updated on 2023-06-29 GMT+08:00

Updating a Backend Instance

Function

Update the backend instance of a specified VPC channel. During the update, the transferred request parameters are used to overwrite the backend instances of the corresponding cloud service group. If you do not specify the modified cloud server group, perform full overwriting.

URI

PUT /v2/{project_id}/apic/instances/{instance_id}/vpc-channels/{vpc_channel_id}/members

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Appendix > Obtaining a Project ID in the ROMA Connect API Reference.

instance_id

Yes

String

Instance ID.

vpc_channel_id

Yes

String

VPC channel ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

members

No

Array of MemberInfo objects

Backend server list.

member_group_name

No

String

Backend server group to be modified.

If this parameter is not passed, use the definition in members to fully overwrite the backend of the VPC channel.

When this parameter is passed, only the backend instance of the corresponding backend server group in members are processed. Input parameters of other backend server groups are ignored. For example, if member_group_name is set to primary, only backend instances whose backend server group is 105c6902457144a4820dff8b1ad63331 in members are processed.

Table 4 MemberInfo

Parameter

Mandatory

Type

Description

host

No

String

Backend server address.

This parameter is valid when the member type is IP address.

Maximum: 64

weight

No

Integer

Backend server weight.

The higher the weight is, the more requests a cloud server will receive.

It is valid only when the VPC channel type is set to 2.

Minimum: 0

Maximum: 10000

is_backup

No

Boolean

Indicates whether it is a standby node.

After this parameter is enabled, the corresponding backend service functions as the standby node and works only when all non-standby nodes are faulty.

The instance must be upgraded to the corresponding version to support this function. If the instance does not support this function, contact technical support.

Default: false

member_group_name

No

String

Name of the backend server group. Select a server group for the backend service address so that the backend addresses of the corresponding server group can be changed in a unified manner.

status

No

Integer

Backend server status.

  • 1: available

  • 2: unavailable

port

No

Integer

Backend server port.

Minimum: 0

Maximum: 65535

ecs_id

No

String

Backend ECS ID

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), and underscores (_) (max. 64 characters).

Maximum: 255

ecs_name

No

String

Backend ECS name

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), underscores (_), and periods (.) (max. 64 characters).

Maximum: 64

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

size

Integer

Length of the returned resource list.

total

Long

Number of resources that match the query conditions.

members

Array of VpcMemberInfo objects

Backend server group ID.

Table 6 VpcMemberInfo

Parameter

Type

Description

host

String

Backend server address.

This parameter is valid when the member type is IP address.

Maximum: 64

weight

Integer

Backend server weight.

The higher the weight is, the more requests a cloud server will receive.

It is valid only when the VPC channel type is set to 2.

Minimum: 0

Maximum: 10000

is_backup

Boolean

Indicates whether it is a standby node.

After this parameter is enabled, the corresponding backend service functions as the standby node and works only when all non-standby nodes are faulty.

The instance must be upgraded to the corresponding version to support this function. If the instance does not support this function, contact technical support.

Default: false

member_group_name

String

Name of the backend server group. Select a server group for the backend service address so that the backend addresses of the corresponding server group can be changed in a unified manner.

status

Integer

Backend server status.

  • 1: available

  • 2: unavailable

port

Integer

Backend server port.

Minimum: 0

Maximum: 65535

ecs_id

String

Backend ECS ID

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), and underscores (_) (max. 64 characters).

Maximum: 255

ecs_name

String

Backend ECS name

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), underscores (_), and periods (.) (max. 64 characters).

Maximum: 64

id

String

VPC channel list.

vpc_channel_id

String

Backend instance ID.

create_time

String

VPC channel ID.

member_group_id

String

Time when the backend server is added to the VPC channel.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

  • Update information about a non-standby backend instance of a VPC channel.

    {
      "member_group_name" : "primary",
      "members" : [ {
        "host" : "192.168.2.25",
        "weight" : 1,
        "is_backup" : false,
        "member_group_name" : "primary"
      } ]
    }
  • Fully update backend instance information of a VPC channel.

    {
      "members" : [ {
        "ecs_id" : "1082720c-3c15-409c-9ae3-4983ddfb6a9d",
        "ecs_name" : "APIGtest02",
        "weight" : 2
      } ]
    }

Example Responses

Status code: 200

OK

  • Example 1

    {
      "total" : 1,
      "size" : 1,
      "members" : [ {
        "host" : "192.168.2.25",
        "weight" : 1,
        "is_backup" : false,
        "member_group_name" : "primary",
        "port" : 22,
        "status" : 1,
        "ecs_id" : "192.168.2.25",
        "ecs_name" : "192.168.2.25",
        "id" : "683b6807cad54122a6777ad047a6178e",
        "vpc_channel_id" : "56a7d7358e1b42459c9d730d65b14e59",
        "create_time" : "2020-07-23T09:13:24Z",
        "member_group_id" : "631b551cddda40478ef720163a9412ed"
      } ]
    }
  • Example 2

    {
      "total" : 1,
      "size" : 1,
      "members" : [ {
        "host" : "192.168.0.17",
        "weight" : 2,
        "is_backup" : false,
        "member_group_name" : "primary",
        "port" : 22,
        "status" : 1,
        "ecs_id" : "1082720c-3c15-409c-9ae3-4983ddfb6a9d",
        "ecs_name" : "APIGtest02",
        "id" : "5c868f0224084710a1e188b7d3057c52",
        "vpc_channel_id" : "105c6902457144a4820dff8b1ad63331",
        "create_time" : "2020-07-23T09:03:53Z",
        "member_group_id" : "631b551cddda40478ef720163a9412ed"
      } ]
    }

Status code: 400

Bad Request

{
  "error_code" : "APIG.2004",
  "error_msg" : "The parameter value is outside the allowable range,parameterName:weight. Please refer to the support documentation"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "APIG.3023",
  "error_msg" : "The VPC channel does not exist,id:56a7d7358e1b42459c9d730d65b14e59"
}

Status code: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.