Creating a Directory
Function
This API is used to create a directory.
URI
POST /v1/{project_id}/sfs-turbo/shares/{share_id}/fs/dir
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
share_id |
Yes |
String |
File system ID |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Account token |
Content-Type |
Yes |
String |
MIME type |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
path |
Yes |
String |
Valid full path of an existing directory |
mode |
No |
Long |
Directory permissions, which range from 0 to 777*. The default value is 755. The first digit indicates the permissions of the directory owner, and its value ranges from 0 to 7. The second digit indicates the permissions of the user group to which the directory belongs, and its value ranges from 0 to 7. The third digit indicates the permissions of other users, and its value ranges from 0 to 7. The directory owner is specified by UID, and the user group to which the directory belongs is specified by GID. Users who are not the directory owner and not in the user group to which the directory belongs are other users. For example, in 755, the first digit 7 indicates that the directory owner has the read, write, and execute permissions on the directory, the second digit 5 indicates that the user group to which the directory belongs has the read and execute permissions on the directory, and the third digit 5 indicates that other users have the read and execute permissions on the directory. |
uid |
No |
Long |
ID of the directory owner. The default value is 0. The value ranges from 0 to 4,294,967,294 (2^32-2). |
gid |
No |
Long |
ID of the user group to which the directory belongs. The default value is 0. The value ranges from 0 to 4,294,967,294 (2^32-2). |
Response Parameters
Status code: 400
Parameter |
Type |
Description |
---|---|---|
errCode |
String |
Error code |
errMsg |
String |
Error description |
Status code: 409
Parameter |
Type |
Description |
---|---|---|
errCode |
String |
Error code |
errMsg |
String |
Error description |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
errCode |
String |
Error code |
errMsg |
String |
Error description |
Example Requests
Creating a directory whose full path is /date/test
{ "path" : "/date/test" }
Example Responses
Status code: 400
Error response
{ "errCode" : "SFS.TURBO.0122", "errMsg" : "invalid mode" }
Status code: 409
Conflict directory
{ "errCode" : "SFS.TURBO.0114", "errMsg" : "path already exist" }
Status code: 500
Error response
{ "errCode" : "SFS.TURBO.0005", "errMsg" : "Internal server error" }
Status Codes
Status Code |
Description |
---|---|
204 |
Directory created |
400 |
Error response |
409 |
Conflict directory |
500 |
Error response |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot