查询浮动ip列表-凯发k8国际娱乐官网入口
功能介绍
查询提交请求的租户有权限操作的所有浮动ip地址。单次查询最多返回2000条数据,超过2000后会返回分页标记。
接口约束
单次查询最多返回2000条数据,超过2000后会返回分页标记。
调用方法
请参见。
uri
get /v2.0/floatingips
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
limit |
否 |
integer |
最小值:0 最大值:2000 |
marker |
否 |
string |
最小长度:0 最大长度:36 |
page_reverse |
否 |
boolean |
|
id |
否 |
string |
最小长度:0 最大长度:36 |
floating_ip_address |
否 |
string |
最小长度:0 最大长度:64 |
router_id |
否 |
string |
最小长度:0 最大长度:36 |
port_id |
否 |
string |
最小长度:0 最大长度:36 |
fixed_ip_address |
否 |
string |
最小长度:0 最大长度:64 |
tenant_id |
否 |
string |
最小长度:0 最大长度:36 |
floating_network_id |
否 |
string |
最小长度:0 最大长度:36 |
请求参数
无
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
floatingips |
array of floatingipresp objects |
floatingip对象列表 数组长度:0 - 99999 |
floatingips_links |
array of pager objects |
floatingips_link对象列表 数组长度:0 - 99999 |
参数 |
参数类型 |
描述 |
---|---|---|
fixed_ip_address |
string |
最小长度:0 最大长度:64 |
floating_ip_address |
string |
最小长度:0 最大长度:64 |
floating_network_id |
string |
最小长度:0 最大长度:36 |
id |
string |
最小长度:0 最大长度:36 |
port_id |
string |
最小长度:0 最大长度:36 |
router_id |
string |
最小长度:0 最大长度:36 |
status |
string |
枚举值:
|
tenant_id |
string |
最小长度:0 最大长度:36 |
project_id |
string |
最小长度:0 最大长度:36 |
dns_name |
string |
最小长度:0 最大长度:255 |
dns_domain |
string |
最小长度:0 最大长度:255 |
created_at |
string |
|
updated_at |
string |
|
参数 |
参数类型 |
描述 |
---|---|---|
href |
string |
页码url 最小长度:0 最大长度:256 |
rel |
string |
next:下一页 previous:前一页 枚举值:
|
请求示例
get https://{endpoint}/v2.0/floatingips?limit=1
get https://{endpoint}/v2.0/floatingips?id={fip_id}&router_id={router_id}&floating_network_id={net_id}&floating_ip_address={floating_ip}&port_id={port_id}&fixed_ip_address={fixed_ip}&project_id={project_id}
响应示例
状态码: 200
get操作正常返回
{ "floatingips" : [ { "id" : "1a3a2818-d9b4-4a9c-8a19-5252c499d1cd", "status" : "down", "router_id" : null, "tenant_id" : "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id" : "bbfe8c41dd034a07bebd592bf03b4b0c", "floating_network_id" : "0a2228f2-7f8a-45f1-8e09-9039e1d09975", "fixed_ip_address" : null, "floating_ip_address" : "99.99.99.84", "port_id" : null, "dns_name" : "ecs-88-99-103-61", "dns_domain" : "compute.hwclouds-dns.com.", "created_at" : "2017-10-19t12:21:28", "updated_at" : "2018-07-30t12:52:13" } ], "floatingips_links" : [ { "href" : "https://network.region.cn-southwest-2.hwclouds.com/v2.0/floatingips.json?limit=2000&marker=000a6144-5010-46f2-bf06-6a1c94477ea3&page_reverse=true", "rel" : "previous" }, { "href" : "https://network.region.cn-southwest-2.hwclouds.com/v2.0/floatingips.json?limit=2000&marker=d445e537-bc81-4039-9c7b-f9c1f5c73c78", "rel" : "next" } ] }
sdk代码示例
sdk代码示例如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
package com.huaweicloud.sdk.test;
import com.huaweicloud.sdk.core.auth.icredential;
import com.huaweicloud.sdk.core.auth.basiccredentials;
import com.huaweicloud.sdk.core.exception.connectionexception;
import com.huaweicloud.sdk.core.exception.requesttimeoutexception;
import com.huaweicloud.sdk.core.exception.serviceresponseexception;
import com.huaweicloud.sdk.eip.v2.region.eipregion;
import com.huaweicloud.sdk.eip.v2.*;
import com.huaweicloud.sdk.eip.v2.model.*;
public class neutronlistfloatingipssolution {
public static void main(string[] args) {
// the ak and sk used for authentication are hard-coded or stored in plaintext, which has great security risks. it is recommended that the ak and sk be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// in this example, ak and sk are stored in environment variables for authentication. before running this example, set environment variables cloud_sdk_ak and cloud_sdk_sk in the local environment
string ak = system.getenv("cloud_sdk_ak");
string sk = system.getenv("cloud_sdk_sk");
icredential auth = new basiccredentials()
.withak(ak)
.withsk(sk);
eipclient client = eipclient.newbuilder()
.withcredential(auth)
.withregion(eipregion.valueof("
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# coding: utf-8
from huaweicloudsdkcore.auth.credentials import basiccredentials
from huaweicloudsdkeip.v2.region.eip_region import eipregion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkeip.v2 import *
if __name__ == "__main__":
# the ak and sk used for authentication are hard-coded or stored in plaintext, which has great security risks. it is recommended that the ak and sk be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
# in this example, ak and sk are stored in environment variables for authentication. before running this example, set environment variables cloud_sdk_ak and cloud_sdk_sk in the local environment
ak = os.getenv("cloud_sdk_ak")
sk = os.getenv("cloud_sdk_sk")
credentials = basiccredentials(ak, sk) \
client = eipclient.new_builder() \
.with_credentials(credentials) \
.with_region(eipregion.value_of("
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
package main
import (
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
eip "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v2"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v2/model"
region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v2/region"
)
func main() {
// the ak and sk used for authentication are hard-coded or stored in plaintext, which has great security risks. it is recommended that the ak and sk be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// in this example, ak and sk are stored in environment variables for authentication. before running this example, set environment variables cloud_sdk_ak and cloud_sdk_sk in the local environment
ak := os.getenv("cloud_sdk_ak")
sk := os.getenv("cloud_sdk_sk")
auth := basic.newcredentialsbuilder().
withak(ak).
withsk(sk).
build()
client := eip.neweipclient(
eip.eipclientbuilder().
withregion(region.valueof("
|
更多编程语言的sdk代码示例,请参见的代码示例页签,可生成自动对应的sdk代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
get操作正常返回 |
错误码
请参见。
意见反馈
文档内容是否对您有帮助?
如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨