Getting Started
This section describes the procedure for executing a job by calling the API.
- Use the token authentication to obtain the user token, which will be put into the request header for authentication in a subsequent request.
- Execute the job.
Prerequisites
- You have obtained the endpoints of IAM and Data Development. For details, see Regions and Endpoints.
- You have obtained a project ID. For details, see Obtaining a Project ID.
Procedure
The following value settings are used as an example:
- IAM endpoint: iam_endpoint
- Data Development endpoint: dlf_endpoint
- Project ID: project_id
- Use the token authentication API to obtain the user token and set it as an environment variable.
curl -H "Content-Type:application/json" https://{iam_endpoint}/v3/auth/tokens -X POST -d '{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "testname", "domain": { "name": "testname" }, "password": "Passw0rd" } } }, "scope": { "project": { "name": "ap-southeast-1" } } } }' -v -k
The value of X-Subject-Token in the response header is the token.
X-Subject-Token:MIIDkgYJKoZIhvcNAQcCoIIDgzCCA38CAQExDTALBglghkgBZQMEAgEwgXXXXX...
Run the following command to set the token as an environment variable for future use:
export Token={X-Subject-Token}
Replace X-Subject-Token with the token obtained in the preceding step.
export X-Auth-Token=MIIDkgYJKoZIhvcNAQcCoIIDgzCCA38CAQExDTALBglghkgBZQMEAgEwgXXXXX...
- Call the API to execute the job.
curl -H "Content-Type:application/json" https://{dlf_endpoint}/v1.0/{project_id}/pipelines/run-pipeline -X POST -d ' { "pipelineId": "b9636fa3-048f-495e-a33f-74b2744801ec" }
If the returned status code is 200, the job is successfully executed.
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