Creating a Synchronization Event
Function
This API is used to create a synchronization event when objects in the source bucket need to be synchronized. Then OMS synchronizes the objects contained in the synchronization event. This API is available in regions CN North-Beijing4 and CN East-Shanghai1.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{project_id}/sync-tasks/{sync_task_id}/events
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
The project ID. Minimum length: 1 character Maximum length: 1,024 characters |
sync_task_id |
Yes |
String |
The synchronization task ID. Minimum length: 1 character Maximum length: 1,024 characters |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
The token used for API authentication. It is recommended that you use signature authorization. For details, see "API Authentication." Minimum length: 1 character Maximum length: 16,384 characters |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
object_keys |
Yes |
Array of strings |
The list of URL-encoded names of objects to be synchronized. A maximum of 10 objects can be included. Minimum length: 1 character Maximum length: 16,384 characters Array length: 1 to 100 |
Response
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
The error message. |
error_code |
String |
The error code. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
The error message. |
error_code |
String |
The error code. |
Status code: 503
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
The error message. |
error_code |
String |
The error code. |
Example Request
-
This example creates a synchronization event for the task 31e9b7e6-6ffb-452f-9842-6ce354d99d75 to synchronize the files test %2F001.txt and test %2F002.txt.
/v2/f697f813-554a-4f05-bac8-82a183b20878/sync-tasks/31e9b7e6-6ffb-452f-9842-6ce354d99d75/events { "object_keys" : [ "test%2F001.txt", "test%2F002.txt" ] }
-
This example creates a synchronization event for the task 31e9b7e6-6ffb-452f-9842-6ce354d99d75 to synchronize the file test %2B001.txt.
/v2/f697f813-554a-4f05-bac8-82a183b20878/sync-tasks/31e9b7e6-6ffb-452f-9842-6ce354d99d75/events { "object_keys" : [ "test%2B001.txt" ] }
-
This example creates a synchronization event for the task 31e9b7e6-6ffb-452f-9842-6ce354d99d75 to synchronize the file test+001.txt.
/v2/f697f813-554a-4f05-bac8-82a183b20878/sync-tasks/31e9b7e6-6ffb-452f-9842-6ce354d99d75/events { "object_keys" : [ "test+001.txt" ] }
Example Response
None
Status Codes
Status Code |
Description |
---|---|
200 |
OK. Synchronous event created successfully. |
400 |
Bad request. Invalid parameters. |
404 |
Not found. Synchronization task not found. |
503 |
Service unavailable. Please try again later. |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot