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.
Security
Every request must include the Authorization
HTTP header with the value Bearer [access_token]
. An access token can be obtained in one of three ways:
- Using the
/auth/tokens
endpoint - Creating an IAM access token
- Generating an IBM Cloud IAM oauth-token
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.
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.
- API Key
- Header
- Authorization
Third-party libraries
You can optionally use the okhttp jquery httpclientthird-party library to make requests to the console API.
Related APIs
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
The user's ID
The user's password
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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>"}'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/auth/token/publickey -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-deployment-id: {DEPLOYMENT_ID}'
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
New password
dswebToken received by email
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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>"}'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01::
Example:
scheduled
Example:
completed
Example:
2020-03-26T02:45:35.000Z
Example:
13958643712
Example:
40
Example:
30
backups
Status Code
The list of backups
Bad request
Unauthorized
Internal server error
No Sample Response
Request
Timestamp, used when doing point-in-time restore
backup ID, used when restoring to a particular backup
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01::
Example:
scheduled
Example:
completed
Example:
2020-03-26T02:45:35.000Z
Example:
15
task
Status Code
Task detail of the restore job
Bad request
Unauthorized
Unauthorized
No Sample Response
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01::
Example:
scheduled
Example:
completed
Example:
2020-03-26T02:45:35.000Z
Example:
15
task
Status Code
OK
Bad request
Unauthorized
Unexpected error
No Sample Response
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
Request
Example:
08:05
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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"}'
Copy database to a new provision database
Provision new database by copy from current database
POST /manage/copy_db
Request
name of the new cloned system
Example:
clone-instance-namw
region of the new cloned system
Example:
us-south
resource plan id
Example:
DashStandard
whether it's HA
Example:
true
resource group
Example:
ea345q3-ddfe34q-sdfdaasd
key protect key
Example:
default
backup id
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712
storage allocated to the new cloned system
Example:
20480
tags for the new cloned system
Examples:View
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
task ID of the copy request
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:task:3562g234fgsdggd
CRN of the new cloned system
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01::
status of the copy request
Example:
running
creation time of the copy request
Example:
2020-03-26T02:45:35.000Z
name of the new cloned instance
Example:
running
region of the new cloned instance
Example:
us-south
Status Code
Copy db successfully
Bad request
Error
No Sample Response
Request
Path Parameters
Encoded deployment id
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/connectioninfo/{DEPLOYMENT_ID} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-deployment-id: {DEPLOYMENT_ID}'
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
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Load job ID
User ID of who requested the load
Execution status of a data load job
Data load request
Meta information of an resource. Metadata is ready-only and values are auto-generated by the system.
Status Code
Data load jobs
Error payload
No Sample Response
Request
Data load job details
Type of data source. It can take the values 'SERVER', 'S3', or 'IBMCloud'.
Allowable values: [
SERVER
,S3
,IBMCloud
]Schema name where the target table is located
Table name where data should be loaded
Modifies how the source data should be interpreted
The character encoding of the source file. Valid values are listed in Supported territory codes and code pages. Default value is "1208" (corresponds to UTF-8).
Specifies whether or not the source file includes column names in a header row. Db2 on Cloud does not support this function, so the only acceptable value is NO.
Allowable values: [
no
]Default:
no
Single character used as column delimiter. Default value is comma (","). The character can also be specified using the format 0xJJ, where JJ is the hexadecimal representation of the character. Valid delimiters can be hexadecimal values from 0x00 to 0x7F, except for binary zero (0x00), line-feed (0x0A), carriage return (0x0D), space (0x20), and decimal point (0x2E).
Default:
,
A valid date format, such as "DD-MM-YY", "YYYY-MMM-DD", "DD/MM/YYY", "M/D/YYYY", "M/DD", "YYYY". For a full list of supported formats, see Valid file type modifiers for the load utility - ASCII file formats (ASC/DEL), in the LOAD command reference.
Default:
YYYY-MM-DD
A valid time format, such as "HH-MM-SS", "H:MM:SS TT", "HH:MM", "H:MM TT", "H:M", "H:M:S". For a full list of supported formats, see Valid file type modifiers for the load utility - ASCII file formats (ASC/DEL), in the LOAD command reference.
Default:
HH:MM:SS
A valid timestamp format, such as "YYYY-MM-DD HH:MM:SS", "DD/MM/YYYY H:MM TT", "MMM DD YYYY HH:MM:SS TT". For a full list of supported formats, see Valid file type modifiers for the load utility - ASCII file formats (ASC/DEL), in the LOAD command reference.
Default:
YYYY-MM-DD HH:MM:SS
file_options
If set to 'INSERT' data is appended to the existing table data. If set to 'REPLACE' the table data is replaced with the data being loaded.
Allowable values: [
INSERT
,REPLACE
]Default:
INSERT
Maximum number of rows to be loaded. If set to zero or not specified, all rows from the source data are loaded. Not supported in multi-partitioned (MPP) Db2 Warehouse on Cloud environments.
Default:
0
Maximum number of warnings that are tolerated before failing the load operation. A warning is generated for each row that is not loaded correctly.
Default:
1000
Required when load_type is set to "S3" or "SOFTLAYER". It specifies how to located the data to be loaded from a cloud storage service.
URL of the cloud storage endpoint where data is located. Amazon S3 valid endpoints are "s3.amazonaws.com", "s3.us-east-2.amazonaws.com", "s3-us-west-1.amazonaws.com, "s3-us-west-2.amazonaws.com", "s3.ca-central-1.amazonaws.com", "s3.ap-south-1.amazonaws.com", "s3.ap-northeast-2.amazonaws.com", "s3-ap-southeast-1.amazonaws.com", "s3-ap-southeast-2.amazonaws.com", "s3-ap-northeast-1.amazonaws.com", "s3.eu-central-1.amazonaws.com", "s3-eu-west-1.amazonaws.com", "s3.eu-west-2.amazonaws.com", "s3-sa-east-1.amazonaws.com". SoftLayer object storage valid endpoints are "https://ams01.objectstorage.softlayer.net/auth/v1.0", "https://che01.objectstorage.softlayer.net/auth/v1.0", "https://dal05.objectstorage.softlayer.net/auth/v1.0", "https://fra02.objectstorage.softlayer.net/auth/v1.0", "https://hkg02.objectstorage.softlayer.net/auth/v1.0", "https://lon02.objectstorage.softlayer.net/auth/v1.0", "https://mel01.objectstorage.softlayer.net/auth/v1.0", "https://mex01.objectstorage.softlayer.net/auth/v1.0", "https://mil01.objectstorage.softlayer.net/auth/v1.0", "https://mon01.objectstorage.softlayer.net/auth/v1.0", "https://par01.objectstorage.softlayer.net/auth/v1.0", "https://sao01.objectstorage.softlayer.net/auth/v1.0", "https://seo01.objectstorage.softlayer.net/auth/v1.0", "https://sjc01.objectstorage.softlayer.net/auth/v1.0", "https://sng01.objectstorage.softlayer.net/auth/v1.0", "https://syd01.objectstorage.softlayer.net/auth/v1.0", "https://tok02.objectstorage.softlayer.net/auth/v1.0", "https://tor01.objectstorage.softlayer.net/auth/v1.0", "https://wdc.objectstorage.softlayer.net/auth/v1.0".
Path used to find and retrieve the data in the cloud storage service
Username (SoftLayer) or Access Key (S3).
API Key (SoftLayer) or Secret Key (S3).
cloud_source
Required when load_type is set to "SERVER". It specifies how to source filein the server.
File path in the server relative to the user's home folder.
server_source
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Load job ID
User ID of who created the job
Describes the source of the data being loaded
If set to 'INSERT' data is appended to the existing table data. If set to 'REPLACE' the table data is replaced with the data being loaded. The default is 'INSERT'.
Target database name
Schema name where the target table is located
Table name where data will be loaded to
Job overall status
Status Code
load jobs.
Error payload
No Sample Response
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Load job ID
User ID of who requested the load
Execution status of a data load job
Data load request
Meta information of an resource. Metadata is ready-only and values are auto-generated by the system.
Status Code
Data load job
Not authorized to access load job
Job not found
Error payload
No Sample Response
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/load_jobs/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-deployment-id: {DEPLOYMENT_ID}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/load_jobs/{log_path}/log -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: file' -H 'x-deployment-id: {DEPLOYMENT_ID}'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/db_update -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-deployment-id: {DEPLOYMENT_ID}'
Request
db2 version
Example:
1.9.1
leave it as empty
Default:
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:backup:ac9555b1-df50-4ecb-88ef-34b650eff712
Example:
crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01::
Example:
completed
Example:
10
task
Status Code
Db2 database update was triggered successfully.
Bad request
Error
No Sample Response
List disaster recovery enablement information
List available regions that can be used for disaster recovery.
GET /manage/dr
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/manage/dr -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-deployment-id: {DEPLOYMENT_ID}'
Request
The name of disaster recovery node
The region where this disaster recovery node will be deployed. The complete region list can be retrieved from
/manage/dr
.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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>"}'
List disaster recovery remotes pair information
List disaster recovery remotes pair information
GET /manage/dr/remotes/status
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/manage/dr/remotes/status -H 'authorization: Bearer {AUTH_TOKEN}' -H 'x-deployment-id: {DEPLOYMENT_ID}'
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
If set to 'true' specifies that the database is not to wait for confirmation that the primary database has been shut down and it will close the connection between primary and standby node.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
Resync disaster recovery remote pair
Reconnect a broken or disconnected standby node
POST /manage/dr/resync
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
Check current disaster recovery resync status
Check if there is an ongoing resync request
GET /manage/dr/resync/status
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_HOSTNAME}/dbapi/v4/home/{path} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-deployment-id: {DEPLOYMENT_ID}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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.
Relative URL path for this file or folder.
Size in bytes. The size of a folder is the sum of the files directly under it, excluding subfolders.
List of files and folders
Relative URL path for this file or folder.
Size in bytes. The size of a folder will be -1.
contents
Status Code
Metadata about a file or folder
File not found
Error payload
No Sample Response
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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.
Relative URL path for this file or folder.
Size in bytes. The size of a folder is the sum of the files directly under it, excluding subfolders.
List of files and folders
Relative URL path for this file or folder.
Size in bytes. The size of a folder will be -1.
contents
Status Code
Files successfully uploaded
Error payload
No Sample Response
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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 of the database service.
Possible values: [
online
,offline
]Status of the authentication service.
Possible values: [
online
,offline
]Warnings or errors reported while checking status of services.
Status Code
System status
Operation is only available to administrators
Error payload
No Sample Response
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
Request
Custom Headers
Database profile name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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
Schema name
Amount of disk space logically allocated for row-organized data in all tables in the schema, reported in kilobytes.
Amount of disk space logically allocated for the indexes defined in all tables in the schema, reported in kilobytes.
Amount of disk space logically allocated for long field data in all tables in the schema, reported in kilobytes.
Amount of disk space logically allocated for LOB data in all tables in the schema, reported in kilobytes.
Amount of disk space logically allocated for XML data in all tables in the schema, reported in kilobytes.
Amount of disk space logically allocated for column-organized data in all tables in the schema, reported in kilobytes.
Total amount of logically allocated disk space for all tables in the schema, reported in kilobytes.
Amount of disk space physically allocated in all tables in the schema, reported in kilobytes.
Amount of disk space physically allocated for the indexes defined in all tables in the schema, reported in kilobytes.
Amount of disk space physically allocated for long field data in all tables in the schema, reported in kilobytes.
Amount of disk space logically allocated for LOB data in all tables in the schema, reported in kilobytes.
Amount of disk space physically allocated for XML data in all tables in the schema, reported in kilobytes.
Amount of disk space physically allocated for column-organized data in all tables in the schema, reported in kilobytes.
Total amount of physically allocated disk space for all tables in the schema, reported in kilobytes.
Status Code
Storage usage for a schema
Operation is only available to administrators
Schema does not exist
Error payload
No Sample Response
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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://{REST_API_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}'
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://{REST_API_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://{REST_API_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": "{REST_API_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("{REST_API_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/rows_read?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{REST_API_HOSTNAME}/dbapi/v4/metrics/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}'
Return the maximum number of concurrent connections for a specified time frame **DB ADMIN ONLY**
Return the maximum number of concurrent connections for a specified time frame
GET /metrics/max_connections_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://{REST_API_HOSTNAME}/dbapi/v4/metrics/max_connections_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)) }