创建虚拟服务器组并向指定的服务器组中添加后端服务器。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
slb:CreateVServerGroup |
create |
Instance
*LoadBalancer
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Tag |
array<object> |
否 |
标签列表。 |
|
|
object |
否 |
标签列表。 |
||
| Key |
string |
否 |
资源的标签键。N 的取值范围:1~20。一旦输入该值,则不允许为空字符串。 最多支持 64 个字符,不能以 |
TestKey |
| Value |
string |
否 |
资源的标签值。N 的取值范围:1~20。一旦输入该值,可以为空字符串。
最多支持 128 个字符,不能以 |
TestValue |
| RegionId |
string |
是 |
传统型负载均衡地域 ID。 |
cn-hangzhou |
| LoadBalancerId |
string |
是 |
传统型负载均衡实例 ID。 |
lb-bp1qjwo61pqz3ahl****** |
| VServerGroupName |
string |
否 |
虚拟服务器组名称。 长度限制为 1~80 个字符,支持中文、字母、数字、短划线(-)、正斜线(/)、英文句点(.)和下划线(_)。 |
Group1 |
| BackendServers |
string |
否 |
要添加的后端服务器列表,包含以下参数:
说明
只有性能保障型实例支持添加 eni 和 eci 类型的后端服务器。
示例说明如下:
说明
必须是状态为运行中的后端服务器才可以加入负载均衡实例,每次调用最多可添加 20 个后端服务器。 |
[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port":"80","Description":"test-113" }] |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| VServerGroupId |
string |
后端服务器组 ID。 |
rsp-cige6****** |
| RequestId |
string |
请求 ID。 |
9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C |
| BackendServers |
object |
||
| BackendServer |
array<object> |
后端服务器列表。 |
|
|
object |
后端服务器列表。 |
||
| Type |
string |
后端服务器类型,取值:
|
eni |
| Weight |
integer |
后端服务器的权重。 |
100 |
| Description |
string |
后端服务器组描述。 |
vServer group |
| Port |
integer |
后端服务器使用的端口。 |
70 |
| ServerId |
string |
ECS 实例 ID 或 ENI 实例 ID。 |
eni-hhshhs**** |
示例
正常返回示例
JSON格式
{
"VServerGroupId": "rsp-cige6******",
"RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
"BackendServers": {
"BackendServer": [
{
"Type": "eni",
"Weight": 100,
"Description": "vServer group",
"Port": 70,
"ServerId": "eni-hhshhs****"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | LBNotSupportIpv6Backend | The specified loadbalancer does not support ipv6 backend. | |
| 400 | Mismatched.ZoneId | The zone of the server is not matched with the cloud box loadbalancer. | 当前服务器的可用区与云盒实例可用区不匹配。 |
| 400 | InvalidBackendServers.ServerIpConflict | %s. | 存在相同TunnelId和RsIp配置的后端服务器。 |
| 400 | OperationUnsupported.CreateVServerGroup | This type of backend server is not allowed to attached to singleTunnel or anyTunnel lb. | SingleTunnel和AnyTunnel类型负载均衡实例不支持指定类型的后端服务器。 |
| 400 | IncorrectStatus.RSByPassToas | %s. | 指定后端服务器的BypassToa配置无效。 |
| 400 | BackendServer.InvalidType | The specified Type is invalid. | 后端服务器类型非法。 |
| 400 | BackendServer.ServerRegionIdNotEqual | The specified ServerRegionId must be equal. | 后端服务器必须属于同一个地域。 |
| 400 | OperationFailed.InvalidCen | The cen related with this loadbalancer is invalid. | 操作失败,原因是指定负载均衡实例关联的Cen信息缺失。 |
| 400 | IncorrectStatus.CenNotAssociated | The action is invalid because the loadbalancer is not associated with cen. | 该操作无效,因为当前负载均衡实例未与cen关联。 |
| 400 | InvalidBackendServers.MissingCenBandWidth | The bandwidth is missing between loadbalancer and backendServers in cen. | Cen中的负载均衡实例所在的地域和挂载的目标地域之间要有带宽包。 |
| 400 | InvalidBackendServers.VpcNotInCen | The BackendServers is not in the cen associated with the loadbalancer. | 后端服务器不在与负载均衡关联的cen中。 |
| 400 | InvalidServerId.NotExist | The specified ServerId is not exist. | 指定的后端服务器不存在。 |
| 400 | MissingParameter.ServerRegionId | The parameter ServerRegionId is required. | 参数ServerRegionId缺失。 |
| 400 | MissingParameter.VbrId | The parameter VbrId is required. | 参数VbrId缺失。 |
| 400 | InvalidParameter.ServerRegionId | The parameter ServerRegionId is invalid for crossborder. | 指定的ServerRegionId无效。请检查参数约束,并在修改后重试。 |
| 400 | InvalidVbrId.NotInCen | The VbrId is not in the cen associated with the loadbalancer. | 指定的Vbr不在实例关联的Cen内。 |
| 400 | InvalidParameter.ZoneNotSupport | The zone does not support the parameter %s. | 当前可用区不支持指定参数。 |
| 400 | NetworkConflict | %s. | 虚拟服务器组和ECS配置信息不一致。 |
| 400 | InvalidParam.TagValue | %s. | |
| 400 | InvalidParam.TagKey | %s. | |
| 400 | SizeLimitExceeded.Tag | %s. | |
| 400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. | |
| 400 | VpcSystemBusy | Invoke vpc system busy, please retry later. | |
| 400 | OperationFailed.Endpoint | The operation failed because of the RegionId is unavailable in this endpoint. | endpoint 错误 |
| 403 | UnauthorizedRegion | The specified region of is not authorized. | 指定地域不可见。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。