Creates a file share for a file gateway.
Operation description
Before you call this operation, make sure that the following requirements are met:
You have created and deployed a file gateway that has an unused cache disk.
You have an Object Storage Service (OSS) bucket.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
hcs-sgw:CreateGatewayFileShare | create | *All Resource
| None | None |
Request parameters
Parameter | Type | Required | Description | Example |
GatewayId | string | Yes | The gateway ID. | gw-000eg44nmxbsfwbvq*** |
Name | string | Yes | The name of the file 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. | alex*** |
ShareProtocol | string | Yes | The file sharing protocol. Valid values:
| NFS |
RemoteSync | boolean | No | Specifies whether to enable remote sync for the file share. Valid values:
| false |
PollingInterval | integer | No | The interval for remote sync. The value must be an integer from 15 to 36,000. Note If you use replication mode and enable both remote sync and file data download, the value must be an integer from 3,600 to 36,000. | 4500 |
IgnoreDelete | boolean | No | Specifies whether to ignore deletions. If you enable this feature, deleting a file on the gateway does not delete the corresponding file in the OSS bucket.
Note This feature is supported by gateway versions 1.0.40 and later. | false |
FrontendLimit | integer | No | The maximum write speed of the file share. Unit: MB/s. The value must be an integer from 0 to 1,280. The default value is 0, which indicates no limit. | 1234 |
BackendLimit | integer | No | The maximum upload speed of the file share. Unit: MB/s. The value must be an integer from 0 to 1,280. The default value is 0, which indicates no limit. Note If you set a maximum write speed, the maximum upload speed cannot be lower than the maximum write speed. | 1234 |
InPlace | boolean | No | This parameter is deprecated. Do not set this parameter. | false |
CacheMode | string | No | The cache mode of the file share. Valid values:
| Cache |
Browsable | boolean | No | Specifies whether the file share is browsable in a Server Message Block (SMB) protocol environment. This means whether it can be discovered in Network Neighborhood. Valid values:
Note
| true |
Squash | string | No | The user mapping for the file share under the NFS protocol. Valid values:
| none |
ReadWriteUserList | string | No | The list of users with read and write permissions for the file share under the SMB protocol. Separate multiple users with commas (,). Note
| user1,user2 |
ReadOnlyUserList | string | No | The list of users with read-only permissions for the file share under the SMB protocol. Separate multiple users with commas (,). Note
| userA,userB |
ReadWriteClientList | string | No | The list of clients with read and write permissions for the file share under the NFS protocol. The list can contain IP addresses or IP address ranges. Separate multiple clients with commas (,). | 12.12.12.12 |
ReadOnlyClientList | string | No | The list of clients with read-only permissions for the file share under the NFS protocol. The list can contain IP addresses or IP address ranges. Separate multiple clients with commas (,). | 12.12.12.12 |
OssBucketName | string | Yes | The name of the OSS bucket that corresponds to the file share. Note File shares do not support OSS buckets that have the origin fetch feature enabled. | testbucket |
OssEndpoint | string | Yes | The endpoint of the region where the OSS bucket is located. Note Differentiate between internal and public endpoints. If the OSS bucket and the gateway are in the same region, use an internal endpoint, such as oss-cn-hangzhou-internal.aliyuncs.com. | oss-cn-hangzhou-internal.aliyuncs.com |
OssBucketSsl | boolean | No | Specifies whether to enable Secure Sockets Layer (SSL) to access the OSS bucket. Valid values:
| true |
LagPeriod | integer | No | The synchronization latency. This is the delay for synchronizing the local cache of the gateway to the cloud OSS bucket. Unit: seconds. The value must be an integer from 5 to 120. The default value is 5. Note This feature is supported by gateway versions 1.0.40 and later. | 5 |
DirectIO | boolean | No | Specifies whether to enable Direct I/O (DirectIO) for data transfer. Valid values:
| false |
LocalFilePath | string | Yes | The internal device name of the cache disk used by the file share. You can get this name by calling the DescribeGatewayCaches operation. | /dev/vdb |
ServerSideEncryption | boolean | No | Deprecated. | false |
ServerSideCmk | string | No | Deprecated. | xxxxx |
ClientSideEncryption | boolean | No | Deprecated. | false |
ClientSideCmk | string | No | Deprecated. | xxxxx |
KmsRotatePeriod | integer | No | Deprecated. | 0 |
PathPrefix | string | No | The path of the subdirectory in the OSS bucket that corresponds to the file share. If this parameter is empty, it corresponds to the root directory of the bucket. | test1 |
FastReclaim | boolean | No | Specifies whether to enable upload optimization for the file share. This is suitable for scenarios where data is purely backed up to the cloud. Valid values:
Note This feature is supported by gateway versions 1.0.39 and later. | false |
SupportArchive | boolean | No | This parameter is deprecated. Do not set this parameter. | false |
WindowsAcl | boolean | No | For the SMB protocol, specifies whether to enable access control using Windows Access Control Lists (ACLs). This requires an Active Directory (AD) domain. Valid values:
Note This feature is supported by gateway versions 1.0.45 and later. | false |
AccessBasedEnumeration | boolean | No | For the SMB protocol, specifies whether to enable Windows access-based enumeration (ABE). This parameter takes effect only when the WindowsAcl parameter is set to true. Valid values:
Note This feature is supported by gateway versions 1.0.45 and later. | false |
NfsV4Optimization | boolean | No | For the NFS protocol, specifies whether to enable NFS v4 optimization to improve mount and upload efficiency. Valid values:
Note After you enable this feature, mounting with NFS v3 is not supported. This feature is supported by gateway versions 1.2.0 and later. | false |
TransferAcceleration | boolean | No | Specifies whether to enable transfer acceleration for the file share. The corresponding OSS bucket must have transfer acceleration enabled. Note This feature is supported by gateway versions 1.3.0 and later. | false |
RemoteSyncDownload | boolean | No | In replication mode, specifies whether to download file data. Valid values:
Note This parameter takes effect only when remote sync is enabled for the share or the share is added to an express synchronization group. | false |
DownloadLimit | integer | No | The maximum download speed of the file share. Unit: MB/s. The value must be an integer from 0 to 1,280. A value of 0 indicates no limit. Note
| 0 |
PartialSyncPaths | string | No | In replication mode, you can set a collection of directory paths to specify that only these directories use replication mode. Note Contact us to add your account to the whitelist before you can configure this setting. | test1 |
ServerSideAlgorithm | string | No | Deprecated. | AES256 |
BypassCacheRead | boolean | No | Specifies whether to read directly from OSS. Valid values:
| false |
BindIPAddr | string | No | Used only for high availability (HA) gateways. Sets the virtual mount IP address that is attached to the share. | 192.168.0.10 |
OssBucketRegionId | string | No | The region where the OSS bucket is located. Note
| cn-hangzhou |
| BucketInfos | array<object> | No | The list of bucket information. Note
| |
object | No | |||
Name | string | No | The name of the OSS bucket. | test-aliyun |
Endpoint | string | No | The endpoint of the OSS bucket. | oss-cn-hangzhou.aliyuncs.com |
PathPrefix | string | No | Deprecated. | test1 |
BucketStub | boolean | No | Specifies whether to enable multi-bucket aggregation. Valid values:
Note
| true |
Response elements
Element | Type | Description | Example |
object | |||
Code | string | The status code. A status code of 200 indicates that the request was successful. | 200 |
Message | string | The message returned. | successful |
RequestId | string | The request ID. | F8B59F29-453D-49BF-8673-EEB8F9F2D5C6 |
Success | boolean | Indicates whether the request was successful. | true |
TaskId | string | The task ID. | t-000eg44nmxbsh3qk*** |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "successful",
"RequestId": "F8B59F29-453D-49BF-8673-EEB8F9F2D5C6",
"Success": true,
"TaskId": "t-000eg44nmxbsh3qk***"
}Error codes
HTTP status code | Error code | Error message | Description |
400 | InvalidParameter.FileShare.%s | The specified field %s for file share is invalid. Please check it again. | The specified file sharing parameter for the gateway is invalid. You must specify a valid parameter. |
400 | VersionNotSupported.FileShare.%s | The specified field %s for file share is not supported by current gateway version. Please check it again. | The specified file sharing parameter for the gateway does not match the gateway version. You must specify a valid parameter. |
400 | FileShareArchiveSupportConflict | You can configure the ArchiveSupport parameter only with NFS protocol and when the user mapping value is "none". |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.