All Products
Search
Document Center

File Storage NAS:CreateFile

Last Updated:Nov 07, 2024

Creates a directory or file.

Operation description

  • This operation is only available to some users.
  • This operation supports only General-purpose NAS file systems that use the Server Message Block (SMB) protocol and have Resource Access Management (RAM) enabled.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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
nas:CreateFilecreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
FileSystemIdstringYes

The ID of the file system.

1ca404****
PathstringYes

The absolute path of the directory or file. The path must start and end with a forward slash (/) and must be 2 to 1024 characters in length.

/test/
TypestringYes

The type of the object. Valid values:

  • File
  • Directory
File
OwnerstringNo

The ID of the portable account. The ID must be a 16-digit string. The string can contain digits and lowercase letters.

378cc7630f26****
OwnerAccessInheritablebooleanNo

Specifies whether to share the directory. Valid values:

  • false (default): does not share the directory.
  • true: shares the directory.
Note
  • This parameter takes effect only if the Type parameter is set to Directory and the Owner parameter is not empty.
  • The permissions on a directory can be inherited by the owner. The owner has read and write permissions on the subdirectories and subfiles created in the directory, even if they are created by others.
  • false

    Response parameters

    ParameterTypeDescriptionExample
    object

    Schema of Response

    RequestIdstring

    The request ID.

    2D69A58F-345C-4FDE-88E4-BF518948****

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "2D69A58F-345C-4FDE-88E4-BF518948****"
    }

    Error codes

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

    Change history

    Change timeSummary of changesOperation
    2024-09-05The internal configuration of the API is changed, but the call is not affectedView Change Details