华为云用户手册

  • 请求参数 表1 请求参数 参数名称 类型 是否必选 说明 router router object 是 router对象,参见表2。 表2 router对象 属性 是否必选 类型 说明 name 否 String 路由器的名称。 【使用说明】 仅支持数字、字母、_(下划线)、-(中划线)、.(点)。 admin_state_up 否 Boolean 管理状态。 【取值范围】 只支持true。 external_gateway_info 否 external_gateway_info object 扩展属性:外部网关信息,参见external_gateway_info对象 表3 external_gateway_info对象 属性 是否必选 类型 说明 network_id 否 String 外部网络的UUID。 外部网络的信息请通过GET /v2.0/networks?router:external=True或neutron net-external-list方式查询。
  • URI GET /v2.0/security-group-rules 样例: GET https://{Endpoint}/v2.0/security-group-rules?security_group_id={security_group_id}&remote_group_id={remote_group_id}&direction={direction}&remote_ip_prefix={remote_ip_prefix}&protocol={protocol}&port_range_max={port_range_max}&port_range_min={port_range_min}ðertype={ethertype}&tenant_id ={tenant_id} 分页查询样例: GET https://{Endpoint}/v2.0/networks?limit=2&marker=07adc044-3f21-4eeb-bd57-5e5eb6024b7f&page_reverse=False 参数说明请参见表1 表1 参数说明 名称 是否必选 参数类型 说明 id 否 String 按照安全组规则对应的id过滤查询结果 description 否 String 按照description过滤查询结果 remote_group_id 否 String 按照与此安全组规则关联的远端安全组ID过滤查询结果 security_group_id 否 String 按照与此安全组规则所属的安全组ID过滤查询结果 direction 否 String 按照安全组规则的方向过滤查询结果,支持ingress和egress进行过滤 protocol 否 String 按照安全组规则的IP协议过滤查询结果 remote_ip_prefix 否 String 按照与此安全组规则匹配的远端IP网段过滤查询结果 ethertype 否 String 按照网络类型过滤查询结果 port_range_max 否 Integer 按照最大端口过滤查询结果 port_range_min 否 Integer 按照最小端口过滤查询结果 tenant_id 否 String 按照项目ID过滤查询结果 marker 否 String 分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用: 若不传入marker和limit参数,查询结果返回第一页全部资源记录。 若不传入marker参数,limit为10,查询结果返回第1~10条资源记录。 若marker为第10条记录的资源ID,limit为10,查询结果返回第11~20条资源记录。 若marker为第10条记录的资源ID,不传入limit参数,查询结果返回第11~2000条(limit默认值2000)资源记录。 limit 否 Integer 分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。
  • 响应示例 { "security_group_rules": [ { "remote_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967", "direction": "ingress", "remote_ip_prefix": null, "protocol": null, "tenant_id": "6c9298ec8c874f7f99688489ab65f90e", "port_range_max": null, "security_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967", "port_range_min": null, "ethertype": "IPv6", "description": null, "id": "07adc044-3f21-4eeb-bd57-5e5eb6024b7f", "project_id": "6c9298ec8c874f7f99688489ab65f90e", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34", "remote_address_group_id": null }, { "remote_group_id": null, "direction": "egress", "remote_ip_prefix": null, "protocol": null, "tenant_id": "6c9298ec8c874f7f99688489ab65f90e", "port_range_max": null, "security_group_id": "328fb454-a2ee-4a11-bdb1-ee19bbdfde43", "port_range_min": null, "ethertype": "IPv6", "description": null, "id": "09358f83-f4a5-4386-9563-a1e3c373d655", "project_id": "6c9298ec8c874f7f99688489ab65f90e", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34", "remote_address_group_id": null }, { "remote_group_id": "4c763030-366e-428c-be2b-d48f6baf5297", "direction": "ingress", "remote_ip_prefix": null, "protocol": null, "tenant_id": "6c9298ec8c874f7f99688489ab65f90e", "port_range_max": null, "security_group_id": "4c763030-366e-428c-be2b-d48f6baf5297", "port_range_min": null, "ethertype": "IPv6", "description": null, "id": "219a6f56-1069-458b-bec0-df9270e7a074", "project_id": "6c9298ec8c874f7f99688489ab65f90e", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34", "remote_address_group_id": null } ], "security_group_rules_links": [ { "rel": "previous", "href": "https://{Endpoint}/v2.0/security-group-rules?marker=07adc044-3f21-4eeb-bd57-5e5eb6024b7f&page_reverse=True" } ]}
  • 响应参数 表2 响应参数 参数名称 类型 说明 security_group_rules Array of Security Group Rule objects security group rule对象列表。请参见表3。 security_group_rules_links Array of SecurityGroupRulesLink objects 分页信息。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 Security Group Rule对象 属性 类型 说明 id String 安全组规则id 使用说明:查询安全组规则非必选 description String 安全组规则描述 security_group_id String 所属安全组id remote_group_id String 所属安全组的对端id direction String 规则方向 remote_ip_prefix String 对端ip网段 protocol String 协议类型或直接指定IP协议号 port_range_max Integer 最大端口,当协议类型为ICMP时,该值表示ICMP的code port_range_min Integer 最小端口,当协议类型为ICMP时,该值表示ICMP的type。 protocol为tcp和udp时,port_range_max和port_range_min必须同时输入,且port_range_max应大于等于port_range_min。 protocol为icmp时,指定ICMP code(port_range_max)时,必须同时指定ICMP type(port_range_min)。 ethertype String 网络类型 支持IPv4,IPv6 tenant_id String 项目ID remote_address_group_id String 功能说明:远端IP地址组ID。 约束:和remote_ip_prefix,remote_group_id功能互斥。 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表4 SecurityGroupRulesLink对象 参数名称 类型 说明 href String API链接 rel String API链接与该API版本的关系
  • URI GET /v2.0/vpc/routes 样例: 样例:GET https://{Endpoint}/v2.0/vpc/routes?id={id}&vpc_id={vpc_id}&tenant_id={tenant_id}&destination={destination}&type={type}&limit={limit}&marker={marker} 参数说明请参见表1。 表1 参数说明 名称 是否必选 参数类型 说明 id 否 String 按照routes_id过滤查询 tenant_id 否 String 按照tenant_id过滤查询 vpc_id 否 String 按照vpc_id过滤查询 destination 否 String 按照路由目的地址CIDR过滤查询 type 否 String 按照type进行过滤查询,目前只支持peering marker 否 String 分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用: 若不传入marker和limit参数,查询结果返回第一页全部资源记录。 若不传入marker参数,limit为10,查询结果返回第1~10条资源记录。 若marker为第10条记录的资源ID,limit为10,查询结果返回第11~20条资源记录。 若marker为第10条记录的资源ID,不传入limit参数,查询结果返回第11~2000条(limit默认值2000)资源记录。 limit 否 Integer 分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。 默认值为2000。
  • 响应示例 { "routes": [ { "type": "peering", "nexthop": "60c809cb-6731-45d0-ace8-3bf5626421a9", "destination": "192.168.200.0/24", "vpc_id": "ab78be2d-782f-42a5-aa72-35879f6890ff", "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "id": "3d42a0d4-a980-4613-ae76-a2cddecff054" } ] }
  • 响应参数 表2 响应参数 参数名称 类型 说明 routes Array of route objects route对象列表,参见表3。 routes_links Array of routes_link objects routes_link对象列表,参见表4。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 route对象 属性 类型 说明 id String 路由id destination String 路由目的地址CIDR,如192.168.200.0/24。 nexthop String 路由下一跳,如果路由是“peering”类型,填写vpc peering id。 type String 路由类型。目前只支持“peering”。 vpc_id String 路由的vpc,需要填写存在的vpc_id。 tenant_id String 项目ID 表4 routes_link对象 名称 参数类型 说明 href String API链接 rel String API链接与该API版本的关系
  • 响应示例 { "route": { "type": "peering", "nexthop": "60c809cb-6731-45d0-ace8-3bf5626421a9", "destination": "192.168.200.0/24", "vpc_id": "ab78be2d-782f-42a5-aa72-35879f6890ff", "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "id": "3d42a0d4-a980-4613-ae76-a2cddecff054" }}
  • 响应参数 表2 响应参数 参数名称 类型 说明 route route object route对象,参见表3。 表3 route对象 属性 类型 说明 id String 路由id destination String 路由目的地址CIDR,如192.168.200.0/24。 nexthop String 路由下一跳,如果路由是“peering”类型,填写vpc peering id。 type String 路由类型。目前只支持“peering”。 vpc_id String 路由的vpc,需要填写存在的vpc_id。 tenant_id String 项目ID
  • 响应示例 { "router": { "id": "01ab4be1-4447-45fb-94be-3ee787ed4ebe", "name": "xiaoleizi-tag", "status": "ACTIVE", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "admin_state_up": true, "external_gateway_info": { "network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975", "enable_snat": false }, "routes": [ { "destination": "0.0.0.0/0", "nexthop": "172.16.0.124" } ], "created_at": "2018-03-23T09:26:08", "updated_at": "2018-08-24T08:49:53" }}
  • 响应参数 表1 响应参数 参数名称 类型 说明 router router object router对象,参见表2。 表2 router对象 属性 类型 说明 id String 路由器的id 【使用说明】在查询路由器列表时非必选 name String 路由器的名称。 仅支持数字、字母、_(下划线)、-(中划线)、.(点)。 admin_state_up Boolean 管理状态。 只支持true。 status String 状态,可以为ACTIVE, DOWN,ERROR。 tenant_id String 项目ID external_gateway_info external_gateway_info object 扩展属性:外部网关信息,参见external_gateway_info对象 routes Array of route objects 扩展属性:路由信息列表,参见表4 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表3 external_gateway_info对象 属性 类型 说明 network_id String 外部网络的UUID。 外部网络的信息请通过GET /v2.0/networks?router:external=True或neutron net-external-list方式查询。 enable_snat Boolean 是否启用SNAT。 默认为false。 表4 route对象 属性 类型 说明 destination String IP地址段 nexthop String 下一跳IP地址,nexthop仅支持是router所关联的子网范围内IP地址
  • 响应示例 { "routers": [ { "id": "01ab4be1-4447-45fb-94be-3ee787ed4ebe", "name": "xiaoleizi-tag", "status": "ACTIVE", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "admin_state_up": true, "external_gateway_info": { "network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975", "enable_snat": false }, "routes": [ { "destination": "0.0.0.0/0", "nexthop": "172.16.0.124" } ], "created_at": "2018-03-23T09:26:08", "updated_at": "2018-08-24T08:49:53" } ], "routers_links": [ { "rel": "next", "href": "https://{Endpoint}/v2.0/routers?limit=1&marker=01ab4be1-4447-45fb-94be-3ee787ed4ebe" }, { "rel": "previous", "href": "https://{Endpoint}/v2.0/routers?limit=1&marker=01ab4be1-4447-45fb-94be-3ee787ed4ebe&page_reverse=True" } ]}
  • URI GET /v2.0/routers 样例: GET https://{Endpoint}/v2.0/routers?id={id}&name={name}&admin_state_up={admin_state_up}&tenant_id={tenant_id}&status={status} 分页查询样例: GET https://{Endpoint}/v2.0/routers?limit=2&marker=01ab4be1-4447-45fb-94be-3ee787ed4ebe&page_reverse=False
  • 响应参数 表2 响应参数 参数名称 类型 说明 routers Array of router objects router对象列表,参见表3。 routers_links Array of routers_link objects 分页信息,参见表6。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 router对象 属性 类型 说明 id String 路由器的id 【使用说明】在查询路由器列表时非必选 name String 路由器的名称。 仅支持数字、字母、_(下划线)、-(中划线)、.(点)。 admin_state_up Boolean 管理状态。 只支持true。 status String 状态,可以为ACTIVE, DOWN,ERROR。 tenant_id String 项目ID external_gateway_info external_gateway_info object 扩展属性:外部网关信息,参见external_gateway_info对象 routes Array of route objects 扩展属性:路由信息列表,参见routes对象 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表4 external_gateway_info对象 属性 类型 说明 network_id String 外部网络的UUID。 外部网络的信息请通过GET /v2.0/networks?router:external=True或neutron net-external-list方式查询。 enable_snat Boolean 是否启用SNAT。 默认为false。 表5 route对象 属性 类型 说明 destination String IP地址段 nexthop String 下一跳IP地址,nexthop仅支持是router所关联的子网范围内IP地址 表6 routers_link对象 名称 参数类型 说明 href String API链接 rel String API链接与该API版本的关系
  • 响应参数 表2 响应参数 名称 参数类型 说明 quotas quotas object 配额列表对象,请参见表3。 表3 quotas字段说明 名称 参数类型 说明 resources Array of resource objects 资源列表对象,请参见表4。 表4 resource字段说明 名称 参数类型 说明 type String 功能说明:根据type过滤查询指定类型的配额 取值范围: vpc 虚拟私有云 subnet 子网 securityGroup 安全组 securityGroupRule 安全组规则 publicIp 弹性公网IP vpn 虚拟专用网络 vpngw VPN网关 vpcPeer 对等连接 loadbalancer 负载均衡 listener 负载倾听器 physicalConnect 物理专线 virtualInterface 虚拟接口 firewall 防火墙 shareBandwidthIP 单个共享带宽的IP shareBandwidth 共享带宽 address_group 地址组 flow_log 流日志 vpcContainRoutetable 单VPC下的路由表数量 routetableContainRoutes 单路由表下的路由条目 used Integer 功能说明:已创建的资源个数 取值范围:0~quota数 quota Integer 功能说明:资源的最大配额数 取值范围:各类型资源默认配额数~Integer最大值 min Integer 允许修改的配额最小值 通过接口查询单租户在VPC服务下的网络资源配额,返回值“-1”,表示配额数量不限制。
  • URI GET /v1/{project_id}/quotas 样例: GET https://{Endpoint}/v1/{project_id}/quotas?type={type} 参数说明请参见表1。 表1 参数说明 名称 是否必选 参数类型 说明 project_id 是 String 项目ID,获取项目ID请参见获取项目ID。 type 否 String 功能说明:根据type过滤查询指定类型的配额 取值范围: vpc 虚拟私有云 subnet 子网 securityGroup 安全组 securityGroupRule 安全组规则 publicIp 弹性公网IP vpn 虚拟专用网络 vpngw VPN网关 vpcPeer 对等连接 loadbalancer 负载均衡 listener 负载倾听器 physicalConnect 物理专线 virtualInterface 虚拟接口 firewall 防火墙 shareBandwidthIP 单个共享带宽的IP shareBandwidth 共享带宽 address_group 地址组 flow_log 流日志 vpcContainRoutetable 单VPC下的路由表数量 routetableContainRoutes 单路由表下的路由条目
  • 响应示例 { "quotas": { "resources": [ { "type": "vpc", "used": 4, "quota": 150, "min": 0 }, { "type": "subnet", "used": 5, "quota": 400, "min": 0 }, { "type": "securityGroup", "used": 1, "quota": 100, "min": 0 }, { "type": "securityGroupRule", "used": 6, "quota": 5000, "min": 0 }, { "type": "publicIp", "used": 2, "quota": 10, "min": 0 }, { "type": "vpn", "used": 0, "quota": 5, "min": 0 }, { "type": "vpngw", "used": 0, "quota": 2, "min": 0 }, { "type": "vpcPeer", "used": 0, "quota": 50, "min": 0 }, { "type":"physicalConnect", "used":0, "quota":10, "min":0 }, { "type":"virtualInterface", "used":0, "quota":50, "min":0 }, { "type": "firewall", "used": 0, "quota": 200, "min": 0 }, { "type": "shareBandwidth", "used": 0, "quota": 5, "min": 0 }, { "type": "shareBandwidthIP", "used": 0, "quota": 20, "min": 0 }, { "type": "loadbalancer", "used": 0, "quota": 10, "min": 0 }, { "type": "listener", "used": 0, "quota": 10, "min": 0 }, { "type": "flow_log", "used": 0, "quota": 10, "min": 0 }, { "type": "vpcContainRoutetable", "used": 0, "quota": 1, "min": 0 }, { "type": "routetableContainRoutes", "used": 0, "quota": 200, "min": 0 }, { "type": "address_group", "used": 0, "quota": 50, "min": 0 } ] }}
  • 响应参数 表2 响应参数 参数名称 类型 说明 networks Array of network objects network对象列表,参见表3。 networks_links Array of networks_link objects 分页信息,参见表4。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 network对象 属性 类型 说明 status String 网络状态,可以为ACTIVE,BUILD,DOWN或ERROR。 subnets Array of strings 网络关联的子网ID。 一个network仅支持关联一个subnet。 name String 网络名称。 name不能为admin_external_net(预置网络名称,不可占用)。 router:external Boolean 扩展属性:是否外部网络,默认值false。 admin_state_up Boolean 管理状态。 只支持true。 tenant_id String 项目ID shared Boolean 是否支持跨租户共享。 id String 网络的id provider:network_type String 扩展属性:网络类型。 取值范围:支持租户创建geneve、vxlan类型的网络 租户只能指定此参数为geneve,不指定时网络类型自动分配,一般分配为vxlan类型。预置网络admin_external_net的情况下,此参数为vlan,用户不可配置。 【使用说明】 创建geneve类型的网络,请指定此参数为geneve。 创建vxlan类型的网络,请求时请不要指定此参数。 availability_zone_hints Array of strings 本网络的候选可用域,当前版本不支持可用域调度。 availability_zones Array of strings 本网络的可用域。 port_security_enabled Boolean 端口安全使能标记,如果不使能,则network下所有虚机的安全组和dhcp防欺骗不生效 dns_domain String 默认内网DNS域地址,系统自动生成维护,不支持设置和更新 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表4 networks_link对象 参数名称 类型 说明 href String API链接 rel String API链接与该API版本的关系
  • 响应示例 { "networks": [ { "id": "0133cd73-34d4-4d4c-bf1f-e65b24603206", "name": "3804f26c-7862-43b6-ad3c-48445f42de89", "status": "ACTIVE", "shared": false, "subnets": [ "423796f5-e02f-476f-bf02-2b88c8ddac8b" ], "availability_zone_hints": [], "availability_zones": [ "az2.dc2", "az5.dc5" ], "admin_state_up": true, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "provider:network_type": "vxlan", "router:external": false, "port_security_enabled": true, "created_at": "2018-03-23T03:51:58", "updated_at": "2018-03-23T03:51:58" } ], "networks_links": [ { "rel": "next", "href": "https://{Endpoint}/v2.0/networks?limit=1&marker=0133cd73-34d4-4d4c-bf1f-e65b24603206" }, { "rel": "previous", "href": "https://{Endpoint}/v2.0/subnets?limit=1&marker=0133cd73-34d4-4d4c-bf1f-e65b24603206&page_reverse=True" } ]}
  • URI GET /v2.0/networks 样例: GET https://{Endpoint}/v2.0/networks?id={network_id}&status={network_status}&name={network_name}&admin_state_up=${admin_state_up}&tenant_id={tenant_id}&shared={is_shared}&provider:network_type={geneve} 分页查询样例: GET https://{Endpoint}/v2.0/networks?limit=2&marker=0133cd73-34d4-4d4c-bf1f-e65b24603206&page_reverse=False 参数说明请参见表1。 表1 参数说明 名称 是否必选 参数类型 说明 id 否 String 按照网络对应的ID过滤查询 name 否 String 按照网络的名称过滤查询 admin_state_up 否 Boolean 按照网络的管理状态过滤查询 取值范围:true or false provider:network_type 否 String 按照网络的类型过滤查询 shared 否 Boolean 按照网络是否支持跨租户共享过滤查询 取值范围:true or false status 否 String 按照网络的状态过滤查询 取值范围:ACTIVE、BUILD、DOWN router:external 否 Boolean 按照网络是否外部网络过滤查询 取值范围:true or false tenant_id 否 String 按照网络所属的项目ID过滤查询 marker 否 String 分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用: 若不传入marker和limit参数,查询结果返回第一页全部资源记录。 若不传入marker参数,limit为10,查询结果返回第1~10条资源记录。 若marker为第10条记录的资源ID,limit为10,查询结果返回第11~20条资源记录。 若marker为第10条记录的资源ID,不传入limit参数,查询结果返回第11~2000条(limit默认值2000)资源记录。 limit 否 Integer 分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。
  • 请求参数 表1 请求参数 参数名称 类型 必选 说明 firewall_policy firewall_policy object 是 firewall policy对象。请参见表2。 表2 Firewall Policy对象 属性 是否必选 类型 说明 name 否 String 网络ACL策略名称。 使用说明:最长255个字符 description 否 String 网络ACL策略描述。 使用说明:最长255个字符 firewall_rules 否 Array of strings 策略引用的网络ACL规则链。 audited 否 Boolean 审计标记。 取值范围:true/false
  • 响应参数 表3 响应参数 参数名称 类型 说明 firewall_policy firewall_policy object firewall policy对象。请参见表4。 表4 Firewall Policy对象 属性 类型 说明 id String 网络ACL策略uuid标识。 name String 网络ACL策略名称。 description String 网络ACL策略描述。 tenant_id String 项目ID firewall_rules Array of strings 策略引用的网络ACL规则链。 audited Boolean 审计标记。 public Boolean 是否支持跨租户共享。 project_id String 项目ID,请参见获取项目ID。
  • 响应示例 { "firewall_policy": { "description": "", "firewall_rules": [ "b8243448-cb3c-496e-851c-dadade4c161b" ], "tenant_id": "23c8a121505047b6869edf39f3062712", "public": false, "id": "2fb0e81f-9f63-44b2-9894-c13a3284594a", "audited": false, "name": "test-policy", "project_id": "23c8a121505047b6869edf39f3062712" }}
  • 请求示例 创建ACL策略,命名为test-policy,关联ACL规则b8243448-cb3c-496e-851c-dadade4c161b。 POST https://{Endpoint}/v2.0/fwaas/firewall_policies{ "firewall_policy": { "name": "test-policy", "firewall_rules": [ "b8243448-cb3c-496e-851c-dadade4c161b" ] }}
  • 请求参数 表2 请求参数 参数名称 是否必选 类型 说明 peering 是 peering object peering对象中要更新的字段,请参见表3。 更新操作时至少指定一项属性,目前只支持更新name和description。 表3 对等连接更新字段说明 参数名称 是否必选 类型 说明 name 否 String 对等连接名称,支持长度为1-64字符 description 否 String 对等连接描述,取值范围:0-255个字符,支持数字、字母、中文字符
  • 响应示例 { "peering": { "name": "test2", "description": "test", "id": "22b76469-08e3-4937-8c1d-7aad34892be1", "request_vpc_info": { "vpc_id": "9daeac7c-a98f-430f-8e38-67f9c044e299", "tenant_id": "f65e9ebc-ed5d-418b-a931-9a723718ba4e" }, "accept_vpc_info": { "vpc_id": "f583c072-0bb8-4e19-afb2-afb7c1693be5", "tenant_id": "059a737356594b41b447b557bf0aae56" }, "status": "ACTIVE" }}
  • 响应参数 表4 响应参数 参数名称 类型 说明 peering peering object peering对象,参见表5。 表5 peering对象 属性 类型 说明 id String 对等连接id name String 对等连接的名称 status String 状态位: PENDING_ACCEPTANCE:等待接受 REJECTED:已拒绝。 EXPIRED:已过期。 DELETED:已删除。 ACTIVE:活动的。 request_vpc_info vpc_info object 对等连接发起端vpc信息,请参见表6。 accept_vpc_info vpc_info object 对等连接接受端vpc信息,请参见表6。 description String 对等连接描述 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表6 vpc_info对象 属性 类型 说明 vpc_id String 对等连接其中一端vpc id tenant_id String 对等连接其中一端vpc所属的项目id
  • 响应示例 { "subnet": { "name": "kesmdemeet", "cidr": "172.16.236.0/24", "id": "011fc878-5521-4654-a1ad-f5b0b5820302", "enable_dhcp": true, "network_id": "48efad0c-079d-4cc8-ace0-dce35d584124", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "dns_nameservers": [], "allocation_pools": [ { "start": "172.16.236.2", "end": "172.16.236.251" } ], "host_routes": [], "ip_version": 4, "gateway_ip": "172.16.236.1", "created_at": "2018-03-26T08:23:43", "updated_at": "2018-03-26T08:23:44" }}
  • 响应参数 表1 响应参数 参数名称 类型 说明 subnet subnet object subnet对象,参见表2。 表2 subnet对象 属性 类型 说明 id String 子网的id 【使用说明】在查询子网列表时非必选 name String 子网的名称 ip_version Integer IP版本 【使用说明】支持4(IPv4)、6(IPv6) ipv6_address_mode String IPv6寻址模式 【使用说明】仅支持dhcpv6-stateful ipv6_ra_mode String IPv6路由广播模式 【使用说明】仅支持dhcpv6-stateful network_id String 所属网络的id cidr String CIDR格式 【使用说明】IPV4只支持10.0.0.0/8,172.16.0.0/12,192.168.0.0/16三个网段内的地址,掩码长度不能大于28。 约束:当ip_version=6时,该字段不支持设置 gateway_ip String 网关IP不允许和allocation_pools地址块冲突。 【使用说明】不支持修改。 allocation_pools Array of allocation_pool objects 可用的IP池,allocation_pool对象参见表3 例如:[ { "start": "10.0.0.2", "end": "10.0.0.251"} ] 每个子网的第1个和最后3个IP地址为系统保留地址。以192.168.1.0/24为例,192.168.1.0、 192.168.1.253、192.168.1.254和192.168.1.255这些地址是系统保留地址。 [{"start": "2001:db8:a583:9::2", "end": "2001:db8:a583:9:ffff:ffff:ffff:fffc"}] ipv6子网以2001:db8:a583:9::/64为例,2001:db8:a583:9::1和2001:db8:a583:9:ffff:ffff:ffff:fffd、2001:db8:a583:9:ffff:ffff:ffff:fffe、2001:db8:a583:9:ffff:ffff:ffff:ffff这些地址是系统保留地址。系统预留地址默认不在allocation_pool范围内。 约束:更新时allocation_pool范围不能包含网关和广播地址的所有IP。 dns_nameservers Array of strings dns服务器 例如:"dns_nameservers": ["8.xx.xx.8","8.xx.xx.4"] host_routes Array of host_route objects 虚拟机静态路由,参见“host_route对象”表 【使用说明】不支持,忽略输入信息 tenant_id String 项目ID enable_dhcp Boolean 是否启动dhcp,false表示不提供dhcp服务的能力 【使用说明】只支持true subnetpool_id String 子网池id 【使用说明】目前IPv4不支持,IPv6支持 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表3 allocation_pool对象 参数名 参数类型 备注 start String 网络池起始IP end String 网络池结束IP 表4 host_route对象 参数名 参数类型 备注 destination String 路由目的子网 nexthop String 路由下一跳IP
  • URI GET /v2.0/subnets 样例: GET https://{Endpoint}/v2.0/subnets?name={subnet_name}&ip_version={ip_version}&network_id={network_id}&cidr={subnet_cidr_address}&gateway_ip={subnet_gateway}&tenant_id={tenant_id}&enable_dhcp={is_enable_dhcp} 分页查询样例: GET https://{Endpoint}/v2.0/subnets?limit=2&marker=011fc878-5521-4654-a1ad-f5b0b5820302&page_reverse=False
共100000条
提示

您即将访问非华为云网站,请注意账号财产安全