华为云用户手册

  • 请求参数 表2 请求参数 参数名称 类型 必选 说明 network network object 是 network对象,参见表3。 更新操作时至少指定一项属性 表3 network对象 属性 是否必选 类型 说明 name 否 String 网络名称。 【使用说明】name不能为admin_external_net(预置网络名称,不可占用)。 admin_state_up 否 Boolean 管理状态。 【使用说明】只支持true。 port_security_enabled 否 Boolean 端口安全使能标记,如果不能使,则network下所有虚机的安全组和dhcp防欺骗不生效
  • 响应参数 表4 响应参数 参数名称 类型 说明 network network object network对象,参见表5。 表5 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
  • 响应参数 表2 响应参数 参数名称 类型 说明 network network object network对象,参见表3。 表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
  • 响应示例 { "network": { "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" }}
  • 响应示例 { "security_group": { "id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "name": "sg-ad3f", "description": "", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "security_group_rules": [ { "id": "d90e55ba-23bd-4d97-b722-8cb6fb485d69", "direction": "ingress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": "0150a3a7-82ca-4569-865c-04e46e5e9249" }, { "id": "aecff4d4-9ce9-489c-86a3-803aedec65f7", "direction": "egress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": null } ], "created_at": "2018-09-12T08:24:14", "updated_at": "2018-09-12T08:24:14" }}
  • 响应参数 表1 响应参数 参数名称 类型 说明 security_group security_group object security group对象。请参见表2。 表2 Security Group对象 属性 类型 说明 id String 安全组的id 使用说明:查询安全组列表非必选 tenant_id String 项目ID name String 安全组名称 description String 安全组描述 security_group_rules Array of Security Group Rule objects security_group_rule列表,参见表3 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表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
  • 响应示例 { "security_groups": [ { "id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "name": "sg-ad3f", "description": "", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "security_group_rules": [ { "id": "d90e55ba-23bd-4d97-b722-8cb6fb485d69", "direction": "ingress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": "0150a3a7-82ca-4569-865c-04e46e5e9249" }, { "id": "aecff4d4-9ce9-489c-86a3-803aedec65f7", "direction": "egress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": null } ], "created_at": "2018-09-12T08:24:14", "updated_at": "2018-09-12T08:24:14" } ], "security_groups_links": [ { "rel": "next", "href": "https://{Endpoint}/v2.0/security-groups?limit=1&marker=0431c9c5-1660-42e0-8a00-134bec7f03e2" }, { "rel": "previous", "href": "https://{Endpoint}/v2.0/security-groups?limit=1&marker=0431c9c5-1660-42e0-8a00-134bec7f03e2&page_reverse=True" } ]}
  • 响应参数 表2 响应参数 参数名称 类型 说明 security_groups Array of Security Group objects security group对象列表。请参见表3 security_groups_links Array of SecurityGroupsLink objects 分页信息。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 Security Group对象 属性 类型 说明 id String 安全组的id 使用说明:查询安全组列表非必选 tenant_id String 项目ID name String 安全组名称 description String 安全组描述 security_group_rules Array of Security Group Rule objects security_group_rule列表,参见表4 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表4 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 表5 SecurityGroupsLink对象 参数名称 类型 说明 href String API链接 rel String API链接与该API版本的关系
  • 响应示例 { "security_group": { "id": "16b6e77a-08fa-42c7-aa8b-106c048884e6", "name": "qq", "description": "qq", "vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85", "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2", "security_group_rules": [ { "id": "f11a3824-ac19-4fad-b4f1-c5f4a6dd0a80", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction": "ingress", "protocol": null, "description": "", "ethertype": "IPv6", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null }, { "id": "3d6480e8-9ea4-46dc-bb1b-8db190cd5677", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": null, "direction": "egress", "protocol": null, "description": "", "ethertype": "IPv6", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null }, { "id": "9581f18c-1fdd-43da-ace9-7758a56ef28a", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": null, "direction": "egress", "protocol": null, "description": "", "ethertype": "IPv4", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null }, { "id": "a3ba270e-e58b-432d-a912-aeb7eace9fb8", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction": "ingress", "protocol": null, "description": "", "ethertype": "IPv4", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null } ] }}
  • 响应参数 表2 响应参数 名称 参数类型 说明 security_group security_group object 安全组对象 表3 security_group字段说明 名称 参数类型 说明 name String 安全组名称 description String 安全组描述 id String 安全组唯一标识 vpc_id String 安全组所在的vpc的资源标识 说明: 当前该参数只作提示用,不约束安全组在此vpc下,不建议继续使用。 security_group_rules Array of security_group_rule objects 默认安全组规则列表,保证安全组内互通。 enterprise_project_id String 功能说明:企业项目ID。创建安全组时,给安全组绑定企业项目ID。 取值范围:最大长度36字节,带“-”连字符的UUID格式,或者是字符串“0”。“0”表示默认企业项目。 说明: 关于企业项目ID的获取及企业项目特性的详细信息,请参见《企业管理用户指南》。 表4 security_group_rule对象 名称 参数类型 说明 id String 安全组规则标识。 description String 功能说明:安全组规则描述。 取值范围:0-255个字符,支持数字、字母、中文字符。 security_group_id String 安全组标识。 direction String 功能说明:出入控制方向。 取值范围: egress:出方向 ingress:入方向 ethertype String 功能说明:IP协议类型。 取值范围:IPv4,IPv6 protocol String 功能说明:协议类型。 取值范围:icmp、tcp、udp、icmpv6、IP协议号(0~255)(如gre协议号为47)。 约束:为空表示支持所有协议。 port_range_min Integer 功能说明:起始端口值。 取值范围:1~65535 约束:不能大于port_range_max的值,为空表示所有端口,如果协议是icmp类型,取值范围请参见安全组规则icmp协议名称对应关系表。 port_range_max Integer 功能说明:结束端口值。 取值范围:1~65535 约束:协议不为icmp时,取值不能小于port_range_min的值,为空表示所有端口,如果协议是icmp类型,取值范围请参见安全组规则icmp协议名称对应关系表。 remote_ip_prefix String 功能说明:远端IP地址,当direction是egress时为虚拟机访问端的地址,当direction是ingress时为访问虚拟机的地址。 取值范围:IP地址,或者cidr格式 约束:和remote_group_id,remote_address_group_id功能互斥。 remote_group_id String 功能说明:对端安全组id。 约束:和remote_ip_prefix,remote_address_group_id功能互斥。 remote_address_group_id String 功能说明:远端IP地址组ID。 约束:和remote_ip_prefix,remote_group_id功能互斥。 tenant_id String 功能说明:安全组规则所属项目ID。
  • 响应参数 表5 响应参数 参数名称 类型 说明 router router object router对象,参见表6。 表6 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 表7 external_gateway_info对象 属性 类型 说明 network_id String 外部网络的UUID。 外部网络的信息请通过GET /v2.0/networks?router:external=True或neutron net-external-list方式查询。 enable_snat Boolean 是否启用SNAT。 默认为false。 表8 route对象 属性 类型 说明 destination String IP地址段 nexthop String 下一跳IP地址,nexthop仅支持是router所关联的子网范围内IP地址
  • 响应示例 { "router": { "id": "f5dbdfe0-86f9-4b0a-9a32-6be143f0a076", "name": "router-220", "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": [], "created_at": "2018-09-20T02:06:07", "updated_at": "2018-09-20T02:06:09" }}
  • 响应示例 { "privateip": { "status": "DOWN", "id": "d600542a-b231-45ed-af05-e9930cb14f78", "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd", "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c", "device_owner": "", "ip_address": "192.168.1.11" }}
  • 请求参数 表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对象 routes 否 Array of route objects 扩展属性:路由信息列表,参见routes对象 表3 external_gateway_info对象 属性 是否必选 类型 说明 network_id 否 String 外部网络的UUID。 外部网络的信息请通过GET /v2.0/networks?router:external=True或neutron net-external-list方式查询。 表4 route对象 属性 是否必选 类型 说明 destination 否 String IP地址段 【使用说明】 前缀不能和直连路由重复 nexthop 否 String 下一跳IP地址,nexthop仅支持是router所关联的子网范围内IP地址
  • 响应参数 表2 响应参数 名称 参数类型 说明 privateip privateip object 私有IP对象,请参见表3。 表3 privateip字段说明 名称 参数类型 说明 status String 功能说明:私有IP的状态 取值范围: ACTIVE:活动的 DOWN:不可用 id String 私有IP标识 subnet_id String 分配IP的子网标识 如果您使用管理控制台,此值即为子网详情中的“网络ID”参数值。 tenant_id String 项目ID device_owner String 功能说明:私有IP的使用者,空表示未使用 取值范围: network:dhcp DHCP服务IP地址 network:router_interface_distributed 网关IP地址 compute:xxx(xxx对应具体的可用区名称,例如compute:aa-bb-cc表示是被可用区aa-bb-cc上的E CS 使用) 虚拟机网卡IP地址 neutron:VIP_PORT 虚拟IP地址 compute:subeni 辅助弹性网卡IP地址 neutron:LOADBALANCERV2 共享ELB使用的IP地址 neutron:LOADBALANCERV3 独享ELB使用的IP地址 network:endpoint_interface VPC终端节点 使用的IP地址 network:nat_gateway NAT网关使用的IP地址 约束:此处的取值范围只是本服务支持的类型,其他类型未做标注 ip_address String 申请到的私有IP
  • 请求示例 更新id为f49f00f1-0f15-470a-a8c5-4e879e461c8d的流日志,名称更新为flow-log-update。 PUT https://{Endpoint}/v1/b2782e6708b8475c993e6064bc456bf8/fl/flow_logs/f49f00f1-0f15-470a-a8c5-4e879e461c8d{ "flow_log": { "name": "flow-log-update", "description": "update", "admin_state": false }}
  • 响应示例 { "flow_log": { "id": "f49f00f1-0f15-470a-a8c5-4e879e461c8d", "name": " flow-log-update", "description": "update", "tenant_id": "b2782e6708b8475c993e6064bc456bf8", "resource_type": "port", "resource_id": "05c4052d-8d14-488f-aa00-19fea5a25fde", "traffic_type": "reject", "log_group_id": "05c4052d-8d14-488f-aa00-19fea5a25fdd", "log_topic_id": "a9d7dee7-37d2-4cba-a208-a016252aaa63", "log_store_type": "lts", "created_at": "2019-01-14T11:03:02", "updated_at": "2019-01-14T12:03:02", "status": "DOWN", "admin_state": false }}
  • 响应示例 { "firewall_group": { "status": "PENDING_CREATE", "public": false, "egress_firewall_policy_id": null, "name": "test", "admin_state_up": true, "ports": [ "c133f2bf-6937-4416-bb17-012e1be5cd2d" ], "tenant_id": "23c8a121505047b6869edf39f3062712", "id": "0415f554-26ed-44e7-a881-bdf4e6216e38", "ingress_firewall_policy_id": "afc52ce9-5305-4ec9-9feb-44feb8330341", "description": "", "project_id": "23c8a121505047b6869edf39f3062712", "created_at": "2018-09-12T08:24:14", "updated_at": "2018-09-12T08:24:14" }}
  • 请求示例 创建ACL组,关联入方向ACL策略afc52ce9-5305-4ec9-9feb-44feb8330341,网关口id为c133f2bf-6937-4416-bb17-012e1be5cd2d。 POST https://{Endpoint}/v2.0/fwaas/firewall_groups{ "firewall_group": { "name": "test", "ingress_firewall_policy_id": "afc52ce9-5305-4ec9-9feb-44feb8330341", "ports": [ "c133f2bf-6937-4416-bb17-012e1be5cd2d" ] }}
  • 请求参数 表1 请求参数 参数名称 类型 必选 说明 firewall_group firewall_group object 是 firewall group对象。请参见表2。 表2 Firewall Group对象 属性 是否必选 类型 说明 name 否 String 网络ACL组名称。 使用说明:最长255个字符 description 否 String 网络ACL组描述。 使用说明:最长255个字符 ingress_firewall_policy_id 否 String 入方向网络ACL策略。 egress_firewall_policy_id 否 String 出方向网络ACL策略。 ports 否 Array of strings 网络ACL组绑定的端口列表。 使用说明:必须为网关口的id。 说明: 网关口是device_owner为"network:router_interface_distributed"的端口,它的id的获取方式是: 通过虚拟私有云服务的API接口查询,具体操作可参考查询端口列表。查询port_id,过滤条件为指定的network_id和device_owner,其中network_id为网络ACL待关联子网的network_id。 样例: GET https://{Endpoint}/v1/{project_id}/ports?network_id={network_id}&device_owner=network%3Arouter_interface_distributed admin_state_up 否 Boolean 网络ACL的管理状态。 取值范围:true/false
  • 响应参数 表3 响应参数 参数名称 类型 说明 firewall_group firewall_group object firewall group对象。请参见表4。 表4 Firewall Group对象 属性 类型 说明 id String 网络ACL组的uuid标识。 name String 网络ACL组名称。 description String 网络ACL组描述。 tenant_id String 项目ID ingress_firewall_policy_id String 入方向网络ACL策略。 egress_firewall_policy_id String 出方向网络ACL策略。 ports Array of strings 网络ACL组绑定的端口列表。 public Boolean 是否支持跨租户共享。 status String 网络ACL策略的状态。 取值范围: ACTIVE:正常 INACTIVE:未激活 ERROR:错误 PENDING_CREATE:创建中 PENDING_UPDATE:更新中 PENDING_DELETE:删除中 admin_state_up Boolean 网络ACL的管理状态。 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss
  • 响应示例 { "security_group_rule": { "direction": "ingress", "ethertype": "IPv4", "id": "2bc0accf-312e-429a-956e-e4407625eb62", "description":"", "port_range_max": 80, "port_range_min": 80, "protocol": "tcp", "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a", "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "remote_address_group_id": null }}
  • 响应参数 表2 响应参数 名称 参数类型 说明 security_group_rule security_group_rule object 安全组规则对象,请参见表3。 表3 security_group_rule对象 名称 参数类型 说明 id String 安全组规则标识。 description String 功能说明:安全组规则描述。 取值范围:0-255个字符,支持数字、字母、中文字符。 security_group_id String 安全组标识。 direction String 功能说明:出入控制方向。 取值范围: egress:出方向 ingress:入方向 ethertype String 功能说明:IP协议类型。 取值范围:IPv4,IPv6 protocol String 功能说明:协议类型。 取值范围:icmp、tcp、udp、icmpv6、IP协议号(0~255)(如gre协议号为47)。 约束:为空表示支持所有协议。 port_range_min Integer 功能说明:起始端口值。 取值范围:1~65535 约束:不能大于port_range_max的值,为空表示所有端口,如果协议是icmp类型,取值范围请参见安全组规则icmp协议名称对应关系表。 port_range_max Integer 功能说明:结束端口值。 取值范围:1~65535 约束:协议不为icmp时,取值不能小于port_range_min的值,为空表示所有端口,如果协议是icmp类型,取值范围请参见安全组规则icmp协议名称对应关系表。 remote_ip_prefix String 功能说明:远端IP地址,当direction是egress时为虚拟机访问端的地址,当direction是ingress时为访问虚拟机的地址。 取值范围:IP地址,或者cidr格式 约束:和remote_group_id,remote_address_group_id功能互斥。 remote_group_id String 功能说明:对端安全组id。 约束:和remote_ip_prefix,remote_address_group_id功能互斥。 remote_address_group_id String 功能说明:远端IP地址组ID。 约束:和remote_ip_prefix,remote_group_id功能互斥。 tenant_id String 功能说明:安全组规则所属项目ID。
  • 响应示例 { "subnet_id": "ab78be2d-782f-42a5-aa72-35879f6890ff", "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "project_id": "6fbe9263116a4b68818cf1edce16bc4f", "port_id": "40e86635-b2a3-45de-a7c8-3cced5b7e755", "id": "5b8e885c-1347-4ac2-baf9-2249c8ed1270"}
  • 请求示例 路由器添加接口,路由器id为5b8e885c-1347-4ac2-baf9-2249c8ed1270,子网id为ab78be2d-782f-42a5-aa72-35879f6890ff。 PUT https://{Endpoint}/v2.0/routers/5b8e885c-1347-4ac2-baf9-2249c8ed1270/add_router_interface{"subnet_id": "ab78be2d-782f-42a5-aa72-35879f6890ff"}
  • 响应消息 响应参数 表6 响应参数 名称 参数类型 说明 port port object 端口对象,请参见表7。 表7 port字段说明 名称 参数类型 说明 id String 端口唯一标识 name String 功能说明:端口名称 取值:默认为空,最大长度不超过255 network_id String 功能说明:端口所属网络的ID 约束:必须是存在的网络ID admin_state_up Boolean 功能说明:管理状态 约束:只支持true,默认为true mac_address String 功能说明:端口MAC地址 约束:由系统分配,不支持指定 fixed_ips Array of fixed_ip objects 功能说明:端口IP。例如:"fixed_ips": [{"subnet_id": "4dc70db6-cb7f-4200-9790-a6a910776bba", "ip_address": "192.169.25.79"}] 约束:一个端口只支持一个fixed_ip,且不支持更新。 device_id String 功能说明:端口所属设备ID 约束:不支持设置和更新,由系统自动维护 device_owner String 功能说明:设备所属(DHCP/Router/ lb/Nova) 约束:不支持设置和更新,由系统自动维护 tenant_id String 项目ID。 status String 功能说明:端口状态,Hana硬直通虚拟机端口状态总为DOWN 取值范围:ACTIVE、BUILD、DOWN security_groups Array of strings 安全组的UUID(扩展属性) allowed_address_pairs Array of allow_address_pairobjects 功能说明:IP/Mac对列表,allow_address_pair参见表9(扩展属性)。 约束:IP地址不允许为 “0.0.0.0” 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组 如果allowed_address_pairs为“1.1.1.1/0”,表示关闭源目的地址检查开关 extra_dhcp_opts Array of extra_dhcp_opt objects DHCP的扩展Option(扩展属性),请参见表10 binding:vif_details Object vif的详细信息, "ovs_hybrid_plug": 是否为ovs/bridge混合模式 binding:profile Object 扩展属性:提供用户设置自定义信息 【使用说明】 internal_elb字段,布尔类型,普通租户可见。只有在创建内网ELB的虚拟IP的网卡时设置为true。普通租户没有权限更改该字段,由系统维护。 举例: {"internal_elb": true} disable_security_groups字段,布尔类型,普通租户可见。默认为false高性能通信场景下,允许指定为true普通租户可见。仅支持创建port和读取时指定。当前仅支持指定为true,不支持指定为false 举例: {"disable_security_groups":true }, 当前仅支持指定为true,不支持指定为false,指定为true时,FWaaS功能不生效。 binding:vnic_type String 功能说明:绑定的vNIC类型 取值范围:normal或者direct。normal: 软交换,direct: SRIOV硬直通(不支持) port_security_enabled Boolean 端口安全使能标记,如果不使能则安全组和dhcp防欺骗不生效,默认为true 表8 fixed_ip对象 名称 参数类型 说明 subnet_id String 功能说明:所属子网ID 约束:不支持更新 ip_address String 端口IP地址 表9 allow_address_pair对象 名称 参数类型 说明 ip_address String 功能说明:IP地址 约束:不支持0.0.0.0 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组。 mac_address String MAC地址 表10 extra_dhcp_opt对象 名称 参数类型 说明 opt_name String Option名称 opt_value String Option值 响应样例: { "port": { "id": "7204e0da-40de-4207-a536-6f59b84f6f0e", "name": "adc", "status": "DOWN", "admin_state_up": "true", "fixed_ips": [ { "subnet_id": "689156ca-038f-4478-b265-fd26aa8bbe31", "ip_address": "192.168.0.9" } ], "mac_address": "fa:16:3e:d7:f2:6c", "network_id": "b4152e98-e3af-4e49-bb7f-7766e2b5ec63", "tenant_id": "caa6cf4337ea47fb823b15709ebe8591", "device_id": "", "device_owner": "", "security_groups": [ "59b39002-e79b-4bac-8e27-aa884ab1beb6" ], "extra_dhcp_opts": [], "allowed_address_pairs": [], "binding:vnic_type": "normal", "binding:vif_details": {}, "binding:profile": {}, "port_security_enabled":true }}
  • 请求消息 请求参数 表2 请求参数 名称 是否必选 参数类型 说明 port 是 port object 端口对象,请参见表3。 表3 port字段说明 名称 是否必选 参数类型 说明 name 否 String 功能说明:端口名称 取值:默认为空,最大长度不超过255 security_groups 否 Array of strings 安全组的UUID allowed_address_pairs 否 Array of allow_address_pair objects 功能说明:IP/Mac对列表,allow_address_pair参见表4。 约束: IP地址不允许为 “0.0.0.0”。 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组。 如果allowed_address_pairs为“1.1.1.1/0”,表示关闭源目的地址检查开关。 为虚拟IP配置后端ECS场景,allowed_address_pairs中配置的IP地址,必须为ECS网卡已有的IP地址,否则可能会导致虚拟IP通信异常。 extra_dhcp_opts 否 Array of extra_dhcp_opt objects DHCP的扩展Option(扩展属性),请参见表5。 表4 allow_address_pair对象 名称 参数类型 说明 ip_address String 功能说明:IP地址 约束:不支持0.0.0.0 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组。 mac_address String MAC地址 表5 extra_dhcp_opt对象 名称 是否必选 参数类型 说明 opt_name 否 String Option名称 opt_value 否 String Option值 请求样例: { "port": { "name": "adc" }}
  • 响应消息 响应参数 表6 响应参数 名称 参数类型 说明 port port object 端口对象,请参见表7。 表7 port字段说明 名称 参数类型 说明 id String 端口唯一标识 name String 功能说明:端口名称 取值:默认为空,最大长度不超过255 network_id String 功能说明:端口所属网络的ID 约束:必须是存在的网络ID admin_state_up Boolean 功能说明:管理状态 约束:只支持true,默认为true mac_address String 功能说明:端口MAC地址 约束:由系统分配,不支持指定 fixed_ips Array of fixed_ip objects 功能说明:端口IP。例如:"fixed_ips": [{"subnet_id": "4dc70db6-cb7f-4200-9790-a6a910776bba", "ip_address": "192.169.25.79"}] 约束:一个端口只支持一个fixed_ip,且不支持更新。 device_id String 功能说明:端口所属设备ID 约束:不支持设置和更新,由系统自动维护 device_owner String 功能说明:设备所属(DHCP/Router/ lb/Nova) 约束:不支持设置和更新,由系统自动维护 tenant_id String 项目ID。 status String 功能说明:端口状态,Hana硬直通虚拟机端口状态总为DOWN 取值范围:ACTIVE、BUILD、DOWN security_groups Array of strings 安全组的UUID(扩展属性) allowed_address_pairs Array of allow_address_pairobjects 功能说明:IP/Mac对列表,allow_address_pair参见表9(扩展属性)。 约束:IP地址不允许为 “0.0.0.0” 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组 如果allowed_address_pairs为“1.1.1.1/0”,表示关闭源目的地址检查开关 extra_dhcp_opts Array of extra_dhcp_opt objects DHCP的扩展Option(扩展属性),请参见表10 binding:vif_details Object vif的详细信息, "ovs_hybrid_plug": 是否为ovs/bridge混合模式 binding:profile Object 扩展属性:提供用户设置自定义信息 【使用说明】 internal_elb字段,布尔类型,普通租户可见。只有在创建内网ELB的虚拟IP的网卡时设置为true。普通租户没有权限更改该字段,由系统维护。 举例: {"internal_elb": true} disable_security_groups字段,布尔类型,普通租户可见。默认为false高性能通信场景下,允许指定为true普通租户可见。仅支持创建port和读取时指定。当前仅支持指定为true,不支持指定为false 举例: {"disable_security_groups":true }, 当前仅支持指定为true,不支持指定为false,指定为true时,FWaaS功能不生效。 binding:vnic_type String 功能说明:绑定的vNIC类型 取值范围:normal或者direct。normal: 软交换,direct: SRIOV硬直通(不支持) port_security_enabled Boolean 端口安全使能标记,如果不使能则安全组和dhcp防欺骗不生效,默认为true 表8 fixed_ip对象 名称 参数类型 说明 subnet_id String 功能说明:所属子网ID 约束:不支持更新 ip_address String 端口IP地址 表9 allow_address_pair对象 名称 参数类型 说明 ip_address String 功能说明:IP地址 约束:不支持0.0.0.0 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组。 mac_address String MAC地址 表10 extra_dhcp_opt对象 名称 参数类型 说明 opt_name String Option名称 opt_value String Option值 响应样例 { "port": { "id": "d00f9c13-412f-4855-8af3-de5d8c24cd60", "name": "test", "status": "DOWN", "admin_state_up": "true", "fixed_ips": [ { "subnet_id": "70f2e74b-e660-410a-b754-0ca46744348a", "ip_address": "10.128.1.10" } ], "mac_address": "fa:16:3e:d7:f2:6c", "network_id": "5b808927-13c9-4e60-a4f4-ed6ffe225167", "tenant_id": "43f2d1cca56a40729dcb17212482f34d", "device_id": "", "device_owner": "", "security_groups": [ "02b4e8ee-74fa-4a31-802e-5490df11245e" ], "extra_dhcp_opts": [], "allowed_address_pairs": [], "binding:vnic_type": "normal", "binding:vif_details": {}, "binding:profile": {}, "port_security_enabled":true }}
  • 请求消息 请求参数 表1 请求参数 名称 是否必选 参数类型 说明 port 是 port object 端口对象,请参见表2。 表2 port字段说明 名称 是否必选 参数类型 说明 name 否 String 功能说明:端口名称 取值:默认为空,最大长度不超过255 network_id 是 String 功能说明:端口所属网络的ID 约束:必须是存在的网络ID admin_state_up 否 Boolean 功能说明:管理状态 约束:只支持true,默认为true fixed_ips 否 Array of fixed_ip objects 功能说明:端口IP。请参见表3。 例如:"fixed_ips": [{"subnet_id": "4dc70db6-cb7f-4200-9790-a6a910776bba", "ip_address": "192.169.25.79"}] 约束:一个端口只支持一个fixed_ip,且不支持更新。 tenant_id 否 String 项目ID。 security_groups 否 Array of strings 安全组的UUID,例如:"security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"](扩展属性) allowed_address_pairs 否 Array of allow_address_pair objects 功能说明:IP/Mac对列表,allow_address_pair参见表4(扩展属性) 约束:IP地址不允许为 “0.0.0.0” 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组 如果allowed_address_pairs为“1.1.1.1/0”,表示关闭源目的地址检查开关 extra_dhcp_opts 否 Array of extra_dhcp_opt objects DHCP的扩展Option(扩展属性) port_security_enabled 否 Boolean 端口安全使能标记,如果不使能则安全组和dhcp防欺骗不生效,默认为true 表3 fixed_ip对象 名称 是否必选 参数类型 说明 subnet_id 否 String 功能说明:所属子网ID 约束:不支持更新 ip_address 否 String 功能说明:端口IP地址 约束:不支持更新 表4 allow_address_pair对象 名称 是否必选 参数类型 说明 ip_address 否 String 功能说明:IP地址 约束:不支持0.0.0.0 如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组 如果allowed_address_pairs为“1.1.1.1/0”,表示关闭源目的地址检查开关 mac_address 否 String MAC地址 表5 extra_dhcp_opt对象 名称 是否必选 参数类型 说明 opt_name 否 String Option名称 opt_value 否 String Option值 请求样例 POST https://{Endpoint}/v1/ports{ "port": { "fixed_ips": [ { "ip_address": "192.168.0.38", "subnet_id": "06bc2359-d75e-4f96-82f4-313e39c7148c" } ], "network_id": "28a1c93c-9a5e-4a9f-813b-e495bdef7d34", "security_groups": [ "f2c5b3fc-b971-4a86-87b9-032586260e3e" ] }}
  • 响应示例 { "name": "test", "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"}
共100000条
提示

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