調用CreateExpressSync可以創建極速同步組。
接口說明
調用該接口時,您需要注意:
- 請確保在使用該接口前,已充分了解阿里云輕量消息隊列(原 MNS)產品的收費方式和價格。輕量消息隊列(原 MNS)費用由主題(Topic)和隊列(Queue)兩部分組成,并按天進行計費。每個極速同步組按照一個Topic進行計費,每個加入同步組的共享都會按一個Queue進行計費。
- 極速同步功能依賴于阿里云輕量消息隊列(原 MNS)實現,因此使用極速同步會產生相應服務的費用。
- 使用極速同步功能,您可以將一個或多個連接至同一個OSS Bucket的共享加入一個同步組。對該Bucket中數據進行的任何改動都會同步至該同步組中所有共享的本地客戶端,從而無需單獨對每個共享進行反向同步,提高數據同步的效率和準確性。
- 目前只有標準型、增強型及性能型的云存儲網關支持極速同步功能。
- 請確認您已創建文件網關并添加緩存,如果沒有請創建文件網關及添加緩存。
- 請確認您已創建OSS Bucket,并配置了文件網關與OSS Bucket之間的NFS或SMB共享。
- 可加入極速同步組的相關Bucket信息可以通過DescribeSharesBucketInfoForExpressSync接口查詢。
- 請確認您已開通阿里云輕量消息隊列(原 MNS)并授權。
請求參數
名稱 |
類型 |
是否必選 |
示例值 |
描述 |
Action | String | 是 | CreateExpressSync | 操作接口名稱。固定取值為CreateExpressSync。 |
Name | String | 是 | alex-tb*** | 極速同步組名稱。同步組名稱長度限制1~128個字符,可以包含大小寫字母、中文、數字、半角句號(.)、下劃線(_)或短劃線(-),同時必須以大小寫字母或者中文開頭。 |
Description | String | 否 | 同步組測試 | 極速同步組描述。長度限制為255個字符。 |
BucketRegion | String | 是 | cn-hangzhou | OSS Bucket所在地域。 |
BucketName | String | 是 | sgw-test*** | 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)中已有的事件規則配置沖突。 |
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. | 云存儲網關需要的跨服務授權角色不存在,請授予云存儲網關服務相應權限。 |
500 | InternalError | Unexpected error. Try again later. If the error persists after several tries, we recommend that you submit a ticket. | 內部錯誤,請重試。如果多次嘗試失敗,請提交工單。 |
訪問錯誤中心查看更多錯誤碼。
文檔內容是否對您有幫助?