IBM Cloud API Docs

Introduction

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

Java developers can use this SDK to interact with IBM Db2 SaaS.

Node (Javascript) developers can use this SDK to interact with IBM Db2 SaaS.

Python developers can use this SDK to interact with IBM Db2 SaaS.

Go developers can use this SDK to interact with IBM Db2 SaaS.

Root URL

The context root for the IBM Db2 SaaS 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:

  • Using the /auth/tokens endpoint

The token is used by IBM Db2 SaaS to identify who you are.

Every request must include the X-Deployment-Id HTTP header with the value of your IBM Db2 SaaS 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.

IBM Db2 SaaS 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/tokens 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.

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

Enable or disable a non ssl port

Enable or disable a non ssl port.

PUT /dbsettings/nonsslport

Request

Specify for enabling or disabling, values can be true/false.

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/dbsettings/nonsslport"
    
    	payload := strings.NewReader("{\"enable\":\"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, "{\"enable\":\"true\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/dbsettings/nonsslport")
      .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/dbsettings/nonsslport",
      "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({enable: 'true'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"enable\":\"true\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/dbsettings/nonsslport", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/dbsettings/nonsslport   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"enable":"true"}'

Response

Status Code

  • Operation response

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists all data load jobs using 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.

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

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,index,mqt,alias,sequence,procedure,nickname,udt,function,datalake_table]

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 multiple schemas

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

PUT /admin/schemas/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/delete"
    
    	payload := strings.NewReader("[{\"name\":\"TESTSCHEMA\"}]")
    
    	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, "[{\"name\":\"TESTSCHEMA\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/delete")
      .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/schemas/delete",
      "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("PUT", "/dbapi/v4/admin/schemas/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/schemas/delete   -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\",\"objStorage\":\"Y\",\"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\",\"objStorage\":\"Y\",\"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',
      objStorage: 'Y',
      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\",\"objStorage\":\"Y\",\"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","objStorage":"Y","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 multiple tables

Drop multiple tables.

PUT /admin/tables/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]")
    
    	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\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/delete")
      .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/delete",
      "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("PUT", "/dbapi/v4/admin/tables/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/tables/delete   -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\",\"objStorage\":\"Y\",\"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\",\"objStorage\":\"Y\",\"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',
      objStorage: 'Y',
      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\",\"objStorage\":\"Y\",\"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","objStorage":"Y","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.

Move tables

Move tables to another tablespace.

POST /admin/tables/move_activity

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/move_activity"
    
    	payload := strings.NewReader("{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"table_space\":\"<ADD STRING VALUE>\"}]}")
    
    	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, "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"table_space\":\"<ADD STRING VALUE>\"}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/move_activity")
      .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/move_activity",
      "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({
      table_space: 'TABLE_SPACE',
      tables: [
        {
          schema_name: '<ADD STRING VALUE>',
          table_name: '<ADD STRING VALUE>',
          table_space: '<ADD STRING VALUE>'
        }
      ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"table_space\":\"<ADD STRING VALUE>\"}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/tables/move_activity", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/tables/move_activity   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"table_space":"TABLE_SPACE","tables":[{"schema_name":"<ADD STRING VALUE>","table_name":"<ADD STRING VALUE>","table_space":"<ADD STRING VALUE>"}]}'

Response

Status Code

  • Move table started successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Move tables script

Get script of move tables to another tablespace.

POST /admin/tables/move_activity/script

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/move_activity/script"
    
    	payload := strings.NewReader("{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"table_space\":\"<ADD STRING VALUE>\"}]}")
    
    	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, "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"table_space\":\"<ADD STRING VALUE>\"}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/move_activity/script")
      .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/move_activity/script",
      "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({
      table_space: 'TABLE_SPACE',
      tables: [
        {
          schema_name: '<ADD STRING VALUE>',
          table_name: '<ADD STRING VALUE>',
          table_space: '<ADD STRING VALUE>'
        }
      ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"table_space\":\"<ADD STRING VALUE>\"}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/tables/move_activity/script", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/tables/move_activity/script   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"table_space":"TABLE_SPACE","tables":[{"schema_name":"<ADD STRING VALUE>","table_name":"<ADD STRING VALUE>","table_space":"<ADD STRING VALUE>"}]}'

Response

Status Code

  • Get move table script successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Copy tables

Copy tables to another tablespace.

POST /admin/tables/copy_activity

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/copy_activity"
    
    	payload := strings.NewReader("{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"target_schema\":\"<ADD STRING VALUE>\",\"target_table\":\"<ADD STRING VALUE>\"}]}")
    
    	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, "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"target_schema\":\"<ADD STRING VALUE>\",\"target_table\":\"<ADD STRING VALUE>\"}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/copy_activity")
      .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/copy_activity",
      "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({
      table_space: 'TABLE_SPACE',
      tables: [
        {
          schema_name: '<ADD STRING VALUE>',
          table_name: '<ADD STRING VALUE>',
          target_schema: '<ADD STRING VALUE>',
          target_table: '<ADD STRING VALUE>'
        }
      ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"target_schema\":\"<ADD STRING VALUE>\",\"target_table\":\"<ADD STRING VALUE>\"}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/tables/copy_activity", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/tables/copy_activity   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"table_space":"TABLE_SPACE","tables":[{"schema_name":"<ADD STRING VALUE>","table_name":"<ADD STRING VALUE>","target_schema":"<ADD STRING VALUE>","target_table":"<ADD STRING VALUE>"}]}'

Response

Status Code

  • Copy table started successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Copy tables script

Get script of copy tables to another tablespace.

POST /admin/tables/copy_activity/script

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/copy_activity/script"
    
    	payload := strings.NewReader("{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"target_schema\":\"<ADD STRING VALUE>\",\"target_table\":\"<ADD STRING VALUE>\"}]}")
    
    	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, "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"target_schema\":\"<ADD STRING VALUE>\",\"target_table\":\"<ADD STRING VALUE>\"}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/copy_activity/script")
      .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/copy_activity/script",
      "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({
      table_space: 'TABLE_SPACE',
      tables: [
        {
          schema_name: '<ADD STRING VALUE>',
          table_name: '<ADD STRING VALUE>',
          target_schema: '<ADD STRING VALUE>',
          target_table: '<ADD STRING VALUE>'
        }
      ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"table_space\":\"TABLE_SPACE\",\"tables\":[{\"schema_name\":\"<ADD STRING VALUE>\",\"table_name\":\"<ADD STRING VALUE>\",\"target_schema\":\"<ADD STRING VALUE>\",\"target_table\":\"<ADD STRING VALUE>\"}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/tables/copy_activity/script", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/tables/copy_activity/script   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"table_space":"TABLE_SPACE","tables":[{"schema_name":"<ADD STRING VALUE>","table_name":"<ADD STRING VALUE>","target_schema":"<ADD STRING VALUE>","target_table":"<ADD STRING VALUE>"}]}'

Response

Status Code

  • Get copy table script successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the latest status after last updated time

Get the latest status after last updated time.

POST /admin/tables/tasks/status

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/tasks/status"
    
    	payload := strings.NewReader("{\"last_updated_time\":1684828233690}")
    
    	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, "{\"last_updated_time\":1684828233690}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/tasks/status")
      .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/tasks/status",
      "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({last_updated_time: 1684828233690}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"last_updated_time\":1684828233690}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/tables/tasks/status", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/tables/tasks/status   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"last_updated_time":1684828233690}'

Response

Status Code

  • Get copy table script successfully.

  • 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 multiple views

Drop multiple views.

PUT /admin/views/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/views/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]")
    
    	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\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/views/delete")
      .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/views/delete",
      "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("PUT", "/dbapi/v4/admin/views/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/views/delete   -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}'

Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query trigger detail properties

Query trigger detail properties.

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

Request

Path Parameters

  • Schema name of the object.

  • Name of the trigger.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_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}/triggers/{trigger_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}/triggers/{trigger_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}/triggers/{trigger_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}/triggers/{trigger_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 MQT detail properties

Query MQT detail properties.

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

Request

Path Parameters

  • Schema name of the object.

  • Name of the MQT.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/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/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/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/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/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/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -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 UDF detail properties

Query UDF detail properties.

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

Request

Path Parameters

  • Schema name of the object.

  • Name of the UDF.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_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}/functions/{specific_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}/functions/{specific_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}/functions/{specific_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}/functions/{specific_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 tablespace detail properties

Query tablespace detail properties.

GET /admin/tablespaces/{table_space}/properties

Request

Path Parameters

  • Tablespace name of the object.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces/{table_space}/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/tablespaces/{table_space}/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/tablespaces/{table_space}/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/tablespaces/{table_space}/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/tablespaces/{table_space}/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 procedure detail properties

Query procedure detail properties.

GET /admin/schemas/{schema_name}/procedures/{specific_name}/properties

Request

Path Parameters

  • Schema name of the object.

  • Name of the procedure.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/procedures/{specific_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}/procedures/{specific_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}/procedures/{specific_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}/procedures/{specific_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}/procedures/{specific_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 sequence detail properties

Query sequence detail properties.

GET /admin/schemas/{schema_name}/sequences/{sequence_name}/properties

Request

Path Parameters

  • Schema name of the object.

  • Name of the sequence.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/sequences/{sequence_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}/sequences/{sequence_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}/sequences/{sequence_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}/sequences/{sequence_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}/sequences/{sequence_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 package detail properties

Query package detail properties.

GET /admin/schemas/{schema_name}/packages/{package_name}/properties

Request

Path Parameters

  • Schema name of the object.

  • Name of the package.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/packages/{package_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}/packages/{package_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}/packages/{package_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}/packages/{package_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}/packages/{package_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 UDT detail properties

Query UDT detail properties.

GET /admin/schemas/{schema_name}/udts/{type_name}/properties

Request

Path Parameters

  • Schema name of the object.

  • Name of the user-defined type.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/udts/{type_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}/udts/{type_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}/udts/{type_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}/udts/{type_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}/udts/{type_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 alias detail properties

Query alias detail properties.

GET /admin/schemas/{schema_name}/aliases/{alias_name}/properties

Request

Path Parameters

  • Schema name of the object.

  • Alias name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/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/SYSPUBLIC/aliases/DUAL/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/SYSPUBLIC/aliases/DUAL/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/SYSPUBLIC/aliases/DUAL/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/properties   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Query alias detail properties.

  • Not authorized.

  • Schema or alias not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get table detail properties

Get table detail properties.

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

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/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/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/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/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/properties   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Get table detail properties.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Create alias

Create alias.

PUT /admin/aliases

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/aliases"
    
    	payload := strings.NewReader("{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\"}")
    
    	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, "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/aliases")
      .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/aliases",
      "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({
      base_obj_schema: 'SYSCAT',
      base_obj_name: 'TABLES',
      alias_name: 'ALIAS_NAME',
      alias_schema: 'ALIAS_SCHEMA'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/aliases", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/aliases   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"base_obj_schema":"SYSCAT","base_obj_name":"TABLES","alias_name":"ALIAS_NAME","alias_schema":"ALIAS_SCHEMA"}'

Response

Status Code

  • The alias was created successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop multiple aliases

Drop multiple alias.

PUT /admin/aliases/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/aliases/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"ALIAS_SCHEMA\",\"alias\":\"ALIAS_NAME\"}]")
    
    	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\":\"ALIAS_SCHEMA\",\"alias\":\"ALIAS_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/aliases/delete")
      .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/aliases/delete",
      "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: 'ALIAS_SCHEMA', alias: 'ALIAS_NAME'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"ALIAS_SCHEMA\",\"alias\":\"ALIAS_NAME\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/aliases/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/aliases/delete   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"ALIAS_SCHEMA","alias":"ALIAS_NAME"}]'

Response

Status Code

  • The alias was dropped successfully.

  • Invalid parameters or run sql exception.

  • Not authorized.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Generate Alias DDL

Generate Alias DDL.

POST /admin/aliases/ddl

Request

Query Parameters

  • Type of operation.

    Allowable values: [create,more]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/aliases/ddl?action=create"
    
    	payload := strings.NewReader("{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\",\"objects\":[{\"schema\":\"ALIAS_SCHEMA\",\"name\":\"ALIAS_NAME\",\"base_schema\":\"TABLE_SCHEMA\",\"base_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, "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\",\"objects\":[{\"schema\":\"ALIAS_SCHEMA\",\"name\":\"ALIAS_NAME\",\"base_schema\":\"TABLE_SCHEMA\",\"base_name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/aliases/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/aliases/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({
      base_obj_schema: 'SYSCAT',
      base_obj_name: 'TABLES',
      alias_name: 'ALIAS_NAME',
      alias_schema: 'ALIAS_SCHEMA',
      objects: [
        {
          schema: 'ALIAS_SCHEMA',
          name: 'ALIAS_NAME',
          base_schema: 'TABLE_SCHEMA',
          base_name: 'TABLE_NAME'
        }
      ],
      options: [{}],
      stat_terminator: ';'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\",\"objects\":[{\"schema\":\"ALIAS_SCHEMA\",\"name\":\"ALIAS_NAME\",\"base_schema\":\"TABLE_SCHEMA\",\"base_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/aliases/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/aliases/ddl?action=create'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"base_obj_schema":"SYSCAT","base_obj_name":"TABLES","alias_name":"ALIAS_NAME","alias_schema":"ALIAS_SCHEMA","objects":[{"schema":"ALIAS_SCHEMA","name":"ALIAS_NAME","base_schema":"TABLE_SCHEMA","base_name":"TABLE_NAME"}],"options":[{}],"stat_terminator":";"}'

Response

Status Code

  • Generate Alias DDL.

  • Invalid parameters.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query alias data

Query alias data.

GET /admin/schemas/{schema_name}/aliases/{alias_name}/data

Request

Path Parameters

  • Schema name of the object.

  • Alias 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/SYSPUBLIC/aliases/DUAL/data?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/schemas/SYSPUBLIC/aliases/DUAL/data?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/schemas/SYSPUBLIC/aliases/DUAL/data?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/schemas/SYSPUBLIC/aliases/DUAL/data?rows_return=10", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/data?rows_return=10'   -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.

  • Schema or alias not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the SQL statement template for creating MQT table

Get the SQL statement template for creating MQT table.

POST /admin/mqts/ddl

Request

Query Parameters

  • Allowable values: [create,more]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE"
    
    	payload := strings.NewReader("{\"schema\":\"schemaName\",\"objects\":[{\"schema\":\"MQT_SCHEMA\",\"name\":\"MQT_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\":\"schemaName\",\"objects\":[{\"schema\":\"MQT_SCHEMA\",\"name\":\"MQT_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE")
      .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/mqts/ddl?action=SOME_STRING_VALUE",
      "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: 'schemaName',
      objects: [{schema: 'MQT_SCHEMA', name: 'MQT_NAME'}],
      options: [{}],
      stat_terminator: ';'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"schemaName\",\"objects\":[{\"schema\":\"MQT_SCHEMA\",\"name\":\"MQT_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"schema":"schemaName","objects":[{"schema":"MQT_SCHEMA","name":"MQT_NAME"}],"options":[{}],"stat_terminator":";"}'

Response

Status Code

  • The SQL statement of creating MQT table

  • Get error when create MQT table

  • Error payload

No Sample Response

This method does not specify any sample responses.

Delete multiple mqt tables

Delete mutliple mqt tables.

PUT /admin/mqts/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/mqts/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"schemaName\",\"mqt\":\"mqtName\"}]")
    
    	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\":\"schemaName\",\"mqt\":\"mqtName\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/mqts/delete")
      .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/mqts/delete",
      "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: 'schemaName', mqt: 'mqtName'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"schemaName\",\"mqt\":\"mqtName\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/mqts/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/mqts/delete   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"schemaName","mqt":"mqtName"}]'

Response

Status Code

  • The status of deleting MQT tables

  • Error payload

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the definition of MQT table

Get the definition of MQT table.

GET /admin/schemas/{schema_name}/mqts/{mqt_name}/definition

Request

Path Parameters

  • Schema name

  • mqt name

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/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/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/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/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/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/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/definition", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/definition   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Definition of MTQ table

  • Error information when get mqt definition

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the data of specified mqt table

Get the data of specified mqt table.

GET /admin/schemas/{schema_name}/mqts/{mqt_name}/data

Request

Path Parameters

Query Parameters

  • Default: 1000

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?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/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?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/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?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/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?rows_return=10", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?rows_return=10'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Get the data of MQT table,include table columns information and data

  • Error information when get mqt data

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get authentications through the authid filter

Get authentications through the authid filter

GET /admin/privileges/authentications

Request

Query Parameters

  • 0 means return all query results

    Default: 0

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/authentications?rows_return=10&authid=PUBLIC"
    
    	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/authentications?rows_return=10&authid=PUBLIC")
      .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/authentications?rows_return=10&authid=PUBLIC",
      "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/authentications?rows_return=10&authid=PUBLIC", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/admin/privileges/authentications?rows_return=10&authid=PUBLIC'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • The list of authid and authid type

  • Get error when search authid

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the privieles of auth id

Get the privieles of auth id

GET /admin/privileges/{authid_type}/{authid}/{obj_type}

Request

Path Parameters

  • authid type

    Allowable values: [GROUP,USER,ROLE]

  • Authorization id.

  • Type of object

    Allowable values: [VIEW,TABLE,DATABASE,PROCEDURE,FUNCTION,MQT,SEQUENCE,HADOOP_TABLE,NICKNAME,INDEX,TABLESPACE]

Query Parameters

  • Default: 1000

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/GROUP/PUBLIC/VIEW?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/GROUP/PUBLIC/VIEW?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/GROUP/PUBLIC/VIEW?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/GROUP/PUBLIC/VIEW?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/GROUP/PUBLIC/VIEW?rows_return=10'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Returned result was successful.

  • Get error when get privileges

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get SQL statement of grant or revoke privileges

Get SQL statement of grant or revoke privileges

POST /admin/privileges/dcl

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/dcl"
    
    	payload := strings.NewReader("[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]")
    
    	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\":\"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/dcl")
      .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/dcl",
      "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: '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 = "[{\"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("POST", "/dbapi/v4/admin/privileges/dcl", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/privileges/dcl   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"SYSCAT","obj_name":"TABLES","obj_type":"VIEW","grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["select"],"revoke":["insert"]}]'

Response

Status Code

  • SQL statement for grant or revoke privileges

  • Get error when get privileges

  • Error payload

No Sample Response

This method does not specify any sample responses.

Add new role

Add new role

POST /admin/privileges/roles

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles"
    
    	payload := strings.NewReader("{\"authid\":\"authid\"}")
    
    	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, "{\"authid\":\"authid\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/roles")
      .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/roles",
      "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({authid: 'authid'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"authid\":\"authid\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/privileges/roles", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/privileges/roles   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"authid":"authid"}'

Response

Status Code

  • The status of adding new role

  • Get error when add new roles

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Grant or revoke the privilges of role

Grant or revoke the privilges of role

PUT /admin/privileges/roles

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles"
    
    	payload := strings.NewReader("{\"stop_on_error\":false,\"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\":false,\"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/roles")
      .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/roles",
      "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: false,
      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\":false,\"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/roles", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/privileges/roles   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"stop_on_error":false,"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 the role's privileges

  • Error payload

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Delete one role

Delete one role

DELETE /admin/privileges/roles/{role_name}

Request

Path Parameters

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/roleName"
    
    	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/admin/privileges/roles/roleName")
      .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/admin/privileges/roles/roleName",
      "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/admin/privileges/roles/roleName", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/roleName   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • The status of deleting one role

  • Error payload

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the membership of authid

Get the membership of authid

GET /admin/privileges/roles/{authid_type}/{authid}

Request

Path Parameters

  • authid type

    Allowable values: [USER,GROUP,ROLE]

  • authid

Query Parameters

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/GROUP/PUBLIC?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/roles/GROUP/PUBLIC?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/roles/GROUP/PUBLIC?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/roles/GROUP/PUBLIC?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/roles/GROUP/PUBLIC?rows_return=10'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • The membership of one auth

  • Error payload

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get SQL statement of grant or revoke role

Get SQL statement of grant or revoke role

POST /admin/privileges/roles/dcl

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/dcl"
    
    	payload := strings.NewReader("[{\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"<ADD STRING VALUE>\"],\"revoke\":[\"<ADD STRING VALUE>\"]}]")
    
    	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, "[{\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"<ADD STRING VALUE>\"],\"revoke\":[\"<ADD STRING VALUE>\"]}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/dcl")
      .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/roles/dcl",
      "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([
      {
        grantee: {authid: 'PUBLIC', authid_type: 'GROUP'},
        grant: ['<ADD STRING VALUE>'],
        revoke: ['<ADD STRING VALUE>']
      }
    ]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"<ADD STRING VALUE>\"],\"revoke\":[\"<ADD STRING VALUE>\"]}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/privileges/roles/dcl", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/dcl   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["<ADD STRING VALUE>"],"revoke":["<ADD STRING VALUE>"]}]'

Response

Status Code

  • The SQL statement of grant or revoke role

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get SQL statement for grant or revoke privileges

Get SQL statement for grant or revoke privileges

POST /admin/privileges/multiple_objtypes/dcl

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes/dcl"
    
    	payload := strings.NewReader("{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}]}")
    
    	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, "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes/dcl")
      .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/multiple_objtypes/dcl",
      "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({
      grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}],
      privileges: [
        {
          obj_type: 'VIEW',
          grant: ['select'],
          objects: [{schema: 'SYSCAT', obj_name: 'TABLES', specific_name: '<ADD STRING VALUE>'}]
        }
      ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/privileges/multiple_objtypes/dcl", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes/dcl   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"privileges":[{"obj_type":"VIEW","grant":["select"],"objects":[{"schema":"SYSCAT","obj_name":"TABLES","specific_name":"<ADD STRING VALUE>"}]}]}'

Response

Status Code

  • The SQL statement for grant or revoke privileges

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Grant or revole privileges for multiple objects and objects type

Grant or revole privileges for multiple objects and objects type

PUT /admin/privileges/multiple_objtypes

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes"
    
    	payload := strings.NewReader("{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}],\"stop_on_error\":false}")
    
    	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, "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}],\"stop_on_error\":false}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes")
      .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/multiple_objtypes",
      "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({
      grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}],
      privileges: [
        {
          obj_type: 'VIEW',
          grant: ['select'],
          objects: [{schema: 'SYSCAT', obj_name: 'TABLES', specific_name: '<ADD STRING VALUE>'}]
        }
      ],
      stop_on_error: false
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}],\"stop_on_error\":false}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/privileges/multiple_objtypes", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"privileges":[{"obj_type":"VIEW","grant":["select"],"objects":[{"schema":"SYSCAT","obj_name":"TABLES","specific_name":"<ADD STRING VALUE>"}]}],"stop_on_error":false}'

Response

Status Code

  • The status of grant or revoke privileges

  • Error payload

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the SQL statement for grant or revoke multiple roles

Get the SQL statement for grant or revoke multiple roles

POST /admin/privileges/multiple_roles/dcl

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles/dcl"
    
    	payload := strings.NewReader("[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}]")
    
    	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, "[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles/dcl")
      .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/multiple_roles/dcl",
      "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([
      {
        grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}],
        grant: ['SYSTS_USR'],
        revoke: ['SYSTS_USR']
      }
    ]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/privileges/multiple_roles/dcl", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles/dcl   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"grant":["SYSTS_USR"],"revoke":["SYSTS_USR"]}]'

Response

Status Code

  • The SQL statement for grant or revoke multiple roles

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Grant or revoke multiple roles

Grant or revoke multiple roles

PUT /admin/privileges/multiple_roles

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles"
    
    	payload := strings.NewReader("{\"privileges\":[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}],\"stop_on_error\":false}")
    
    	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, "{\"privileges\":[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}],\"stop_on_error\":false}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles")
      .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/multiple_roles",
      "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({
      privileges: [
        {
          grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}],
          grant: ['SYSTS_USR'],
          revoke: ['SYSTS_USR']
        }
      ],
      stop_on_error: false
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"privileges\":[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}],\"stop_on_error\":false}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/privileges/multiple_roles", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"privileges":[{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"grant":["SYSTS_USR"],"revoke":["SYSTS_USR"]}],"stop_on_error":false}'

Response

Status Code

  • The status of grant or revoke roles

  • Error payload

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate workload DDL

Generate workload DDL.

POST /admin/workloads/ddl

Request

Query Parameters

  • Type of operation.

    Allowable values: [create]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/workloads/ddl?action=create"
    
    	payload := strings.NewReader("{\"categorization\":\"GetWorkloadDDLTemplate\",\"enable_coll_act_data\":true}")
    
    	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, "{\"categorization\":\"GetWorkloadDDLTemplate\",\"enable_coll_act_data\":true}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/workloads/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/workloads/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({categorization: 'GetWorkloadDDLTemplate', enable_coll_act_data: true}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"categorization\":\"GetWorkloadDDLTemplate\",\"enable_coll_act_data\":true}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/workloads/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/workloads/ddl?action=create'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"categorization":"GetWorkloadDDLTemplate","enable_coll_act_data":true}'

Response

Status Code

  • Return the ddl of creating workloads.

  • Invalid parameters or miss some parameters

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists workloads

Returns the list of workloads.

GET /admin/workloads

Request

Query Parameters

  • The amount of return records.

    Default: 1000

  • Workload name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/workloads?rows_return=10&search_name=SEARCH_NAME"
    
    	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/workloads?rows_return=10&search_name=SEARCH_NAME")
      .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/workloads?rows_return=10&search_name=SEARCH_NAME",
      "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/workloads?rows_return=10&search_name=SEARCH_NAME", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/admin/workloads?rows_return=10&search_name=SEARCH_NAME'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Return the list of workloads

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop multiple sequences

Drop multiple sequences

PUT /admin/sequences/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/sequences/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"SEQUENCE_SCHEMA\",\"sequence\":\"SEQUENCE_NAME\"}]")
    
    	req, _ := http.NewRequest("PUT", 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, "[{\"schema\":\"SEQUENCE_SCHEMA\",\"sequence\":\"SEQUENCE_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/sequences/delete")
      .put(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": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/sequences/delete",
      "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([{schema: 'SEQUENCE_SCHEMA', sequence: 'SEQUENCE_NAME'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"SEQUENCE_SCHEMA\",\"sequence\":\"SEQUENCE_NAME\"}]"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/sequences/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/sequences/delete   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"SEQUENCE_SCHEMA","sequence":"SEQUENCE_NAME"}]'

Response

Status Code

  • The status of dropping sequences

  • Faile to drop sequences

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop multiple procedures

Drop multiple procedures

PUT /admin/procedures/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/procedures/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"PROCEDURE_SCHEMA\",\"procedure\":\"PROCEDURE_NAME\"}]")
    
    	req, _ := http.NewRequest("PUT", 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, "[{\"schema\":\"PROCEDURE_SCHEMA\",\"procedure\":\"PROCEDURE_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/procedures/delete")
      .put(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": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/procedures/delete",
      "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([{schema: 'PROCEDURE_SCHEMA', procedure: 'PROCEDURE_NAME'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"PROCEDURE_SCHEMA\",\"procedure\":\"PROCEDURE_NAME\"}]"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/procedures/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/procedures/delete   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"PROCEDURE_SCHEMA","procedure":"PROCEDURE_NAME"}]'

Response

Status Code

  • Delete procedure successfully

  • Faile to drop procedures

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Retrieve parameters for procedure

Retrieve parameters for procedure.

GET /admin/schemas/{schema_name}/procedures/{specific_name}/parameters

Request

Path Parameters

  • The schema name of the procedure

  • The specificname of procedure

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters"
    
    	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/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters")
      .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/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters",
      "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/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Retrieve parameters for procedure.

  • Error information when get procedure parameters.

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate create procedure template

POST /admin/procedures/ddl

Request

Query Parameters

  • Allowable values: [create]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/procedures/ddl?action=create"
    
    	payload := strings.NewReader("{\"schema\":\"PROCEDURE_SCHEMA\"}")
    
    	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, "{\"schema\":\"PROCEDURE_SCHEMA\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/procedures/ddl?action=create")
      .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/admin/procedures/ddl?action=create",
      "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({schema: 'PROCEDURE_SCHEMA'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"PROCEDURE_SCHEMA\"}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/procedures/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/procedures/ddl?action=create'   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"schema":"PROCEDURE_SCHEMA"}'

Response

Status Code

  • Generate the template of creating procedure

  • Faile to generate create procedure template

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop multiple functions

Drop multiple functions

PUT /admin/functions/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/functions/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"UDT_SCHEMA\",\"function\":\"UDT_NAME\"}]")
    
    	req, _ := http.NewRequest("PUT", 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, "[{\"schema\":\"UDT_SCHEMA\",\"function\":\"UDT_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/functions/delete")
      .put(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": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/functions/delete",
      "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([{schema: 'UDT_SCHEMA', function: 'UDT_NAME'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"UDT_SCHEMA\",\"function\":\"UDT_NAME\"}]"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/functions/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/functions/delete   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"UDT_SCHEMA","function":"UDT_NAME"}]'

Response

Status Code

  • Delete function successfully

  • Faile to drop functions

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Retrieve parameters for specific udf

Retrieve parameters for specific udf.

GET /admin/schemas/{schema_name}/functions/{specific_name}/parameters

Request

Path Parameters

  • The schema name of the function.

  • The specific name of function.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/UDF_SCHEMA/functions/UDF_NAME/parameters"
    
    	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/UDF_SCHEMA/functions/UDF_NAME/parameters")
      .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/UDF_SCHEMA/functions/UDF_NAME/parameters",
      "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/UDF_SCHEMA/functions/UDF_NAME/parameters", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/UDF_SCHEMA/functions/UDF_NAME/parameters   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Retrieve parameters for specific udf.

  • Error information when get procedure parameters

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate create function template

POST /admin/functions/ddl

Request

Query Parameters

  • Allowable values: [create]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/functions/ddl?action=create"
    
    	payload := strings.NewReader("{\"schema\":\"UDF_SCHEMA\"}")
    
    	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, "{\"schema\":\"UDF_SCHEMA\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/functions/ddl?action=create")
      .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/admin/functions/ddl?action=create",
      "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({schema: 'UDF_SCHEMA'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"UDF_SCHEMA\"}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/functions/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/functions/ddl?action=create'   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"schema":"UDF_SCHEMA"}'

Response

Status Code

  • Generate the template of creating function.

  • Faile to generate create function template.

  • SQLException

  • SQLException

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop multiple User-defined Types

Drop multiple User-defined Types

PUT /admin/udts/delete

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/udts/delete"
    
    	payload := strings.NewReader("[{\"schema\":\"UDT_SCHEMA\",\"udt\":\"UDT_NAME\"}]")
    
    	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\":\"UDT_SCHEMA\",\"udt\":\"UDT_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/udts/delete")
      .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/udts/delete",
      "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: 'UDT_SCHEMA', udt: 'UDT_NAME'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"UDT_SCHEMA\",\"udt\":\"UDT_NAME\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/udts/delete", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/udts/delete   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '[{"schema":"UDT_SCHEMA","udt":"UDT_NAME"}]'

Response

Status Code

  • The UDTs was dropped successfully.

  • Invalid parameters or run sql exception.

  • Not authorized.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Retrieve row definition for User-defined Type object

Retrieve row definition for User-defined Type object

GET /admin/schemas/{schema_name}/udts/{udt_name}/definition

Request

Path Parameters

  • The schema name of User-defined Type.

  • The name of User-defined Type.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/UDT_SCHEMA/udts/UDT_NAME/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/UDT_SCHEMA/udts/UDT_NAME/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/UDT_SCHEMA/udts/UDT_NAME/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/UDT_SCHEMA/udts/UDT_NAME/definition", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/UDT_SCHEMA/udts/UDT_NAME/definition   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Retrieve row definition for User-defined Type object.

  • Not authorized.

  • Schema or alias not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate Create User-defined Types template

Generate Create User-defined Types template.

POST /admin/udts/ddl

Request

Query Parameters

  • Type of operation.

    Allowable values: [create]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/udts/ddl?action=create"
    
    	payload := strings.NewReader("{\"schema\":\"UDT_SCHEMA\"}")
    
    	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\":\"UDT_SCHEMA\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/udts/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/udts/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: 'UDT_SCHEMA'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"UDT_SCHEMA\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/udts/ddl?action=create", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/udts/ddl?action=create'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"schema":"UDT_SCHEMA"}'

Response

Status Code

  • Generate Create User-defined Types template.

  • Not authorized.

  • Schema or alias not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Executes SQL statements

Executes one or more SQL statements as a background job. This endpoint returns a job ID that can be used to retrieve the results.

POST /sql_jobs

Request

SQL script and execution options

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/sql_jobs"
    
    	payload := strings.NewReader("{\"commands\":\"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;\",\"limit\":10,\"separator\":\";\",\"stop_on_error\":\"no\"}")
    
    	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, "{\"commands\":\"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;\",\"limit\":10,\"separator\":\";\",\"stop_on_error\":\"no\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/sql_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/sql_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({
      commands: 'select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;',
      limit: 10,
      separator: ';',
      stop_on_error: 'no'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"commands\":\"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;\",\"limit\":10,\"separator\":\";\",\"stop_on_error\":\"no\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/sql_jobs", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/sql_jobs   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"commands":"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;","limit":10,"separator":";","stop_on_error":"no"}'

Response

Status Code

  • SQL execution job

  • Error payload

No Sample Response

This method does not specify any sample responses.

Fetches partial results of a SQL job execution

Returns the current status of a SQL job execution along with any results of SQL statements that have already been executed. Clients are supposed to poll this endpoint until the status returned is either 'completed', which indicates all SQL statements have completed executing, or 'failed', which indicates the job failed to execute and therefore is considered terminated. The returned list of results is not cumulative. That means, results that were fetched in a previous call will not be returned again, only new results (i.e. that were not fetched yet) will be included. For example, assuming a job with 10 SQL statements, the first call returns status "running" and 6 results, the second call returns status "running" and an empty list of results, a third call status "completed" and 4 results. Any subsequent calls would return status "completed" and an empty list of results.

GET /sql_jobs/{id}

Request

Path Parameters

  • ID of the SQL execution job

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/sql_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/sql_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/sql_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/sql_jobs/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/sql_jobs/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Contains the results of executing the SQL statements associated with a SQL execution job

Status Code

  • Result of a SQL job

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns the results of a SQL query to CSV

Executes the specified SQL query and returns the data as a CSV file. The amount of data returned is limited to 100,000 rows.

POST /sql_query_export

Request

The SQL query to be executed

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/sql_query_export"
    
    	payload := strings.NewReader("{\"command\":\"<ADD STRING VALUE>\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "text/csv")
    	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, "{\"command\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/sql_query_export")
      .post(body)
      .addHeader("content-type", "text/csv")
      .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/sql_query_export",
      "headers": {
        "content-type": "text/csv",
        "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({command: '<ADD STRING VALUE>'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"command\":\"<ADD STRING VALUE>\"}"
    
    headers = {
        'content-type': "text/csv",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/sql_query_export", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/sql_query_export   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: text/csv'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"command":"<ADD STRING VALUE>"}'

Response

Status Code

  • CSV file containing query results

  • Error payload

No Sample Response

This method does not specify any sample responses.

Create a scaling request

Scale the amount of storage and cpu cores for your instance. You can also update instance type, iops range and throughput.

POST /scaling/byoc_request

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/scaling/byoc_request"
    
    	payload := strings.NewReader("{\"disk\":\"<ADD STRING VALUE>\",\"iops\":\"<ADD STRING VALUE>\",\"throughput\":\"<ADD STRING VALUE>\",\"instance_type\":\"<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, "{\"disk\":\"<ADD STRING VALUE>\",\"iops\":\"<ADD STRING VALUE>\",\"throughput\":\"<ADD STRING VALUE>\",\"instance_type\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/scaling/byoc_request")
      .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/scaling/byoc_request",
      "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({
      disk: '<ADD STRING VALUE>',
      iops: '<ADD STRING VALUE>',
      throughput: '<ADD STRING VALUE>',
      instance_type: '<ADD STRING VALUE>'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"disk\":\"<ADD STRING VALUE>\",\"iops\":\"<ADD STRING VALUE>\",\"throughput\":\"<ADD STRING VALUE>\",\"instance_type\":\"<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/scaling/byoc_request", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/scaling/byoc_request   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"disk":"<ADD STRING VALUE>","iops":"<ADD STRING VALUE>","throughput":"<ADD STRING VALUE>","instance_type":"<ADD STRING VALUE>"}'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Forbidden

  • Not found

  • Unprocessable Content

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Get available scaling resources

View the allocated storage, cpu size, iops and throughput at the time of the request. This request will also return the supported scaling ranges for this Db2 on Cloud service.

GET /v1/manage/scaling/byoc_resources

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/v1/manage/scaling/byoc_resources"
    
    	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/v1/manage/scaling/byoc_resources")
      .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/v1/manage/scaling/byoc_resources",
      "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/v1/manage/scaling/byoc_resources", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/v1/manage/scaling/byoc_resources   -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

  • Forbidden

  • Not Found

  • Unprocessable Content

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Get available scaling instance types

Retrieve the list of instance types with cpu,memory in gb and network bandwidth

GET /scaling/instance_type

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/scaling/instance_type"
    
    	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/scaling/instance_type")
      .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/scaling/instance_type",
      "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/scaling/instance_type", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/scaling/instance_type   -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

  • Forbidden

  • Not Found

  • Unprocessable Content

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Get available scaling iops ranges

Retrieve the list of valid iops ranges and its corresponding storage ranges.

GET /scaling/iops_ranges

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/scaling/iops_ranges"
    
    	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/scaling/iops_ranges")
      .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/scaling/iops_ranges",
      "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/scaling/iops_ranges", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/scaling/iops_ranges   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

List of scaling iops ranges

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unprocessable Content

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

View scaling history

View scaling historical data.

GET /scaling/history

Request

Query Parameters

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE"
    
    	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/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE")
      .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/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE",
      "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/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE'   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • View scaling history

  • Bad request

  • Unauthorized

  • Internal server error

No Sample Response

This method does not specify any sample responses.

Get auto scaling configuration

View latest auto scaling configurations.

GET /scaling/auto

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/scaling/auto"
    
    	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/scaling/auto")
      .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/scaling/auto",
      "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/scaling/auto", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/scaling/auto   -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

  • Not Found

  • Unauthorized

No Sample Response

This method does not specify any sample responses.

Update auto scaling configuration

Configure the auto scaling parameters

PUT /scaling/auto

Request

auto scaling configuration

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/scaling/auto"
    
    	payload := strings.NewReader("{\"auto_scaling_enabled\":\"YES\",\"auto_scaling_threshold\":0,\"auto_scaling_over_time_period\":5,\"auto_scaling_pause_limit\":0,\"auto_scaling_allow_plan_limit\":\"YES\"}")
    
    	req, _ := http.NewRequest("PUT", 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, "{\"auto_scaling_enabled\":\"YES\",\"auto_scaling_threshold\":0,\"auto_scaling_over_time_period\":5,\"auto_scaling_pause_limit\":0,\"auto_scaling_allow_plan_limit\":\"YES\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/scaling/auto")
      .put(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": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/scaling/auto",
      "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({
      auto_scaling_enabled: 'YES',
      auto_scaling_threshold: 0,
      auto_scaling_over_time_period: 5,
      auto_scaling_pause_limit: 0,
      auto_scaling_allow_plan_limit: 'YES'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"auto_scaling_enabled\":\"YES\",\"auto_scaling_threshold\":0,\"auto_scaling_over_time_period\":5,\"auto_scaling_pause_limit\":0,\"auto_scaling_allow_plan_limit\":\"YES\"}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/scaling/auto", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/scaling/auto   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"auto_scaling_enabled":"YES","auto_scaling_threshold":0,"auto_scaling_over_time_period":5,"auto_scaling_pause_limit":0,"auto_scaling_allow_plan_limit":"YES"}'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Not Found

  • Unauthorized

No Sample Response

This method does not specify any sample responses.

Get system information

GET /about

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/about"
    
    	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/about")
      .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/about",
      "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/about", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/about   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Get system information

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get tasks status

GET /tasks/status

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/tasks/status"
    
    	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/tasks/status")
      .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/tasks/status",
      "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/tasks/status", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/tasks/status   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • contain tasks status for scaling ,restore etc.

  • Bad request

  • Unauthorized

  • Error

No Sample Response

This method does not specify any sample responses.

Analyzes CSV data to return a list of value data types

Schema discovery analyzes data in CSV format and returns a list of suggested data types that can be used when creating a table to store the CSV data.

POST /schema_discovery

Request

Data to analyze

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/schema_discovery"
    
    	payload := strings.NewReader("{\"column_separator\":\"<ADD STRING VALUE>\",\"includes_header\":\"<ADD STRING VALUE>\",\"data\":\"<ADD STRING VALUE>\"}")
    
    	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, "{\"column_separator\":\"<ADD STRING VALUE>\",\"includes_header\":\"<ADD STRING VALUE>\",\"data\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schema_discovery")
      .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/schema_discovery",
      "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({
      column_separator: '<ADD STRING VALUE>',
      includes_header: '<ADD STRING VALUE>',
      data: '<ADD STRING VALUE>'
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"column_separator\":\"<ADD STRING VALUE>\",\"includes_header\":\"<ADD STRING VALUE>\",\"data\":\"<ADD STRING VALUE>\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/schema_discovery", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/schema_discovery   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"column_separator":"<ADD STRING VALUE>","includes_header":"<ADD STRING VALUE>","data":"<ADD STRING VALUE>"}'

Response

Result of running schema discovery.

Status Code

  • Suggested table schema

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns the list of users

Administrators can retrieve the list of all users in the system. Regular users will receive a list containing only their own user profile.

GET /users

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/users"
    
    	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/users")
      .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/users",
      "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/users", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/users   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Collection of users

Status Code

  • List of users

  • Error payload

No Sample Response

This method does not specify any sample responses.

Creates a new user. **DB ADMIN ONLY**

Creates a new user.

This operation is only available to administrators.

POST /users

Request

User information

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/users"
    
    	payload := strings.NewReader("{\"id\":\"test_user\",\"name\":\"test_user\",\"password\":\"dEkMc43@gfAPl!867^dSbu\",\"role\":\"bluuser\",\"email\":\"test_user@mycompany.com\",\"locked\":\"no\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}")
    
    	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, "{\"id\":\"test_user\",\"name\":\"test_user\",\"password\":\"dEkMc43@gfAPl!867^dSbu\",\"role\":\"bluuser\",\"email\":\"test_user@mycompany.com\",\"locked\":\"no\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/users")
      .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/users",
      "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({
      id: 'test_user',
      name: 'test_user',
      password: 'dEkMc43@gfAPl!867^dSbu',
      role: 'bluuser',
      email: 'test_user@mycompany.com',
      locked: 'no',
      authentication: {method: 'internal', policy_id: 'Default'}
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"id\":\"test_user\",\"name\":\"test_user\",\"password\":\"dEkMc43@gfAPl!867^dSbu\",\"role\":\"bluuser\",\"email\":\"test_user@mycompany.com\",\"locked\":\"no\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/users", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/users   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"id":"test_user","name":"test_user","password":"dEkMc43@gfAPl!867^dSbu","role":"bluuser","email":"test_user@mycompany.com","locked":"no","authentication":{"method":"internal","policy_id":"Default"}}'

Response

Status Code

  • User response

  • The creating user task has not been finished

  • Invalid parameters or user already exists

  • Operation is only available to administrators

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get a specific user by ID

Get a specific user by ID. Administrators may retrieve user information for any user. Regular users may only retrieve themselves.

GET /users/{id}

Request

Path Parameters

  • ID of the user to be fetched

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/users/bluadmin"
    
    	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/users/bluadmin")
      .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/users/bluadmin",
      "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/users/bluadmin", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/users/bluadmin   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • User response

  • Access to this user is not allowed

  • The user does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Updates an existing user **DB ADMIN ONLY**

Updates an existing user.

Administrators may update user information for any user.

PUT /users/{id}

Request

Path Parameters

  • ID of the user to be updated

User information

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/users/{id}"
    
    	payload := strings.NewReader("{\"id\":\"<ADD STRING VALUE>\",\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"<ADD STRING VALUE>\",\"old_password\":\"<ADD STRING VALUE>\",\"new_password\":\"<ADD STRING VALUE>\",\"role\":\"bluadmin\",\"email\":\"<ADD STRING VALUE>\",\"locked\":\"yes\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}")
    
    	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, "{\"id\":\"<ADD STRING VALUE>\",\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"<ADD STRING VALUE>\",\"old_password\":\"<ADD STRING VALUE>\",\"new_password\":\"<ADD STRING VALUE>\",\"role\":\"bluadmin\",\"email\":\"<ADD STRING VALUE>\",\"locked\":\"yes\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/users/{id}")
      .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/users/{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.write(JSON.stringify({
      id: '<ADD STRING VALUE>',
      ibmid: '<ADD STRING VALUE>',
      name: '<ADD STRING VALUE>',
      old_password: '<ADD STRING VALUE>',
      new_password: '<ADD STRING VALUE>',
      role: 'bluadmin',
      email: '<ADD STRING VALUE>',
      locked: 'yes',
      authentication: {method: 'internal', policy_id: 'Default'}
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"id\":\"<ADD STRING VALUE>\",\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"<ADD STRING VALUE>\",\"old_password\":\"<ADD STRING VALUE>\",\"new_password\":\"<ADD STRING VALUE>\",\"role\":\"bluadmin\",\"email\":\"<ADD STRING VALUE>\",\"locked\":\"yes\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("PUT", "/dbapi/v4/users/{id}", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/users/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"id":"<ADD STRING VALUE>","ibmid":"<ADD STRING VALUE>","name":"<ADD STRING VALUE>","old_password":"<ADD STRING VALUE>","new_password":"<ADD STRING VALUE>","role":"bluadmin","email":"<ADD STRING VALUE>","locked":"yes","authentication":{"method":"internal","policy_id":"Default"}}'

Response

Status Code

  • User response

  • The updating user task has not been finished

  • Access to this user is not allowed

  • The user does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Deletes an existing user **DB ADMIN ONLY**

Deletes an existing user.

Only administrators can delete users.

DELETE /users/{id}

Request

Path Parameters

  • ID of the user to be deleted.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/users/{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/users/{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/users/{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/users/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/users/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • User deleted

  • The deleting user task has not been finished

  • Removal of this user is not allowed

  • The user does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Locks a user account indefinitely. **DB ADMIN ONLY**

Admin users can unlock users' accounts which have been locked out following repeated failed authentication attempts.

PUT /users/{id}/lock

Request

Path Parameters

  • ID of the user who will be locked

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/users/{id}/lock"
    
    	req, _ := http.NewRequest("PUT", 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/users/{id}/lock")
      .put(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": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/users/{id}/lock",
      "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("PUT", "/dbapi/v4/users/{id}/lock", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/users/{id}/lock   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • User response

  • The locking user task has not been finished

  • Cannot edit this user

  • The user does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Unlocks a user account **DB ADMIN ONLY**

Admin users can unlock users' accounts which have been locked out following repeated failed authentication attempts.

PUT /users/{id}/unlock

Request

Path Parameters

  • ID of the user who will be unlocked

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/users/{id}/unlock"
    
    	req, _ := http.NewRequest("PUT", 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/users/{id}/unlock")
      .put(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": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/users/{id}/unlock",
      "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("PUT", "/dbapi/v4/users/{id}/unlock", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/users/{id}/unlock   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • User response

  • The unlocking user task has not been finished

  • Cannot edit this user

  • The user does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get a list of backups

Get a list of backups from 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.

id=curlclassName=tab-item-selected