Querying All Migration Tasks of a Tenant
Function
This API is used to query information about all migration tasks of a tenant.
URI
GET /v1/{project_id}/objectstorage/task?start={start}&limit={limit}&state={state}
Table 1 describes the parameters in the URI.
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. |
start |
Yes |
Specifies the start serial number of migration tasks. |
limit |
Yes |
Specifies the maximum number of returned tasks, which cannot exceed 100. Otherwise, the query fails. |
state |
No |
Specifies the task status as follows:
|
Request
Request Parameters
None.
Response
Response Parameters
Table 2 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
id |
long |
Specifies the task ID. |
name |
String |
Specifies a task name. |
src_node |
JSONObject |
Specifies the source node information. For details, see Table 3. |
dst_node |
JSONObject |
Specifies the destination node information. For details, see Table 5. |
thread_num |
int |
Specifies the number of threads used by a migration task. |
status |
int |
Specifies the task status as follows:
|
progress |
double |
Specifies the task progress. For example, 0.522 represents the progress is 52.2%, and 1 represents the progress is 100%. |
migrate_speed |
long |
Specifies the migration speed (byte/s). |
enableKMS |
boolean |
Specifies whether to use KMS encryption. |
description |
String |
Describes the migration task. This field can be left blank. |
error_reason |
JSONObject |
Specifies the migration task failure cause. For details, see Table 8. This field is left blank when the task is not in the Migration failed state. |
total_size |
long |
Specifies the total amount of a task. |
complete_size |
long |
Specifies the size of a task that has been completed. |
start_time |
long |
Specifies the start time of a task. |
left_time |
long |
Specifies the remaining time of a task. |
total_time |
long |
Specifies the total time used of a task. |
success_num |
long |
Specifies the number of successfully migrated objects. |
fail_num |
long |
Specifies the number of objects failed to be migrated. |
total_num |
long |
Specifies the total number of migrated objects. |
smnInfo |
JSONObject |
Specifies SMN messages. For details, see Table 6.
NOTE:
You can determine whether to enable SMN to send messages. This parameter is available only after a migration task is complete. |
migrate_since |
long |
Specifies whether to migrate only object data that is modified after a specified time. If this function is enabled, only objects that are modified after the specified time at the source end will be migrated. The default value is 0, indicating that no time is specified. |
task_type |
String |
Specifies the task type. The default value is object.
|
source_cdn |
JSONObject |
Specifies whether to enable CDN during the migration. For details, see Table 7. If CDN is enabled, the source objects to be migrated are obtained from the CDN domain name during migration. If this field is included, CDN is supported. Otherwise, CDN is not supported. |
auto_restore |
Boolean |
Specifies whether to automatically restore archive data. IF this function is enabled, archive data is automatically restored and migrated. |
enable_failed_object_recording |
Boolean |
Specifies whether to record objects failed to be migrated. With this function, information about the objects that fail to be migrated will be stored in the destination bucket. |
failed_object_record |
String |
Specifies the failed data record format. The data format is JSON. For details about the value, see Table 9. |
bandwidth_policy |
JSONArray |
Specifies traffic limiting rules. For details, see Table 10. |
Parameter |
Type |
Description |
---|---|---|
region |
String |
Specifies the region where the source bucket locates. |
list_file |
JSONObject |
Specifies the failed data record format. The data format is JSON. For details about the value, see Table 4. |
object_key |
JSONArray |
Specifies the name of the object to be selected in the source bucket, which is in JSONArray format. Each element is the absolute path of an object. |
bucket |
String |
Specifies the name of the source bucket. |
cloud_type |
String |
Specifies source cloud providers. |
Parameter |
Type |
Description |
---|---|---|
obs_bucket |
String |
Specifies the name of the OBS bucket for storing object list files. |
list_file_key |
String |
Specifies the object name of the object list file. |
Parameter |
Type |
Description |
---|---|---|
region |
String |
Specifies the region where the destination bucket locates. |
object_key |
String |
Specifies the name of the object selected in the destination bucket. |
bucket |
String |
Specifies the name of the destination bucket. |
cloud_type |
String |
Specifies the destination cloud service provider. |
Parameter |
Type |
Description |
---|---|---|
notifyResult |
Boolean |
Records whether messages are sent using SMN after migration tasks are complete. |
notifyErrorMessage |
String |
Records the error code of the failure cause in sending messages using SMN. This parameter value is empty if migration tasks are successful. |
topicName |
String |
Specifies the SMN topic name. This parameter value is empty if SMN messages are successfully sent. |
Parameter |
Type |
Description |
---|---|---|
protocol |
String |
Specifies the protocol type. The value can be HTTPS or HTTP. |
domain |
String |
Specifies the domain name from which to obtain objects to be migrated. |
authentication_type |
String |
Specifies the authentication method. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Specifies the returned error code for a failed migration task. |
error_msg |
String |
Specifies why the migration fails. |
Parameter |
Type |
Description |
---|---|---|
result |
Boolean |
Specifies whether to support retransmission of failed objects. |
list_file_key |
String |
Specifies the path for storing the failed object list file. |
errorCode |
String |
Specifies the error codes configured for failed objects that cannot be retransmitted. |
Parameter |
Type |
Description |
---|---|---|
start |
String |
Specifies the start time of a traffic limiting rule. The format is hh:mm. For example, 10:03 |
end |
String |
Specifies the end time of a traffic limiting rule. The format is the same as that of the start time. |
max_bandwidth |
int |
Specifies the maximum bandwidth allowed (byte/s) in a time segment. |
Examples
Request example
GET /v1/{project_id}/objectstorage/task?start=0&limit=10&state=0
Response example
{ "id": 1, "name": "bucket3-bucket3-20161027211637786_544", "src_node": { "region": "us-east-1", "bucket": "bucket3", "object_key": ["log/object1", "log/object2"] }, "dst_node": { "region": "xxx", "bucket": "bucket3", "object_key": "/" }, "thread_num": 50, "status": 5, "progress": 1, "total_num": 2000, "success_num": 200, "fail_num": 0, "migrate_speed": 7213154, "enableKMS": true, "description": "ZXCZCZXCDVXVC", "error_reason": "", "total_size": 2000000000, "complete_size": 2000000000, "start_time": 1477574224062, "left_time": 0, "total_time": 88124, "smnInfo": { "notifyResult": false, "notifyErrorMessage": "S3M.0156", "topicName": "Test" }, "enable_failed_object_recording": true, "failed_object_record": "{" result ": true, " list_file_key ": " oms / failed_object_lists / 180840792025063 / failed - objects - list.txt "}" }, { "id": 2, "name": "bucket3-bucket3-20161027211637786_545", "src_node": { "region": "us-east-1", "bucket": "bucket3", "object_key": ["log/object1", "log/object2"], "cloud_type": "xxx" }, "dst_node": { "region": "xxx", "bucket": "bucket3", "object_key": "/", "cloud_type": "HEC" }, "thread_num": 50, "status": 5, "progress": 1, "total_num": 2000, "success_num": 200, "fail_num": 0, "migrate_speed": 7213154, "enableKMS": true, "description": "ZXCZCZXCDVXVC", "error_reason": "", "total_size": 2000000000, "complete_size": 2000000000, "start_time": 1477574224062, "left_time": 0, "total_time": 88124, "smnInfo": { "notifyResult": false, "notifyErrorMessage": "S3M.0156", "topicName": "Test" }, "migrate_since": 123456789, "source_cdn": { "protocol": "https", "domain": "xxx.xxx.xxx", "authentication_type": "NONE" }, "bandwidth_policy": [ { "start": "00:00", "end": "23:59", "max_bandwidth": 50000000 } ] }
Status Code
For details about the status code, see Status Code.
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