华为云用户手册

  • 响应示例 { "security_group": { "id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "name": "sg-test", "description": "", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "security_group_rules": [ { "id": "3f51e52c-0e85-40f7-a137-85927392e436", "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": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "remote_address_group_id": null }, { "id": "6332de3e-98fb-4f8c-b44a-fcb8ff09881e", "direction": "egress", "protocol": null, "ethertype": "IPv6", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "remote_address_group_id": null } ], "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34" } }
  • 响应参数 表3 响应参数 参数名称 类型 说明 security_group security_group object security group对象。请参见表4。 表4 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列表,参见表5 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表5 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
  • 响应参数 表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版本的关系
  • 响应示例 { "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" } ] }
  • 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条及之后的所有资源记录。 limit 否 Integer 分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。
  • 响应示例 { "peerings": [ { "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": "f65e9ebc-ed5d-418b-a931-9a723718ba4e" }, "name": "test", "description": "test", "id": "b147a74b-39bb-4c7a-aed5-19cac4c2df13", "status": "ACTIVE" } ] }
  • 响应参数 表2 响应参数 参数名称 类型 说明 peerings Array of peering objects peering对象列表,参见表3。 peerings_links Array of peerings_link objects peerings_link对象列表,参见表5。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 peering对象 属性 类型 说明 id String 对等连接id。 name String 对等连接的名称。 status String 状态位: PENDING_ACCEPTANCE:等待接受 REJECTED:已拒绝。 EXPIRED:已过期。 DELETED:已删除。 ACTIVE:活动的。 request_vpc_info vpc_info object 对等连接发起端vpc信息,请参见表4。 accept_vpc_info vpc_info object 对等连接接受端vpc信息,请参见表4。 description String 对等连接描述。 created_at String 功能说明:资源创建时间,UTC时间。 格式:yyyy-MM-ddTHH:mm:ss updated_at String 功能说明:资源更新时间,UTC时间。 格式:yyyy-MM-ddTHH:mm:ss 表4 vpc_info对象 属性 类型 说明 vpc_id String 对等连接其中一端vpc id。 tenant_id String 对等连接其中一端vpc所属的项目id。 表5 peerings_link对象 名称 参数类型 说明 href String API链接。 rel String API链接与该API版本的关系。
  • URI GET /v2.0/vpc/peerings 样例: GET https://{Endpoint}/v2.0/vpc/peerings?id={id}&name={name}&status={status}&tenant_id={tenant_id}&vpc_id={vpc_id}&limit={limit}&marker={marker} 参数说明请参见表1。 表1 参数说明 名称 是否必选 参数类型 说明 id 否 String 按照peering_id过滤查询。 name 否 String 功能说明:按照peering_name过查询。 取值范围:最大长度不超过64。 status 否 String 按照status进行过滤。 tenant_id 否 String 按照tenant_id过滤查询。 vpc_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条及之后的所有资源记录。 limit 否 Integer 分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。 默认值为2000。
  • 响应示例 状态码为 200 时: OK { "request_id": "80747d36e3376c0894ba8f9a9156355d", "security_group_rules": [ { "id": "f626eb24-d8bd-4d26-ae0b-c16bb65730cb", "project_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "0552091e-b83a-49dd-88a7-4a5c86fd9ec3", "remote_group_id": null, "direction": "ingress", "protocol": "tcp", "description": "security group rule description", "created_at": "2020-08-13T07:12:36Z", "updated_at": "2020-08-13T07:12:36Z", "ethertype": "IPv4", "remote_ip_prefix": "10.10.0.0/16", "multiport": "333", "remote_address_group_id": null, "action": "allow", "priority": 1 } ] }
  • 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 功能说明:安全组规则生效策略。 remote_ip_prefix 否 String 功能说明:远端IP地址。 取值范围:cidr格式。
  • 请求示例 批量创建3个辅助弹性网卡,虚拟子网id为115b5a84-31dc-4b1e-8de9-bf5a75d2c566,宿主网络接口id为8b6c46f1-c68d-4bba-a922-2d97da185af5,关联安全组6727c950-9f01-47a2-a7aa-7d3686c4c95b。 POST https://{Endpoint}/v3/8c6fb137a48a428aaf9a0229dca4edb3/vpc/sub-network-interfaces/batch-create { "sub_network_interface" : { "virsubnet_id" : "115b5a84-31dc-4b1e-8de9-bf5a75d2c566", "security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ], "parent_id" : "8b6c46f1-c68d-4bba-a922-2d97da185af5" }, "count" : 3 }
  • 响应示例 状态码为 201 时: Created { "sub_network_interfaces" : [ { "id" : "d1f8094c-bb3d-43c5-b625-52dd43eab451", "project_id" : "8c6fb137a48a428aaf9a0229dca4edb3", "virsubnet_id" : "115b5a84-31dc-4b1e-8de9-bf5a75d2c566", "private_ip_address" : "192.168.6.245", "ipv6_ip_address" : "2001:db8:a583:5d:11e8:b908:4fe6:9802", "mac_address" : "fa:16:3e:97:1f:f5", "parent_device_id" : "11185aa2-4e08-4d9e-87ed-84817280eaa7", "security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ], "vpc_id" : null, "description" : "", "parent_id" : "8b6c46f1-c68d-4bba-a922-2d97da185af5", "vlan_id" : 41, "tags" : [ ] }, { "id" : "0dce57ab-00de-443b-a7fe-e8ff68bd95bc", "project_id" : "8c6fb137a48a428aaf9a0229dca4edb3", "virsubnet_id" : "115b5a84-31dc-4b1e-8de9-bf5a75d2c566", "private_ip_address" : "192.168.6.75", "ipv6_ip_address" : "2001:db8:a583:5d:6c22:8ea2:c061:a802", "mac_address" : "fa:16:3e:5a:61:84", "parent_device_id" : "11185aa2-4e08-4d9e-87ed-84817280eaa7", "security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ], "vpc_id" : null, "description" : "", "parent_id" : "8b6c46f1-c68d-4bba-a922-2d97da185af5", "vlan_id" : 42, "tags" : [ ] }, { "id" : "1eca03ee-c0f1-4434-9c4c-87fe4426718c", "project_id" : "8c6fb137a48a428aaf9a0229dca4edb3", "virsubnet_id" : "115b5a84-31dc-4b1e-8de9-bf5a75d2c566", "private_ip_address" : "192.168.6.194", "ipv6_ip_address" : "2001:db8:a583:5d:2b45:a3ae:17db:ec02", "mac_address" : "fa:16:3e:b8:ec:6d", "parent_device_id" : "11185aa2-4e08-4d9e-87ed-84817280eaa7", "security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ], "vpc_id" : null, "description" : "", "parent_id" : "8b6c46f1-c68d-4bba-a922-2d97da185af5", "vlan_id" : 43, "tags" : [ ] } ], "request_id" : "344544c1-d053-4ad3-b673-900a0e01db7e" }
  • 响应示例 { "security_group": { "id": "16b6e77a-08fa-42c7-aa8b-106c048884e6", "name": "qq", "description": "", "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 } ] } }
  • 请求示例 创建一个安全组,命名为sg-01,所在vpc id为3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85。 POST https://{Endpoint}/v1/{project_id}/security-groups { "security_group": { "name": "sg-01", "vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85", "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" } }
  • 请求参数 表2 请求参数 名称 是否必选 参数类型 说明 security_group 是 security_group object 安全组对象,请参见表3。 表3 security_group字段说明 名称 是否必选 参数类型 说明 name 是 String 功能说明:安全组名称。 取值范围:1-64个字符,支持数字、字母、中文、_(下划线)、-(中划线)、.(点)。 vpc_id 否 String 安全组所在的vpc的资源标识。 说明: 当前该参数只作提示用,不约束安全组在此vpc下,不建议继续使用。 enterprise_project_id 否 String 功能说明:企业项目ID。创建安全组时,给安全组绑定企业项目ID。 取值范围:最大长度36字节,带“-”连字符的UUID格式,或者是字符串“0”。“0”表示默认企业项目。 说明: 关于企业项目ID的获取及企业项目特性的详细信息,请参见《企业管理用户指南》。
  • 响应参数 表4 响应参数 名称 参数类型 说明 security_group security_group object 安全组对象,请参见表5。 表5 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的获取及企业项目特性的详细信息,请参见《企业管理用户指南》。 表6 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。
  • 响应参数 表3 响应参数 参数名称 类型 说明 security_group_rule security_group_rule object security group rule对象。请参见表4。 表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。 取值范围:1-65535(当表示code时为0-255)。 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 功能说明:IP地址协议类型。 取值范围:支持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:ssZ updated_at String 功能说明:安全组规则更新时间 取值范围:UTC时间格式,yyyy-MM-ddTHH:mm:ssZ
  • 响应示例 { "security_group_rule": { "remote_group_id": null, "direction": "egress", "remote_ip_prefix": "10.10.0.0/24", "protocol": "tcp", "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "port_range_max": null, "security_group_id": "5cb9c1ee-00e0-4d0f-9623-55463cd26ff8", "port_range_min": null, "ethertype": "IPv4", "description": null, "id": "7c336b04-1603-4911-a6f4-f2af1d9a0488", "project_id": "6fbe9263116a4b68818cf1edce16bc4f", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34", "remote_address_group_id": null } }
  • 请求示例 创建出方向安全组规则,所在安全组id为5cb9c1ee-00e0-4d0f-9623-55463cd26ff8,协议为tcp,对端ip为10.10.0.0/24。 POST https://{Endpoint}/v2.0/security-group-rules { "security_group_rule": { "security_group_id": "5cb9c1ee-00e0-4d0f-9623-55463cd26ff8", "direction": "egress", "protocol": "tcp", "remote_ip_prefix": "10.10.0.0/24" } }
  • 请求参数 表1 请求参数 参数名称 类型 必选 说明 security_group_rule security_group_rule object 是 security group rule对象。请参见表2。 表2 Security Group Rule对象 属性 是否必选 类型 说明 description 否 String 安全组规则描述。 security_group_id 是 String 所属安全组id。 remote_group_id 否 String 功能说明:所属安全组的对端id。 使用说明:和remote_ip_prefix,remote_address_group_id参数互斥。 direction 是 String 安全组规则方向。 取值范围:ingress表示入方向,egress表示出方向。 remote_ip_prefix 否 String 功能说明:对端ip网段。 使用说明:和remote_group_id,remote_address_group_id参数互斥。 protocol 否 String 功能说明:协议类型或直接指定IP协议号。 取值范围:tcp/udp/icmp或IP协议号。 port_range_max 否 Integer 功能说明:最大端口,当协议类型为ICMP时,该值表示ICMP的code。 取值范围:1-65535(当表示code时为0-255)。 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) 取值范围:1-65535(当表示code时为0-255) ethertype 否 String 功能说明:网络类型。 取值范围:IPv4/IPv6 remote_address_group_id 否 String 功能说明:远端IP地址组ID。您可以登录管理控制台,在IP地址组页面查看该ID。 约束:和remote_ip_prefix,remote_group_id互斥。
  • 接口说明 管理员被授权管理某企业后,登录到华为云买家中心控制台,对企业内用户授权该企业已绑定的应用,云商店异步调用该接口请求商家同步该企业应用的用户授权信息,商家接口需要执行授权信息同步,保存用户授权信息,并返回通知云商店。 针对用户授权同步场景接口调用失败的情况,由企业管理员选择是否要继续进行同步。并用短信或邮件的形式通知商家接口调用失败。 商家的服务器在处理接口请求时,需要做好幂等性处理。 对于同一个实例,相同的租户,相同的应用,相同的userName,要支持多次请求新增,或者删除,多次新增不应产生新的数据,且需要返回成功,如果是删除,多次删除也需要返回成功,不能因已删除返回失败,删除时不需要校验(创建实例)接口产生的实例是否存在。 租户同步流程如下图所示:
  • 请求方法:POST 接口URL:生产地址+固定子路径,其中固定子路径为/produceAPI/v2/allOrgSync; 接口示例:生产地址为https://example.isv.com,则接口URL为https://example.isv.com/produceAPI/v2/allOrgSync BODY请求参数 参数 必选 参数类型 描述 instanceId M String(64) 说明: 卖家申请应用凭证的时候传空,买家必传。 tenantId M String(64) 租户ID orgInfoList M Object 组织内部门层级信息,包含部门代码、部门名称、上级部门Code,Json串,非树形结构 JSON串,例: [{\"orgCode\":\"00000001\", \"OrgName\":\"产品部\",\"parentCode\":\"265789314\"},{\"orgCode\":\"00000002\", \"OrgName\":\"测试部\",\"parentCode\":\"265789314\"}] testFlag M Integer(2) 0-生产正式数据1-调测数据 timeStamp M String 默认时区东8区,时间格式:20220420114117642 响应参数 参数 必选 参数类型 描述 resultCode M String(6) 响应码, 具体请参见调用结果码说明。 resultMsg O String(255) 响应信息 示例: 请求示例: POST https://example.isv.com/produceAPI/v2/allOrgSync Content-Type: application/json x-sign: 11C4CD6279191DE931DEF5C51531DFFA9D37969F4E356B8A3A6D8DE4FB357A48 x-timestamp: 1680508066618 x-nonce:50D83FDECAED6CCD8EF597F2A577950527928BA287D04E6036E92B2806FD17DA {"instanceId": "hua******t123456","tenantId": "68cbc8******b880d92f36422fa0e","orgInfoList": "[{orgCode:\"00000001\", orgName:\"产品部\", parentCode:\"265789314\" },{orgCode:\"00000002\", orgName:\"测试部\", parentCode:\"265789314\" }]","flag": 1,"testFlag": 0,"timeStamp": "20220413093539534"} 响应示例: HTTP/1.1 200 OK Content-Type: application/json { " resultCode": "000000", " resultMsg": "Success" }
  • 接口说明 按周期售卖的商品,用户试用转正、续费、退续费后,云商店调用该接口,更新实例的到期日期。 用户进行商品转正、续费下单或退订续费周期后,云商店将调用该接口请求商家执行业务变更,商家接口需要执行将到期日进行更新,并返回通知云商店。 商家需要保障更新实例接口通畅,如调用失败,将可能导致用户的业务被释放的风险。 请及时关注商家信息中客服邮箱以及云商店账号绑定的邮箱的通知,收到调用失败通知邮件及时处理接口异常。 云商店会对接口异常的情况做监控,如SaaS商品频繁出现因接口异常的情况,云商店将对该商品做下架处理。 商品更新实例流程如下图所示:
  • 接口说明 买家购买联营SaaS商品后,登录到华为云买家中心控制台,将应用与企业绑定时,云商店调用该接口请求商家同步该企业的租户信息,商家接口需要执行租户同步,保存租户信息,并返回通知云商店。 针对企业同步场景接口调用失败的情况,由买家选择是否重试,并用短信或邮件的形式通知商家接口调用失败。 商家的服务器在处理接口请求时,需要做好幂等性处理。 对于同一个实例,相同的租户要支持多次请求新增,或者删除,多次新增不应产生新的数据,且需要返回成功,如果是删除,多次删除也需要返回成功,不能因已删除返回失败,删除时不需要校验(创建实例)接口产生的实例是否存在。 租户同步流程如下图所示:
  • 请求方法:POST 接口URL:生产地址+固定子路径,其中固定子路径为/produceAPI/v2/tenantSync; 接口示例:生产地址为https://example.isv.com,则接口URL为https://example.isv.com/produceAPI/v2/tenantSync Body参数 参数 必选 参数类型 描述 instanceId M String(64) 说明: 实例ID,卖家申请应用凭证的时候传空,买家正式订单必传。 orderId M String(64) 说明: 买家的订单号,卖家申请应用凭证的时候传空,买家正式订单必传。 tenantId M String(64) 租户ID tenantCode M String(64) 租户标识,用来识别最终用户的登录指向买家对应的域名 name M String(255) 租户名称,买家企业的名称 domainName M String(255) 域名,是认证中心返回的统一域名地址 flag M Integer(2) 0-删除 1-新增 2-修改(仅限租户名称、域名) testFlag M Integer(2) 0-生产正式数据 1-调测数据 timeStamp M String 默认时区东8区,时间格式:20220420114117642 响应参数 参数 必选 参数类型 描述 resultCode M String(6) 响应码, 具体请参见调用结果码说明。 resultMsg O String(255) 响应信息 示例: 请求示例: POST https://example.isv.com/produceAPI/v2/tenantSync Content-Type: application/json x-sign:11C4CD6279191DE931DEF5C51531DFFA9D37969F4E356B8A3A6D8DE4FB357A48 x-timestamp:1680508066618 x-nonce:50D83FDECAED6CCD8EF597F2A577950527928BA287D04E6036E92B2806FD17DA {"instanceId": "huaiweitest123456","orderId": "CS1906666666ABCDE","tenantId": "68cbc86****************880d92f36422fa0e","tenantCode": "huawei","name": "huaiweitest","domainName": "https://example.tenantaccount.com","flag": 1,"testFlag": 0,"timeStamp": "20220413093539534"} 响应示例: HTTP/1.1 200 OK Content-Type: application/json { " resultCode": "000000", " resultMsg": "Success" }
  • 接口说明 管理员被授权管理某企业后,在华为云买家中心控制台登录,对管理的企业执行新建、编辑、删除部门操作时,云商店调用该接口,请求商家同步该企业的组织增量变更;商家接口需要执行增量组织信息同步,保存信息,并返回通知云商店。 商家的服务器在处理接口请求时,需要做好幂等性处理。 对于同一个实例,相同的租户,相同的orgCode,要支持多次请求新增,或者删除,多次新增不应产生新的数据,且需要返回成功,如果是删除,多次删除也需要返回成功,不能因已删除返回失败,删除时不需要校验(创建实例)接口产生的实例是否存在。
  • 请求方法:POST 接口URL:生产地址+固定子路径,其中固定子路径为/produceAPI/v2/singleOrgSync; 接口示例:生产地址为https://example.isv.com,则接口URL为https://example.isv.com/produceAPI/v2/singleOrgSync BODY请求参数 参数 必选 参数类型 描述 instanceId M String(64) 说明: 卖家申请应用凭证的时候传空,买家必传。 tenantId M String(64) 租户ID,与租户的同步信息保持一致 orgCode M String(64) 部门代码租户自定义,租户内唯一 orgName M Vachar(128) 部门名称所在层级唯一,允许租户更新名称 parentCode O String(64) 上级部门的orgCode,如果是顶层部门,这个值为空,其他场景不能为空,允许租户更新当前部门归属的上层部门 flag M Integer(2) 0-删除 1-新增,2-修改 testFlag M Integer(2) 0-生产正式数据 1-调测数据 timeStamp M String 默认时区东8区,时间格式:20220420114117642 响应参数 参数 必选 参数类型 描述 resultCode M String(6) 响应码, 具体请参见调用结果码说明。 resultMsg O String(255) 响应信息 示例: 请求示例: POST https://example.isv.com/produceAPI/v2/singleOrgSync Content-Type: application/json x-sign: 11C4CD6279191DE931DEF5C51531DFFA9D37969F4E356B8A3A6D8DE4FB357A48 x-timestamp: 1680508066618 x-nonce:50D83FDECAED6CCD8EF597F2A577950527928BA287D04E6036E92B2806FD17DA {"instanceId": "hua********23456","instanceId": "hua********23456","tenantId": "68cbc********0d92f36422fa0e","orgCode": "10000","orgName": "开发部","parentCode": "","flag": 1,"testFlag": 0,"timeStamp": "20220413093539534"} 响应示例: HTTP/1.1 200 OK Content-Type: application/json { " resultCode": "000000", " resultMsg": "Success" }
  • 响应消息 响应参数说明请参见下表: 参数 是否必选 类型 取值范围 说明 resultCode M String 6 调用结果码。 具体请参见调用结果码说明。 resultMsg O String 255 调用结果描述。 info O InstanceInfo[] 实例详情 InstanceInfo数据结构定义如下: 参数 是否必选 类型及范围 取值范围 参数说明 instanceId M String 64 实例id appInfo O AppInfo N/A 应用实例信息。 客户购买商品后,商家需要返回登录服务地址(网站地址)或免登地址供客户后续操作。 说明: SaaS商品必须向客户提供应用使用信息,包括使用地址、账号、密码等。 如可实现通过短信、邮件等其他方式发送使用信息,则接口中允许不响应;否则,必须在接口中返回应用实例信息。 如使用信息不仅包含使用地址及账号密码,可通过如下memo参数灵活返回其他使用信息或使用说明等。 appInfo数据结构定义请参见下表。 appInfo数据结构定义如下: 参数 是否必选 类型及范围 取值范围 参数说明 frontEndUrl M String 512 前台地址。 客户购买商品后,可以访问的网站地址。 adminUrl O String 512 管理地址。 客户购买商品后,可以访问的管理后台地址。 userName O String 128 管理员帐号。 password O String 128 管理员初始密码。 memo O String 1024 备注。 说明: 如果备注包含中文内容,请将中文转换成unicode编码,例如:“中文”可以转换成“\u4e2d\u6587”。 响应消息示例: { "resultCode": "000000", "resultMsg": "success", "info": [{ "instanceId": "huaweitest123", "appInfo": { "frontEndUrl": "https://www.baidu.com", "userName": "zhangsan123", "password": "zhangsan123", "memo": "hvave a test, 测试!" } }] }
  • 生成规则 对请求参数排序,根据参数名自然排序,例如,以字母a开头的参数名会排在以b开头的参数后面,如果首字母相同,将会对第二个字母进行排序,以此类推,直到字符串结束 根据规则对规范请求字符串,密钥取x-sign值,规则: canonicalRequest = accessKey + nonce + timestamp + RequestPayload x-sign = HexEncode(HMAC_SHA256(canonicalRequest))
  • 举例 商家收到的调用数据示例如下: 请求示例: POST https://example.isv.com/produceAPI/v2/tenantSync Content-Type: application/json x-sign:11C4CD6279191DE931DEF5C51531DFFA9D37969F4E356B8A3A6D8DE4FB357A48 x-timestamp:1680508066618 x-nonce:50D83FDECAED6CCD8EF597F2A577950527928BA287D04E6036E92B2806FD17DA {"instanceId": "huaiweitest123456","orderId": "CS1906666666ABCDE","tenantId": "68cbc86****************880d92f36422fa0e","tenantCode": "huawei","name": "huaiweitest","domainName": "https://example.tenantaccount.com","flag": 1,"testFlag": 0,"timeStamp": "20220413093539534"} 响应示例: HTTP/1.1 200 OK Content-Type: application/json { " resultCode": "000000", " resultMsg": "Success" }
共100000条