All Products
Search
Document Center

CloudSSO:CreateDirectory

Last Updated:Mar 01, 2024

Creates a directory.

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.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cloudsso:CreateDirectoryWrite
  • Directory
    acs:cloudsso:{#regionId}:{#accountId}:directory/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DirectoryNamestringNo

The name of the directory. The name must be globally unique.

The name can contain lowercase letters, digits, or hyphens (-). The name cannot start or end with a hyphen (-) and cannot contain two consecutive hyphens (-). The name cannot start with d-.

The name must be 2 to 64 characters in length.

Note If you do not specify this parameter, the value of this parameter is automatically generated by the system.
example

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

ADADC31D-90EE-5459-99B0-D83DF07769A3
Directoryobject

The information about the directory.

DirectoryIdstring

The ID of the directory.

d-00fc2p61****
CreateTimestring

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

2021-10-10T04:04:04Z
UpdateTimestring

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

2021-10-10T04:04:04Z
Regionstring

The region ID of the directory.

cn-shanghai
DirectoryNamestring

The name of the directory.

example

Examples

Sample success responses

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"
  }
}

Error codes

For a list of error codes, visit the Service error codes.