文档中心 > OperateServer
OperateServer

最近更新时间:2021-12-28

请求方法:PUT

接口描述:批量操作实服务器


请求参数

路径参数

参数名称

类型

是否必须

备注

Action

string

是

要执行的操作   OperateServer。

RegionId

string

是

节点ID。

Body

参数名称

类型

是否必须

备注

Servers

Integer

是


ActionStatus

string

是

0:添加实服务器到服务器组 
1:更新实服务器 
2:从服务器组移出实服务器

LoadbalancerId

string

是

负载均衡ID。

PortId

string

是

实服务器网卡ID。

ServerGroupId

string

是

服务器组ID。

ServerId

string

是

实服务器ID。

ServerIp

string

是

实服务器IP。

ServerPort

Integer

是

实服务器端口。

Weight

Integer

是

权重。



返回参数

参数名称

类型

备注

Code

string

请求结果编码。

Msg

string

请求结果信息。

RequestId

string

请求结果数据ID。


示例

请求示例

GET https://api.unicloud.com/networks/slb?Action=OperateServer

&RegionId=HB1-BJMY

&LoadbalancerId=1111

&公共请求参数

body

{

  "Servers": [

    {

      "ActionStatus": 0,

      "LoadbalancerId": "slb-j2ooftebs2f3",

      "PortId": "eni-j2ryk0ed2c2m",

      "ServerGroupId": "42643a28d64948a3aed6ad32f35c79a5",

      "ServerId": "ecs-j2ryk0ed2c2k",

      "ServerIp": "10.0.0.10",

      "ServerPort": 49106,

      "Weight": 1

    }

  ]

}

返回示例

{

    "Code": "Network.Success",

    "Msg": "批量操作实服务器成功",

    "RequestId": "87fe793c-c5a5-4d74-b830-245bc530e061"

}