Help Center/ Data Lake Insight/ SDK Reference/ Mapping Between DLI SDKs and APIs
Updated on 2022-09-15 GMT+08:00

Mapping Between DLI SDKs and APIs

OBS Authorization SDKs

Table 1 Mapping between OBS authorization APIs and SDKs

Class

Method

Java Method

Python Method

API

Authorize

OBS authorization

authorizeBucket

-

POST /v1.0/{project_id}/dli/obs-authorize

Queue-related SDKs

Table 2 Mapping between queue-related APIs and SDKs

Class

Method

Java Method

Python Method

API

Queue

Creating a Queue

createQueue

-

POST /v1.0/{project_id}/queues

Deleting a Queue

deleteQueue

-

DELETE /v1.0/{project_id}/queues/{queue_name}

Obtaining the Default Queue

getDefaultQueue

-

-

Querying All Queues

listAllQueues

list_queues

GET/v1.0/{project_id}/queues

Resource-related SDKs

Table 3 Mapping between resource-related APIs and SDKs

Class

Method

Java Method

Python Method

API

packageResources

Uploading a Resource Package

uploadResources

upload_resource

POST /v2.0/{project_id}/resources

Deleting a Resource Package

deleteResource

delete_resource

DELETE /v2.0/{project_id}/resources/{resource_name}

Querying All Resource Packages

listAllResources

list_resources

GET /v2.0/{project_id}/resources

Querying a Specified Resource Package

getResource

get_package_resource

GET /v2.0/{project_id}/resources/{resource_name}

SDKs Related to SQL Jobs

Table 4 Mapping between SQL job APIs and SDKs

Class

Method

Java Method

Python Method

API

Database

Creating a Database

createDatabase

create_database

POST /v1.0/{project_id}/databases

Deleting a Database

deleteDatabase

delete_database

DELETE /v1.0/{project_id}/databases/{database_name}

Querying All Databases

listAllDatabases

list_databases

GET /v1.0/{project_id}/databases

Modifying a Database User

-

-

PUT /v1.0/{project_id}/databases/{database_name}/owner

Table

Creating a DLI Table

createDLITable

create_dli_table

POST /v1.0/{project_id}/databases/{database_name}/tables

Creating an OBS Table

createObsTable

create_obs_table

POST /v1.0/{project_id}/databases/{database_name}/tables

Deleting a Table

deleteTable

delete_table

DELETE /v1.0/{project_id}/databases/{database_name}/tables/{table_name}

Querying All Tables

listAllTables

list_tables

GET /v1.0/{project_id}/databases/{database_name}/tables?keyword=tb&with-detail=true

Describing Table Information

getTableDetail

get_table_schema

GET /v1.0/{project_id}/databases/{database_name}/tables/{table_name}

Previewing a Table

-

-

GET /v1.0/{project_id}/databases/{database_name}/tables/{table_name}/preview

Modifying a Table User

-

-

PUT /v1.0/{project_id}/databases/{database_name}/tables/{table_name}/owner

Job

Importing Data

submit

import_table

POST /v1.0/{project_id}/jobs/import-table

Exporting Data

submit

export_table

POST /v1.0/{project_id}/jobs/export-table

Submitting a Job

submit

execute_sql

POST /v1.0/{project_id}/jobs/submit-job

Canceling a Job

cancelJob

-

DELETE /v1.0/{project_id}/jobs/{job_id}

Querying All Jobs

listAllJobs

-

GET /v1.0/{project_id}/jobs?page-size={size}&current-page={page_number}&start={start_time}&end={end_time}&job-type={QUERY}&queue_name={test}&order={duration_desc}

Querying Job Results

queryJobResultInfo

-

GET/v1.0/{project_id}/jobs/{job_id}?page-size={size}&current-page={page_number}

Querying Job Status

-

-

GET/v1.0/{project_id}/jobs/{job_id}/status

Querying Job Details

-

-

GET/v1.0/{project_id}/jobs/{job_id}/detail

Querying Jobs of the SQL Type

listSQLJobs

-

-

Checking the SQL Syntax

-

-

POST /v1.0/{project_id}/jobs/check-sql

Exporting Search Results

-

-

POST /v1.0/{project_id}/jobs/{job_id}/export-result

SDKs Related to Flink Jobs

Table 5 Mapping between Java and Python SDKs and APIs

Class

Method

Java Method

Python Method

API

Job

Creating a Flink SQL Job

submitFlinkSqlJob

-

POST /v1.0/{project_id}/streaming/sql-jobs

Creating a Custom Flink Job

createFlinkJarJob

-

POST /v1.0/{project_id}/streaming/flink-jobs

Updating a Flink SQL Job

updateFlinkSqlJob

-

PUT /v1.0/{project_id}/streaming/sql-jobs/{job_id}

Updating a Custom Flink Job

updateFlinkJarJob

-

PUT /v1.0/{project_id}/streaming/flink-jobs/{job_id}

Querying the List of Jobs

getFlinkJobs

-

GET /v1.0/{project_id}/streaming/jobs

Querying Flink Job Details

getFlinkJobDetail

-

GET /v1.0/{project_id}/streaming/jobs/{job_id}

Querying the Flink Job Execution Plan Diagram

getFlinkJobExecuteGraph

-

GET /v1.0/{project_id}/streaming/jobs/{job_id}/execute-graph

Querying Flink Job Monitoring Information

getFlinkJobsMetrics

-

POST /v1.0/{project_id}/streaming/jobs/metrics

Querying the APIG Address of a Flink Job

getFlinkApigSinks

-

GET /v1.0/{project_id}/streaming/jobs/{job_id}/apig-sinks

Running a Flink Job

runFlinkJob

-

POST /v1.0/{project_id}/streaming/jobs/run

Stopping a Flink Job

stopFlinkJob

-

POST /v1.0/{project_id}/streaming/jobs/stop

Deleting Flink Jobs in Batches

deleteFlinkJobInBatch

-

POST /v1.0/{project_id}/streaming/jobs/delete

SDKs Related to Spark Jobs

Table 6 Mapping between Spark job APIs and SDKs

Class

Method

Java Method

Python Method

API

BatchJob

Submitting Batch Jobs

asyncSubmit

submit_spark_batch_job

POST /v2.0/{project_id}/batches

Deleting Batch Jobs

deleteBatchJob

del_spark_batch_job

DELETE /v2.0/{project_id}/batches/{batch_id}

Querying All Batch Jobs

listAllBatchJobs

-

GET /v2.0/{project_id}/batches

Querying Batch Job Details

-

-

GET /v2.0/{project_id}/batches/{batch_id}

Querying a Batch Job Status

getStateBatchJob

-

GET /v2.0/{project_id}/batches/{batch_id}/state

Querying Batch Job Logs

getBatchJobLog

-

GET /v2.0/{project_id}/batches/{batch_id}/log

SDKs Related to Flink Job Templates

Table 7 Mapping between Java and Python SDKs and APIs

Class

Java Method

Python Method

API

Template

createFlinkJobTemplate

-

POST /v1.0/{project_id}/streaming/job-templates

updateFlinkJobTemplate

-

PUT /v1.0/{project_id}/streaming/job-templates/{template_id}

deleteFlinkJobTemplate

-

DELETE /v1.0/{project_id}/streaming/job-templates/{template_id}

getFlinkJobTemplates

-

GET /v1.0/{project_id}/streaming/job-templates