All Products
Search
Document Center

Resource Management:SearchMultiAccountResources

Last Updated:Jun 10, 2026

Mencari resource di akun manajemen dan beberapa akun anggota dari direktori sumber daya.

Deskripsi operasi

  • You can search only for Services that work with Resource Center.

  • To search for resources across accounts as a RAM user or RAM role, you must have been attached the resourcecenter:SearchMultiAccountResources policy. For more information, see Grant a RAM user the permissions to use Resource Center.

  • By default, this operation returns a maximum of 20 entries. To change the maximum number of entries that can be returned, specify the MaxResults parameter.

  • If the response does not include NextToken, no more data is available. To query the next page of results, set the NextToken parameter to the value that was returned from the previous call. If you do not specify the NextToken parameter, the first page of data is returned by default.

  • You can set one or more filter conditions to narrow the search scope. For information about supported filter parameters and matching methods, see the information below. Multiple filter conditions are joined by a logical AND. Only resources that meet all filter conditions are returned. The values within a single filter condition are joined by a logical OR. Resources that meet any value for a filter condition are returned.

  • For more query examples, visit OpenAPI Portal.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

resourcecenter:SearchMultiAccountResources

list

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

Scope

string

Yes

Cakupan akun tempat Anda ingin mencari resource. Nilai valid:

  • ID direktori sumber daya: Mencari resource di akun manajemen dan semua akun anggotanya. Untuk informasi selengkapnya, lihat GetResourceDirectory.

  • ID Folder Root: Mencari resource di semua akun anggota di bawah Folder Root dan subfoldernya. Untuk informasi selengkapnya, lihat ListFoldersForParent.

  • ID folder: Mencari resource di semua akun anggota di bawah folder tersebut. Untuk informasi selengkapnya, lihat ListFoldersForParent.

  • ID akun anggota: Mencari resource di akun anggota tersebut. Untuk informasi selengkapnya, lihat ListAccounts.

rd-r4****

NextToken

string

No

Token paginasi yang digunakan pada permintaan berikutnya untuk mengambil halaman hasil baru. Anda tidak perlu menentukan parameter ini untuk permintaan pertama. Anda harus menentukan token yang diperoleh dari kueri sebelumnya sebagai nilai NextToken.

eyJzZWFyY2hBZnRlcnMiOlsiMTAwMTU2Nzk4MTU1OSJd****

MaxResults

integer

No

Jumlah maksimum entri yang dikembalikan pada setiap halaman.

Nilai valid: 1 hingga 100.

Nilai default: 20.

10

Filter

array<object>

No

Kondisi filter.

object

No

The filter condition.

Key

string

No

The key of the filter condition. For more information, see the "Supported filter parameters" section below.

ResourceGroupId

MatchType

string

No

The matching method.

Set this parameter to Equals, which means an exact match.

Equals

Value

array

No

The values of the filter condition.

string

No

The value of the filter condition.

rg-aekzmrjn4ns****

SortCriterion

object

No

Parameter pengurutan.

Key

string

No

The sort key.

Set this parameter to CreateTime, which means the results are sorted by resource creation time.

CreateTime

Order

string

No

The sort order. Valid values:

  • ASC: Ascending order.

  • DESC: Descending order.

Default value: ASC.

ASC

Parameter filter yang didukung

ParameterDeskripsiMetode pencocokan yang didukung
ResourceTypeTipe resource.Equals
RegionIdID wilayah.Equals
ResourceIdID resource.Equals, Prefix
ResourceGroupIdID kelompok sumber daya.Equals, Exists, NotExists
ResourceNameNama resource.Equals, Contains
TagPasangan kunci-nilai dari sebuah tag. Nilainya harus berupa string JSON dalam format { "key": $key, "value": $value }. Anda harus menentukan minimal key atau value. Misalnya, jika Anda ingin mengkueri kunci tag foo dan nilai tag bar, atur parameter ini ke { "key": "foo", "value": "bar" }. Jika Anda hanya ingin mengkueri kunci tag foo, atur parameter ini ke { "key": "foo" }.Contains, NotContains, NotExists
VpcIdID VPC.Equals
VSwitchIdID vSwitch.Equals

Elemen respons

Element

Type

Description

Example

object

The response parameters.

Filters

array<object>

The filter conditions.

object

The filter condition.

Key

string

The key of the filter condition.

RegionId

MatchType

string

The matching method.

Equals

Values

array

The values of the filter condition.

string

The value of the filter condition.

cn-hangzhou

MaxResults

integer

The maximum number of entries returned per page.

10

NextToken

string

The token to retrieve the next page of results.

查询返回结果下一页的令牌。

RequestId

string

The request ID.

EFA806B9-7F36-55AB-8B7A-D680C2C5EE57

Resources

array<object>

The information about the resources.

array<object>

The information about the resource.

AccountId

string

The ID of the management account or a member account of the resource directory.

151266687691****

CreateTime

string

The time when the resource was created.

Catatan

Whether this parameter is returned depends on the Alibaba Cloud service that manages the resource.

2021-06-30T09:20:08Z

ExpireTime

string

The time when the resource expires.

2023-06-14T14:35:45Z

IpAddressAttributes

array<object>

The attributes of the IP addresses.

object

The attributes of the IP address.

IpAddress

string

The IP address.

192.168.1.2

NetworkType

string

The network type. Valid values:

  • Public: Internet.

  • Private: Private network.

Public

Version

string

The IP address version.

Ipv4

IpAddresses

array

The IP addresses.

Catatan

Whether this parameter is returned depends on the Alibaba Cloud service that manages the resource.

string

The IP address.

Catatan

Whether this parameter is returned depends on the Alibaba Cloud service that manages the resource.

192.168.1.2

RegionId

string

The region ID.

cn-hangzhou

ResourceGroupId

string

The resource group ID.

rg-acfmzawhxxc****

ResourceId

string

The resource ID.

vtb-bp11lbh452fr8940s****

ResourceName

string

The resource name.

group1

ResourceType

string

The resource type.

ACS::VPC::RouteTable

Tags

array<object>

The tags.

object

The tag.

Key

string

The tag key.

test_key

Value

string

The tag value.

test_value

ZoneId

string

The zone ID.

Catatan

Whether this parameter is returned depends on the Alibaba Cloud service that manages the resource.

cn-hangzhou-k

Scope

string

The scope of accounts in which the resources were searched. Valid values:

  • The ID of the resource directory. This indicates that resources were searched in the management account and all member accounts of the resource directory.

  • The ID of the Root folder. This indicates that resources were searched in all member accounts under the Root folder and its subfolders.

  • The ID of a folder. This indicates that resources were searched in all member accounts under the folder.

  • The ID of a member account. This indicates that resources were searched in the member account.

rd-r4****

Contoh

Respons sukses

JSONformat

{
  "Filters": [
    {
      "Key": "RegionId",
      "MatchType": "Equals",
      "Values": [
        "cn-hangzhou"
      ]
    }
  ],
  "MaxResults": 10,
  "NextToken": "查询返回结果下一页的令牌。",
  "RequestId": "EFA806B9-7F36-55AB-8B7A-D680C2C5EE57",
  "Resources": [
    {
      "AccountId": "151266687691****",
      "CreateTime": "2021-06-30T09:20:08Z",
      "ExpireTime": "2023-06-14T14:35:45Z",
      "IpAddressAttributes": [
        {
          "IpAddress": "192.168.1.2",
          "NetworkType": "Public",
          "Version": "Ipv4"
        }
      ],
      "IpAddresses": [
        "192.168.1.2"
      ],
      "RegionId": "cn-hangzhou",
      "ResourceGroupId": "rg-acfmzawhxxc****\t\n",
      "ResourceId": "vtb-bp11lbh452fr8940s****",
      "ResourceName": "group1",
      "ResourceType": "ACS::VPC::RouteTable",
      "Tags": [
        {
          "Key": "test_key",
          "Value": "test_value"
        }
      ],
      "ZoneId": "cn-hangzhou-k"
    }
  ],
  "Scope": "rd-r4****\n"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 NoPermission You are not authorized to perform this operation.
400 InvalidParameter.MaxResults The specified parameter MaxResults is not valid.
400 MultiAccountServiceNotEnabled Multi account ResourceCenter service is not enabled.
400 InvalidParameter.Filter.ResourceType The specified parameter value of Filter.ResourceType is not valid.
400 InvalidParameter.Filter.CreateTime The specified parameter Filter.n.CreateTime is not valid.
400 InvalidParameter.Filter.IpAddress The specified parameter Filter.n.IpAddress is not valid.
400 InvalidParameter.Filter.Tag The specified parameter Filter.n.Tag is not valid.
403 NoPermission.AccountScope The operator is not permitted for this account scope.
404 NotExists.Resource The specified resource does not exist.
404 NotExists.ResourceDirectory The resource directory for the account is not enabled.
404 NotExists.ResourceDirectory.FolderId The specified folder does not exist.
409 InvalidParameter.Scope The Scope is invalid.
409 NoPermission.ResourceDirectory.MemberAccount ResourceDirectory Member Account is not authorized to perform this operation.
409 InvalidParameter.SortCriterion.Key The specified parameter SortCriterion.Key is not valid.
409 ExceedLimit.Filter The maximum length of Filters is exceeded.
409 ServiceNotEnabled.SpecifiedAccount ResourceCenter service of the specified account is not enabled.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.