Importing Tasks in Batches
Function
This API is used to import the task template to create tasks in batches.
Constraints
This API is available only for migration and synchronization from MySQL to MySQL.
URI
POST /v5/{project_id}/jobs/template
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
MIME type of the request body. Use the default value multipart/form-data. For APIs used to upload objects or images, the value varies depending on the flow type. Default value: multipart/form-data |
X-Auth-Token |
Yes |
String |
User token obtained from IAM. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. After a request is processed, the value of X-Subject-Token in the header is the token value. |
X-Language |
No |
String |
Request language type. Default value: en-us Enumerated values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file |
Yes |
File |
Template file to be uploaded. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
async_job_id |
String |
ID of the tasks created in batches by importing a template. |
import_error_messages |
Array of objects |
Error message displayed for an import failure. For details, see Table 5. |
error_code |
String |
Error code. Minimum length: 12 Maximum length: 12 |
error_msg |
String |
Error message. Minimum length: 1 Maximum length: 512 |
Example Request
Importing the task template to create tasks in batches
https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs/template
Example Response
Status code: 200
OK
{ "async_job_id":"dc6016cf-f3b6-4c2d-b4d7-5084b0fdf456" }
Status code: 400
{ "error_code":"DRS.10120001", "error_msg": "Failed to parse the imported file" "import_error_messages":[ { "sheet_name":"sheet0", "row_rum":"10", "value":"test", "error_message":"base_info.tags parse object failed." } ] }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Code
For details, see Error 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