Introduction

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

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

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

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

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

Root URL

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

Error handling

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

Security

Every request must include the Authorization HTTP header with the value Bearer [access_token]. An access token can be obtained in one of three ways:

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

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

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

For example:

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

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

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

Security scheme

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

authToken

Authorize using Bearer [access_token]. The access token can be obtained by authenticating with the /auth/tokens endpoint or use the API key to generate an IAM Bearer Token.

Value
  • API Key
  • Header
  • Authorization

deploymentId

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

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

Third-party libraries

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

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

Methods

Request a new access token

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

POST /auth/tokens

Request

User credentials

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

Response

Token generated after successful authentication.

Status Code

  • Authentication token

  • Invalid credentials

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns public key of Json Web Token

Returns public key of Json Web Token.

GET /auth/token/publickey

Request

No Request Parameters

This method does not accept any request parameters.

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

Response

Public key of token.

Status Code

  • Token public key and key id.

No Sample Response

This method does not specify any sample responses.

Sets a new password using dswebToken

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

PUT /auth/password

Request

New password and dswebToken

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

Response

Status Code

  • Password changed

  • Invalid or missing new password

  • If dswebToken is missing or invalid

  • Error payload

No Sample Response

This method does not specify any sample responses.

List currently available backups

Get details of all currently available backups

GET /backups

Request

No Request Parameters

This method does not accept any request parameters.

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

Response

Status Code

  • The list of backups

  • Bad request

  • Unauthorized

  • Internal server error

No Sample Response

This method does not specify any sample responses.

Restore

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

POST /backups/restore

Request

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

Response

Status Code

  • Task detail of the restore job

  • Bad request

  • Unauthorized

  • Unauthorized

No Sample Response

This method does not specify any sample responses.

Create a backup

Create a backup

POST /backups/backup

Request

No Request Parameters

This method does not accept any request parameters.

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

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Get backup setting

Get backup setting for scheduled time and retention policy

GET /backups/setting

Request

No Request Parameters

This method does not accept any request parameters.

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

Response

Status Code

  • OK

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Update backup setting

update backup setting for scheduled backup time

POST /backups/setting

Request

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

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Copy database to a new provision database

Provision new database by copy from current database

POST /manage/copy_db

Request

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

Response

Status Code

  • Copy db successfully

  • Bad request

  • Error

No Sample Response

This method does not specify any sample responses.

Get Db2 connection information

GET /connectioninfo/{DEPLOYMENT_ID}

Request

Path Parameters

  • Encoded deployment id

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

Response

Status Code

  • Get connection info

  • Error payload

No Sample Response

This method does not specify any sample responses.

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

Dowloads log file for a data load job

Downloads log file for a data load job

GET /load_jobs/{log_path}/log

Request

Path Parameters

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

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

Response

Status Code

  • Log file

  • Not authorized to access load log

  • Log not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Checks for any available database update

GET /db_update

Request

No Request Parameters

This method does not accept any request parameters.

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

Response

Status Code

  • Returns the available Db2 database update.

  • Bad request

  • Error

No Sample Response

This method does not specify any sample responses.

Trigger database update

POST /db_update

Request

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

Response

Status Code

  • Db2 database update was triggered successfully.

  • Bad request

  • Error

No Sample Response

This method does not specify any sample responses.

List disaster recovery enablement information

List available regions that can be used for disaster recovery.

GET /manage/dr

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

Response

Status Code

  • List disaster recovery enablement information successfully.

  • Bad request

  • Unauthorized

  • Error

No Sample Response

This method does not specify any sample responses.

Enable disaster recovery

Enable disaster recovery.

POST /manage/dr

Request

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

Response

Status Code

  • Disaster recovery enabled successfully.

  • Bad request

  • Unauthorized

  • Error

No Sample Response

This method does not specify any sample responses.

List disaster recovery remotes pair information

List disaster recovery remotes pair information

GET /manage/dr/remotes/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/manage/dr/remotes/status"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	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/manage/dr/remotes/status")
      .get()
      .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/manage/dr/remotes/status",
      "headers": {
        "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 = {
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/manage/dr/remotes/status", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/manage/dr/remotes/status   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Disaster recovery remotes status was returned successfully.

  • Bad request

  • Unauthorized

  • Error

No Sample Response

This method does not specify any sample responses.

Perform disaster recovery takeover

Perform take over on current instance to switch from standby node to primary node. This API requires current instance is standby.

POST /manage/dr/takeover

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/manage/dr/takeover"
    
    	payload := strings.NewReader("{\"force\":false}")
    
    	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, "{\"force\":false}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/manage/dr/takeover")
      .post(body)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .addHeader("x-deployment-id", "{DEPLOYMENT_ID}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/manage/dr/takeover",
      "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({ force: false }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"force\":false}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("POST", "/dbapi/v4/manage/dr/takeover", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/manage/dr/takeover   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-deployment-id: {DEPLOYMENT_ID}'   -d '{"force":false}'

Response

Status Code

  • Takeover has ran successfully on current instance.

  • Bad request

  • Unauthorized

  • Error

No Sample Response

This method does not specify any sample responses.

Resync disaster recovery remote pair

Reconnect a broken or disconnected standby node

POST /manage/dr/resync

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

Response

Status Code

  • Disaster recovery resync request completed successfully.

  • Bad request

  • Unauthorized

  • Error

No Sample Response

This method does not specify any sample responses.

Check current disaster recovery resync status

Check if there is an ongoing resync request

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

Response

Status Code

  • Check disaster recovery resync status successfully.

  • Bad request

  • Unauthorized

  • Error

No Sample Response

This method does not specify any sample responses.

Deletes a file in the Db2 temporary cloud object storage

Deletes a file in the Db2 temporary cloud object storage.

DELETE /home/{path}

Request

Path Parameters

  • File path

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

Response

Status Code

  • File deleted

  • Error payload

No Sample Response

This method does not specify any sample responses.

Download file from Db2 temporary cloud object storage

Download file from Db2 temporary cloud object storage.

GET /home_content/{path}

Request

Custom Headers

  • Allowable values: [application/json,application/octet-stream]

Path Parameters

  • File path

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

Response

Describes a file or folder.

Status Code

  • Metadata about a file or folder

  • File not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Uploads a file to Db2 temporary cloud object storage

Uploads a file to Db2 temporary cloud object storage.

POST /home_content/{path}

Request

Path Parameters

  • Target folder

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

Response

Describes a file or folder.

Status Code

  • Files successfully uploaded

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns overall status of system components

Returns overall status of system components.

GET /monitor

Request

Custom Headers

  • Database profile name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/monitor"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/monitor")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/monitor",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/monitor", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/monitor   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Services status

Status Code

  • System status

  • Operation is only available to administrators

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists active database connections **DB ADMIN ONLY**

Returns a list of active database connections.

GET /monitor/connections

Request

Custom Headers

  • Database profile name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/monitor/connections"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/monitor/connections")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/monitor/connections",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/monitor/connections", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/monitor/connections   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Collection of active database connections

Status Code

  • Active connections

  • Operation is only available to administrators

  • Error payload

No Sample Response

This method does not specify any sample responses.

Terminates a database connection **DB ADMIN ONLY**

Terminates an active database connection.

DELETE /monitor/connections/{application_handle}

Request

Custom Headers

  • Database profile name.

Path Parameters

  • Application handle name

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/monitor/connections/{application_handle}"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/monitor/connections/{application_handle}")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/monitor/connections/{application_handle}",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("DELETE", "/dbapi/v4/monitor/connections/{application_handle}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/monitor/connections/{application_handle}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Connection terminated

  • Operation is only available to administrators

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns current storage usage **DB ADMIN ONLY**

Returns current storage usage.

GET /monitor/storage

Request

Custom Headers

  • Database profile name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/monitor/storage"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/monitor/storage")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/monitor/storage",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/monitor/storage", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/monitor/storage   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Storage usage

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns storage usage history **DB ADMIN ONLY**

Returns a list of storage usage daily stats. Currenlty the history of the last seven days is returned.

GET /monitor/storage/history

Request

Custom Headers

  • Database profile name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/monitor/storage/history"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/monitor/storage/history")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/monitor/storage/history",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/monitor/storage/history", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/monitor/storage/history   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Collection of system storage stats

Status Code

  • Storage usage history

  • Error payload

No Sample Response

This method does not specify any sample responses.

Storage utilization by schema **DB ADMIN ONLY**

Returns a list where each element represents a schema and its corresponding logical and physical sizes. Physical size is the amount of storage in disk allocated to objects in the schema. Logical size is the actual object size, which might be less than the physical size (e.g. in the case of a logical table truncation).

GET /monitor/storage/by_schema

Request

Custom Headers

  • Database profile name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/monitor/storage/by_schema")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/monitor/storage/by_schema",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/monitor/storage/by_schema", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Collection of schema's storage usage data

Status Code

  • Storage usage by schema

  • Operation is only available to administrators

  • Error payload

No Sample Response

This method does not specify any sample responses.

Storage utilization of a schema **DB ADMIN ONLY**

Returns logical and physical sizes for one schema. Physical size is the amount of storage in disk allocated to objects in the schema. Logical size is the actual object size, which might be less than the physical size (e.g. in the case of a logical table truncation).

GET /monitor/storage/by_schema/{schema_name}

Request

Custom Headers

  • Database profile name.

Path Parameters

  • Schema name

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema/{schema_name}"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/monitor/storage/by_schema/{schema_name}")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/monitor/storage/by_schema/{schema_name}",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/monitor/storage/by_schema/{schema_name}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema/{schema_name}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Status Code

  • Storage usage for a schema

  • Operation is only available to administrators

  • Schema does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Return the number of statements for a specified time frame. **DB ADMIN ONLY**

Return the number of statements for a specified time frame.

GET /metrics/statements_count

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/statements_count?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/statements_count?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/statements_count?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/metrics/statements_count?start=1546272000000&end=1546272300000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/metrics/statements_count?start=1546272000000&end=1546272300000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Number of statements.

Status Code

  • Return the number of statements for a specified time frame.

  • Operation is only available to administrators.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Return the histogram of response time for a specified time frame. **DB ADMIN ONLY**

Return the histogram of response time for a specified time frame.

GET /metrics/response_time_histograms

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/response_time_histograms?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/response_time_histograms?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

A list of histogram data.

Status Code

  • Return the histogram of response time for a specified time frame

  • Database profile not found.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Return the average response time for a specified time frame. **DB ADMIN ONLY**

Return the average response time for a specified time frame.

GET /metrics/average_response_time

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/average_response_time?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/average_response_time?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Event monitor stats top.

Status Code

  • Return the average response time for a specified time frame.

  • Operation is only available to administrators.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Return the list of average response time for a specified time frame. **DB ADMIN ONLY**

Return the list of average response time for a specified time frame.

GET /metrics/response_time

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/response_time?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/response_time?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

A list of AverageResponseTime.

Status Code

  • Return the list of average response time for a specified time frame.

  • Database profile not found.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Return the average number of statements executed every minutes for a specified time frame. **DB ADMIN ONLY**

Return the average number of statements executed every minutes for a specified time frame.

GET /metrics/average_statements_rate

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/average_statements_rate?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/average_statements_rate?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

SQL rate(sql/min).

Status Code

  • Return the average number of statements executed every minutes for a specified time frame

  • Operation is only available to administrators.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Return numbers of statements executed every minutes for a specified time frame. **DB ADMIN ONLY**

Return numbers of statements executed every minutes for a specified time frame.

GET /metrics/statements_rate

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/statements_rate?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/statements_rate?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

A list of SQL rate(sql/min).

Status Code

  • Return numbers of statements executed every minutes for a specified time frame

  • Database profile not found.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Return the average number of rows read(rows/min) for a specified time frame. **DB ADMIN ONLY**

Return the average number of rows read(rows/min) for a specified time frame.

GET /metrics/average_rows_read

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/average_rows_read?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/average_rows_read?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id': "{DEPLOYMENT_ID}"
        }
    
    conn.request("GET", "/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -H 'x-db-profile: SOME_STRING_VALUE'   -H 'x-deployment-id: {DEPLOYMENT_ID}'

Response

Rows read(rows/min).

Status Code

  • Return the average number of rows read(rows/min) for a specified time frame.

  • Operation is only available to administrators.

  • Error payload.

No Sample Response

This method does not specify any sample responses.

Return the numbers of rows read(rows/min) for a specified time frame. **DB ADMIN ONLY**

Return the numbers of rows read(rows/min) for a specified time frame.

GET /metrics/rows_read

Request

Custom Headers

  • Database profile name.

Query Parameters

  • Start timestamp.

  • End timestamp.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/metrics/rows_read?start=1546272000000&end=1546272300000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("x-db-profile", "SOME_STRING_VALUE")
    	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/metrics/rows_read?start=1546272000000&end=1546272300000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("x-db-profile", "SOME_STRING_VALUE")
      .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/metrics/rows_read?start=1546272000000&end=1546272300000",
      "headers": {
        "content-type": "application/json",
        "x-db-profile": "SOME_STRING_VALUE",
        "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",
        'x-db-profile': "SOME_STRING_VALUE",
        'authorization': "Bearer {AUTH_TOKEN}",
        'x-deployment-id':