首页 负载均衡 传统型负载均衡CLB 开发参考 API参考 API目录 虚拟服务器组 CreateVServerGroup - 添加后端服务器组并添加后端服务器

CreateVServerGroup - 添加后端服务器组并添加后端服务器

更新时间: 2023-12-05 14:40:01

添加后端服务器组并向指定的后端服务器组中添加后端服务器。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
slb:CreateVServerGroupWrite
  • Instance
    acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId}
  • LoadBalancer
    acs:slb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
  • slb:tag

请求参数

名称类型必填描述示例值
Tagobject []

标签列表。

Keystring

资源的标签键。N的取值范围:1~20。一旦输入该值,则不允许为空字符串。

最多支持64个字符,不能以aliyunacs:开头,不能包含http://或者https://

TestKey
Valuestring

资源的标签值。N的取值范围:1~20。一旦输入该值,可以为空字符串。 最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

TestValue
RegionIdstring

传统型负载均衡地域ID。

cn-hangzhou
LoadBalancerIdstring

传统型负载均衡实例ID。

lb-bp1qjwo61pqz3ahl******
VServerGroupNamestring

虚拟服务器组名称。

长度限制为1~80个字符,支持中文、字母、数字、短划线(-)、正斜线(/)、英文句点(.)和下划线(_)。

Group1
BackendServersstring

需要添加的后端服务器。

取值:是一个Json string,其结构是一个JsonList。一次请求中,列表最多支持20个元素。

  • ServerId:String类型,必选,后端服务器实例ID,为ECS实例ID或者ENI实例ID。

  • Port:Integer类型,必选,后端服务器使用的端口,取值范围:1~65535

  • Weight:Integer类型,必选,后端服务器的权重,取值范围:0~100

  • **Description **:String类型,非必选,后端服务器描述,长度为1~80个字符,支持中文、字母、数字、短划线(-)、正斜线(/)、英文句点(.)和下划线(_)。

  • Type:String类型,表示后端服务器的实例类型,取值:

    • ecs:ECS实例(默认)。

    • eni:弹性网卡实例。

  • ServerIp:ECS或者ENI的实例IP。

示例说明如下:

  • 挂载ECS示例:

[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }]

  • 挂载ENI:

    [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" }]

  • 挂载ENI多IP:

[{ "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" }]

[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" }]

返回参数

名称类型描述示例值
object
VServerGroupIdstring

后端服务器组ID。

rsp-cige6******
RequestIdstring

请求ID。

9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C
BackendServersobject []

后端服务器列表。

Typestring

后端服务器类型,取值:

  • ecs:ECS实例(默认)。

  • eni:弹性网卡实例。

ecs
Weightinteger

后端服务器的权重。

100
Descriptionstring

后端服务器组描述。

后端服务器组
Portinteger

后端服务器使用的端口。

70
ServerIdstring

ECS实例ID或ENI实例ID。

vm-2****

示例

正常返回示例

JSON格式

{
  "VServerGroupId": "rsp-cige6******",
  "RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
  "BackendServers": {
    "BackendServer": [
      {
        "Type": "ecs",
        "Weight": 100,
        "Description": "后端服务器组",
        "Port": 70,
        "ServerId": "vm-2****"
      }
    ]
  }
}

错误码

HTTP status code错误码错误信息描述
400LBNotSupportIpv6BackendThe specified loadbalancer does not support ipv6 backend.-
400Mismatched.ZoneIdThe zone of the server is not matched with the cloud box loadbalancer.当前服务器的可用区与云盒实例可用区不匹配。
400InvalidBackendServers.ServerIpConflict%s.存在相同TunnelId和RsIp配置的后端服务器。
400OperationUnsupported.CreateVServerGroupThis type of backend server is not allowed to attached to singleTunnel or anyTunnel lb.SingleTunnel和AnyTunnel类型负载均衡实例不支持指定类型的后端服务器。
400IncorrectStatus.RSByPassToas%s.指定后端服务器的BypassToa配置无效。
400BackendServer.InvalidTypeThe specified Type is invalid.后端服务器类型非法。
400BackendServer.ServerRegionIdNotEqualThe specified ServerRegionId must be equal.后端服务器必须属于同一个地域。
400OperationFailed.InvalidCenThe cen related with this loadbalancer is invalid.操作失败,原因是指定负载均衡实例关联的Cen信息缺失。
400IncorrectStatus.CenNotAssociatedThe action is invalid because the loadbalancer is not associated with cen.该操作无效,因为当前负载均衡实例未与cen关联。
400InvalidBackendServers.MissingCenBandWidthThe bandwidth is missing between loadbalancer and backendServers in cen.Cen中的负载均衡实例所在的地域和挂载的目标地域之间要有带宽包。
400InvalidBackendServers.VpcNotInCenThe BackendServers is not in the cen associated with the loadbalancer.后端服务器不在与负载均衡关联的cen中。
400InvalidServerId.NotExistThe specified ServerId is not exist.指定的后端服务器不存在。
400MissingParameter.ServerRegionIdThe parameter ServerRegionId is required.参数ServerRegionId缺失。
400MissingParameter.VbrIdThe parameter VbrId is required.参数VbrId缺失。
400InvalidParameter.ServerRegionIdThe parameter ServerRegionId is invalid for crossborder.指定的ServerRegionId无效。请检查参数约束,并在修改后重试。
400InvalidVbrId.NotInCenThe VbrId is not in the cen associated with the loadbalancer.指定的Vbr不在实例关联的Cen内。
400InvalidParameter.ServerRegionIdThe specified ServerRegionId is invalid.指定的ServerRegionId无效。请检查参数约束,并在修改后重试。
400InvalidParameter.ZoneNotSupportThe zone does not support the parameter %s.当前可用区不支持指定参数。
400NetworkConflict%s.虚拟服务器组和ECS配置信息不一致。
400InvalidParam.TagValue %s.-
400InvalidParam.TagKey%s.-
400SizeLimitExceeded.Tag%s.-
400MissingParam.TagKeyThe param MissingParam.TagKey is missing.-
400VpcSystemBusyInvoke vpc system busy, please retry later.VPC系统异常,请稍后重试。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-09-08OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
2023-06-02OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
阿里云首页 负载均衡 相关技术圈