Introduction

Use the Db2 on Cloud API to access data, view and create database objects, administer, and monitor your Db2 on Cloud service.

Java developers can use this SDK to interact with Db2 on Cloud.

Node (Javascript) developers can use this SDK to interact with Db2 on Cloud.

Python developers can use this SDK to interact with Db2 on Cloud.

Go developers can use this SDK to interact with Db2 on Cloud.

Root URL

The context root for the Db2 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 in one of three ways:

The token is used by Db2 on Cloud to identify who you are.

Every request must include the X-Deployment-Id HTTP header with the value of your Db2 on Cloud tenant deployment ID (The id starts with crn).

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 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.

Security scheme

Authentication to this API's methods uses one of the following security schemes.

authToken

Authorize using Bearer [access_token]. The access token can be obtained by authenticating with the /auth endpoint.

Value
  • API Key
  • Header
  • Authorization

deploymentId

The deployment id of the service, which can be obtained after provision. When providing the deployment id in the header, use URL encoding. For example, ":" should be escaped as "%3A", and "/" should be escaped as "%2F".

Value
  • API Key
  • Header
  • X-Deployment-Id

Third-party libraries

You can optionally use the okhttp jquery httpclientthird-party library to make requests to the console API.

You can also use the Db2 on Cloud Scaling REST API to schedule, delete or view the status of a scale operation of your Db2 on Cloud instance. See IBM Db2 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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/tokens"
    
    	payload := strings.NewReader("{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/tokens",
      "headers": {
        "content-type": "application/json",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ userid: '<ADD STRING VALUE>', password: '<ADD STRING VALUE>' }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}"
    
    headers = {
        'content-type': "application/json",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/auth/tokens", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/auth/tokens   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"userid":"<ADD STRING VALUE>","password":"<ADD STRING VALUE>"}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/token/publickey"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/token/publickey",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/auth/token/publickey", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/auth/token/publickey   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Public key of token.

Status Code

  • Token public key and key id.

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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/password"
    
    	payload := strings.NewReader("{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/password",
      "headers": {
        "content-type": "application/json",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ password: '<ADD STRING VALUE>', dswebToken: '<ADD STRING VALUE>' }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}"
    
    headers = {
        'content-type': "application/json",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/auth/password", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/auth/password   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"password":"<ADD STRING VALUE>","dswebToken":"<ADD STRING VALUE>"}'

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.

Get a list of backups

Get a list of backups on current instance.

GET /backups

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups")
      .get()
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/backups", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/backups   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • The list of backups

  • Bad request

  • Unauthorized

  • Internal server error

No Sample Response

This method does not specify any sample responses.

Restore

Restore to a particular backup or perform a point-in-time restore.

POST /backups/restore

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/restore"
    
    	payload := strings.NewReader("{\"ts\":\"<ADD STRING VALUE>\",\"backup_id\":\"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"ts\":\"<ADD STRING VALUE>\",\"backup_id\":\"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/restore")
      .post(body)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/restore",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      ts: '<ADD STRING VALUE>',
      backup_id: 'crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"ts\":\"<ADD STRING VALUE>\",\"backup_id\":\"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712\"}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/backups/restore", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/backups/restore   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"ts":"<ADD STRING VALUE>","backup_id":"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712"}'

Response

Status Code

  • task detail of the restore job

  • Bad request

  • Unauthorized

  • Unauthorized

No Sample Response

This method does not specify any sample responses.

Create a backup

Create a backup

POST /backups/backup

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/backup"
    
    	req, _ := http.NewRequest("POST", url, nil)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/backup")
      .post(null)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/backup",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/backups/backup", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/backups/backup   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Get backup setting

Get backup setting for scheduled time and retention policy

GET /backups/setting

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/setting"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/setting")
      .get()
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/setting",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/backups/setting", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/backups/setting   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • OK

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Update backup setting

update backup setting for scheduled backup time

POST /backups/setting

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/setting"
    
    	payload := strings.NewReader("{\"backup_time\":\"08:05\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"backup_time\":\"08:05\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/setting")
      .post(body)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/setting",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ backup_time: '08:05' }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"backup_time\":\"08:05\"}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/backups/setting", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/backups/setting   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"backup_time":"08:05"}'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Copy database to a new provision database

Provision new database by copy from current database

POST /manage/copy_db

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/manage/copy_db"
    
    	payload := strings.NewReader("{\"name\":\"clone-instance-namw\",\"target\":\"us-south\",\"resource_plan_id\":\"DashStandard\",\"high_availability\":true,\"resource_group\":\"ea345q3-ddfe34q-sdfdaasd\",\"backup_id\":\"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712\",\"key_protect_key\":\"default\",\"members_disk_allocation_mb\":\"20480\",\"tags\":[\"<ADD STRING VALUE>\"]}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"name\":\"clone-instance-namw\",\"target\":\"us-south\",\"resource_plan_id\":\"DashStandard\",\"high_availability\":true,\"resource_group\":\"ea345q3-ddfe34q-sdfdaasd\",\"backup_id\":\"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712\",\"key_protect_key\":\"default\",\"members_disk_allocation_mb\":\"20480\",\"tags\":[\"<ADD STRING VALUE>\"]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/manage/copy_db")
      .post(body)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/manage/copy_db",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      name: 'clone-instance-namw',
      target: 'us-south',
      resource_plan_id: 'DashStandard',
      high_availability: true,
      resource_group: 'ea345q3-ddfe34q-sdfdaasd',
      backup_id: 'crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712',
      key_protect_key: 'default',
      members_disk_allocation_mb: '20480',
      tags: [ '<ADD STRING VALUE>' ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"name\":\"clone-instance-namw\",\"target\":\"us-south\",\"resource_plan_id\":\"DashStandard\",\"high_availability\":true,\"resource_group\":\"ea345q3-ddfe34q-sdfdaasd\",\"backup_id\":\"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712\",\"key_protect_key\":\"default\",\"members_disk_allocation_mb\":\"20480\",\"tags\":[\"<ADD STRING VALUE>\"]}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/manage/copy_db", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/manage/copy_db   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"name":"clone-instance-namw","target":"us-south","resource_plan_id":"DashStandard","high_availability":true,"resource_group":"ea345q3-ddfe34q-sdfdaasd","backup_id":"crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712","key_protect_key":"default","members_disk_allocation_mb":"20480","tags":["<ADD STRING VALUE>"]}'

Response

Status Code

  • Copy db successfully

  • Bad request

  • error

No Sample Response

This method does not specify any sample responses.

Get DB2 connection information

GET /connectionInfo/{DEPLOYMENT_ID}

Request

Path Parameters

  • encoded deployment id

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/connectionInfo/{DEPLOYMENT_ID}"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/connectionInfo/{DEPLOYMENT_ID}")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/connectionInfo/{DEPLOYMENT_ID}",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/connectionInfo/{DEPLOYMENT_ID}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/connectionInfo/{DEPLOYMENT_ID}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Get connection info

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists all data load jobs, load uses Db2 load utility technology

Lists all data load jobs for the user.

GET /load_jobs

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/load_jobs", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/load_jobs   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Information about a data load job

Status Code

  • Data load jobs

  • Error payload

No Sample Response

This method does not specify any sample responses.

Creates a data load job

Creates a data load job

POST /load_jobs

Request

Data load job details

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs"
    
    	payload := strings.NewReader("{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"date_format\":\"YYYY-MM-DD\",\"time_format\":\"HH:MM:SS\",\"timestamp_format\":\"YYYY-MM-DD HH:MM:SS\"}}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"date_format\":\"YYYY-MM-DD\",\"time_format\":\"HH:MM:SS\",\"timestamp_format\":\"YYYY-MM-DD HH:MM:SS\"}}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      load_source: 'SERVER',
      load_action: 'INSERT',
      schema: '<ADD STRING VALUE>',
      table: '<ADD STRING VALUE>',
      max_row_count: 0,
      max_warning_count: 1000,
      cloud_source: {
        endpoint: '<ADD STRING VALUE>',
        path: '<ADD STRING VALUE>',
        auth_id: '<ADD STRING VALUE>',
        auth_secret: '<ADD STRING VALUE>'
      },
      server_source: { file_path: '<ADD STRING VALUE>' },
      file_options: {
        code_page: '<ADD STRING VALUE>',
        has_header_row: 'no',
        column_delimiter: ',',
        date_format: 'YYYY-MM-DD',
        time_format: 'HH:MM:SS',
        timestamp_format: 'YYYY-MM-DD HH:MM:SS'
      }
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"date_format\":\"YYYY-MM-DD\",\"time_format\":\"HH:MM:SS\",\"timestamp_format\":\"YYYY-MM-DD HH:MM:SS\"}}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/load_jobs", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/load_jobs   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"load_source":"SERVER","load_action":"INSERT","schema":"<ADD STRING VALUE>","table":"<ADD STRING VALUE>","max_row_count":0,"max_warning_count":1000,"cloud_source":{"endpoint":"<ADD STRING VALUE>","path":"<ADD STRING VALUE>","auth_id":"<ADD STRING VALUE>","auth_secret":"<ADD STRING VALUE>"},"server_source":{"file_path":"<ADD STRING VALUE>"},"file_options":{"code_page":"<ADD STRING VALUE>","has_header_row":"no","column_delimiter":",","date_format":"YYYY-MM-DD","time_format":"HH:MM:SS","timestamp_format":"YYYY-MM-DD HH:MM:SS"}}'

Response

Confirmation of load job created

Status Code

  • load jobs.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns details about a load job including its progress

Returns details about a load job including its progress.

GET /load_jobs/{id}

Request

Path Parameters

  • Load job ID

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs/{id}"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs/{id}",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/load_jobs/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/load_jobs/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Information about a data load job

Status Code

  • Data load job

  • Not authorized to access load job

  • Job not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Removes load job from history

Removes a data load job from history. This operation has no effect on the data already loaded. In-progress jobs cannot be deleted.

DELETE /load_jobs/{id}

Request

Path Parameters

  • Load job ID

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs/{id}"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs/{id}",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("DELETE", "/dbapi/v4/load_jobs/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/load_jobs/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Load job deleted

  • Not authorized to delete load job

  • Job not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Dowloads log file for a data load job

Downloads log file for a data load job

GET /load_jobs/{log_path}/log

Request

Path Parameters

  • Base64 encode and URL encode with ([deployment id]/[log file name]) the log file name we can get from /load_jobs/{id}

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs/{log_path}/log"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "file")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{log_path}/log")
      .get()
      .addHeader("content-type", "file")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs/{log_path}/log",
      "headers": {
        "content-type": "file",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "file",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/load_jobs/{log_path}/log", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/load_jobs/{log_path}/log   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: file'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Log file

  • Not authorized to access load log

  • Log not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Gets available db update

GET /db_update

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/db_update"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/db_update")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/db_update",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/db_update", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/db_update   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Gets available db update

  • Bad request

  • error

No Sample Response

This method does not specify any sample responses.

Trigger db update

POST /db_update

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/db_update"
    
    	payload := strings.NewReader("{\"scheduled_timestamp\":\"<ADD STRING VALUE>\",\"target_version\":\"1.9.1\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"scheduled_timestamp\":\"<ADD STRING VALUE>\",\"target_version\":\"1.9.1\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/db_update")
      .post(body)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/db_update",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ scheduled_timestamp: '<ADD STRING VALUE>', target_version: '1.9.1' }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"scheduled_timestamp\":\"<ADD STRING VALUE>\",\"target_version\":\"1.9.1\"}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/db_update", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/db_update   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"scheduled_timestamp":"<ADD STRING VALUE>","target_version":"1.9.1"}'

Response

Status Code

  • Trigger db update successfully

  • Bad request

  • error

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

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • 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'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas"
    
    	payload := strings.NewReader("{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ name: 'TESTSCHEMA', authorization: 'SYSIBM' }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/schemas", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/schemas   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"name":"TESTSCHEMA","authorization":"SYSIBM"}'

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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas"
    
    	payload := strings.NewReader("[{\"name\":\"TESTSCHEMA\"}]")
    
    	req, _ := http.NewRequest("DELETE", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify([ { name: 'TESTSCHEMA' } ]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"name\":\"TESTSCHEMA\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/schemas", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/admin/schemas   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"name":"TESTSCHEMA"}]'

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

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • 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'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges"
    
    	payload := strings.NewReader("{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/privileges",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      obj_type: 'VIEW',
      rows_return: 10,
      filter: [ { schema: 'SYSCAT', obj_name: 'TABLES' } ]
    }));
    req.end();
  • 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}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/privileges", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/privileges   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"obj_type":"VIEW","rows_return":10,"filter":[{"schema":"SYSCAT","obj_name":"TABLES"}]}'

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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges"
    
    	payload := strings.NewReader("{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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\":[\"select\"],\"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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/privileges",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      stop_on_error: true,
      privileges: [
        {
          schema: 'SYSCAT',
          obj_name: 'TABLES',
          obj_type: 'VIEW',
          grantee: { authid: 'PUBLIC', authid_type: 'GROUP' },
          grant: [ 'select' ],
          revoke: [ 'insert' ]
        }
      ]
    }));
    req.end();
  • 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\":[\"select\"],\"revoke\":[\"insert\"]}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/privileges", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/privileges   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"stop_on_error":true,"privileges":[{"schema":"SYSCAT","obj_name":"TABLES","obj_type":"VIEW","grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["select"],"revoke":["insert"]}]}'

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.

Generate schema DDL

Generate schema DDL.

POST /admin/schemas/ddl

Request

Query Parameters

  • Type of operation.

    Allowable values: [more]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more"
    
    	payload := strings.NewReader("{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/ddl?action=more",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      objects: [ { schema: 'SCHEMA_NAME' } ],
      options: [ {} ],
      stat_terminator: ';'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/schemas/ddl?action=more", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"objects":[{"schema":"SCHEMA_NAME"}],"options":[{}],"stat_terminator":";"}'

Response

Status Code

  • Generate schema DDL.

  • Invalid parameters.

  • 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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables"
    
    	payload := strings.NewReader("{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tables",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      schema: 'TABLE_SCHEMA',
      table: 'TABLE_NAME',
      column_info: [
        {
          data_type: 'DECIMAL',
          length: 5,
          scale: {},
          column_name: 'COL_NAME',
          nullable: true
        }
      ]
    }));
    req.end();
  • 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}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/tables", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/tables   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"schema":"TABLE_SCHEMA","table":"TABLE_NAME","column_info":[{"data_type":"DECIMAL","length":5,"scale":{},"column_name":"COL_NAME","nullable":true}]}'

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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables"
    
    	payload := strings.NewReader("[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]")
    
    	req, _ := http.NewRequest("DELETE", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tables",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify([ { schema: 'TABLE_SCHEMA', table: 'TABLE_NAME' } ]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/tables", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/admin/tables   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"TABLE_SCHEMA","table":"TABLE_NAME"}]'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • 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'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • 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'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tables/meta/datatype",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/tables/meta/datatype", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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,more]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create"
    
    	payload := strings.NewReader("{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}],\"objects\":[{\"schema\":\"TABLE_SCHEMA\",\"name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}],\"objects\":[{\"schema\":\"TABLE_SCHEMA\",\"name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}");
    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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tables/ddl?action=create",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      schema: 'TABLE_SCHEMA',
      table: 'TABLE_NAME',
      column_info: [
        {
          data_type: 'DECIMAL',
          length: 5,
          scale: {},
          column_name: 'COL_NAME',
          nullable: true
        }
      ],
      objects: [ { schema: 'TABLE_SCHEMA', name: 'TABLE_NAME' } ],
      options: [ {} ],
      stat_terminator: ';'
    }));
    req.end();
  • 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}],\"objects\":[{\"schema\":\"TABLE_SCHEMA\",\"name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/tables/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"schema":"TABLE_SCHEMA","table":"TABLE_NAME","column_info":[{"data_type":"DECIMAL","length":5,"scale":{},"column_name":"COL_NAME","nullable":true}],"objects":[{"schema":"TABLE_SCHEMA","name":"TABLE_NAME"}],"options":[{}],"stat_terminator":";"}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/views"
    
    	payload := strings.NewReader("[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]")
    
    	req, _ := http.NewRequest("DELETE", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/views",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify([ { schema: 'VIEW_SCHEMA', view: 'VIEW_NAME' } ]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/views", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/admin/views   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"VIEW_SCHEMA","view":"VIEW_NAME"}]'

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

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • 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'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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,more]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create"
    
    	payload := strings.NewReader("{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\",\"objects\":[{\"schema\":\"VIEW_SCHEMA\",\"name\":\"VIEW_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\",\"objects\":[{\"schema\":\"VIEW_SCHEMA\",\"name\":\"VIEW_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}");
    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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/views/ddl?action=create",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      schema: 'VIEW_SCHEMA',
      view: 'VIEW_NAME',
      objects: [ { schema: 'VIEW_SCHEMA', name: 'VIEW_NAME' } ],
      options: [ {} ],
      stat_terminator: ';'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\",\"objects\":[{\"schema\":\"VIEW_SCHEMA\",\"name\":\"VIEW_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/views/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"schema":"VIEW_SCHEMA","view":"VIEW_NAME","objects":[{"schema":"VIEW_SCHEMA","name":"VIEW_NAME"}],"options":[{}],"stat_terminator":";"}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Get the dependencies of the object.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the dependencies of the tablespace

Get the dependencies of the tablespace.

GET /admin/tablespaces/{tablespace}/dependencies

Request

Path Parameters

  • Tablespace name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • 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'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

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.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    	req.Header.Add("x-deployment-id", "{DEPLOYMENT_ID}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • 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}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}",
        "x-deployment-id": "{DEPLOYMENT_ID}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    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"))
  • 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'   -H 'x-deployment-id: {DEPLOYMENT_ID}'