华为云用户手册

  • 请求示例 创建一条流量镜像筛选规则,入方向,筛选条件ID为417d7317-6c17-4428-a0f3-997d3e2293a0,源cidr为192.168.0.0/24。 POST http://{endpoint}/v3/{project_id}/vpc/traffic-mirror-filter-rules { "traffic_mirror_filter_rule" : { "traffic_mirror_filter_id" : "417d7317-6c17-4428-a0f3-997d3e2293a0", "ethertype" : "ipv4", "direction" : "ingress", "protocol" : "ICMP", "source_cidr_block" : "192.168.0.0/24", "action" : "accept", "priority" : 29 } }
  • 响应示例 状态码: 200 OK { "traffic_mirror_session" : { "name" : "test-session", "created_at" : "2023-03-23T10:53:12.000+00:00", "updated_at" : "2023-03-23T10:56:54.000+00:00", "id" : "16538eda-7e94-4b90-b5f3-a653f62dc817", "project_id" : "7365fcd452924e398ec4cc1fe39c0d12", "description" : "", "traffic_mirror_filter_id" : "b765ba87-c0b4-4f1a-9ec3-d5b1d1ddb137", "traffic_mirror_sources" : [ "6134900d-31a6-4b71-8453-dbca7f26982a" ], "traffic_mirror_target_id" : "c9f8acef-d550-4fbe-be7c-e8bfd3501dc1", "traffic_mirror_target_type" : "elb", "virtual_network_id" : 1, "packet_length" : 96, "priority" : 11, "enabled" : true, "type" : "eni" }, "request_id" : "a7ee4a0e-12e9-457a-b739-46bffb2e7bbb" }
  • 请求示例 更新ID为16538eda-7e94-4b90-b5f3-a653f62dc817的流量镜像会话,镜像目的类型为elb,镜像目的ID为c9f8acef-d550-4fbe-be7c-e8bfd3501dc1 PUT http://{endpoint}/v3/{project_id}/vpc/traffic-mirror-sessions/16538eda-7e94-4b90-b5f3-a653f62dc817 { "traffic_mirror_session" : { "traffic_mirror_target_id" : "c9f8acef-d550-4fbe-be7c-e8bfd3501dc1", "traffic_mirror_target_type" : "elb" } }
  • 响应示例 状态码: 200 GET操作正常返回,更多状态码请参见状态码。 { "security_group_rule" : { "id" : "f626eb24-d8bd-4d26-ae0b-c16bb65730cb", "project_id" : "060576782980d5762f9ec014dd2f1148", "security_group_id" : "0552091e-b83a-49dd-88a7-4a5c86fd9ec3", "direction" : "ingress", "protocol" : "tcp", "description" : "security group rule description", "created_at" : "2020-08-13T07:12:36.000+00:00", "updated_at" : "2020-08-13T07:12:36.000+00:00", "ethertype" : "IPv4", "remote_ip_prefix" : "10.10.0.0/16", "multiport" : 333, "action" : "allow", "priority" : 1 }, "request_id" : "034c4840bde0b1263a4b2e66fbd74d5f" }
  • 请求示例 添加扩展网段,vpc id为99d9d709-8478-4b46-9f3f-2206b1023fd3,添加的扩展网段为23.8.0.0/16。 PUT https://{Endpoint}/v3/{project_id}/vpc/vpcs/99d9d709-8478-4b46-9f3f-2206b1023fd3/add-extend-cidr { "vpc" : { "extend_cidrs" : [ "23.8.0.0/16" ] } }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 dry_run 否 Boolean 功能说明:是否只预检此次请求。 取值范围: true:发送检查请求,不会添加扩展网段。检查项包括是否填写了必需参数、请求格式、业务限制。如果检查不通过,则返回对应错误。如果检查通过,则返回响应码202。 false(默认值):发送正常请求,并直接添加VPC扩展网段。 vpc 是 AddExtendCidrOption object 添加VPC扩展网段请求体。 表3 AddExtendCidrOption 参数 是否必选 参数类型 描述 extend_cidrs 是 Array of strings 功能说明:扩展cidr列表。 取值范围:不能包含以下网段 100.64.0.0/10 214.0.0.0/7 198.18.0.0/15 169.254.0.0/16 0.0.0.0/8 127.0.0.0/8 240.0.0.0/4 172.31.0.0/16 192.168.0.0/16 255.255.255.255/32
  • 响应示例 状态码: 200 PUT操作正常返回,更多状态码请参见状态码。 { "request_id" : "84eb4f775d66dd916db121768ec55626", "vpc" : { "id" : "0552091e-b83a-49dd-88a7-4a5c86fd9ec3", "name" : "vpc1", "description" : "test1", "cidr" : "192.168.0.0/16", "extend_cidrs" : [ "23.8.0.0/16" ], "enterprise_project_id" : "0", "tags" : [ { "key" : "key", "value" : "value" } ], "cloud_resources" : [ { "resource_type" : "routetable", "resource_count" : 1 } ], "status" : "ACTIVE", "project_id" : "060576782980d5762f9ec014dd2f1148", "created_at" : "2018-03-23T09:26:08", "updated_at" : "2018-08-24T08:49:53" } } 状态码: 202 API V3的指定预检请求正常返回,更多状态码请参见状态码。 { "error_msg" : "Request validation has been passed with dry run...", "error_code" : "SYS.0202", "request_id" : "cfd81aea3f59eac7128dba4b36d516c8" }
  • URI GET /v3/{project_id}/vpc/firewalls 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方式请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 功能说明:每页返回的个数。 取值范围:0~2000。 marker 否 String 分页查询起始的资源ID,为空时查询第一页。 id 否 Array 功能说明:网络ACL唯一标识,填写后接口按照id进行过滤,支持多id同时过滤。 name 否 Array 功能说明:ACL名称,填写后按照名称进行过滤,支持多名称同时过滤。 status 否 String 功能说明:ACL的状态,填写后按照状态进行过滤。 admin_state_up 否 Boolean 功能说明:ACL管理状态,填写后按照管理状态进行过滤。 enterprise_project_id 否 Array 功能说明:企业项目ID。可以使用该字段过滤某个企业项目下的ACL。 取值范围:最大长度36字节,带“-”连字符的UUID格式,或者是字符串“0”。“0”表示默认企业项目。若需要查询当前用户所有企业项目绑定的ACL,请传参all_granted_eps。
  • 响应示例 状态码: 200 GET操作正常返回,更多状态码请参见状态码。 { "firewalls" : [ { "id" : "e9a7731d-5bd9-4250-a524-b9a076fd5629", "name" : "network_acl_test1", "description" : "network_acl_test1", "project_id" : "9476ea5a8a9849c38358e43c0c3a9e12", "created_at" : "2022-04-07T07:30:46.000+00:00", "updated_at" : "2022-04-07T07:30:46.000+00:00", "admin_state_up" : true, "enterprise_project_id" : "158ad39a-dab7-45a3-9b5a-2836b3cf93f9", "status" : "ACTIVE", "tags" : [ ], "associations" : [ { "virsubnet_id" : "8359e5b0-353f-4ef3-a071-98e67a34a143" } ] } ] }
  • 响应示例 状态码: 200 GET操作正常返回,更多状态码请参见状态码。 { "request_id" : "84eb4f775d66dd916db121768ec55626", "vpc" : { "id" : "0552091e-b83a-49dd-88a7-4a5c86fd9ec3", "name" : "name-test", "description" : "description-test", "cidr" : "192.168.0.0/16", "extend_cidrs" : [ "21.8.0.0/16" ], "enterprise_project_id" : "0", "tags" : [ { "key" : "key", "value" : "value" } ], "cloud_resources" : [ { "resource_type" : "routetable", "resource_count" : 1 } ], "status" : "ACTIVE", "project_id" : "060576782980d5762f9ec014dd2f1148", "created_at" : "2018-03-23T09:26:08", "updated_at" : "2018-08-24T08:49:53" } }
  • 请求示例 使用辅助弹性网卡ID过滤查询辅助弹性网卡列表。 GET https://{Endpoint}/v3/8c6fb137a48a428aaf9a0229dca4edb3/vpc/sub-network-interfaces?id=022b5c53-20e1-4f4b-b90c-0575a5e97412&id=056d6cb4-b436-460d-9a63-67666bf3ea9c 多条件组合过滤查询辅助弹性网卡 https://{Endpoint}/v3/8c6fb137a48a428aaf9a0229dca4edb3/vpc/sub-network-interfaces?virsubnet_id=3eae2c96-de45-4c41-bf2d-e4ad53a2acb4&private_ip_address=192.168.22.177&parent_id=5eb9dc59-8159-4197-88ea-f3507ad8e0a7 分页查询辅助弹性网卡列表 GET https://{Endpoint}/v3/8c6fb137a48a428aaf9a0229dca4edb3/vpc/sub-network-interfaces?limit=2
  • 响应示例 状态码: 200 GET操作正常返回,更多状态码请参见状态码。 { "request_id" : "e4cb9e3a-7b99-41c9-afd8-1630fe313299", "sub_network_interfaces" : [ { "id" : "2be868f2-f7c9-48db-abc0-eea0b9105b0d", "project_id" : "8c6fb137a48a428aaf9a0229dca4edb3", "virsubnet_id" : "08278e6c-61ca-46c1-9fc3-0d4f6c12f193", "private_ip_address" : "10.0.0.225", "mac_address" : "fa:16:3e:48:f8:6f", "parent_device_id" : "1ab01f1d-4ef7-4d83-82be-802b3aca0223", "security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ], "allowed_address_pairs" : [ ], "vpc_id" : "63b97e6b-3598-430f-9eb8-1caf06937be8", "parent_id" : "637748df-2986-4350-8303-95d259580fb3", "vlan_id" : 2787, "instance_type" : "", "instance_id" : "", "tags" : [ ], "created_at" : "2020-05-19T01:16:25.000+00:00" }, { "id" : "55761e2d-8f72-42c0-9874-98e9885bf0fe", "project_id" : "8c6fb137a48a428aaf9a0229dca4edb3", "virsubnet_id" : "08278e6c-61ca-46c1-9fc3-0d4f6c12f193", "private_ip_address" : "10.0.3.55", "mac_address" : "fa:16:3e:c2:2c:ba", "parent_device_id" : "1ab01f1d-4ef7-4d83-82be-802b3aca0223", "security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ], "allowed_address_pairs" : [ ], "vpc_id" : "63b97e6b-3598-430f-9eb8-1caf06937be8", "parent_id" : "637748df-2986-4350-8303-95d259580fb3", "vlan_id" : 799, "instance_type" : "", "instance_id" : "", "tags" : [ ], "created_at" : "2020-05-19T01:16:31.000+00:00" } ], "page_info" : { "next_marker" : "55761e2d-8f72-42c0-9874-98e9885bf0fe", "previous_marker" : "2be868f2-f7c9-48db-abc0-eea0b9105b0d", "current_count" : 2 } }
  • URI GET /v3/{project_id}/vpc/sub-network-interfaces 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方式请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 功能说明:每页返回的个数。 取值范围:0-2000。 marker 否 String 分页查询起始的资源ID,为空时查询第一页。 id 否 Array 功能说明:辅助弹性网卡ID,支持多ID过滤。 使用场景:查询需要的多个辅助弹性网卡信息。 description 否 Array 功能说明:辅助弹性网卡的描述信息,支持多个同时过滤。 使用场景:通过描述信息过滤辅助弹性网卡。 vpc_id 否 Array 功能说明:辅助弹性网卡所属的VPC_ID,支持多ID过滤。 使用场景:过滤单个或多个VPC下的辅助弹性网卡信息。 virsubnet_id 否 Array 功能说明:辅助弹性网卡所属虚拟子网的ID,支持多个ID过滤。 使用场景:过滤需要的单个或者多个虚拟子网下的辅助弹性网卡。 parent_id 否 Array 功能说明:辅助弹性网卡的宿主网卡的ID,支持多ID过滤。 使用场景:过滤单个或多个宿主网卡下存在的辅助弹性网卡。 private_ip_address 否 Array 功能说明:辅助弹性网卡的私有IPv4地址,支持多个地址同时过滤。 使用场景:通过单个或者多个ip地址过滤查询辅助弹性网卡。 mac_address 否 Array 功能说明:辅助弹性网卡的mac地址,支持多个同时过滤。 使用场景:使用mac地址精确过滤辅助弹性网卡。 enable_ip 否 Boolean 功能说明:按照“是否关联EIP”过滤查询。 scope 否 String 功能说明:按照publicBorderGroup过滤查询。 security_groups 否 String 功能说明:辅助弹性网卡绑定的安全组id,支持多个id同时过滤。 enterprise_project_id 否 String 功能说明:企业项目ID。可以使用该字段过滤某个企业项目下的IP地址组。 取值范围:最大长度36字节,带“-”连字符的UUID格式,或者是字符串“0”。“0”表示默认企业项目。若需要查询当前用户所有企业项目绑定的IP地址组,请传参all_granted_eps。
  • 响应示例 状态码: 200 GET操作正常返回,更多状态码请参见状态码。 { "address_group" : { "id" : "dd18a501-fcd5-4adc-acfe-b0e2384baf08", "name" : "AutoTester746010.580123789", "tenant_id" : "b2782e6708b8475c993e6064bc456bf8", "ip_version" : 4, "max_capacity" : 20, "ip_set" : [ "192.168.5.0/24", "192.168.3.20-192.168.3.100", "192.168.3.40", "192.168.3.2" ], "ip_extra_set" : [ { "ip" : "192.168.5.0/24", "remarks" : null }, { "ip" : "192.168.3.20-192.168.3.100", "remarks" : null }, { "ip" : "192.168.3.40", "remarks" : null }, { "ip" : "192.168.3.2", "remarks" : null } ], "enterprise_project_id" : "0aad99bc-f5f6-4f78-8404-c598d76b0ed2", "created_at" : "2019-06-28T02:06:38.000+00:00", "updated_at" : "2019-06-28T02:06:38.000+00:00", "description" : "10.10.4.0/23", "status" : "NORMAL", "status_message" : "" }, "request_id" : "ce6c359b-9002-41e5-a0b1-232759bd6637" }
  • 响应示例 状态码: 200 OK { "traffic_mirror_session" : { "name" : "test-session", "created_at" : "2023-02-23T06:57:39.000+00:00", "updated_at" : "2023-02-23T06:57:39.000+00:00", "id" : "e15a6e40-2580-4949-bf2a-55ee7cd49392", "project_id" : "7365fcd452924e398ec4cc1fe39c0d12", "description" : "", "traffic_mirror_filter_id" : "b765ba87-c0b4-4f1a-9ec3-d5b1d1ddb137", "traffic_mirror_sources" : [ "6134900d-31a6-4b71-8453-dbca7f26982a" ], "traffic_mirror_target_id" : "1adbc9b3-df85-4343-948a-d129536fa309", "traffic_mirror_target_type" : "eni", "virtual_network_id" : 1, "packet_length" : 96, "priority" : 6, "enabled" : true, "type" : "eni" }, "request_id" : "be17b2e9-098c-4b56-ac0c-97e6b6413f12" }
  • 响应示例 状态码: 200 PUT操作正常返回,更多状态码请参见状态码。 { "port" : { "name" : "", "id" : "99fd0c77-56b4-4bf6-8365-df352e45d5fc", "admin_state_up" : true, "status" : "DOWN", "project_id" : "f5dab68cd75740e68c599e9af5fe0aed", "device_id" : "", "mac_address" : "fa:16:3e:1f:17:df", "device_owner" : "", "description" : "", "zone_id" : "", "scope" : "center", "position_type" : "center", "created_at" : "2023-05-10T01:35:02.000+00:00", "updated_at" : "2023-05-10T01:35:02.000+00:00", "port_security_enabled" : true, "tags" : [ ], "security_groups" : [ "567be4e3-d171-46ce-9e8a-c15e91cfe86a", "8edd3747-ccd4-49a1-82b9-a165eec314b4", "6c2d4540-3b7d-4207-a319-a7231b439995", "4940b983-5992-4663-bed9-d1d1e15d1009" ], "allowed_address_pairs" : [ ], "extra_dhcp_opts" : [ ], "instance_id" : "", "instance_type" : "", "ecs_flavor" : "", "enable_efi" : false, "virsubnet_id" : "3847b263-2370-45c0-8236-38a1de568049", "private_ips" : [ { "subnet_cidr_id" : "ffe98087-6d4f-45cd-988b-1c87f75d2d53", "ip_address" : "192.168.158.228" } ], "binding:host_id" : "", "binding:vif_type" : "unbound", "binding:vnic_type" : "normal", "binding:vif_details" : { }, "binding:profile" : { }, "binding:migration_info" : { } }, "request_id" : "458691c0-7db2-43d8-9400-053800c5ff53" }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 port 是 InsertSecurityGroupOption object 端口插入安全组请求体。 表3 InsertSecurityGroupOption 参数 是否必选 参数类型 描述 security_groups 是 Array of strings 功能说明:安全组的ID列表,例如:"security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"]。 index 否 Integer 安全组插入的位置,从0开始计数。 举例: 要插入到已关联安全组列表的首位,index=0; 要插入到已关联安全组列表的第n个安全组后面,index=n。 默认插入到端口已关联的安全组列表末尾。
  • 请求示例 指定端口插入安全组,端口99fd0c77-56b4-4bf6-8365-df352e45d5fc已关联的安全组列表为["567be4e3-d171-46ce-9e8a-c15e91cfe86a", "4940b983-5992-4663-bed9-d1d1e15d1009"],要将新安全组插入到第1个安全组567be4e3-d171-46ce-9e8a-c15e91cfe86a后面,此时新安全组插入的index为1。 PUT https://{Endpoint}/v3/f5dab68cd75740e68c599e9af5fe0aed/ports/99fd0c77-56b4-4bf6-8365-df352e45d5fc/insert-security-groups { "port" : { "security_groups" : [ "8edd3747-ccd4-49a1-82b9-a165eec314b4", "6c2d4540-3b7d-4207-a319-a7231b439995" ], "index" : 1 } }
  • 请求示例 查询安全组资源实例,action为filter时请求体。 POST https://{Endpoint}/v2.0/{project_id}/security-groups/resource_instances/action { "offset" : "0", "limit" : "100", "action" : "filter", "matches" : [ { "key" : "resource_name", "value" : "resource1" } ], "tags" : [ { "key" : "key1", "values" : [ "*value1", "value2" ] } ] } example-2:action为count时请求体 POST https://{Endpoint}/v2.0/{project_id}/security-groups/resource_instances/action { "action" : "count", "tags" : [ { "key" : "key1", "values" : [ "value1", "value2" ] }, { "key" : "key2", "values" : [ "value1", "value2" ] } ], "matches" : [ { "key" : "resource_name", "value" : "resource1" } ] }
  • 响应示例 状态码: 200 请求体action为filter时返回资源tag列表,action为count时返回tag总数 { "resources" : [ { "resource_id" : "cdfs_cefs_wesas_12_dsad", "resource_name" : "resouece1", "tags" : [ { "key" : "key1", "value" : "value1" }, { "key" : "key2", "value" : "value1" } ] } ], "total_count" : 1000 }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 action 是 String 功能说明:操作标识 取值范围:filter(过滤),count(查询总条数) limit 否 Integer 功能说明:查询记录数 取值范围:1-1000 约束:action为count时此参数不生效;action为filter时默认为1000 offset 否 Integer 功能说明:索引位置, 从offset指定的下一条数据开始查询。 查询第一页数据时,不需要传入此参数,查询后续页码数据时,将查询前一页数据时响应体中的值带入此参数 约束:action为count时无此参数;action为filter时默认为0;必须为数字,不能为负数 matches 否 Array of Match objects 功能说明:搜索字段,key为要匹配的字段,value为匹配的值 约束:当前仅支持resource_name tags 否 Array of ListTag objects 包含标签,最多包含10个key,每个key下面的value最多10个,结构体不能缺失,key不能为空或者空字符串。Key不能重复,同一个key中values不能重复 表3 Match 参数 是否必选 参数类型 描述 key 是 String 键。当前仅限定为resource_name value 是 String 值。每个值最大长度255个unicode字符,不能包含$ - . /等特殊字符。 最大长度:255 表4 ListTag 参数 是否必选 参数类型 描述 key 是 String 功能说明:标签键 约束:key不能为空 最小长度:1 最大长度:127 values 是 Array of strings 功能描述:标签值列表。 如果values为空列表,则表示any_value。value之间为或的关系。
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 resources Array of ListResourceResp objects 资源列表 total_count Integer 资源数量 表6 ListResourceResp 参数 参数类型 描述 resource_detail Object 资源详情。 资源对象,用于扩展。默认为空 resource_id String 资源ID resource_name String 资源名称,没有默认为空字符串 tags Array of ResourceTag objects 标签列表,没有标签默认为空数组 表7 ResourceTag 参数 参数类型 描述 key String 功能说明:标签键 约束:同一资源的key值不能重复。 最小长度:0 最大长度:36 value String 功能说明:标签值 最小长度:0 最大长度:43 状态码: 400 表8 响应Body参数 参数 参数类型 描述 code String 请求返回的错误码 message String 请求返回的错误信息 最小长度:1 最大长度:999 状态码: 401 表9 响应Body参数 参数 参数类型 描述 code String 请求返回的错误码 message String 请求返回的错误信息 最小长度:1 最大长度:999 状态码: 403 表10 响应Body参数 参数 参数类型 描述 code String 请求返回的错误码 message String 请求返回的错误信息 最小长度:1 最大长度:999 状态码: 404 表11 响应Body参数 参数 参数类型 描述 code String 请求返回的错误码 message String 请求返回的错误信息 最小长度:1 最大长度:999 状态码: 409 表12 响应Body参数 参数 参数类型 描述 code String 请求返回的错误码 message String 请求返回的错误信息 最小长度:1 最大长度:999 状态码: 500 表13 响应Body参数 参数 参数类型 描述 code String 请求返回的错误码 message String 请求返回的错误信息 最小长度:1 最大长度:999
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 dry_run 否 Boolean 功能说明:是否只预检此次请求。 取值范围: true:发送检查请求,不会移除VPC扩展网段。检查项包括是否填写了必需参数、请求格式、业务限制。如果检查不通过,则返回对应错误。如果检查通过,则返回响应码202。 false(默认值):发送正常请求,并直接移除VPC扩展网段。 vpc 是 RemoveExtendCidrOption object 移除VPC扩展网段请求体。 表3 RemoveExtendCidrOption 参数 是否必选 参数类型 描述 extend_cidrs 是 Array of strings 功能说明:移除VPC扩展网段。 取值范围:该VPC已经存在的扩展网段。 约束:移除扩展网段前,请先清理该VPC下对应cidr范围内的subnet。
  • 请求示例 移除id为99d9d709-8478-4b46-9f3f-2206b1023fd3的vpc的扩展网段23.8.0.0/16。 PUT https://{Endpoint}/v3/{project_id}/vpc/vpcs/99d9d709-8478-4b46-9f3f-2206b1023fd3/remove-extend-cidr { "vpc" : { "extend_cidrs" : [ "23.8.0.0/16" ] } }
  • 响应示例 状态码: 200 PUT操作正常返回,更多状态码请参见状态码。 { "request_id" : "84eb4f775d66dd916db121768ec55626", "vpc" : { "id" : "0552091e-b83a-49dd-88a7-4a5c86fd9ec3", "name" : "vpc1", "description" : "test1", "cidr" : "192.168.0.0/16", "extend_cidrs" : [ ], "enterprise_project_id" : "0", "tags" : [ { "key" : "key", "value" : "value" } ], "cloud_resources" : [ { "resource_type" : "routetable", "resource_count" : 1 } ], "status" : "ACTIVE", "project_id" : "060576782980d5762f9ec014dd2f1148", "created_at" : "2018-03-23T09:26:08", "updated_at" : "2018-08-24T08:49:53" } } 状态码: 202 API V3的指定预检请求正常返回,更多状态码请参见状态码。 { "error_msg" : "Request validation has been passed with dry run...", "error_code" : "SYS.0202", "request_id" : "cfd81aea3f59eac7128dba4b36d516c8" }
  • 响应示例 状态码: 200 OK { "request_id" : "f87354b7-eecd-4b64-87f6-bfd6430e33bd", "traffic_mirror_sessions" : [ { "name" : "test-session", "created_at" : "2023-03-14T08:44:12.000+00:00", "updated_at" : "2023-03-14T08:44:12.000+00:00", "id" : "6cc12480-5a92-4aed-99fb-07c52cc98961", "project_id" : "7365fcd452924e398ec4cc1fe39c0d12", "description" : "", "traffic_mirror_filter_id" : "b765ba87-c0b4-4f1a-9ec3-d5b1d1ddb137", "traffic_mirror_sources" : [ "6134900d-31a6-4b71-8453-dbca7f26982a" ], "traffic_mirror_target_id" : "029ab12b-dc38-4228-b146-44975bf55250", "traffic_mirror_target_type" : "eni", "virtual_network_id" : 1, "packet_length" : 96, "priority" : 9, "enabled" : true, "type" : "eni" } ], "page_info" : { "previous_marker" : "6cc12480-5a92-4aed-99fb-07c52cc98961", "current_count" : 1 } }
  • URI GET /v3/{project_id}/vpc/traffic-mirror-sessions 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方式请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 id 否 String 使用镜像会话ID过滤或排序 name 否 String 使用镜像会话名称过滤或排序 description 否 String 使用镜像会话描述过滤 enabled 否 String 使用enabled过滤 packet_length 否 String 使用最大传输单元MTU过滤 priority 否 String 使用镜像会话优先级过滤 traffic_mirror_filter_id 否 String 使用筛选条件ID过滤 traffic_mirror_target_type 否 String 使用镜像目的类型过滤 traffic_mirror_target_id 否 String 使用镜像目的ID过滤 type 否 String 使用镜像源类型过滤 virtual_network_id 否 String 使用VNI过滤 created_at 否 String 使用创建时间戳排序 updated_at 否 String 使用更新时间戳排序
  • 请求示例 创建安全组,指定名称为security_group_1,描述为security group description,指定预检该请求。 POST https://{Endpoint}/v3/{project_id}/vpc/security-groups { "security_group" : { "name" : "security_group_1", "description" : "security group description" }, "dry_run" : true } 创建安全组,指定名称为security_group_1,描述为security group description。 POST https://{Endpoint}/v3/{project_id}/vpc/security-groups { "security_group" : { "name" : "security_group_1", "description" : "security group description" } }
  • 响应示例 状态码: 201 POST操作正常返回,更多状态码请参见状态码。 { "security_group" : { "id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "name" : "security_group_1", "project_id" : "060576782980d5762f9ec014dd2f1148", "description" : "security group description", "enterprise_project_id" : "0", "security_group_rules" : [ { "id" : "f11a3824-ac19-4fad-b4f1-c5f4a6dd0a80", "project_id" : "060576782980d5762f9ec014dd2f1148", "security_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction" : "ingress", "protocol" : null, "description" : "", "created_at" : "2020-07-09T05:56:27Z", "updated_at" : "2020-07-09T05:56:27Z", "ethertype" : "IPv6", "remote_ip_prefix" : null, "multiport" : null, "remote_address_group_id" : null, "action" : "allow", "priority" : 100 }, { "id" : "3d6480e8-9ea4-46dc-bb1b-8db190cd5677", "project_id" : "060576782980d5762f9ec014dd2f1148", "security_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id" : null, "direction" : "egress", "protocol" : null, "description" : "", "created_at" : "2020-07-09T05:56:27Z", "updated_at" : "2020-07-09T05:56:27Z", "ethertype" : "IPv6", "remote_ip_prefix" : null, "multiport" : null, "remote_address_group_id" : null, "action" : "allow", "priority" : 100 }, { "id" : "9581f18c-1fdd-43da-ace9-7758a56ef28a", "project_id" : "060576782980d5762f9ec014dd2f1148", "security_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id" : null, "direction" : "egress", "protocol" : null, "description" : "", "created_at" : "2020-07-09T05:56:27Z", "updated_at" : "2020-07-09T05:56:27Z", "ethertype" : "IPv4", "remote_ip_prefix" : null, "multiport" : null, "remote_address_group_id" : null, "action" : "allow", "priority" : 100 }, { "id" : "a3ba270e-e58b-432d-a912-aeb7eace9fb8", "project_id" : "060576782980d5762f9ec014dd2f1148", "security_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction" : "ingress", "protocol" : null, "description" : "", "created_at" : "2020-07-09T05:56:27Z", "updated_at" : "2020-07-09T05:56:27Z", "ethertype" : "IPv4", "remote_ip_prefix" : null, "multiport" : null, "remote_address_group_id" : null, "action" : "allow", "priority" : 100 } ], "created_at" : "2020-07-09T05:56:27Z", "updated_at" : "2020-07-09T05:56:27Z" }, "request_id" : "a8cf4f79ca3c22ca685e7e8872e8c20b" }
  • 响应示例 状态码: 200 PUT操作正常返回,更多状态码请参见状态码。 { "firewall" : { "id" : "e9a7731d-5bd9-4250-a524-b9a076fd5629", "name" : "network_acl_test1", "description" : "network_acl_test1", "project_id" : "9476ea5a8a9849c38358e43c0c3a9e12", "created_at" : "2022-04-07T07:30:46.000+00:00", "updated_at" : "2022-04-07T07:30:46.000+00:00", "admin_state_up" : true, "enterprise_project_id" : "158ad39a-dab7-45a3-9b5a-2836b3cf93f9", "status" : "INACTIVE", "tags" : [ ], "ingress_rules" : [ { "id" : "e9a7731d-5bd9-4250-a524-b9a076fd5629", "name" : "network_acl_rule test", "description" : "network_acl_rule test", "action" : "allow", "project_id" : "9476ea5a8a9849c38358e43c0c3a9e12", "protocol" : "tcp", "ip_version" : 4, "source_ip_address" : "192.168.3.0/24", "destination_ip_address" : "192.168.6.0/24", "source_port" : "30-40,60-90", "destination_port" : "40-60,70-90" } ], "egress_rules" : [ { "id" : "f9a7731d-5bd9-4250-a524-b9a076fd5629", "name" : "network_acl_rule test", "description" : "network_acl_rule test", "action" : "allow", "project_id" : "9476ea5a8a9849c38358e43c0c3a9e12", "protocol" : "tcp", "ip_version" : 4, "source_ip_address" : "192.168.3.0/24", "destination_ip_address" : "192.168.6.0/24", "source_port" : "30-40,60-90", "destination_port" : "40-60,70-90" } ], "associations" : [ ] } }
共100000条