华为云用户手册

  • 响应示例 状态码: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" }
  • URI GET /v1/{project_id}/vpcs 样例: GET https://{Endpoint}/v1/{project_id}/vpcs?limit=10&marker=13551d6b-755d-4757-b956-536f674975c0 参数说明请参见表1。 表1 参数说明 名称 是否必选 参数类型 说明 project_id 是 String 项目ID,获取项目ID请参见获取项目ID。 id 否 String 按照VPC 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的参数说明。 enterprise_project_id 否 String 功能说明:按照企业项目ID过滤查询,可以使用该字段过滤某个企业项目下的虚拟私有云。 取值范围:最大长度36字节,带“-”连字符的UUID格式,或者是字符串“0”。“0”表示默认企业项目。若需要查询当前用户所有企业项目绑定的虚拟私有云,请传参all_granted_eps。
  • 响应示例 { "vpcs": [ { "id": "13551d6b-755d-4757-b956-536f674975c0", "name": "default", "description": "test", "cidr": "172.16.0.0/16", "status": "OK", "enterprise_project_id": "0", "routes": [], "tenant_id": "087679f0aa80d32a2f4ec0172f5e902b", "created_at": "2022-12-15T02:11:13", "updated_at": "2022-12-15T02:11:13" }, { "id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85", "name": "222", "description": "test", "cidr": "192.168.0.0/16", "status": "OK", "enterprise_project_id": "0635d733-c12d-4308-ba5a-4dc27ec21038", "routes": [], "tenant_id": "087679f0aa80d32a2f4ec0172f5e902b", "created_at": "2022-12-15T04:01:21", "updated_at": "2022-12-15T04:01:21" }, { "id": "99d9d709-8478-4b46-9f3f-2206b1023fd3", "name": "vpc", "description": "test", "cidr": "192.168.0.0/16", "status": "OK", "enterprise_project_id": "0", "routes": [], "tenant_id": "087679f0aa80d32a2f4ec0172f5e902b", "created_at": "2022-12-15T05:36:29", "updated_at": "2022-12-15T05:36:29" } ] }
  • 请求参数 表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" }
  • 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 使用更新时间戳排序
  • 响应示例 状态码: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 } }
  • 请求示例 创建安全组,指定名称为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, "enabled" : true }, { "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, "enabled" : true }, { "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, "enabled" : true }, { "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, "enabled" : true } ], "created_at" : "2020-07-09T05:56:27Z", "updated_at" : "2020-07-09T05:56:27Z" }, "request_id" : "a8cf4f79ca3c22ca685e7e8872e8c20b" }
  • 响应示例 状态码:201 POST操作正常返回,更多状态码请参见状态码。 { "request_id" : "1666b2708aaf849337572d6846dce781", "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" : 33, "action" : "allow", "priority" : 1, "remote_group_id" : null, "remote_address_group_id" : null, "enabled" : true } }
  • 请求示例 创建一条入方向安全组规则,所在安全组id为1c8d9f94-6022-4518-bb98-e0145fcc7b33。 POST https://{Endpoint}/v3/{project_id}/vpc/security-group-rules { "security_group_rule" : { "security_group_id" : "1c8d9f94-6022-4518-bb98-e0145fcc7b33", "direction" : "ingress", "protocol" : "tcp", "description" : "security group rule description", "action" : "allow", "priority" : 1, "multiport" : "33", "remote_ip_prefix" : "10.10.0.0/16" } }
  • 请求示例 创建网络ACL,命名为network_acl_test1。 POST https://{Endpoint}/v3/{project_id}/vpc/firewalls { "firewall" : { "name" : "network_acl_test1", "description" : "network_acl_test1", "enterprise_project_id" : "158ad39a-dab7-45a3-9b5a-2836b3cf93f9" } }
  • 响应示例 状态码:201 POST操作正常返回,更多状态码请参见状态码。 { "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" : "ACTIVE", "tags" : [ ], "ingress_rules" : [ ], "egress_rules" : [ ], "associations" : [ ] } }
  • 响应示例 状态码:201 Created { "traffic_mirror_filter" : { "id" : "59d2b2e7-0d35-41f7-a12e-f7699366cd21", "project_id" : "49a42f378df747bf8b8f6a70e25b63fb", "name" : "test1", "description" : "description", "ingress_rules" : [ ], "egress_rules" : [ ], "created_at" : "2022-08-29T06:22:01.000+00:00", "updated_at" : "2022-08-29T06:22:01.000+00:00" }, "request_id" : "f05abcd9-fa75-43a5-a795-b3d8e8b7a9e9" }
  • 请求示例 创建流量镜像筛选条件,命名为test1,描述为description。 POST https://{endpoint}/v3/{project_id}/vpc/traffic-mirror-filters { "traffic_mirror_filter" : { "name" : "test1", "description" : "description" } }
  • 响应示例 状态码:200 PUT操作正常返回,更多状态码请参见状态码。 { "security_group" : { "id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "name" : "security_group_2", "project_id" : "060576782980d5762f9ec014dd2f1148", "description" : "modified description", "enterprise_project_id" : 0, "tags" : [ ], "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", "description" : "", "created_at" : "2020-07-09T05:56:27.000+00:00", "updated_at" : "2020-07-09T05:56:27.000+00:00", "ethertype" : "IPv6", "action" : "allow", "priority" : 100, "protocol" : null, "multiport" : null, "remote_ip_prefix" : null, "remote_address_group_id" : null, "enabled" : true }, { "id" : "3d6480e8-9ea4-46dc-bb1b-8db190cd5677", "project_id" : "060576782980d5762f9ec014dd2f1148", "security_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction" : "egress", "description" : "", "created_at" : "2020-07-09T05:56:27.000+00:00", "updated_at" : "2020-07-09T05:56:27.000+00:00", "ethertype" : "IPv6", "action" : "allow", "priority" : 100, "protocol" : null, "multiport" : null, "remote_ip_prefix" : null, "remote_group_id" : null, "remote_address_group_id" : null, "enabled" : true }, { "id" : "9581f18c-1fdd-43da-ace9-7758a56ef28a", "project_id" : "060576782980d5762f9ec014dd2f1148", "security_group_id" : "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction" : "egress", "description" : "", "created_at" : "2020-07-09T05:56:27.000+00:00", "updated_at" : "2020-07-09T05:56:27.000+00:00", "ethertype" : "IPv4", "action" : "allow", "priority" : 100, "protocol" : null, "multiport" : null, "remote_ip_prefix" : null, "remote_group_id" : null, "remote_address_group_id" : null, "enabled" : true }, { "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", "description" : "", "created_at" : "2020-07-09T05:56:27.000+00:00", "updated_at" : "2020-07-09T05:56:27.000+00:00", "ethertype" : "IPv4", "action" : "allow", "priority" : 100, "protocol" : null, "multiport" : null, "remote_ip_prefix" : null, "remote_address_group_id" : null, "enabled" : true } ], "created_at" : "2020-07-09T05:56:27.000+00:00", "updated_at" : "2020-07-09T05:56:27.000+00:00" }, "request_id" : "a8cf4f79ca3c22ca685e7e8872e8c20b" }
  • 请求示例 更新id为1d8b19c7-7c56-48f7-a99b-4b40eb390967的安全组,名称更新为security_group_2,描述更新为modified description。 PUT https://{Endpoint}/v3/{project_id}/vpc/security-groups/1d8b19c7-7c56-48f7-a99b-4b40eb390967 { "security_group" : { "name" : "security_group_2", "description" : "modified description" } }
  • URI GET /v3/{project_id}/vpc/traffic-mirror-filter-rules 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方式请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 id 否 String 使用规则ID过滤或排序 action 否 String 使用规则action过滤 description 否 String 使用规则描述过滤 destination_cidr_block 否 String 使用规则目的网段过滤 destination_port_range 否 String 使用规则目的端口范围过滤 direction 否 String 使用规则方向过滤 priority 否 String 使用规则优先级过滤 protocol 否 String 使用规则协议过滤 source_cidr_block 否 String 使用规则源网段过滤 source_port_range 否 String 使用规则源端口范围过滤 traffic_mirror_filter_id 否 String 使用筛选条件ID过滤
  • 响应示例 状态码:200 OK { "request_id" : "38719a68-c7c1-4fe1-bf12-4bb049349174", "traffic_mirror_filter_rules" : [ { "created_at" : "2023-02-17T08:42:44.000+00:00", "updated_at" : "2023-02-17T08:42:44.000+00:00", "id" : "3daa97b5-ad58-477d-86a5-52b65257f94b", "project_id" : "7365fcd452924e398ec4cc1fe39c0d12", "description" : "", "traffic_mirror_filter_id" : "b765ba87-c0b4-4f1a-9ec3-d5b1d1ddb137", "direction" : "ingress", "protocol" : "ICMPV6", "ethertype" : "IPv4", "action" : "accept", "priority" : 16 } ], "page_info" : { "previous_marker" : "3daa97b5-ad58-477d-86a5-52b65257f94b", "current_count" : 1 } }
  • 请求示例 更新ID为59d2b2e7-0d35-41f7-a12e-f7699366cd21的流量镜像筛选条件,名称更新为test1 PUT /v3/{project_id}/vpc/traffic-mirror-filters/59d2b2e7-0d35-41f7-a12e-f7699366cd21 { "traffic_mirror_filter" : { "name" : "test1", "description" : "description" } }
  • 响应示例 状态码:200 OK { "traffic_mirror_filter" : { "id" : "59d2b2e7-0d35-41f7-a12e-f7699366cd21", "project_id" : "49a42f378df747bf8b8f6a70e25b63fb", "name" : "test1", "description" : "description", "ingress_rules" : [ ], "egress_rules" : [ ], "created_at" : "2022-08-29T06:22:01.000+00:00", "updated_at" : "2022-08-29T06:22:01.000+00:00" }, "request_id" : "f05abcd9-fa75-43a5-a795-b3d8e8b7a9e9" }
  • 响应示例 状态码:200 GET操作正常返回,更多状态码请参见状态码。 { "request_id" : "80747d36e3376c0894ba8f9a9156355d", "security_group_rules" : [ { "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, "remote_group_id" : null, "remote_address_group_id" : null, "enabled" : true } ] }
  • URI GET /v3/{project_id}/vpc/security-group-rules 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方式请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 功能说明:每页返回个数。 取值范围:0-2000。 marker 否 String 分页查询起始的资源ID,为空时查询第一页。 id 否 Array of strings 功能说明:安全组规则ID,支持多个ID过滤。 security_group_id 否 Array of strings 功能说明:安全组规则所属安全组ID,支持多个ID过滤。 protocol 否 Array of strings 功能说明:安全组规则协议,支持多条过滤。 description 否 Array of strings 功能说明:安全组描述新增。可以使用该字段精确过滤安全组,支持传入多个描述进行过滤。 remote_group_id 否 Array of strings 功能说明:远端安全组ID,支持多ID过滤。 direction 否 String 功能说明:安全组规则方向。 取值范围:ingress表示入方向,egress表示出方向。 action 否 String 功能说明:安全组规则生效策略。 取值范围:allow表示允许,deny表示拒绝。 remote_ip_prefix 否 String 功能说明:远端IP地址。 取值范围:cidr格式。 enabled 否 Boolean 功能说明:是否启用安全组规则,不支持多值过滤。 取值范围:true, false。 priority 否 Array of integers 功能说明:优先级,支持多条过滤。 ethertype 否 Array of strings 功能说明:IP协议类型,支持多条过滤。 取值范围:IPv4,IPv6,ipv4,ipv6 remote_address_group_id 否 Array of strings 功能说明:远端IP地址组ID,支持多ID过滤。
  • 响应示例 状态码:201 POST操作正常返回,更多状态码请参见状态码。 { "security_group_rules" : [ { "id" : "abef369b-d646-4b8a-9f44-fcd248a6c421", "project_id" : "5f6387106c2048b589b369d96c2f23a2", "security_group_id" : "15457509-18f9-4387-bae6-d4ed1898b301", "direction" : "ingress", "protocol" : "tcp", "description" : "", "created_at" : "2023-04-28T04:08:52.000+00:00", "updated_at" : "2023-04-28T04:08:52.000+00:00", "ethertype" : "IPv4", "remote_ip_prefix" : "117.78.12.122/32", "multiport" : 22, "action" : "allow", "priority" : 1, "remote_group_id" : null, "remote_address_group_id" : null, "enabled" : true } ], "request_id" : "f1ae2c6f9e94babf077cd3b3e1570c81" }
  • 请求示例 在安全组15457509-18f9-4387-bae6-d4ed1898b301中创建入方向规则,忽略重复规则,两条规则相同。 POST https://{Endpoint}/v3/{project_id}/vpc/security-groups/15457509-18f9-4387-bae6-d4ed1898b301/security-group-rules/batch-create { "ignore_duplicate" : true, "security_group_rules" : [ { "direction" : "ingress", "description" : "", "protocol" : "tcp", "action" : "allow", "priority" : 1, "ethertype" : "IPv4", "multiport" : "22", "remote_ip_prefix" : "117.78.12.122/32" }, { "direction" : "ingress", "description" : "", "protocol" : "tcp", "action" : "allow", "priority" : 1, "ethertype" : "IPv4", "multiport" : "22", "remote_ip_prefix" : "117.78.12.122/32" } ] }
  • URI GET /v3/{project_id}/vpc/traffic-mirror-filters 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方式请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 id 否 String 使用ID过滤查询或排序 name 否 String 使用name过滤或排序 description 否 String 使用description过滤查询 created_at 否 String 使用创建时间戳排序 updated_at 否 String 使用更新时间戳排序
  • 响应示例 状态码:200 OK { "request_id" : "05e4a009-74aa-47cb-8055-c3da26a51737", "traffic_mirror_filters" : [ { "id" : "59d2b2e7-0d35-41f7-a12e-f7699366cd21", "project_id" : "49a42f378df747bf8b8f6a70e25b63fb", "name" : "test1", "description" : "new_filter", "ingress_rules" : [ ], "egress_rules" : [ ], "created_at" : "2022-08-29T06:22:01.000+00:00", "updated_at" : "2022-08-29T06:22:01.000+00:00" } ], "page_info" : { "previous_marker" : "180edd76-ab7e-4039-acc2-239ff89243e8", "current_count" : 1 } }
  • 请求示例 添加镜像源6134900d-31a6-4b71-8453-dbca7f26982e到镜像会话e15a6e40-2580-4949-bf2a-55ee7cd49392中。 PUT https://{endpoint}/v3/{project_id}/vpc/traffic-mirror-sessions/e15a6e40-2580-4949-bf2a-55ee7cd49392/add-sources { "traffic_mirror_session" : { "traffic_mirror_sources" : [ "6134900d-31a6-4b71-8453-dbca7f26982e" ] } }
共100000条
提示

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