Creates a share for a file gateway.

Before you call this operation, take note of the following items:

  • A file gateway with an unused cache disk is created and deployed.
  • An Object Storage Service (OSS) bucket is created.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateGatewayFileShare

The operation that you want to perform. Set the value to CreateGatewayFileShare.

GatewayId String Yes gw-000eg44nmxbsfwbvq***

The ID of the gateway.

Name String Yes alex***

The name of the share. The name must be 1 to 255 characters in length and can contain lowercase letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a lowercase letter.

ShareProtocol String Yes NFS

The protocol of the share. Valid values:

  • NFS
  • SMB
RemoteSync Boolean No false

Specifies whether to enable reverse synchronization for the share. Default value: false. Valid values:

  • false
  • true
PollingInterval Integer No 4500

The interval between two consecutive reverse synchronization tasks. Valid values: 15 to 36000.

Note If the replication mode and reverse synchronization are enabled at the same time when data is downloaded, valid values range from 3600 to 36000.
IgnoreDelete Boolean No false

Specifies whether to enable the ignore deletions for the share. Default value: false. After you enable the feature, data stored in the OSS bucket is retained if you delete data from the gateway. Valid values:

  • false
  • true
Note This parameter is supported for Cloud Storage Gateway version 1.0.40 or later.
FrontendLimit Integer No 1234

The maximum write speed of the share. Unit: MB/s. Valid values: 0 to 1280. Default value: 0 (unlimited write speed).

BackendLimit Integer No 1234

The maximum upload speed of the share. Unit: MB/s. Valid values: 0 to 1280. Default value: 0 (unlimited upload speed).

Note The maximum upload speed cannot be less than the maximum write speed.
InPlace Boolean No false

Specifies whether to enable the fragmentation optimization feature for the share. Default value: false. Valid values:

  • false
  • true
CacheMode String No Cache

The data synchronization mode of the share. Valid values:

  • Cache: the cache mode
  • Sync: the replication mode
Browsable Boolean No true

Specifies whether the share is browsable over the SMB protocol (that is, whether the share is discoverable in the network neighbor). This parameter takes effect only when the ShareProtocol parameter is set to SMB. Default value: true. Valid values:

  • true
  • false
Squash String No none

The NFS identity mapping to map NFS client users to NFS server users. Default value: none Valid values:

  • none
  • root_squash
  • all_squash
  • all_anonymous
ReadWriteUserList String No user1, user2

The list of users who have read and write access to the SMB share. Separate multiple users with commas (,). This parameter takes effect only when the ShareProtocol parameter is set to SMB.

ReadOnlyUserList String No userA, userB

The list of users who have read-only access to the SMB share. Separate multiple users with commas (,). This parameter takes effect only when the ShareProtocol parameter is set to SMB.

ReadWriteClientList String No 12.12.12.12

The IP addresses or CIDR blocks allowed to read and write the NFS share. Separate multiple IP addresses or CIDR blocks with commas (,).

ReadOnlyClientList String No 12.12.12.12

The IP addresses or CIDR blocks that can be used to only read the NFS share. Separate multiple IP addresses or CIDR blocks with commas (,).

OssBucketName String Yes testbucket

The name of the OSS bucket.

Note An OSS bucket for which you configure back-to-origin rules is not supported.
OssEndpoint String Yes oss-cn-hangzhou-internal.aliyuncs.com

The endpoint of the region in which the OSS bucket is located.

Note Specify an internal or public endpoint based on your business requirements. If the OSS bucket and the gateway reside in the same region, we recommend that you specify the internal endpoint. Example: oss-cn-shanghai-internal.aliyuncs.com.
OssBucketSsl Boolean No true

Specifies whether to enable SSL for the OSS bucket. Default value: true. Valid values:

  • true
  • false
LagPeriod Long No 5

A period of time to delay the upload of files from the gateway cache to the OSS bucket. Unit: seconds. Valid values: 5 to 120. Default value: 5.

Note This parameter is supported for Cloud Storage Gateway version 1.0.40 or later.
DirectIO Boolean No false

Specifies whether data is directly read from and written to the cache disk. Default value: false. Valid values:

  • false
  • true
LocalFilePath String Yes /dev/vdb

The cache disk path of the share. You can call the DescribeGatewayCaches operation to query the cache disk path.

ServerSideEncryption Boolean No false

Specifies whether to enable server-side encryption for the share. Default value: false. Valid values:

  • false
  • true
Note The feature is available only to users in the whitelist. To enable the feature, contact our technical support. Server-side encryption and client-side encryption cannot be configured at the same time.
ServerSideCmk String No xxxxx

The KMS-managed encryption key that is used for server-side encryption.

Note The encryption key must be in the same region as the gateway.
ClientSideEncryption Boolean No false

Specifies whether to enable client-side encryption for the share. Default value: false. Valid values:

  • false
  • true
Note The feature is available only to users in the whitelist. To enable the feature, contact our technical support. Only Enhanced and Advanced gateways support the feature. Server-side encryption and client-side encryption cannot be configured at the same time.
ClientSideCmk String No xxxxx

The encryption key that is managed by Key Management Service (KMS) and used for client-side encryption.

Note The encryption key must be in the same region as the gateway.
KmsRotatePeriod Long No 0

The key rotation cycle. The parameter takes effect only when client-side encryption is enabled for the share. Unit: seconds. Valid values: 3600 to 360 × 86400. Default value: 0. A value of 0 indicates that the key is not rotated.

PathPrefix String No test1

The subdirectory of the OSS bucket. If you leave the parameter empty, the root directory of the OSS bucket is specified.

FastReclaim Boolean No false

Specifies whether to enable the upload optimization feature for the share. The feature is suitable for the scenarios where you synchronize only backups to the cloud. Default value: false. Valid values:

  • false
  • true
Note This parameter is supported for Cloud Storage Gateway version 1.0.39 or later.
SupportArchive Boolean No false

Specifies whether to allow access to archived files for the share. This parameter takes effect only when the ShareProtocol parameter is set to NFS.

Note If you enable the feature and access an archived file, a request is initiated to restore the archived file. The request does not trigger error messages. However, the request increases the latency to read the file.
WindowsAcl Boolean No false

Specifies whether to configure a Windows access control list (ACL) for the SMB share. Active Directory is required to configure this parameter. Default value: false. Valid values:

  • false
  • true
Note This parameter is supported for Cloud Storage Gateway version 1.0.45 or later.
AccessBasedEnumeration Boolean No false

Specifies whether to enable Windows access-based enumeration (ABE) for the SMB share. This parameter takes effect only when the windowsAcl parameter is set to true. Default value: false. Valid values:

  • false
  • true
Note This parameter is supported for Cloud Storage Gateway version 1.0.45 or later.
NfsV4Optimization Boolean No false

Specifies whether to enable fragment optimization based on the Network File System version 4 (NFSv4) protocol to improve the upload efficiency. Default value: false. Valid values:

  • false
  • true
Note After you enable the feature, you cannot mount the share on on-premises clients over NFSv3. This parameter is supported for Cloud Storage Gateway version 1.2.0 or later.
TransferAcceleration Boolean No false

Specifies whether to enable the transfer acceleration feature for the share. Before you configure this parameter, make sure that transfer acceleration is enabled for the bucket.

Note This parameter is supported for Cloud Storage Gateway version 1.3.0 or later.
RemoteSyncDownload Boolean No false

Specifies whether to download data if the replication mode is enabled. Default value: false. Valid values:

  • false
  • true
Note This parameter takes effect only when the share allows reverse synchronization or is added to an express synchronization group.
DownloadLimit Integer No 0

The maximum download speed of the share. Unit: MB/s. Valid values: 0 to 1280. A value of 0 indicates that the download speed is not limited.

Note
  • This parameter takes effect only when the replication mode and data download feature are enabled.
  • This parameter takes effect only when the share allows reverse synchronization or is added to an express synchronization group.
  • This parameter is supported for Cloud Storage Gateway version 1.3.0 or later.
PartialSyncPaths String No test1

The directories from which you want to synchronize data if the replication mode is enabled.

Note The feature is available only to users in the whitelist. To enable the feature, contact our technical support.
ServerSideAlgorithm String No AES256

The encryption algorithm. Default value: AES256. Valid values:

  • AES256
  • SM4
BypassCacheRead Boolean No false

Specifies whether to directly read data from OSS. Default value: false. Valid values:

  • true
  • false

Response parameters

Parameter Type Example Description
TaskId String t-000eg44nmxbsh3qk***

The ID of the task.

Message String successful

The description of the request result.

RequestId String F8B59F29-453D-49BF-8673-EEB8F9F2D5C6

The ID of the request.

Code String 200

The HTTP status code. If the request is successful, 200 is returned.

Success Boolean true

Indicates whether the call was successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateGatewayFileShare
&GatewayId=gw-000eg44nmxbsfwbvq***
&LocalFilePath=/dev/vdb
&Name=alex***
&OssBucketName=testbucket
&OssEndpoint=oss-cn-hangzhou-internal.aliyuncs.com
&ShareProtocol=NFS
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateGatewayFileShareResponse>
    <TaskId>t-000eg44nmxbsh3qk***</TaskId>
    <Message>successful</Message>
    <RequestId>F8B59F29-453D-49BF-8673-EEB8F9F2D5C6</RequestId>
    <Code>200</Code>
    <Success>true</Success>
</CreateGatewayFileShareResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TaskId" : "t-000eg44nmxbsh3qk***",
  "Message" : "successful",
  "RequestId" : "F8B59F29-453D-49BF-8673-EEB8F9F2D5C6",
  "Code" : "200",
  "Success" : true
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter.FileShare.%s The specified field %s for file share is invalid. Please check it again. The error message returned because the parameters of the share are invalid.
400 VersionNotSupported.FileShare.%s The specified field %s for file share is not supported by current gateway version. Please check it again. The error message returned because some parameters are not supported for the gateway version that you use. Check the parameters and try again.
400 FileShareArchiveSupportConflict You can configure the ArchiveSupport parameter only with NFS protocol and when the user mapping value is "none". The error message returned because the ShareProtocol parameter is not set to NFS or the Squash parameter is not set to none. The archiveSupport parameter is available only when the ShareProtocol parameter is set to NFS and the Squash parameter is set to none.

For a list of error codes, see Service error codes.