AssociateIP【绑定公网IP】¶
云主机绑定公网IP:可根据公网IP对应ID和网卡ID信息来绑定公网IP。 如果不指定任何绑定条件,则会返回错误信息。
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
ip_id | String | 公网 IP 对应 ID | Yes |
port_id | String | 网卡 ID和 IP拼接的标识符 | Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
data | Array | JSON 格式的绑定的云主机公网IP信息列表,每项参数可见下面 Data Item |
Data Item
Name | Type | Description |
---|---|---|
instance_id | String | 云主机 ID |
addresses | Array | 绑定的内网 IP 和公网 IP信息 |
Example
Example Request:
Request Headers:
POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/json
JSON Data:
{
"action": "AssociateIP",
"ip_id": "be019f0e-98d1-4a35-b0eb-8c1bde507e67",
"port_id": "34d78a8a-5472-4fa0-83f6-7b23eb692c87_192.168.100.7"
}
Example Response:
{
"message": "成功",
"code": 200,
"data": [
{
"instance_id": "2b819c1d-0b75-448b-b76b-c95311f0b472",
"addresses": [
"192.168.1.12",
"10.0.0.109"
]
}
]
}