Creates a directory or file.
Operation description
-
This operation is available only to specific users.
-
Only General-purpose NAS file systems that use the SMB Protocol Type and have access control enabled are supported. Alibaba Cloud Key Management Service (KMS) must also be activated.
Prerequisites
Before calling this API to create a file, complete the following four steps:
-
Create an SMB General-purpose NAS file system: Call the CreateFileSystem operation with ProtocolType set to SMB to create a General-purpose NAS file system that supports the SMB protocol.
-
Activate KMS: Activate KMS by using one of the following methods:
Call the Kms.OpenKmsService API operation.
Go to the console activation page.
-
Enable SMB ACL: Call the EnableSmbAcl operation to enable the SMB ACL feature. Recommended configuration:
AuthMethod=NTLM
AuthCenter=EDS
This configuration does not require an AD domain Keytab and is easier to use.
-
Call CreateFile: After completing the preceding steps, call this operation to create a directory or file.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nas:CreateFile |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| FileSystemId |
string |
Yes |
The file system ID. |
1ca404**** |
| Path |
string |
Yes |
The absolute path of the directory or file.
|
/test/ |
| Type |
string |
Yes |
The object type. Valid values:
|
File |
| Owner |
string |
No |
The portable account ID. Limit: The value is a 16-character string that supports digits and lowercase letters. |
378cc7630f26**** |
| OwnerAccessInheritable |
boolean |
No |
Specifies whether to share directory permissions. Valid values:
Note
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
2D69A58F-345C-4FDE-88E4-BF518948**** |
Examples
Success response
JSON format
{
"RequestId": "2D69A58F-345C-4FDE-88E4-BF518948****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.