Introduction

Use the Db2 Warehouse on Cloud API to access data, view and create database objects, administer, and monitor your Db2 Warehouse on Cloud service. To view previous versions of the REST API documentation, click V1, V2, or V3.

Root URL

The context root for the Db2 Warehouse on Cloud API is /dbapi/v4/.

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response indicates success. A 400 type response is some sort of failure.

Security

Every request must include the Authorization HTTP header with the value Bearer [access_token]. An access token can be obtained with the /auth/tokens endpoint, and it is used by Db2 Warehouse on Cloud to identify who you are.

Some api methods (for example: /schemas and /sql_jobs) also support direct access to the database using HTTP headers.

For example:

X-DB-Userid:[database_user],
X-DB-Password:[database_password],
X-DB-URL:jdbc:db2://[host]:[port]/[database]:[property] for Db2 data sources
add dataservertype (DB2LUW, DB2Z) in property, if dataservertype key
for Db2 data source is not specified, the default is DB2LUW.

Db2 Warehouse on Cloud negotiates SSL connections using the TLS v1.2 protocol.

If you are using the latest version of cURL, protocol negotiation will happen automatically using TLS v1.2. If you are using an older version of cURL, you will need to specify the --tlsv1.2 option in your cURL commands.

You can also use the Db2 Warehouse on Cloud Scaling REST API to schedule, delete or view the status of a scale operation of your Db2 Warehouse on Cloud instance. See IBM Db2 Warehouse on Cloud Scaling REST API.

Methods

Request a new access token

Authenticates the user credentials and returns an access token that can be used when invoking the operations.

POST /auth/tokens
Request

User credentials

  • curl -X POST \
    https://{HOSTNAME}/dbapi/v4/auth/tokens \
    -H 'content-type: application/json' \
    -d '{"userid":"<ADD STRING VALUE>","password":"<ADD STRING VALUE>"}'
  • OkHttpClient client = new OkHttpClient();MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}");Request request = new Request.Builder().url("https://{HOSTNAME}/dbapi/v4/auth/tokens").post(body).addHeader("content-type", "application/json").build();Response response = client.newCall(request).execute();
  • var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://{HOSTNAME}/dbapi/v4/auth/tokens",
    "method": "POST",
    "headers": {
    "content-type": "application/json"
       },
    "processData": false,
    "data": "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}"
              }
    
    $.ajax(settings).done(function (response) {
    console.log(response);
             });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}"
    
    headers = { 'content-type': "application/json" }
    
    conn.request("POST", "/dbapi/v4/auth/tokens", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Token generated after successful authentication.

Status Code

  • Authentication token

  • Invalid credentials

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns public key of Json Web Token

Returns public key of Json Web Token.

GET /auth/token/publickey
Request

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/auth/token/publickey \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/token/publickey")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth/token/publickey",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/auth/token/publickey", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Public key of token.

Status Code

  • Token public key and key id.

No Sample Response

This method does not specify any sample responses.

Perform logout operation for a token.

Perform logout operation for a token.

DELETE /auth/token/logout
Request

No Request Parameters

This method does not accept any request parameters.

  • curl -X DELETE \
      https://{HOSTNAME}/dbapi/v4/auth/token/logout \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/token/logout")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth/token/logout",
      "method": "DELETE",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/auth/token/logout", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Logout successfully.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Creates a new authentication policy **ADMIN ONLY**

Creates a new authentication policy which can be used to control password parameters.

POST /auth_policies
Request

Authentication policy

  • curl -X POST \
      https://{HOSTNAME}/dbapi/v4/auth_policies \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"id":"this_id_is_ignored","name":"test_policy","password_history":5,"password_expiration":30,"failed_login_attempts":6,"lockout_duration":30,"min_password_length":15}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth_policies",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/auth_policies", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Collection of authentication policies

Status Code

  • Authentication policy created

  • Only administrators can execute this operation

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists all authentication policies **ADMIN ONLY**

Returns a list of authentication policies.

GET /auth_policies
Request

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/auth_policies \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth_policies",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/auth_policies", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Policy defining user's password rules.

Status Code

  • List of authentication policies

  • Only administrators can execute this operation

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns an authentication policy **ADMIN ONLY**

Returns an authentication policy.

GET /auth_policies/{id}
Request

Path Parameters

  • policy ID

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/auth_policies/Default \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies/Default")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth_policies/Default",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/auth_policies/Default", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Policy defining user's password rules.

Status Code

  • Authentication policy

  • Only administrators can execute this operation

  • Policy not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Updates an authentication policy **ADMIN ONLY**

Updates an authentication policy.

PUT /auth_policies/{id}
Request

Path Parameters

  • policy ID

Authentication policy

  • curl -X PUT \
      https://{HOSTNAME}/dbapi/v4/auth_policies/{id} \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"id":"this_id_is_ignored","name":"test_policy","password_history":5,"password_expiration":30,"failed_login_attempts":6,"lockout_duration":30,"min_password_length":15}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies/{id}")
      .put(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth_policies/{id}",
      "method": "PUT",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("PUT", "/dbapi/v4/auth_policies/{id}", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Policy defining user's password rules.

Status Code

  • Authentication policy

  • Only administrators can execute this operation

  • Policy not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Deletes an existing policy **ADMIN ONLY**

Deletes an existing policy.

Only administratos can delete policies.

DELETE /auth_policies/{id}
Request

Path Parameters

  • ID of the policy to be deleted.

  • curl -X DELETE \
      https://{HOSTNAME}/dbapi/v4/auth_policies/{id} \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies/{id}")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth_policies/{id}",
      "method": "DELETE",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/auth_policies/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Policy deleted

  • Removal of this policy is not allowed

  • The policy does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Sets a new password using dswebToken

Sets a new password using the dswebToken obtained from /auth/reset.

PUT /auth/password
Request

New password and dswebToken

  • curl -X PUT \
      https://{HOSTNAME}/dbapi/v4/auth/password \
      -H 'content-type: application/json' \
      -d '{"password":"<ADD STRING VALUE>","dswebToken":"<ADD STRING VALUE>"}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/password")
      .put(body)
      .addHeader("content-type", "application/json")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth/password",
      "method": "PUT",
      "headers": {
        "content-type": "application/json"
      },
      "processData": false,
      "data": "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}"
    
    headers = { 'content-type': "application/json" }
    
    conn.request("PUT", "/dbapi/v4/auth/password", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Password changed

  • Invalid or missing new password

  • If dswebToken is missing or invalid

  • Error payload

No Sample Response

This method does not specify any sample responses.

Requests a password reset based on user's email

An email is sent with the password reset link and code. To set a new password, the user can open the link on a web browser, or use the /auth/password endpoint providing the dswebToken. The dswebToken is valid for 12 hours.

POST /auth/reset
Request

User's email address and ID

  • curl -X POST \
      https://{HOSTNAME}/dbapi/v4/auth/reset \
      -H 'content-type: application/json' \
      -d '{"email":"<ADD STRING VALUE>","userId":"<ADD STRING VALUE>"}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/reset")
      .post(body)
      .addHeader("content-type", "application/json")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/auth/reset",
      "method": "POST",
      "headers": {
        "content-type": "application/json"
      },
      "processData": false,
      "data": "{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}"
    
    headers = { 'content-type': "application/json" }
    
    conn.request("POST", "/dbapi/v4/auth/reset", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Request accepted

  • Invalid or missing email address and userId

  • The user name and email address do not match.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists all schemas in the database

Returns a list of schemas.

GET /schemas
Request

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/schemas \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/schemas",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Collection of schemas

Status Code

  • List of schemas

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns schema information

Returns schema information.

GET /schemas/{schema_name}
Request

Path Parameters

  • schema name

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas/SYSIBM", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Schema information

  • Schema not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists tables in a schema

Returns the list of tables in a schema.

GET /schemas/{schema_name}/tables
Request

Path Parameters

  • schema name

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas/SYSIBM/tables", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Collection of tables

Status Code

  • List of tables

  • Database or schema not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns information about a table

Return information about a table.

GET /schemas/{schema_name}/tables/{table_name}
Request

Path Parameters

  • schema name

  • table name

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas/SYSIBM/tables/SYSROLES", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Includes table definition and statistics. Note that statistics such as row count and size are not updated real time. Check the stats_timestamp value to know how current that information is.

Status Code

  • Table information

  • Table not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Deletes all table data

Deletes all table data using a TRUNCATE operation.

DELETE /schemas/{schema_name}/tables/{table_name}/data
Request

Path Parameters

  • schema name

  • table name

  • curl -X DELETE \
      https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data",
      "method": "DELETE",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • success

  • Not authorized to access table data

  • Table not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query the list of object schemas.

Query the list of object schemas.

GET /admin/schemas/obj_type/{obj_type}
Request

Path Parameters

  • Object type.

    Allowable values: [table,hadooptable,view,mqt,alias,sequence,procedure,nickname,udt,function]

Query Parameters

  • Object type.

  • Whether to show system objects.

    Allowable values: [true,false]

  • The amount of return records.

    Default: 500

  • curl -X GET \
      'https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50' \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Query the list of object schemas.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Create schema.

Creates a new schema. Any user with enough database authority can create schemas using dbapi directly. Regular users can create new schemas indirectly by creating a new table or other database object and specifying the name of the new schema where the object will be placed.

POST /admin/schemas
Request
  • curl -X POST \
      https://{HOSTNAME}/dbapi/v4/admin/schemas \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"name":"TESTSCHEMA","authorization":"SYSIBM"}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/schemas", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Schema created.

  • Invalid parameters or schema already exists

  • Only administrators can create schemas directly.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drops an empty schema

Drops an empty schema. An error is returned if the schema contains any objects.

DELETE /admin/schemas
Request
  • curl -X DELETE \
      https://{HOSTNAME}/dbapi/v4/admin/schemas \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '[{"name":"TESTSCHEMA"}]'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "[{\"name\":\"TESTSCHEMA\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas")
      .delete(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas",
      "method": "DELETE",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "[{\"name\":\"TESTSCHEMA\"}]"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"name\":\"TESTSCHEMA\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/schemas", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • The schema was dropped successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get single object privilege.

Get single object privilege.

GET /admin/privileges
Request

Query Parameters

  • Object type.

    Allowable values: [TABLE,VIEW,DATABASE,PROCEDURE,FUNCTION,MQT,SEQUENCE,HADOOP_TABLE,NICKNAME,SCHEMA,UDT]

  • Schema name of the object. For table and database, this parameter is not required.

  • Name of the object. For database, this parameter is not required.

  • The amount of return records.

    Default: 1000

  • curl -X GET \
      'https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10' \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get object privilege.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Privilege list of selected objects.

Privilege list of selected objects.

POST /admin/privileges
Request
  • curl -X POST \
      https://{HOSTNAME}/dbapi/v4/admin/privileges \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"obj_type":"VIEW","rows_return":10,"filter":[{"schema":"SYSCAT","obj_name":"TABLES"}]}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/privileges",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/privileges", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Privilege list of selected objects

  • Get error when search authid

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Grant or revoke privileges

Grant or revoke privileges

PUT /admin/privileges
Request
  • curl -X PUT \
      https://{HOSTNAME}/dbapi/v4/admin/privileges \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"stop_on_error":true,"privileges":[{"schema":"SYSCAT","obj_name":"TABLES","obj_type":"VIEW","grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":[],"revoke":["insert"]}]}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[],\"revoke\":[\"insert\"]}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges")
      .put(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/privileges",
      "method": "PUT",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[],\"revoke\":[\"insert\"]}]}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[],\"revoke\":[\"insert\"]}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/privileges", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • The status of grant or revoke

  • Get error when grant or revoke

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Create a new table.

Create a new table.

PUT /admin/tables
Request
  • curl -X PUT \
      https://{HOSTNAME}/dbapi/v4/admin/tables \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"schema":"TABLE_SCHEMA","table":"TABLE_NAME","column_info":[{"data_type":"DECIMAL","length":5,"scale":{},"column_name":"COL_NAME","nullable":true}]}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables")
      .put(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/tables",
      "method": "PUT",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/tables", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • The table was created successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop table.

Drop table.

DELETE /admin/tables
Request
  • curl -X DELETE \
      https://{HOSTNAME}/dbapi/v4/admin/tables \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '[{"schema":"TABLE_SCHEMA","table":"TABLE_NAME"}]'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables")
      .delete(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/tables",
      "method": "DELETE",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/tables", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • The alias was dropped successfully.

  • Invalid parameters.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get table definition.

Get table definition.

GET /admin/schemas/{schema_name}/tables/{table_name}/definition
Request

Path Parameters

  • Schema name of the object.

  • Table name.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get table definition.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query table data.

Fetches the table data up to a maximum of 100,000 rows. Currently it's not possible to retrieve data from tables that contain CLOB, BLOB or DBCLOB values.

GET /admin/schemas/{schema_name}/tables/{table_name}/data
Request

Path Parameters

  • Schema name of the object.

  • Table name.

Query Parameters

  • The amount of return records.

    Default: 1000

  • curl -X GET \
      'https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000' \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get column detail properties.

Get column detail properties.

GET /admin/schemas/{schema_name}/tables/{table_name}/columns/{column_name}/properties
Request

Path Parameters

  • Schema name of the object.

  • Table name.

  • Column name.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get column detail properties.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the metadata type.

Get the metadata type.

GET /admin/tables/meta/datatype
Request

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/tables/meta/datatype", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get the metadata type.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate table DDL.

Generate table DDL.

POST /admin/tables/ddl
Request

Query Parameters

  • Type of operation.

    Allowable values: [create,alter]

  • curl -X POST \
      'https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create' \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"schema":"TABLE_SCHEMA","table":"TABLE_NAME","column_info":[{"data_type":"DECIMAL","length":5,"scale":{},"column_name":"COL_NAME","nullable":true}]}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/tables/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Generate table DDL.

  • Invalid parameters.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get distributin keys.

Get distributin keys.

GET /admin/schemas/{schema_name}/tables/{table_name}/distribution_keys
Request

Path Parameters

  • Schema name of the table.

  • Name of the table.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get distributin keys.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get data distributin property.

Get data distributin property.

GET /admin/schemas/{schema_name}/tables/{table_name}/distributions/properties
Request

Path Parameters

  • Schema name of the table.

  • Name of the table.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get data distributin property.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get partition expressions.

Get partition expressions.

GET /admin/schemas/{schema_name}/tables/{table_name}/partitions/expressions
Request

Path Parameters

  • Schema name of the table.

  • Name of the table.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get partition expressions.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get data partitions.

Get data partitions.

GET /admin/schemas/{schema_name}/tables/{table_name}/partitions
Request

Path Parameters

  • Schema name of the table.

  • Name of the table.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get data partitions.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query view detail properties.

Query view detail properties.

GET /admin/schemas/{schema_name}/views/{view_name}/properties
Request

Path Parameters

  • Schema name of the view.

  • Name of the view.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Query view detail properties.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop views.

Drop views.

DELETE /admin/views
Request
  • curl -X DELETE \
      https://{HOSTNAME}/dbapi/v4/admin/views \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '[{"schema":"VIEW_SCHEMA","view":"VIEW_NAME"}]'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/views")
      .delete(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/views",
      "method": "DELETE",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/views", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • The alias was dropped successfully.

  • Run sql exception.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query view data.

Query view data.

GET /admin/schemas/{schema_name}/views/{view_name}/data
Request

Path Parameters

  • Schema name of the object.

  • View name.

Query Parameters

  • The amount of return records.

    Default: 1000

  • curl -X GET \
      'https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100' \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get View definition.

Get view definition.

GET /admin/schemas/{schema_name}/views/{view_name}/definition
Request

Path Parameters

  • Schema name of the object.

  • View name.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get View definition.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate view DDL.

Generate view DDL.

POST /admin/views/ddl
Request

Query Parameters

  • Type of operation.

    Allowable values: [create,alter]

  • curl -X POST \
      'https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create' \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json' \
      -d '{"schema":"VIEW_SCHEMA","view":"VIEW_NAME"}'
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      },
      "processData": false,
      "data": "{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/views/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Generate view DDL.

  • Invalid parameters.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the dependencies of the object.

Get the dependencies of the object.

GET /admin/schemas/{schema_name}/{obj_type}/{object_name}/dependencies
Request

Path Parameters

  • Schema name of the object.

  • Type of object.

    Allowable values: [tables,views,nicknames,sequences,aliases,mqts,procedures,functions,udts]

  • Name of the object.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Get the dependencies of the object.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query bufferpool detail properties.

Query bufferpool detail properties.

GET /admin/bufferpools/{bufferpool_name}/properties
Request

Path Parameters

  • Name of the object.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query constraint detail properties.

Query constraint detail properties.

GET /admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties
Request

Path Parameters

  • Schema name of the object.

  • Table name.

  • Name of the constraint.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query index detail properties.

Query index detail properties.

GET /admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties
Request

Path Parameters

  • Schema name of the object.

  • Table name.

  • Name of the index.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query trigger detail properties.

Query trigger detail properties.

GET /admin/schemas/{schema_name}/triggers/{trigger_name}/properties
Request

Path Parameters

  • Schema name of the object.

  • Name of the trigger.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query MQT detail properties.

Query MQT detail properties.

GET /admin/schemas/{schema_name}/mqts/{mqt_name}/properties
Request

Path Parameters

  • Schema name of the object.

  • Name of the MQT.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties",
      "method": "GET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query UDF detail properties.

Query UDF detail properties.

GET /admin/schemas/{schema_name}/functions/{specific_name}/properties
Request

Path Parameters

  • Schema name of the object.

  • Name of the UDF.

  • curl -X GET \
      https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties \
      -H 'authorization: Bearer {AUTH_TOKEN}' \
      -H 'content-type: application/json'
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties",