調(diào)用CreateFolder創(chuàng)建資源夾。
接口說明
說明
最多支持創(chuàng)建 5 級(jí)資源夾。
本文將提供一個(gè)示例,在 Root 資源夾下,創(chuàng)建一個(gè)名為rdFolder
的資源夾。
調(diào)試
您可以在OpenAPI Explorer中直接運(yùn)行該接口,免去您計(jì)算簽名的困擾。運(yùn)行成功后,OpenAPI Explorer可以自動(dòng)生成SDK代碼示例。
授權(quán)信息
下表是API對(duì)應(yīng)的授權(quán)信息,可以在RAM權(quán)限策略語句的Action
元素中使用,用來給RAM用戶或RAM角色授予調(diào)用此API的權(quán)限。具體說明如下:
- 操作:是指具體的權(quán)限點(diǎn)。
- 訪問級(jí)別:是指每個(gè)操作的訪問級(jí)別,取值為寫入(Write)、讀取(Read)或列出(List)。
- 資源類型:是指操作中支持授權(quán)的資源類型。具體說明如下:
- 對(duì)于必選的資源類型,用背景高亮的方式表示。
- 對(duì)于不支持資源級(jí)授權(quán)的操作,用
全部資源
表示。
- 條件關(guān)鍵字:是指云產(chǎn)品自身定義的條件關(guān)鍵字。
- 關(guān)聯(lián)操作:是指成功執(zhí)行操作所需要的其他權(quán)限。操作者必須同時(shí)具備關(guān)聯(lián)操作的權(quán)限,操作才能成功。
操作 | 訪問級(jí)別 | 資源類型 | 條件關(guān)鍵字 | 關(guān)聯(lián)操作 |
---|---|---|---|---|
resourcemanager:CreateFolder | Write |
|
| 無 |
請(qǐng)求參數(shù)
名稱 | 類型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ParentFolderId | string | 否 | 父資源夾 ID。 | r-b1**** |
FolderName | string | 是 | 資源夾名稱。 長(zhǎng)度為 1~24 個(gè)字符或漢字,可包含漢字、英文字母、數(shù)字、下劃線(_)、半角句號(hào)(.)和短劃線(-)。 | rdFolder |
關(guān)于公共請(qǐng)求參數(shù)的詳情,請(qǐng)參見公共參數(shù)。
返回參數(shù)
示例
正常返回示例
JSON
格式
{
"RequestId": "C2CBCA30-C8DD-423E-B4AD-4FB694C9180C",
"Folder": {
"FolderId": "fd-u8B321****",
"CreateTime": "2019-02-19T09:34:50.757Z",
"ParentFolderId": "r-b1****",
"FolderName": "rdFolder"
}
}
錯(cuò)誤碼
HTTP status code | 錯(cuò)誤碼 | 錯(cuò)誤信息 | 描述 |
---|---|---|---|
400 | InvalidParameter.ParentFolderId | The ParentFolderId is invalid. | 父資源夾ID無效,資源夾ID應(yīng)以“r-”開頭+6位數(shù)字或英文字母或以“fd-”開頭+10位數(shù)字或英文字母。 |
400 | MissingParameter.Folder.Name | You must specify the resource folder name. | 資源夾名稱缺失,請(qǐng)指定資源夾名稱。 |
400 | InvalidParameter.Folder.Name | The Name of folder is invalid. | 資源夾名稱無效。請(qǐng)輸入漢字、英文字母、數(shù)字、下劃線(_)、點(diǎn)號(hào)(.)和短劃線(-)。 |
400 | InvalidParameter.Folder.Name.Length | The Name of folder exceeds the length limit. | 資源夾名稱長(zhǎng)度超出限制,長(zhǎng)度為1~24個(gè)字符或漢字。 |
400 | InvalidParameter.Folder.Name.AlreadyUsed | The name already exists under the same parent. Please change to another name. | 相同父級(jí)下已存在該名稱,請(qǐng)更換。 |
404 | EntityNotExists.ResourceDirectory | The resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account. | 當(dāng)前賬號(hào)未啟用資源目錄,請(qǐng)先啟用資源目錄。 |
404 | EntityNotExists.Folder | The resource directory folder does not exist. | 資源夾不存在,請(qǐng)先創(chuàng)建資源夾。 |
409 | LimitExceeded.Folder.Depth | The folder depth exceeds the limit of 5. | 資源夾層級(jí)超出限制,除了根資源夾最多只能創(chuàng)建5個(gè)層級(jí)。 |
409 | QuotaExceeded.Folder.Count | The number of folders exceeds the quota. | 資源夾數(shù)量超出限制。 |
訪問錯(cuò)誤中心查看更多錯(cuò)誤碼。
變更歷史
變更時(shí)間 | 變更內(nèi)容概要 | 操作 |
---|
暫無變更歷史