华为云用户手册

  • 请求示例 创建或更新组织合规规则。 PUT https://{endpoint}/v1/resource-manager/organizations/{organization_id}/policy-assignments{ "organization_policy_assignment_name" : "allowed-images-by-id", "managed_policy_assignment_metadata" : { "description" : "The E CS resource is non-compliant if the image it used is not in the allowed list.", "parameters" : { "listOfAllowedImages" : { "value" : [ "ea0d6e0e-99c3-406d-a873-3bb45462b624" ] } }, "policy_filter" : { "resource_provider" : "ecs", "resource_type" : "cloudservers" }, "policy_definition_id" : "5fa265c0aa1e6afc05a0ff07" }}
  • 响应示例 状态码: 200 操作成功。 { "owner_id" : "e74e043fab784a45ad88f5ef6a4bcffc", "organization_id" : "o-doxbpkzqsdd51ti1k27w2y8fitakrknp", "organization_policy_assignment_urn" : "rms::e74e043fab784a45ad88f5ef6a4bcffc:organizationPolicyAssignment:o-doxbpkzqsdd51ti1k27w2y8fitakrknp/d02b7fa9d5a74e638c1402d0868f71fd", "organization_policy_assignment_id" : "d02b7fa9d5a74e638c1402d0868f71fd", "organization_policy_assignment_name" : "allowed-images-by-id", "description" : "The ECS resource is non-compliant if the image it used is not in the allowed list.", "period" : null, "policy_filter" : { "region_id" : null, "resource_provider" : "evs", "resource_type" : "volumes", "resource_id" : null, "tag_key" : null, "tag_value" : null }, "policy_definition_id" : "5fa265c0aa1e6afc05a0ff07", "parameters" : { }, "created_at" : "2022-01-18T06:37:54.432Z", "updated_at" : "2022-01-18T06:37:54.432Z"}
  • 响应参数 状态码: 400 表3 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 403 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 500 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。
  • URI DELETE /v1/resource-manager/domains/{domain_id}/aggregators/aggregation-authorization/{authorized_account_id} 表1 路径参数 参数 是否必选 参数类型 描述 domain_id 是 String 帐号ID。 最大长度:36 authorized_account_id 是 String 授权的资源聚合器的帐号ID。 最大长度:36
  • URI DELETE /v1/resource-manager/organizations/{organization_id}/policy-assignments/{organization_policy_assignment_id} 表1 路径参数 参数 是否必选 参数类型 描述 organization_id 是 String 组织ID。 最大长度:34 organization_policy_assignment_id 是 String 组织合规规则ID。 最大长度:32
  • 响应示例 状态码: 200 操作成功。 { "aggregation_authorization_urn" : "rms::e74e043fab784a45ad88f5ef6a4bcffc:aggregationAuthorization:fb51a91e798a4beb831c9be365aba4db", "authorized_account_id" : "3fd23817bd85480e8dc4f520075de348", "created_at" : "2020-01-18T02:49:12.465Z"}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 aggregation_authorization_urn String 资源聚合器授权标识符。 authorized_account_id String 授权的资源聚合器的帐号ID。 created_at String 资源聚合器授权的创建时间。 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Security-Token 否 String 如果正在使用临时安全凭据,则此header是必需的,该值是临时安全凭据的安全令牌(会话令牌)。 最小长度:0 最大长度:2048 表3 请求Body参数 参数 是否必选 参数类型 描述 authorized_account_id 是 String 要授权的资源聚合器的帐号ID。 最小长度:1 最大长度:36
  • 响应示例 状态码: 200 操作成功。 { "aggregation_authorizations" : [ { "aggregation_authorization_urn" : "rms::e74e043fab784a45ad88f5ef6a4bcffc:aggregationAuthorization:fb51a91e798a4beb831c9be365aba4db", "authorized_account_id" : "3fd23817bd85480e8dc4f520075de348", "created_at" : "2022-12-15T07:50:01.575Z" } ], "page_info" : { "current_count" : 1, "next_marker" : "CAESIDdjYTM0NDc4MzBiZDQ5YzliNjMwYTk5NjgwZWFmOTBmGgQ-0aw3" }}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 aggregation_authorizations Array of AggregationAuthorizationResp objects 授权过的资源聚合器帐号列表。 page_info PageInfo object 分页对象。 表5 AggregationAuthorizationResp 参数 参数类型 描述 aggregation_authorization_urn String 资源聚合器授权标识符。 authorized_account_id String 授权的资源聚合器的帐号ID。 created_at String 资源聚合器授权的创建时间。 表6 PageInfo 参数 参数类型 描述 current_count Integer 当前页的资源数量。 最小值:0 最大值:200 next_marker String 下一页的marker。 最小长度:4 最大长度:400 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 500 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。
  • URI GET /v1/resource-manager/domains/{domain_id}/aggregators/aggregation-authorization 表1 路径参数 参数 是否必选 参数类型 描述 domain_id 是 String 帐号ID。 最大长度:36 表2 Query参数 参数 是否必选 参数类型 描述 account_id 否 String 授权的帐号ID。 最大长度:36 limit 否 Integer 最大的返回数量。 最小值:1 最大值:200 缺省值:200 marker 否 String 分页参数,通过上一个请求中返回的marker信息作为输入,获取当前页。 最小长度:4 最大长度:400
  • 概述 配置审计 (Config)服务提供全局资源配置的检索,配置历史追溯,以及基于资源配置的持续的审计评估能力,确保云上资源配置变更符合客户预期。 本文档提供了配置审计服务API的描述、参数说明以及示例等内容。您可以使用本文档提供的API对Config进行相关操作,如创建、删除、更新、查询等。支持的全部操作请参阅API概览。 在调用Config的API前,请确保已经充分了解了Config的相关概念,详细信息请参阅产品介绍。 父主题: 使用前必读
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 resource_providers Array of ResourceProviderResponse objects 云服务详情列表。 total_count Integer 当前支持的云服务总数。 表5 ResourceProviderResponse 参数 参数类型 描述 provider String 云服务名称。 display_name String 云服务显示名称,可以通过请求Header中的'X-Language'设置语言。 category_display_name String 云服务类别显示名称,可以通过请求Header中的'X-Language'设置语言。 resource_types Array of ResourceTypeResponse objects 资源类型列表。 表6 ResourceTypeResponse 参数 参数类型 描述 name String 资源类型名称。 display_name String 资源类型显示名称,可以通过请求中 'X-Language'设置语言。 global Boolean 是否是全局类型的资源。 regions Array of strings 支持的region列表。 console_endpoint_id String console终端ID。 console_list_url String console列表页地址。 console_detail_url String console详情页地址。 track String 资源是否默认搜集,"tracked"表示默认收集,"untracked"表示默认不收集。 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。
  • 响应示例 状态码: 200 操作成功。 { "total_count" : 2, "resource_providers" : [ { "provider" : "ecs", "display_name" : "弹性云服务器 ECS", "category_display_name" : "计算", "resource_types" : [ { "name" : "cloudservers", "display_name" : "云服务器", "global" : false, "regions" : [ "regionid1", "regionid2", "regionid3", "regionid4", "regionid5", "regionid6" ], "console_endpoint_id" : "ecm", "console_list_url" : "#/ecs/manager/vmList", "console_detail_url" : "#/ecs/manager/ecsDetail?instanceId={id}", "track" : "tracked" } ] }, { "provider" : "vpc", "display_name" : "虚拟私有云 VPC", "category_display_name" : "网络", "resource_types" : [ { "name" : "vpcs", "display_name" : "虚拟私有云", "global" : false, "regions" : [ "regionid1", "regionid2", "regionid3", "regionid4", "regionid5", "regionid6" ], "console_endpoint_id" : "vpc", "console_list_url" : "#/vpcs", "console_detail_url" : "#/vpc/vpcmanager/vpcDetail/subnets?vpcId={id}", "track" : "tracked" }, { "name" : "bandwidths", "display_name" : "共享带宽", "global" : false, "regions" : [ "regionid1", "regionid2", "regionid3", "regionid4", "regionid5", "regionid6" ], "console_endpoint_id" : "vpc", "console_list_url" : "#/vpc/vpcmanager/shareBandwidth", "console_detail_url" : "#/vpc/vpcmanager/shareBandwidth?bandwidthId={id}", "track" : "tracked" }, { "name" : "securityGroups", "display_name" : "安全组", "global" : false, "regions" : [ "regionid1", "regionid2", "regionid5", "regionid6" ], "console_endpoint_id" : "vpc", "console_list_url" : "#/secGroups", "console_detail_url" : "#/vpc/vpcmanager/sgDetail/sgRules?instanceId={id}", "track" : "tracked" }, { "name" : "publicips", "display_name" : "弹性公网IP", "global" : false, "regions" : [ "regionid1", "regionid2", "regionid3", "regionid4", "regionid6" ], "console_endpoint_id" : "vpc", "console_list_url" : "#/vpc/vpcmanager/eips", "console_detail_url" : "#/vpc/vpcmanager/eipDetailNew?eipId={id}", "track" : "tracked" } ] } ]}
  • URI GET /v1/resource-manager/domains/{domain_id}/providers 表1 路径参数 参数 是否必选 参数类型 描述 domain_id 是 String 帐号ID。 最大长度:36 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 Integer 分页偏移。 最小值:1 最大值:1000 limit 否 Integer 最大的返回数量。 最小值:1 最大值:200 缺省值:200
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Language 否 String 选择接口返回的信息的语言,默认为"zh-cn"中文。 缺省值:zh-cn X-Auth-Token 否 String 调用者token。 X-Security-Token 否 String 如果正在使用临时安全凭据,则此header是必需的,该值是临时安全凭据的安全令牌(会话令牌)。 最小长度:0 最大长度:2048
  • 响应示例 状态码: 200 操作成功。 { "page_info" : { "current_count" : 2, "next_marker" : null }, "resources" : [ { "checksum" : "89ca775e88e04b2c200ccbf9e219ad0d7da42e3f446e5c953d443288134eec41", "created" : "2020-02-21T08:41:05Z", "ep_id" : "0", "ep_name" : "default", "id" : "7ffd8564-d88a-4bc9-ab51-d8b79a57d0e6", "name" : "vpc-489c", "project_id" : "059b5e0a2500d5552fa1c00adada8c06", "project_name" : "project_name", "properties" : { "cidr" : "192.168.0.0/16", "status" : "OK" }, "provider" : "vpc", "provisioning_state" : "Succeeded", "region_id" : "regionid1", "tags" : { "use" : "test" }, "type" : "vpcs", "updated" : "2020-02-21T08:41:05Z" }, { "checksum" : "db2aad42804951c03a724b7501da9b6b4c14d319dd319d76bb7c658f256a37b0", "created" : "2020-02-24T08:43:05Z", "ep_id" : "0", "ep_name" : "default", "id" : "b63b33b7-f48c-4048-995b-0445d124a445", "name" : "VPC_TEST3_20200224163856", "project_id" : "059b5e0a2500d5552fa1c00adada8c06", "project_name" : "project_name_1", "properties" : { "cidr" : "192.168.0.0/16", "status" : "OK" }, "provider" : "vpc", "provisioning_state" : "Succeeded", "region_id" : "regionid1", "tags" : { "use" : "test1" }, "type" : "vpcs", "updated" : "2020-08-11T11:55:08Z" } ]}
  • 响应示例 状态码: 200 操作成功。 { "id" : "00337e93-82d1-40ca-911f-07cff94587cc", "name" : "dev_machine", "provider" : "ecs", "type" : "cloudservers", "region_id" : "regionid4", "project_id" : "39c2af998c334ed6bcbb75b27318f7cc", "project_name" : "project_name", "ep_id" : "0", "ep_name" : "default", "checksum" : "3a0075409edb156a74e041b7479f0d5993be1d62b4ccd2af3a1dd01ec80c8b39", "created" : "2019-11-20T06:24:43Z", "updated" : "2020-07-17T08:30:52Z", "provisioning_state" : "Succeeded", "tags" : { "usage" : "展示" }, "properties" : { "accessIpv4" : "", "hostName" : "dev-machine", "addresses" : [ { "OsExtIpsType" : "fixed", "OsExtIpsPortId" : "f2fa750a-e2ab-434f-b14a-bfe7c8cea0cc", "addr" : "192.168.1.212", "version" : 4, "OsExtIpsMacAddr" : "fa:16:3e:6e:cf:33" }, { "OsExtIpsType" : "floating", "OsExtIpsPortId" : "f2fa750a-e2ab-434f-b14a-bfe7c8cea0cc", "addr" : "100.85.225.33", "version" : 4, "OsExtIpsMacAddr" : "fa:16:3e:6e:cf:33" } ], "accessIpv6" : "", "metadata" : { "chargingMode" : "0", "meteringImageType" : "private", "imageName" : "resource-manager-devmachine-template", "meteringImageId" : "9bcaace4-b8da-4008-a352-3f72e1f25333", "meteringResourcesPerCode" : "si2.large.2.linux", "vpcId" : "cf403ef5-90df-4e7e-829d-5d21b1cb7d1e", "osBit" : "64" }, "OsExtStsVmState" : "active", "configDrive" : "", "OsExtStsPowerState" : 1, "hostId" : "3c381dcfc3e628c1a504ad94ba8c4e89081306455273701333f32921", "securityGroup" : [ { "name" : "default", "id" : "5d55b397-ad9c-462d-af72-6599cb941c49" } ], "ExtVolumesAttached" : [ { "bootIndex" : "0", "id" : "010d940e-a73e-417b-85ae-51b76c0d2ba0", "device" : "/dev/vda" } ], "userId" : "e311190745e94cc09d62d5779e55912d", "flavor" : { "disk" : "0", "name" : "Si2.large.2", "id" : "Si2.large.2", "vcpus" : "2", "ram" : "4096" }, "OsDcfDiskConfig" : "MANUAL", "hostStatus" : "UP", "OsSrvUsgLaunchedAt" : "2019-11-20T06:24:56.000000", "OsExtAz" : "regionid4a", "progress" : 0, "locked" : false, "OS-EXT-SRV-ATTR" : { "hostName" : "dev-machine", "kernelId" : "", "ramdiskId" : "", "reservationId" : "r-hhux9o7m", "instanceName" : "instance-0009cb50", "host" : "regionid4a-pod01.regionid4", "rootDeviceName" : "/dev/vda", "hypervisorHostName" : "nova001@2", "launchIndex" : 0 }, "status" : "ACTIVE" }}
  • URI GET /v1/resource-manager/domains/{domain_id}/provider/{provider}/type/{type}/resources/{resource_id} 表1 路径参数 参数 是否必选 参数类型 描述 domain_id 是 String 帐号ID。 最大长度:36 provider 是 String 云服务名称。 最大长度:20 type 是 String 资源类型名称。 最大长度:32 resource_id 是 String 资源ID。 最大长度:256
  • 响应示例 状态码: 200 操作成功。 { "id" : "00337e93-82d1-40ca-911f-07cff94587cc", "name" : "dev_machine", "provider" : "ecs", "type" : "cloudservers", "region_id" : "regionid4", "project_id" : "39c2af998c334ed6bcbb75b27318f7cc", "project_name" : "project_name", "ep_id" : "0", "ep_name" : "chloe", "checksum" : "3a0075409edb156a74e041b7479f0d5993be1d62b4ccd2af3a1dd01ec80c8b39", "created" : "2019-11-20T06:24:43Z", "updated" : "2020-07-17T08:30:52Z", "provisioning_state" : "Succeeded", "tags" : { "usage" : "展示" }, "properties" : { "accessIpv4" : "", "hostName" : "dev-machine", "addresses" : [ { "OsExtIpsType" : "fixed", "OsExtIpsPortId" : "f2fa750a-e2ab-434f-b14a-bfe7c8cea0cc", "addr" : "192.168.1.212", "version" : 4, "OsExtIpsMacAddr" : "fa:16:3e:6e:cf:33" }, { "OsExtIpsType" : "floating", "OsExtIpsPortId" : "f2fa750a-e2ab-434f-b14a-bfe7c8cea0cc", "addr" : "100.85.225.33", "version" : 4, "OsExtIpsMacAddr" : "fa:16:3e:6e:cf:33" } ], "accessIpv6" : "", "metadata" : { "chargingMode" : "0", "meteringImageType" : "private", "imageName" : "resource-manager-devmachine-template", "meteringImageId" : "9bcaace4-b8da-4008-a352-3f72e1f25333", "meteringResourcesPerCode" : "si2.large.2.linux", "vpcId" : "cf403ef5-90df-4e7e-829d-5d21b1cb7d1e", "osBit" : "64" }, "OsExtStsVmState" : "active", "configDrive" : "", "OsExtStsPowerState" : 1, "hostId" : "3c381dcfc3e628c1a504ad94ba8c4e89081306455273701333f32921", "securityGroup" : [ { "name" : "default", "id" : "5d55b397-ad9c-462d-af72-6599cb941c49" } ], "ExtVolumesAttached" : [ { "bootIndex" : "0", "id" : "010d940e-a73e-417b-85ae-51b76c0d2ba0", "device" : "/dev/vda" } ], "userId" : "e311190745e94cc09d62d5779e55912d", "flavor" : { "disk" : "0", "name" : "Si2.large.2", "id" : "Si2.large.2", "vcpus" : "2", "ram" : "4096" }, "OsDcfDiskConfig" : "MANUAL", "hostStatus" : "UP", "OsSrvUsgLaunchedAt" : "2019-11-20T06:24:56.000000", "OsExtAz" : "regionid4a", "progress" : 0, "locked" : false, "OS-EXT-SRV-ATTR" : { "hostName" : "dev-machine", "kernelId" : "", "ramdiskId" : "", "reservationId" : "r-hhux9o7m", "instanceName" : "instance-0009cb50", "host" : "regionid4a-pod01.regionid4", "rootDeviceName" : "/dev/vda", "hypervisorHostName" : "nova001@2", "launchIndex" : 0 }, "status" : "ACTIVE" }}
  • URI GET /v1/resource-manager/domains/{domain_id}/all-resources/tags 表1 路径参数 参数 是否必选 参数类型 描述 domain_id 是 String 帐号ID。 最大长度:36 表2 Query参数 参数 是否必选 参数类型 描述 key 否 String 标签键名。 最大长度:128 marker 否 String 分页参数,通过上一个请求中返回的marker信息作为输入,获取当前页。 最小长度:4 最大长度:400 limit 否 Integer 最大的返回数量。 最小值:1 最大值:200 缺省值:100
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 tags Array of TagEntity objects 标签列表。 page_info PageInfo object 分页对象。 表5 TagEntity 参数 参数类型 描述 key String 标签键。 value Array of strings 标签键对应的标签值列表。 表6 PageInfo 参数 参数类型 描述 current_count Integer 当前页的资源数量。 最小值:0 最大值:200 next_marker String 下一页的marker。 最小长度:4 最大长度:400 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 500 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。
  • URI GET /v1/resource-manager/domains/{domain_id}/all-resources 表1 路径参数 参数 是否必选 参数类型 描述 domain_id 是 String 帐号ID。 最大长度:36 表2 Query参数 参数 是否必选 参数类型 描述 region_id 否 String 区域ID。 最大长度:36 ep_id 否 String 企业项目ID。 最大长度:36 type 否 String 资源类型(provider.type)。 最大长度:40 limit 否 Integer 最大的返回数量。 最小值:1 最大值:200 缺省值:100 marker 否 String 分页参数,通过上一个请求中返回的marker信息作为输入,获取当前页。 最小长度:4 最大长度:400 id 否 String 资源ID。 最大长度:256 name 否 String 资源名称。 最大长度:64 tags 否 Array 标签列表。
  • 响应示例 状态码: 200 操作成功。 { "resources" : [ { "id" : "3ccd9191-6a5e-4939-a971-4652db18b370", "name" : "elb-265a", "provider" : "elb", "type" : "loadbalancers", "region_id" : "regionid1", "project_id" : "05498e12458025102ff5c0061a584a9f", "project_name" : "regionid1_region_service", "ep_id" : "0", "ep_name" : "default", "checksum" : "6e0271b107b764b19acb235f45c0d852f72104fe1d4b32970686e7eae8e87bf4", "created" : "2020-02-29T09:39:19Z", "updated" : "2020-02-29T09:39:19Z", "provisioning_state" : "Succeeded", "tags" : { }, "properties" : { "tenant_id" : "05498e12458025102ff5c0061a584a9f", "listeners" : [ { "id" : "37de3be0-1803-43e2-9bb5-243b4b30b771" } ], "provisioning_status" : "ACTIVE", "description" : "", "pools" : [ { "id" : "a7ae4e7f-3e97-48ea-bdbc-334684aafac4" } ], "created_at" : "2020-02-29T09:39:19", "vip_subnet_id" : "4f91dfd8-cc4f-4c84-bbfd-8518e6b60cad", "tags" : [ ], "enterprise_project_id" : "0", "vip_address" : "192.168.1.127", "updated_at" : "2020-02-29T09:39:19", "project_id" : "05498e12458025102ff5c0061a584a9f", "provider" : "vlb", "operating_status" : "ONLINE", "admin_state_up" : true, "name" : "elb-265a", "id" : "3ccd9191-6a5e-4939-a971-4652db18b370", "vip_port_id" : "5968aa0e-df6a-42c8-adc3-af6acd482163" } }, { "id" : "274698f1-6ae5-4572-b026-edd5e3186343", "name" : "listener-cfcc", "provider" : "elb", "type" : "listeners", "region_id" : "regionid1", "project_id" : "39c2af998c334ed6bcbb75b27318f7b5", "project_name" : "project_name", "ep_id" : "0", "ep_name" : "default", "checksum" : "2fa729ce34155377fe895ebd70e2523632ca34a7310d8a94e00a74b0d4f8ce76", "created" : "2020-06-10T03:38:42Z", "updated" : "2020-06-10T03:38:43Z", "provisioning_state" : "Succeeded", "tags" : { }, "properties" : { "tenant_id" : "39c2af998c334ed6bcbb75b27318f7b5", "default_pool_id" : "524996fb-423e-46df-8ba4-cc00fb810cb8", "protocol_port" : 80, "description" : "", "created_at" : "2020-06-10T03:38:42", "sni_container_refs" : [ ], "connection_limit" : -1, "tags" : [ ], "protocol" : "TCP", "updated_at" : "2020-06-10T03:38:43", "project_id" : "39c2af998c334ed6bcbb75b27318f7b5", "admin_state_up" : true, "name" : "listener-cfcc", "insert_headers" : { "X-Forwarded-ELB-IP" : false, "X-Forwarded-Host" : true }, "loadbalancers" : [ { "id" : "eafba5b9-c67f-4f32-a820-4bc48c0474ee" } ], "http2_enable" : false, "id" : "274698f1-6ae5-4572-b026-edd5e3186343" } }, { "id" : "ede7f295-056c-406a-98cf-551d250f8b44", "name" : "ecs-for-test", "provider" : "ecs", "type" : "cloudservers", "region_id" : "regionid1", "project_id" : "39c2af998c334ed6bcbb75b27318f7b5", "project_name" : "project_name", "ep_id" : "ecf9bb02-bf2b-447c-bafa-bc4b35c31edf", "ep_name" : "test", "checksum" : "9e7d7a2cf3ff4fafb577fef177db606d41433bf1d9e6246e83ffb4b254ad3fd0", "created" : "2020-10-26T03:10Z", "updated" : "2020-10-26T03:10:29Z", "provisioning_state" : "Succeeded", "tags" : { }, "properties" : { "accessIpv4" : "", "hostName" : "ecs-for-test", "addresses" : [ { "OsExtIpsType" : "fixed", "OsExtIpsPortId" : "a3dc68fd-bc03-4a48-9fc3-6854a7ada03d", "addr" : "192.168.20.27", "version" : 4, "OsExtIpsMacAddr" : "fa:16:3e:45:2e:44" }, { "OsExtIpsType" : "floating", "OsExtIpsPortId" : "a3dc68fd-bc03-4a48-9fc3-6854a7ada03d", "addr" : "4.4.4.4", "version" : 4, "OsExtIpsMacAddr" : "fa:16:3e:45:2e:44" } ], "accessIpv6" : "", "metadata" : { "chargingMode" : "0", "meteringImageType" : "shared", "imageName" : "test", "meteringImageId" : "74e96549-a512-44ea-a074-ff69492be31d", "meteringResourcesPerCode" : "si3.small.1.linux", "vpcId" : "1dc57489-4ad1-4905-a447-cd42d77b2525", "osBit" : "64" }, "OsExtStsVmState" : "active", "configDrive" : "", "OsExtStsPowerState" : 1, "hostId" : "3c381dcfc3e628c1a504ad94ba8c4e89081306455273701333f32921", "securityGroup" : [ { "name" : "allow_all", "id" : "52d72165-0d36-48ed-bc51-647ab361c796" } ], "ExtVolumesAttached" : [ { "bootIndex" : "0", "id" : "7642fc7d-9f0e-4cf6-a43a-3c094d7bf596", "device" : "/dev/vda" } ], "userId" : "E2mdWyMJxjRLCkyvTLkRtDMldPnwidNC", "flavor" : { "disk" : "0", "name" : "Si3.small.1", "id" : "Si3.small.1", "vcpus" : "1", "ram" : "1024" }, "OsDcfDiskConfig" : "MANUAL", "hostStatus" : "UP", "OsSrvUsgLaunchedAt" : "2020-10-26T03:10:14.000000", "OsExtAz" : "regionid1a", "progress" : 0, "locked" : false, "OS-EXT-SRV-ATTR" : { "hostName" : "ecs-for-test", "kernelId" : "", "ramdiskId" : "", "reservationId" : "r-o0t5i6lx", "instanceName" : "instance-00117d9e", "host" : "regionid1a-pod01.regionid1", "rootDeviceName" : "/dev/vda", "hypervisorHostName" : "nova001@7", "launchIndex" : 0 }, "status" : "ACTIVE", "schedulerHints" : { } } }, { "id" : "2954ab42-a61d-4545-8fb7-f3029c827f91", "name" : "dcs-test", "provider" : "dcs", "type" : "redis", "region_id" : "regionid1", "project_id" : "2dd15411042d4dd8a708ef86aafebb0c", "project_name" : "project_name", "ep_id" : "0", "ep_name" : "default", "checksum" : "1408722b1da04fb609b377646aeac44d405fdf0aced097f5ec7b4e6c581b933a", "created" : "2019-03-09T09:27:38.340Z", "updated" : "2020-06-07T04:43:04.185Z", "provisioning_state" : "Succeeded", "tags" : { }, "properties" : { "spec_code" : "redis.ha.au1.large.1", "vpc_name" : "vpc-a59a", "charging_mode" : 0, "vpc_id" : "723e6d68-7bd0-4945-ac44-d083e10df9c4", "user_name" : "test", "created_at" : "2019-03-09T09:27:38.340Z", "enable_ssl" : false, "max_memory" : 1024, "capacity" : 1, "maintain_begin" : "02:00:00", "domain_name" : "redis-2954ab4-dcs-test", "engine" : "Redis", "maintain_end" : "06:00:00", "service_upgrade" : false, "no_password_access" : "false", "service_task_id" : "", "ip" : "192.168.1.53", "used_memory" : 2, "enterprise_project_id" : "0", "instance_id" : "2954ab42-a61d-4545-8fb7-f3029c827f91", "port" : 6379, "user_id" : "b32870f8945f443d8aeff4825acf695f", "enable_publicip" : false, "domainName" : "redis-2954ab4-dcs-test", "name" : "dcs-test", "update_at" : "2020-06-07T04:43:04.185Z", "resource_spec_code" : "redis.ha.au1.large.1", "subnet_id" : "08b835de-6c72-493a-84e4-372f13e6c2d8", "engine_version" : "5.0", "status" : "RUNNING" } }, { "id" : "a6e56d05501944d3b2507ba506a43744", "name" : "console", "provider" : "cdn", "type" : "domains", "region_id" : "global", "project_id" : "", "project_name" : "", "ep_id" : "0", "ep_name" : "default", "checksum" : "56afa8b76428f90e9abfbe5cbf33535d8816166114d32eeb119658d6c59eceda", "created" : "2020-01-04T13:42:37Z", "updated" : "2020-01-15T04:23:01Z", "provisioning_state" : "Succeeded", "tags" : { }, "properties" : { "domain_name" : "console", "domain_status" : "offline", "business_type" : "WEB", "modify_time" : 1579062181463, "cname" : "console" } }, { "id" : "1aedefa734514d78baf484358b1066f8in01", "name" : "ecf-cm", "provider" : "rds", "type" : "instances", "region_id" : "regionid1", "project_id" : "9e3425927a954ea5a86d78c3e797acec", "project_name" : "regionid1_region_service", "ep_id" : "0", "ep_name" : "default", "checksum" : "e18552532a73fdfef172061a398212e8ab72e7901a092b240f09a9f250b8e0d1", "created" : "2019-05-21T06:32:52Z", "updated" : "2020-12-22T13:20:56Z", "provisioning_state" : "Succeeded", "tags" : { }, "properties" : { "engineVersion" : "5.7.23.5", "volumeType" : "ULTRAHIGH", "payMode" : "0", "flavorCode" : "rds.mysql.c6.4xlarge.4.ha", "userId" : "04ef9c3e450026431f35c01f946b49d7", "instanceStatus" : "normal", "opsWindow" : "10:00-14:00", "haMode" : "Ha", "enableSsl" : "1", "securityGroupId" : "f6e60b4b-94ca-4d30-9bb2-4ac5366a07e9", "createdAt" : "2019-05-21T06:32:52Z", "port" : "3306", "dataVolumeSizeInGBs" : "1000", "dataVip" : "9.9.9.9", "vpcId" : "ccbea875-6268-473e-bf90-e63159394df2", "networkId" : "ae261422-51c8-4a26-ba53-cfa4cc7d6690", "engineName" : "mysql" } }, { "id" : "7c330b98-87ed-4098-93c7-fc1edc4b6b5a", "name" : "clouddeploy-2pod-env2_hyp-0002", "provider" : "bms", "type" : "servers", "region_id" : "regionid1", "project_id" : "9e3425927a954ea5a86d78c3e797acec", "project_name" : "regionid1_region_service", "ep_id" : "0", "ep_name" : "default", "checksum" : "e18552532a73fdfef172061a398212e8ab72e7901a092b240f09a9f250b8e0d1", "created" : "2019-05-21T06:32:52Z", "updated" : "2020-12-22T13:20:56Z", "provisioning_state" : "Succeeded", "tags" : { "__type_baremetal" : "" }, "properties" : { "accessIpv4" : "", "hostName" : "clouddeploy-2pod-env2-hyp-0002", "addresses" : [ { "OsExtIpsType" : "fixed", "OsExtIpsPortId" : "2db3738d-cbbd-4698-906f-c972845cba3a", "addr" : "192.168.1.49", "version" : 4, "OsExtIpsMacAddr" : "fa:16:3e:29:23:33" } ], "accessIpv6" : "", "metadata" : { "chargingMode" : "1", "meteringImageType" : "private", "imageName" : "Ubuntu 17.10 aarch64 server 64bit for BareMetal", "meteringOrderId" : "CS20122903366ZKVX", "meteringProductId" : "00301-215006-0--0", "meteringImageId" : "e5065d43-4964-4071-b1ab-b17c70f903cc", "meteringResourcesPerCode" : "physical.r1.xlarge.linux", "vpcId" : "d7d8f09b-8bfe-4cc5-87a1-99012253ef44", "osBit" : "64" }, "OsExtStsVmState" : "stopped", "configDrive" : "", "OsExtStsPowerState" : 4, "hostId" : "c3499877cccf68446308b59a0efddb6754029a3b6ddbd14dcca07c46", "securityGroup" : [ { "name" : "default", "id" : "d7872289-f428-4690-9292-583c12fc8449" } ], "ExtVolumesAttached" : [ ], "userId" : "183c03ab1281490e8be2e93038a9079c", "flavor" : { "disk" : "2000", "name" : "physical.r1.xlarge", "id" : "physical.r1.xlarge", "vcpus" : "64", "ram" : "262144" }, "OsDcfDiskConfig" : "MANUAL", "hostStatus" : "UP", "OsSrvUsgLaunchedAt" : "2019-09-05T11:07:15.000000", "OsExtAz" : "regionid1b", "locked" : false, "OS-EXT-SRV-ATTR" : { "hostName" : "clouddeploy-2pod-env2-hyp-0002", "kernelId" : "", "ramdiskId" : "", "reservationId" : "r-703tla9e", "instanceName" : "instance-00034cd1", "host" : "regionid1b-pod02.regionid1", "rootDeviceName" : "/dev/vda", "hypervisorHostName" : "nova004@2", "launchIndex" : 0 }, "status" : "SHUTOFF", "schedulerHints" : { } } } ], "page_info" : { "current_count" : 7, "next_marker" : "CAESJhIkNGEzNWYxMmYtZjM0NC00YTNkLWE1NDEtZWFjMDBiNDIzMjg1GgTGWJss" }}
  • 请求示例 查询当前用户下所有资源。 GET https://{endpoint}/v1/resource-manager/domains/{domain_id}/all-resources 查询当前用户default企业项目下的资源,返回前100条。 GET https://{endpoint}/v1/resource-manager/domains/{domain_id}/all-resources?limit=100&ep_id=0
  • URI DELETE /v1/resource-manager/domains/{domain_id}/aggregators/pending-aggregation-request/{requester_account_id} 表1 路径参数 参数 是否必选 参数类型 描述 domain_id 是 String 帐号ID。 最大长度:36 requester_account_id 是 String 请求聚合数据的帐号ID。 最大长度:36
  • 请求示例 PUT https://{endpoint}/v1/resource-manager/domains/{domain_id}/policy-assignments/{policy_assignment_id}{ "name" : "allowed-images-by-id", "description" : "The ECS resource is non-compliant if the image it used is not in the allowed list", "parameters" : { "listOfAllowedImages" : { "value" : [ "ea0d6e0e-99c3-406d-a873-3bb45462b624" ] } }, "policy_filter" : { "resource_provider" : "ecs", "resource_type" : "cloudservers" }, "policy_definition_id" : "5f3c8b9a9811a13739a32ed9"}
  • 响应示例 状态码: 200 操作成功。 { "id" : "5fb76a240f2daf0b9662a04d", "name" : "volume-inuse-check", "description" : "云硬盘未挂载给任何云服务器,视为“不合规”。", "policy_filter" : { "region_id" : null, "resource_provider" : "evs", "resource_type" : "volumes", "resource_id" : null, "tag_key" : null, "tag_value" : null }, "state" : "Enabled", "created" : "2020-11-20T07:03:00", "updated" : "2020-11-20T07:03:00", "policy_definition_id" : "5fa36558aa1e6afc05a3d0a7", "parameters" : { }}
  • 响应示例 状态码: 200 操作成功。 { "value" : [ { "domain_id" : "059b5c937100d3e40ff0c00a7675a0a0", "region_id" : "regionid1", "resource_id" : "010d95bd-87cd-4f22-ac00-db7fba7d927e", "resource_name" : "ecs-cc-image-test1", "resource_provider" : "ecs", "resource_type" : "cloudservers", "compliance_state" : "NonCompliant", "policy_assignment_id" : "5fb618a726a24c53767fa049", "policy_assignment_name" : "policy-assignment-test1", "policy_definition_id" : "5fa265c0aa1e6afc05a0ff07", "evaluation_time" : 1605776482523 } ], "page_info" : { "current_count" : 1, "next_marker" : null }}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 value Array of PolicyState objects 合规结果查询返回值。 page_info PageInfo object 分页对象。 表5 PolicyState 参数 参数类型 描述 domain_id String 用户ID。 region_id String 资源区域ID。 resource_id String 资源ID。 resource_name String 资源名称。 resource_provider String 云服务名称。 resource_type String 资源类型。 trigger_type String 触发器类型,可选值为"resource"和"period"。 compliance_state String 合规结果。 policy_assignment_id String 规则ID。 policy_assignment_name String 规则名称。 policy_definition_id String 策略ID。 evaluation_time String 合规状态评估时间。 表6 PageInfo 参数 参数类型 描述 current_count Integer 当前页的资源数量。 最小值:0 最大值:200 next_marker String 下一页的marker。 最小长度:4 最大长度:400 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。 状态码: 500 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息内容。
共100000条