All Products
Search
Document Center

CloudSSO:CreateDirectory

Last Updated:Jun 10, 2026

Membuat direktori.

Deskripsi operasi

Operation description

A directory is a CloudSSO instance. Before you can use CloudSSO, you must create a directory. The directory is used to manage all CloudSSO resources.

To create a directory, you must select a region. Alibaba Cloud stores data in the directory only in the region that you select. However, you can deploy Alibaba Cloud resources including Elastic Compute Service (ECS) instances and ApsaraDB RDS instances in other regions. You can also use your cloud account for logons and access the Alibaba Cloud resources in other regions. You can select a region to create a directory based on your security compliance requirements and the geographic location of specific users. If you do not have strict security compliance requirements, we recommend that you select a region that is the closest to the geographical location of the specific users. This way, access to cloud resources is accelerated. You can create the CloudSSO directory in the China (Shanghai), China (Hong Kong), US (Silicon Valley), or Germany (Frankfurt) region.

This topic provides an example on how to create a directory named example in the China (Shanghai) region.

Limits

  • You can create only one directory for a management account.

  • If you want to change the region of a directory, you must delete the directory and then create a directory in a different region.

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

cloudsso:CreateDirectory

create

*Directory

acs:cloudsso:{#regionId}:{#accountId}:directory/*

None
  • ram:CreateServiceLinkedRole

Parameter permintaan

Parameter

Type

Required

Description

Example

DirectoryName

string

No

Nama direktori. Nama harus unik secara global.

Nama dapat berisi huruf kecil, angka, dan tanda hubung (-). Nama tidak boleh diawali atau diakhiri dengan tanda hubung (-) dan tidak boleh berisi dua tanda hubung (-) berturut-turut. Nama tidak boleh diawali dengan d-.

Panjang nama harus 2 hingga 64 karakter.

Catatan

Jika Anda tidak menentukan parameter ini, nilai parameter ini akan dibuat secara otomatis oleh sistem.

example

Elemen respons

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

ADADC31D-90EE-5459-99B0-D83DF07769A3

Directory

object

The information about the directory.

DirectoryId

string

The ID of the directory.

d-00fc2p61****

CreateTime

string

The time when the directory was created. The time is displayed in UTC.

2021-10-10T04:04:04Z

UpdateTime

string

The time when the directory was modified. The time is displayed in UTC.

2021-10-10T04:04:04Z

Region

string

The region ID of the directory.

cn-shanghai

DirectoryName

string

The name of the directory.

example

Contoh

Respons sukses

JSONformat

{
  "RequestId": "ADADC31D-90EE-5459-99B0-D83DF07769A3",
  "Directory": {
    "DirectoryId": "d-00fc2p61****",
    "CreateTime": "2021-10-10T04:04:04Z",
    "UpdateTime": "2021-10-10T04:04:04Z",
    "Region": "cn-shanghai",
    "DirectoryName": "example"
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.