绑定弹性公网 IP

AssociateEip

所属服务

eip

Action

AssociateEip

Version

2017-12-14

Method

GET

描述

绑定云主机

如果PrivateIpAddress不为空,则指定该云主机的某个私有网ip绑定,只支持弹性公网ip使用

请求参数

query

参数名称说明参数类型是否必填备注
IpAddressIP地址string
IdIPID,和IpAddress两个参数至少传入一个string
InstanceType绑定资源类型,nvs - 云主机,srv - 容器,目前只支持 nvsstring
InstanceId绑定的资源IDstring
InstanceName绑定的资源名,最大长度256string
PrivateIpAddress需要绑定的私有网ip地址,默认绑定主私有网ip,只能在绑定弹性ip时使用,不支持旧版ipstring
ActionAssociateEipstring
Version2017-12-14string

Attention

IpAddress 和 Id 必须有一个

返回参数

返回参数被覆盖

状态码

错误码(Code)错误提示(Message)http status code说明
SuccessAction is success200成功
MissingParameterclient params error, Required String parameter "%s" is not present400缺少输入参数:"%s"
InvalidFormatThe format of the input parameter "%s" is illegal400您输入参数格式不正确:"%s"
InvalidIPThe specified Eip not exist404Eip不存在
ActionFailAction fail cause by Eip status403Eip的状态不支持此操作
ResourceNotFoundThe specified instance resouce not found404Eip绑定或解绑的资源不存在
InternalServerErrorInternal server error500服务器内部错误
NetworkErrorInternal network error500服务器内部网络错误
ResourceConflictThe specified Eip conflict400Eip冲突
ResourceNotFoundThe specified instance resouce not found.400Eip绑定或解绑的资源不存在

请求示例

curl -X GET "http://127.0.0.1:7010/eip?Action=AssociateEip&Version=2017-12-14&InstanceName=test&InstanceId=b4d5e41b-ef74-45a7-ab6d-9cb779b4049f&InstanceType=nvs&IpAddress=60.191.82.189&PrivateIpAddress=172.30.10.206" 

返回示例

{
    "RequestId": "2fe3bbf7-a47d-47d5-aaef-b02eeae88fa8",
    "Code": "Success",
    "Message": "Action is success",
    "Eip": {
        "Id": "d5412198-d6ea-482c-b75b-142155963406",
        "IpAddress": "60.191.82.189",
        "Status": "InUse",
        "MaxBandwidth": 5,
        "Comment": "",
        "InstanceId": "b4d5e41b-ef74-45a7-ab6d-9cb779b4049f",
        "InstanceName": "test",
        "InstanceType": "nvs",
        "NetworkChargeType": "PayByTraffic",
        "PayType": "PostPaid",
        "ActiveStatus": "Normal",
        "CreatedAt": "2019-02-20T02:24:31Z",
        "UpdatedAt": "2019-02-20T02:24:31Z",
        "TenantId": "0777ccfb14c84bb18cd819f92b9d7b24"
    }
}