Data Copy REST APIs | Asynchronous Support | Teradata Data Copy - Call the Data Copy REST APIs - Teradata VantageCloud Lake

Lake - Manage and Move Data

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-05-16
dita:mapPath
atx1683670417382.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
atx1683670417382

The following are the steps to follow to call Data Copy APIs.

  1. Get the CCP Account ID (environment ID) from the URL (the part proceeding /environemnts/). For example, in the URL: https://abc.com/environments/9eydr2-yrt/dashboard, the part 9eydr2-yrt is the CCP Account ID.
  2. Build the prefix for Data Copy REST APIs using the CCP Account ID. The prefix of all Data Copy URLs is: CCP_URL/api/accounts/ENVIRONMENT_ID/datamover/api. For example, https://abc.com/environments/9eydr2-yrt/datamover/api.
  3. Call Data Copy REST APIs using URL similar to: CCP_URL/api/accounts/ENVIRONMENT_ID/datamover/api/DM_RESOURCE. A sample code is given here for reference.
    curl --location 'https://xyz.com/api/accounts/0f3a3343-9720-501b-b10e-b6fd1508b6ec/datamover/api/jobs' \
         --header 'Accept: application/json' \
         --header "Authorization: Bearer ey...KA"

Data Copy REST API Resources

The following are the Data Copy REST API resources.

Resource Method Description Asynchronous Support
jobs GET list all copy plans in data copy service No
/jobs POST create a copy plan Yes
/jobs/[plan-name] GET list a definition of copy plan No
/jobs/[plan-name] PUT update a copy plan Yes
/jobs/[plan-name] DELETE delete a copy plan No
/executingJobs GET list all executing copy plans No
/executingJobs POST start a copy plan Yes
/executingJobs/[plan-name] GET status of an executing copy plan No
/executingJobs/[plan-name] DELETE stop an executing plan No
/executingJobs/[plan-name]?cleanupOnly=true DELETE cleanup a canceled plan No
/executedJobs/[plan-name] GET status of an executed copy plan No
/daemonProperties GET Get daemon configuration settings No
/daemonProperties PUT Update daemon configuration settings No

Asynchronous Support of APIs

VantageCloud Lake API calls have a 30 second timeout limit. To avoid this limit, you need to run Data Copy REST APIs in an asynchronous mode. The previous table, Data Copy REST API Resources, contains the list of APIs that require use of asynchronous mode.

To make asynchronous REST API calls:

  1. Use the Prefer: respond-async header.
    The REST API responds with 202 Accepted code and returns response body similar to:
    {
        "id": "unique_id_containing_approx_30_characters",
        "link": "https://localhost:1443/datamover/monitor/unique_id_containing_approx_30_characters"
    }

    Once you receive the id, modify the URL to include CCP URL and add the /monitor/<id> to monitor the progress.

  2. Use the Monitor API ( /monitor/{id}) to monitor the result of a request made asynchronously. When you use GET operation, the response body appears similar to:
    {
        "id": "2b86a1f1-3a36-4eae-b46e-fd2a588ff8c0",
        "timestamp": "2022-11-21T22:38:40Z",
        "request": "POST /datamover/jobs",
        "status": "inprogress"
    }

    The id in the previous response body matches the id made in the request and also from the response body when the call was initially made.

    The status indicates whether the original request is still running or complete. When it’s completed, the response body appears similar to:
    {
        "id": "2b86a1f1-3a36-4eae-b46e-fd2a588ff8c0",
        "timestamp": "2022-11-21T22:38:40Z",
        "request": "POST /datamover/jobs",
        "status": "complete",
        "response_data": {
            "body": {
                "job_name": "dmJob1",
                "links": {
                    "self": "https://localhost:1443/datamover/jobs/dmJob1"
                }        
            },
            "status": "completed",
            "status_code": 201
        }
    }
    The following are some indicators of the previous response body:
    • "status": "complete" : Request is complete.
    • "status": "completed": Status of the actual request.
    • "status_code": Value other than 2xx format indicates that the request is failed.
    • The contents of the "body" element in response data matches with the contents of the "body" element you got when making the calls synchronously.
    You cannot delete a monitor resource. The monitor resource is automatically removed one hour after the request is complete.