调用CreateExpressSync可以创建极速同步组。

调用该接口时,您需要注意:

  • 请确保在使用该接口前,已充分了解阿里云消息服务MNS产品的收费方式和价格。MNS的费用由主题(Topic)和队列(Queue)两部分组成,并按天进行计费。每个极速同步组按照一个Topic进行计费,每个加入同步组的共享都会按一个Queue进行计费。
  • 极速同步功能依赖于阿里云消息服务MNS实现,因此使用极速同步会产生MNS服务的费用。
  • 使用极速同步功能,您可以将一个或多个连接至同一个OSS Bucket的共享加入一个同步组。对该Bucket中数据进行的任何改动都会同步至该同步组中所有共享的本地客户端,从而无需单独对每个共享进行反向同步,提高数据同步的效率和准确性。
  • 目前只有标准型、增强型及性能型的云存储网关支持极速同步功能。
  • 请确认您已创建文件网关并添加缓存,如果没有请创建文件网关及添加缓存。
  • 请确认您已创建OSS Bucket,并配置了文件网关与OSS Bucket之间的NFS或SMB共享。
  • 可加入极速同步组的相关Bucket信息可以通过DescribeSharesBucketInfoForExpressSync接口查询。
  • 请确认您已开通阿里云消息服务(MNS)并授权。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateExpressSync

操作接口名称。固定取值为CreateExpressSync。

Name String alex-tb***

极速同步组名称。同步组名称长度限制1~128个字符,可以包含大小写字母、中文、数字、半角句号(.)、下划线(_)或短划线(-),同时必须以大小写字母或者中文开头。

Description String 同步组测试

极速同步组描述。长度限制为255个字符。

BucketRegion String cn-hangzhou

OSS Bucket所在地域。

BucketName String sgw-test***

Bucket名称。请注意:

  • 一个同步组只能设定一个OSS Bucket,所有对该Bucket内数据进行的改动都会被同步至本地。
  • 如果您还未创建任何连接至OSS Bucket的共享,请先创建文件网关与OSS Bucket之间的共享。
BucketPrefix String test***

Bucket子目录。如果您要对Bucket特定子目录内的数据改动进行同步,可以填写您需要的子目录。

返回数据

名称 类型 示例值 描述
Message String successful

请求结果描述。

RequestId String EEFC9927-B097-446D-8FDA-F848C8B2C9E0

请求ID。

Code String 200

状态码。状态码为200表示请求成功。

ExpressSyncId String sync-0001xv7je357xn8tr***

极速同步组ID。

Success Boolean true

请求是否成功。

示例

请求示例

http(s)://[Endpoint]/?Action=CreateExpressSync
&BucketName=sgw-test***
&BucketRegion=cn-hangzhou
&Name=alex-tb***
&<公共请求参数>

正常返回示例

XML格式

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

<CreateExpressSyncResponse>
    <Message>successful</Message>
    <RequestId>EEFC9927-B097-446D-8FDA-F848C8B2C9E0</RequestId>
    <ExpressSyncId>sync-0001xv7je357xn8tr***</ExpressSyncId>
    <Code>200</Code>
    <Success>true</Success>
</CreateExpressSyncResponse>

JSON格式

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

{
  "Message" : "successful",
  "RequestId" : "EEFC9927-B097-446D-8FDA-F848C8B2C9E0",
  "ExpressSyncId" : "sync-0001xv7je357xn8tr***",
  "Code" : "200",
  "Success" : true
}

错误码

HttpCode 错误码 错误信息 描述
400 EmptyExpressSyncName You must enter a valid name for the sync group. 同步组名称不能为空。
400 EmptyBucketName You must enter a valid name for the bucket. Bucket名称不能为空。
400 EmptyBucketRegion You must specify a valid region for the bucket. OSS Bucket区域不能为空。
400 InvalidExpressSyncName The specified name for the sync group is invalid. The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter. 无效的同步组名称,同步组名称长度限制为1~128个字符,可以包含大小写字母,中文,数字,“.”,“_”或“-”,同时必须以大小写字母或者中文开头。
400 DescriptionOverLimit The length of the specified gateway description exceeds the maximum limit. The description cannot exceed 255 characters. 网关描述超过最大长度,最大限度为255个字符。
400 DuplicateExpressSyncName The specified name of the sync group already exists. Try again later after you specify a valid parameter. 同步组名称已存在,请确认参数后重试。
400 ConflictExpressSyncConfig The parameter you specified for the sync group is invalid. Try again later after you specify a valid parameter. 极速同步组配置信息冲突,请检查参数后重试。
400 ExpressSyncNotificationEventLimitExceed The number of sync groups exceeds the maximum limit. If you want to add more sync groups, we recommend that you submit a ticket to apply for the whitelist permission. 极速同步组数量达到上限,如有需要,请联系工单加白名单。
400 InvalidRegionId The specified RegionId does not exist. You must specify a valid RegionId. 指定的RegionId不存在,请您确认该参数是否正确。
400 InvalidBucketName The specified bucket name is invalid. You must enter a valid bucket name. 无效的Bucket名称,请检查参数后重试。
400 ExpressSyncNotificationEventConflict The express sync configuration of bucket and prefix conflicts with existing notification events in MNS. 该极速同步组的bucket和prefix配置与MNS服务中已有的事件规则配置冲突。
500 InternalError Unexpected error. Try again later. If the error persists after several tries, we recommend that you submit a ticket. 内部错误,请重试。如果多次尝试失败,请提交工单。
403 NoPermission Insufficient permissions. We recommend that you contact the administrator of the Alibaba Cloud account to grant the required permissions to you. 没有足够的权限,请联系云账号管理员授予您相应权限。
403 AssumeRoleFail Failed to perform cross-service authorization. Try again later. If the error persists after several tries, we recommend that you submit a ticket. 跨服务授权失败,请重试,如果多次尝试失败,请提交工单。
404 RoleNotExist The role that Cloud Storage Gateway needs to obtain cross-service authorization does not exist. You must grant the required permissions to Cloud Storage Gateway. 云存储网关需要的跨服务授权角色不存在,请授予云存储网关服务相应权限。

访问错误中心查看更多错误码。