Security
Every request must include the Authorization
HTTP header with the value
Bearer [access_token]
.
An access token can be obtained with the /auth/tokens
endpoint, and it is
used by Db2 Warehouse on Cloud to identify who you are.
Some api methods (for example: /schemas
and /sql_jobs
) also support direct access to the database using HTTP headers.
For example:
X-DB-Userid:[database_user],
X-DB-Password:[database_password],
X-DB-URL:jdbc:db2://[host]:[port]/[database]:[property] for Db2 data sources
add dataservertype (DB2LUW, DB2Z) in property, if dataservertype key
for Db2 data source is not specified, the default is DB2LUW.
Db2 Warehouse on Cloud negotiates SSL connections using the TLS v1.2 protocol.
If you are using the latest version of cURL, protocol negotiation will happen automatically using TLS v1.2.
If you are using an older version of cURL, you will need to specify the --tlsv1.2
option in your cURL commands.
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://{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") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth/tokens") .post(body) .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth/tokens", "headers": { "content-type": "application/json" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({userid: '<ADD STRING VALUE>', password: '<ADD STRING VALUE>'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}" headers = { 'content-type': "application/json" } conn.request("POST", "/dbapi/v4/auth/tokens", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/auth/tokens -H 'content-type: application/json' -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://{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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth/token/publickey") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth/token/publickey", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/auth/token/publickey", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/auth/token/publickey -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/auth/token/logout" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth/token/logout") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth/token/logout", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/auth/token/logout", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/auth/token/logout -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Creates a new authentication policy **ADMIN ONLY**
Creates a new authentication policy which can be used to control password parameters.
POST /auth_policies
Request
Authentication policy
A display name for the policy.
Example:
test_policy
Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.
Example:
5
Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.
Example:
30
Number of failed logins before the user account is locked. This value must be a number between 3 and 8.
Example:
6
Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. This value must be larger than the minimum time duration. The minimum duration is 30 minutes when failed_login_attempts is 3, 45 minutes when failed_login_attempts is 4, 60 minutes when failed_login_attempts is 5, 120 minutes when failed_login_attempts is 6 or 7 and 180 minutes when failed_login_attempts is 8.
Example:
30
Minimum number of characters for passwords
Example:
15
Policy ID.
Example:
this_id_is_ignored
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/auth_policies" payload := strings.NewReader("{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth_policies") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth_policies", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ id: 'this_id_is_ignored', name: 'test_policy', password_history: 5, password_expiration: 30, failed_login_attempts: 6, lockout_duration: 30, min_password_length: 15 })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/auth_policies", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/auth_policies -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"id":"this_id_is_ignored","name":"test_policy","password_history":5,"password_expiration":30,"failed_login_attempts":6,"lockout_duration":30,"min_password_length":15}'
Lists all authentication policies **ADMIN ONLY**
Returns a list of authentication policies.
GET /auth_policies
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/auth_policies" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth_policies") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth_policies", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/auth_policies", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/auth_policies -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Policy defining user's password rules.
Policy ID.
A display name for the policy.
Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.
Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.
Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.
Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.
Minimum number of characters for passwords
Meta information of an resource. Metadata is ready-only and values are auto-generated by the system.
Status Code
List of authentication policies
Only administrators can execute this operation
Error payload
No Sample Response
Returns an authentication policy **ADMIN ONLY**
Returns an authentication policy.
GET /auth_policies/{id}
Request
Path Parameters
policy ID
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/auth_policies/Default" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth_policies/Default") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth_policies/Default", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/auth_policies/Default", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/auth_policies/Default -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Policy defining user's password rules.
Policy ID.
A display name for the policy.
Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.
Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.
Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.
Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.
Minimum number of characters for passwords
Meta information of an resource. Metadata is ready-only and values are auto-generated by the system.
Status Code
Authentication policy
Only administrators can execute this operation
Policy not found
Error payload
No Sample Response
Updates an authentication policy **ADMIN ONLY**
Updates an authentication policy.
PUT /auth_policies/{id}
Request
Path Parameters
policy ID
Authentication policy
A display name for the policy.
Example:
test_policy
Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.
Example:
5
Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.
Example:
30
Number of failed logins before the user account is locked. This value must be a number between 3 and 8.
Example:
6
Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. This value must be larger than the minimum time duration. The minimum duration is 30 minutes when failed_login_attempts is 3, 45 minutes when failed_login_attempts is 4, 60 minutes when failed_login_attempts is 5, 120 minutes when failed_login_attempts is 6 or 7 and 180 minutes when failed_login_attempts is 8.
Example:
30
Minimum number of characters for passwords
Example:
15
Policy ID.
Example:
this_id_is_ignored
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/auth_policies/{id}" payload := strings.NewReader("{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth_policies/{id}") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth_policies/{id}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ id: 'this_id_is_ignored', name: 'test_policy', password_history: 5, password_expiration: 30, failed_login_attempts: 6, lockout_duration: 30, min_password_length: 15 })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/auth_policies/{id}", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/auth_policies/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"id":"this_id_is_ignored","name":"test_policy","password_history":5,"password_expiration":30,"failed_login_attempts":6,"lockout_duration":30,"min_password_length":15}'
Response
Policy defining user's password rules.
Policy ID.
A display name for the policy.
Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.
Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.
Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.
Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.
Minimum number of characters for passwords
Meta information of an resource. Metadata is ready-only and values are auto-generated by the system.
Status Code
Authentication policy
Only administrators can execute this operation
Policy not found
Error payload
No Sample Response
Deletes an existing policy **ADMIN ONLY**
Deletes an existing policy.
Only administratos can delete policies.
DELETE /auth_policies/{id}
Request
Path Parameters
ID of the policy to be deleted.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/auth_policies/{id}" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth_policies/{id}") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth_policies/{id}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/auth_policies/{id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/auth_policies/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
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://{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") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth/password") .put(body) .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth/password", "headers": { "content-type": "application/json" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({password: '<ADD STRING VALUE>', dswebToken: '<ADD STRING VALUE>'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}" headers = { 'content-type': "application/json" } conn.request("PUT", "/dbapi/v4/auth/password", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/auth/password -H 'content-type: application/json' -d '{"password":"<ADD STRING VALUE>","dswebToken":"<ADD STRING VALUE>"}'
Requests a password reset based on user's email
An email is sent with the password reset link and code. To set a new password, the user can open the link on a web browser, or use the /auth/password endpoint providing the dswebToken. The dswebToken is valid for 12 hours.
POST /auth/reset
Request
User's email address and ID
Email address that will receive the password reset instructions and dswebToken
User ID
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/auth/reset" payload := strings.NewReader("{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") 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, "{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/auth/reset") .post(body) .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/auth/reset", "headers": { "content-type": "application/json" } }; 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({email: '<ADD STRING VALUE>', userId: '<ADD STRING VALUE>'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}" headers = { 'content-type': "application/json" } conn.request("POST", "/dbapi/v4/auth/reset", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/auth/reset -H 'content-type: application/json' -d '{"email":"<ADD STRING VALUE>","userId":"<ADD STRING VALUE>"}'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/backups" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/backups") .get() .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/backups", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/backups", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/backups -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
backup ID
Example:
202010050805
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/backups/restore" payload := strings.NewReader("{\"backup_id\":\"202010050805\"}") 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}") 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_id\":\"202010050805\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/backups/restore") .post(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/backups/restore", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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_id: '202010050805'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"backup_id\":\"202010050805\"}" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/backups/restore", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/backups/restore -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"backup_id":"202010050805"}'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/backups/backup" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/backups/backup") .post(null) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/backups/backup", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/backups/backup", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/backups/backup -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
Path Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/backups/2020100508051122" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/backups/2020100508051122") .delete(null) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/backups/2020100508051122", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/backups/2020100508051122", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/backups/2020100508051122 -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/backups/setting" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/backups/setting") .get() .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/backups/setting", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/backups/setting", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/backups/setting -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Update backup setting
update backup setting for scheduled backup time or retention policy
POST /backups/setting
Request
Example:
08:05
Example:
7
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/backups/setting" payload := strings.NewReader("{\"backup_time\":\"08:05\",\"retention\":7}") 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}") 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\",\"retention\":7}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/backups/setting") .post(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/backups/setting", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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', retention: 7})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"backup_time\":\"08:05\",\"retention\":7}" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/backups/setting", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/backups/setting -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"backup_time":"08:05","retention":7}'
Creates a data load job, load uses external table technology
Creates a data load job
POST /load_jobs_ET
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
- file_options
UTF8 The file uses UTF8 encoding and contains only NCHAR or NVARCHAR data. LATIN9 The file uses LATIN9 encoding and contains only CHAR or VARCHAR data. INTERNAL The file uses a mixture of both UTF8 and LATIN9 encoding, or you are unsure which type of encoding is used. The system checks the data and encodes the data as needed. Because this checking of the data reduces overall performance, use this value only when necessary. This is the default.
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).The code_page and ENCODING options are mutually exclusive
Specifies whether or not the source file includes column names in a header row.
Allowable values: [
yes
,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:
,
NO, SINGLE or DOUBLE, refer to string_delimiter
Default:
DOUBLE
Refer to date_style
Refer to time_style
Refer to date_delimiter
The format of the date field in the data file. The value can be any of the date format strings that are accepted by the TIMESTAMP_FORMAT scalar function. The default is YYYY-MM-DD. The DATE_FORMAT option and the DATEDELIM or DATESTYLE option are mutually exclusive.
The format of the time field in the data file. The value can be any of the time format strings that are accepted by the TIMESTAMP_FORMAT scalar function. The default is HH.MI.SS. The TIME_FORMAT option and a TIMEDELIM or TIMESTYLE option are mutually exclusive.
The format of the timestamp field in the data file. The value can be any of the format strings that are accepted by the TIMESTAMP_FORMAT scalar function. The default is 'YYYY-MM-DD HH.MI.SS'. The TIMESTAMP_FORMAT option and the TIMEDELIM, DATEDELIM, TIMESTYLE, or DATESTYLE option are mutually exclusive.
Allowable values: [
1_0 (this is the default)
,T_F
,Y_N
,YES_NO
,TRUE_FALSE
]Whether the byte value zero in a CHAR or VARCHAR field is to be ignored, TRUE or ON The byte value zero is ignored. FALSE or OFF The byte value zero is not ignored. This is the default.
Allowable values: [
true
,ON
,false
,OFF
]Whether quotation marks are mandatory, TRUE or ON, Quotation marks are mandatory. The QUOTEDVALUE option must be set to YES, SINGLE, or DOUBLE. FALSE or OFF Quotation marks are not mandatory. This is the default.
Whether to allow an ASCII value 1 - 31 in a CHAR or VARCHAR field. Any NULL, CR, or LF characters must be escaped. Allowed values are, TRUE or ON An ASCII value 1 - 31 in a CHAR or VARCHAR field is allowed. FALSE or OFF An ASCII value 1 - 31 in a CHAR or VARCHAR field is not allowed. This is the default.
Which character is to be regarded as an escape character. An escape character indicates that the character that follows it, which would otherwise be treated as a field-delimiter character or end-of-row sequence character, is instead treated as part of the value in the field. The escape character is ignored for graphic-string data. There is no default.
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
When set to execute, the source data is analyzed to discover the data types of each column. Then the target table is created using the columns and data types found. Currently, this option is only allowed when load_source is set to SERVER.
- auto_create_table
Allowable values: [
yes
,no
]Optional list of column names for the target table. When not provided, the system will auto-generate the column names.
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.
- cloud_source
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).
Required when load_type is set to "SERVER". It specifies how to source filein the server.
- server_source
File path in the server relative to the user's home folder.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/load_jobs_ET" 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,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"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\":{\"encoding\":\"<ADD STRING VALUE>\",\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"string_delimiter\":\"DOUBLE\",\"date_style\":\"<ADD STRING VALUE>\",\"time_style\":\"<ADD STRING VALUE>\",\"date_delimiter\":\"<ADD STRING VALUE>\",\"date_format\":\"<ADD STRING VALUE>\",\"time_format\":\"<ADD STRING VALUE>\",\"timestamp_format\":\"<ADD STRING VALUE>\",\"bool_style\":\"1_0 (this is the default)\",\"ignore_zero\":true,\"require_quotes\":\"<ADD STRING VALUE>\",\"ctrl_chars\":\"<ADD STRING VALUE>\",\"escape_char\":\"<ADD STRING VALUE>\"}}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") 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,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"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\":{\"encoding\":\"<ADD STRING VALUE>\",\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"string_delimiter\":\"DOUBLE\",\"date_style\":\"<ADD STRING VALUE>\",\"time_style\":\"<ADD STRING VALUE>\",\"date_delimiter\":\"<ADD STRING VALUE>\",\"date_format\":\"<ADD STRING VALUE>\",\"time_format\":\"<ADD STRING VALUE>\",\"timestamp_format\":\"<ADD STRING VALUE>\",\"bool_style\":\"1_0 (this is the default)\",\"ignore_zero\":true,\"require_quotes\":\"<ADD STRING VALUE>\",\"ctrl_chars\":\"<ADD STRING VALUE>\",\"escape_char\":\"<ADD STRING VALUE>\"}}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/load_jobs_ET") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/load_jobs_ET", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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, auto_create_table: {execute: 'yes', column_names: ['<ADD STRING VALUE>']}, 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: { encoding: '<ADD STRING VALUE>', code_page: '<ADD STRING VALUE>', has_header_row: 'no', column_delimiter: ',', string_delimiter: 'DOUBLE', date_style: '<ADD STRING VALUE>', time_style: '<ADD STRING VALUE>', date_delimiter: '<ADD STRING VALUE>', date_format: '<ADD STRING VALUE>', time_format: '<ADD STRING VALUE>', timestamp_format: '<ADD STRING VALUE>', bool_style: '1_0 (this is the default)', ignore_zero: true, require_quotes: '<ADD STRING VALUE>', ctrl_chars: '<ADD STRING VALUE>', escape_char: '<ADD STRING VALUE>' } })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"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\":{\"encoding\":\"<ADD STRING VALUE>\",\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"string_delimiter\":\"DOUBLE\",\"date_style\":\"<ADD STRING VALUE>\",\"time_style\":\"<ADD STRING VALUE>\",\"date_delimiter\":\"<ADD STRING VALUE>\",\"date_format\":\"<ADD STRING VALUE>\",\"time_format\":\"<ADD STRING VALUE>\",\"timestamp_format\":\"<ADD STRING VALUE>\",\"bool_style\":\"1_0 (this is the default)\",\"ignore_zero\":true,\"require_quotes\":\"<ADD STRING VALUE>\",\"ctrl_chars\":\"<ADD STRING VALUE>\",\"escape_char\":\"<ADD STRING VALUE>\"}}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/load_jobs_ET", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/load_jobs_ET -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"load_source":"SERVER","load_action":"INSERT","schema":"<ADD STRING VALUE>","table":"<ADD STRING VALUE>","max_row_count":0,"max_warning_count":1000,"auto_create_table":{"execute":"yes","column_names":["<ADD STRING VALUE>"]},"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":{"encoding":"<ADD STRING VALUE>","code_page":"<ADD STRING VALUE>","has_header_row":"no","column_delimiter":",","string_delimiter":"DOUBLE","date_style":"<ADD STRING VALUE>","time_style":"<ADD STRING VALUE>","date_delimiter":"<ADD STRING VALUE>","date_format":"<ADD STRING VALUE>","time_format":"<ADD STRING VALUE>","timestamp_format":"<ADD STRING VALUE>","bool_style":"1_0 (this is the default)","ignore_zero":true,"require_quotes":"<ADD STRING VALUE>","ctrl_chars":"<ADD STRING VALUE>","escape_char":"<ADD STRING VALUE>"}}'
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
Lists all data load jobs, load uses Db2 load utility technology
Lists all data load jobs for the user.
GET /load_jobs
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/load_jobs" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/load_jobs") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/load_jobs", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/load_jobs", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/load_jobs -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
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
- file_options
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.
Allowable values: [
yes
,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
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
When set to execute, the source data is analyzed to discover the data types of each column. Then the target table is created using the columns and data types found. Currently, this option is only allowed when load_source is set to SERVER.
- auto_create_table
Allowable values: [
yes
,no
]Optional list of column names for the target table. When not provided, the system will auto-generate the column names.
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.
- cloud_source
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).
Required when load_type is set to "SERVER". It specifies how to source filein the server.
- server_source
File path in the server relative to the user's home folder.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/load_jobs" payload := strings.NewReader("{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"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}") 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,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"date_format\":\"YYYY-MM-DD\",\"time_format\":\"HH:MM:SS\",\"timestamp_format\":\"YYYY-MM-DD HH:MM:SS\"}}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/load_jobs") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/load_jobs", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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, auto_create_table: {execute: 'yes', column_names: ['<ADD STRING VALUE>']}, cloud_source: { endpoint: '<ADD STRING VALUE>', path: '<ADD STRING VALUE>', auth_id: '<ADD STRING VALUE>', auth_secret: '<ADD STRING VALUE>' }, server_source: {file_path: '<ADD STRING VALUE>'}, file_options: { code_page: '<ADD STRING VALUE>', has_header_row: 'no', column_delimiter: ',', date_format: 'YYYY-MM-DD', time_format: 'HH:MM:SS', timestamp_format: 'YYYY-MM-DD HH:MM:SS' } })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"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}" } conn.request("POST", "/dbapi/v4/load_jobs", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/load_jobs -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"load_source":"SERVER","load_action":"INSERT","schema":"<ADD STRING VALUE>","table":"<ADD STRING VALUE>","max_row_count":0,"max_warning_count":1000,"auto_create_table":{"execute":"yes","column_names":["<ADD STRING VALUE>"]},"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://{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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/load_jobs/{id}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/load_jobs/{id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/load_jobs/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
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://{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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/load_jobs/{id}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/load_jobs/{id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/load_jobs/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
Path Parameters
Load job ID
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/load_jobs/{id}/log" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "file") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}/log") .get() .addHeader("content-type", "file") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/load_jobs/{id}/log", "headers": { "content-type": "file", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "file", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/load_jobs/{id}/log", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/load_jobs/{id}/log -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: file'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/schemas" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/schemas") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/schemas", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/schemas", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/schemas -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
Path Parameters
Schema name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/schemas/SYSIBM", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/schemas/SYSIBM", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
Path Parameters
Schema name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/schemas/SYSIBM/tables", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/schemas/SYSIBM/tables", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Returns information about a table
Return information about a table.
GET /schemas/{schema_name}/tables/{table_name}
Request
Path Parameters
Schema name
Table name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/schemas/SYSIBM/tables/SYSROLES", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/schemas/SYSIBM/tables/SYSROLES", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Includes table definition and statistics. Note that statistics such as row count and size are not updated real time. Check the stats_timestamp value to know how current that information is.
The table name
The schema name
User provided comments
- stats
Timestamp when statistics were last collected for the table. It can be empty for newly created tables.
Number of rows in the table
Storage size in kilobytes used by table data
Storage size in kilobytes allocated for the table. It is greater or equal to the storage in use. For instance, when rows are deleted storage might remain allocated for the table until a REORG operation reclaims the unused space.
Date when the table data was last read, inserted or updated
It can assume values
Status Code
Table information
Table not found
Error payload
No Sample Response
Deletes all table data
Deletes all table data using a TRUNCATE operation.
DELETE /schemas/{schema_name}/tables/{table_name}/data
Request
Path Parameters
Schema name
Table name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Query the list of object schemas
Query the list of object schemas.
GET /admin/schemas/obj_type/{obj_type}
Request
Path Parameters
Object type.
Allowable values: [
table
,hadooptable
,view
,mqt
,alias
,sequence
,procedure
,nickname
,udt
,function
]
Query Parameters
Object type.
Whether to show system objects.
Allowable values: [
true
,false
]The amount of return records.
Default:
500
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Create schema
Creates a new schema. Any user with enough database authority can create schemas using dbapi directly. Regular users can create new schemas indirectly by creating a new table or other database object and specifying the name of the new schema where the object will be placed.
POST /admin/schemas
Request
Schema name.
Example:
TESTSCHEMA
Authorization ID.
Example:
SYSIBM
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas" payload := strings.NewReader("{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({name: 'TESTSCHEMA', authorization: 'SYSIBM'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/schemas", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/admin/schemas -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"name":"TESTSCHEMA","authorization":"SYSIBM"}'
Drops an empty schema
Drops an empty schema. An error is returned if the schema contains any objects.
DELETE /admin/schemas
Request
Schema name.
Example:
TESTSCHEMA
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas" payload := strings.NewReader("[{\"name\":\"TESTSCHEMA\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"name\":\"TESTSCHEMA\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas") .delete(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{name: 'TESTSCHEMA'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"name\":\"TESTSCHEMA\"}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/schemas", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/schemas -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"name":"TESTSCHEMA"}]'
Request
Query Parameters
Object type.
Allowable values: [
TABLE
,VIEW
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,SCHEMA
,UDT
]Schema name of the object. For table and database, this parameter is not required.
Name of the object. For database, this parameter is not required.
The amount of return records.
Default:
1000
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
Allowable values: [
VIEW
,SCHEMA
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,INDEX
,TABLESPACE
]Example:
VIEW
Default:
1000
Example:
10
- filter
Example:
SYSCAT
Example:
TABLES
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges" payload := strings.NewReader("{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ obj_type: 'VIEW', rows_return: 10, filter: [{schema: 'SYSCAT', obj_name: 'TABLES'}] })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/privileges", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/admin/privileges -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"obj_type":"VIEW","rows_return":10,"filter":[{"schema":"SYSCAT","obj_name":"TABLES"}]}'
Request
Example:
true
- privileges
Example:
SYSCAT
Example:
TABLES
Allowable values: [
VIEW
,SCHEMA
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,INDEX
,TABLESPACE
]Example:
VIEW
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges" payload := strings.NewReader("{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ stop_on_error: true, privileges: [ { schema: 'SYSCAT', obj_name: 'TABLES', obj_type: 'VIEW', grantee: {authid: 'PUBLIC', authid_type: 'GROUP'}, grant: ['select'], revoke: ['insert'] } ] })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/admin/privileges", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/admin/privileges -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"stop_on_error":true,"privileges":[{"schema":"SYSCAT","obj_name":"TABLES","obj_type":"VIEW","grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["select"],"revoke":["insert"]}]}'
Request
Query Parameters
Type of operation.
Allowable values: [
more
]
Only when the action is more, this parameter is needed.
- objects
Schema name.
Example:
SCHEMA_NAME
The options used to generate DDL. Select 0 or one or several options. Only when the action is more, this parameter is needed. - depobj = Generates the basic DDL statements. - privilege = Generate the authorization DDL statements such as GRANT statements.
Examples:[ "depobj", "privilege" ]
Specifies the statement delimiter for SQL statements that are generated. Only when the action is more, this parameter is needed.
Example:
;
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more" payload := strings.NewReader("{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/ddl?action=more", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({objects: [{schema: 'SCHEMA_NAME'}], options: [{}], stat_terminator: ';'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/schemas/ddl?action=more", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"objects":[{"schema":"SCHEMA_NAME"}],"options":[{}],"stat_terminator":";"}'
Request
Schema name of the object.
Example:
TABLE_SCHEMA
Unqualified name of the object.
Example:
TABLE_NAME
- column_info
Data type
Example:
DECIMAL
Maximum length of the data; 0 for distinct types. The LENGTH column indicates precision for DECIMAL fields, and indicates the number of bytes of storage required for decimal floating-point columns; that is, 8 and 16 for DECFLOAT(16) and DECFLOAT(34), respectively.
Example:
5
Scale if the column type is DECIMAL or number of digits of fractional seconds if the column type is TIMESTAMP; 0 otherwise.
Name of the column.
Example:
COL_NAME
Nullability attribute for the column.
Example:
true
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tables" payload := strings.NewReader("{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tables") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tables", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ schema: 'TABLE_SCHEMA', table: 'TABLE_NAME', column_info: [ { data_type: 'DECIMAL', length: 5, scale: {}, column_name: 'COL_NAME', nullable: true } ] })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/admin/tables", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/admin/tables -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"TABLE_SCHEMA","table":"TABLE_NAME","column_info":[{"data_type":"DECIMAL","length":5,"scale":{},"column_name":"COL_NAME","nullable":true}]}'
Request
Example:
TABLE_SCHEMA
Example:
TABLE_NAME
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tables" payload := strings.NewReader("[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tables") .delete(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tables", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'TABLE_SCHEMA', table: 'TABLE_NAME'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/tables", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/tables -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"TABLE_SCHEMA","table":"TABLE_NAME"}]'
Get table definition
Get table definition.
GET /admin/schemas/{schema_name}/tables/{table_name}/definition
Request
Path Parameters
Schema name of the object.
Table name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Query table data
Fetches the table data up to a maximum of 100,000 rows. Currently it's not possible to retrieve data from tables that contain CLOB, BLOB or DBCLOB values.
GET /admin/schemas/{schema_name}/tables/{table_name}/data
Request
Path Parameters
Schema name of the object.
Table name.
Query Parameters
The amount of return records.
Default:
1000
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get column detail properties
Get column detail properties.
GET /admin/schemas/{schema_name}/tables/{table_name}/columns/{column_name}/properties
Request
Path Parameters
Schema name of the object.
Table name.
Column name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the column.
Unqualified name of the table, view, or nickname that contains the column.
Schema name of the table, view, or nickname that contains the column.
Unqualified name of the data type for the column.
Maximum length of the data; 0 for distinct types.
Scale if the column type is DECIMAL or number of digits of fractional seconds if the column type is TIMESTAMP; 0 otherwise.
Nullability attribute for the column.
Default value for the column of a table expressed as a constant, special register, or cast-function appropriate for the data type of the column. Can also be the keyword NULL. Values might be converted from what was specified as a default value. For example, date and time constants are shown in ISO format, cast-function names are qualified with schema names, and identifiers are delimited. Null value if a DEFAULT clause was not specified or the column is a view column.
Whether the column is logged.
Whether the column is compacted.
Compress.
Identity.
Type of generated column.
Row change timestamp.
Start value of the sequence. The null value if the sequence is an alias.
Increment value. The null value if the sequence is an alias.
Minimum value of the sequence. The null value if the sequence is an alias.
Maximum value of the sequence. The null value if the sequence is an alias.
Indicates whether or not the sequence can continue to generate values after reaching its maximum or minimum value.
Number of sequence values to pre-allocate in memory for faster access. 0 indicates that values of the sequence are not to be preallocated. In a partitioned database, this value applies to each database partition. -1 if the sequence is an alias.
Indicates whether or not the sequence numbers must be generated in order of request.
Maximum size in bytes of the internal representation of an instance of an XML document, a structured type, or a LOB data type, that can be stored in the base table; 0 when not applicable.
Whether it is a primary key.
The column's numerical position within the table's distribution key; 0 or the null value if the column is not in the distribution key. The null value for columns of subtables and hierarchy tables.
Status Code
Get column detail properties.
Not authorized.
Object not found.
Error payload
No Sample Response
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tables/meta/datatype", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/tables/meta/datatype", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Whether it is an identity column.
Unqualified name of the data type.
Whether there is a data type check constraint.
Default length of the data.
Maximum length of the data.
Default precision of the data.
Maximum precision of the data.
Scale for distinct types or reference representation types based on the built-in DECIMAL type; the number of digits of fractional seconds for distinct types based on the built-in TIMESTAMP type; 6 for the built-in TIMESTAMP type; 0 for all other types (including DECIMAL itself).
Status Code
Get the metadata type.
Error payload
No Sample Response
Request
Query Parameters
Type of operation.
Allowable values: [
create
,alter
,more
]
Schema name of the object. Only When the action is create or alter, this parameter is needed.
Example:
TABLE_SCHEMA
Unqualified name of the object. Only When the action is create or alter, this parameter is needed.
Example:
TABLE_NAME
Only When the action is create or alter, this parameter is needed.
- column_info
Data type
Example:
DECIMAL
Maximum length of the data; 0 for distinct types. The LENGTH column indicates precision for DECIMAL fields, and indicates the number of bytes of storage required for decimal floating-point columns; that is, 8 and 16 for DECFLOAT(16) and DECFLOAT(34), respectively.
Example:
5
Scale if the column type is DECIMAL or number of digits of fractional seconds if the column type is TIMESTAMP; 0 otherwise.
Name of the column.
Example:
COL_NAME
Nullability attribute for the column.
Example:
true
Only when the action is more, this parameter is needed.
- objects
Schema name of the object.
Example:
TABLE_SCHEMA
Unqualified name of the object.
Example:
TABLE_NAME
The options used to generate DDL. Select 0 or one or several options. Only when the action is more, this parameter is needed. - create = Generates DDL statements with the CREATE OR REPLACE clause. - creatorname:creatorID = Generates DDL statements for objects that were created with the specified creator ID. - depobj = Generates the basic DDL statements - view = Generate the CREATE VIEW DDL statements - privilege = Generate the authorization DDL statements such as GRANT statements.
Examples:[ "create", { "creatorname": "creatorID" }, "depobj", "view", "privilege" ]
Specifies the statement delimiter for SQL statements that are generated. Only when the action is more, this parameter is needed.
Example:
;
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create" payload := strings.NewReader("{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}],\"objects\":[{\"schema\":\"TABLE_SCHEMA\",\"name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}],\"objects\":[{\"schema\":\"TABLE_SCHEMA\",\"name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tables/ddl?action=create", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ schema: 'TABLE_SCHEMA', table: 'TABLE_NAME', column_info: [ { data_type: 'DECIMAL', length: 5, scale: {}, column_name: 'COL_NAME', nullable: true } ], objects: [{schema: 'TABLE_SCHEMA', name: 'TABLE_NAME'}], options: [{}], stat_terminator: ';' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}],\"objects\":[{\"schema\":\"TABLE_SCHEMA\",\"name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/tables/ddl?action=create", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/tables/ddl?action=create' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"TABLE_SCHEMA","table":"TABLE_NAME","column_info":[{"data_type":"DECIMAL","length":5,"scale":{},"column_name":"COL_NAME","nullable":true}],"objects":[{"schema":"TABLE_SCHEMA","name":"TABLE_NAME"}],"options":[{}],"stat_terminator":";"}'
Get distributin keys
Get distributin keys.
GET /admin/schemas/{schema_name}/tables/{table_name}/distribution_keys
Request
Path Parameters
Schema name of the table.
Name of the table.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distribution_keys -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get data distributin property
Get data distributin property.
GET /admin/schemas/{schema_name}/tables/{table_name}/distributions/properties
Request
Path Parameters
Schema name of the table.
Name of the table.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/distributions/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get partition expressions
Get partition expressions.
GET /admin/schemas/{schema_name}/tables/{table_name}/partitions/expressions
Request
Path Parameters
Schema name of the table.
Name of the table.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions/expressions -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get data partitions
Get data partitions.
GET /admin/schemas/{schema_name}/tables/{table_name}/partitions
Request
Path Parameters
Schema name of the table.
Name of the table.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/partitions -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the data partition.
Inclusiveness
Low key value (a string representation of an SQL value) for this data partition.
High key value (a string representation of an SQL value) for this data partition.
Table space for this data partition.
Table space that stores long data.
Table spaces indexed by all partitions of this data partition.
Status Code
Get data partitions.
Invalid parameters.
Not authorized.
Error payload
No Sample Response
Query view detail properties
Query view detail properties.
GET /admin/schemas/{schema_name}/views/{view_name}/properties
Request
Path Parameters
Schema name of the view.
Name of the view.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the view.
Schema name of the view.
View check.
Whether it is read-only.
Whether it is valid.
Whether to optimize the query.
Authorization ID of the owner of the view.
Owner type.
Time at which the object was created.
Time at which the object was last altered.
Time at which any change was last made to recorded statistics for this object. The null value if statistics are not collected.
Full text of the view CREATE statement, exactly as typed.
Status Code
Query view detail properties.
Not authorized.
Object not found.
Error payload
No Sample Response
Request
Schema name.
Example:
VIEW_SCHEMA
View name.
Example:
VIEW_NAME
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/views" payload := strings.NewReader("[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/views") .delete(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/views", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'VIEW_SCHEMA', view: 'VIEW_NAME'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\"}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/views", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/views -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"VIEW_SCHEMA","view":"VIEW_NAME"}]'
Request
Path Parameters
Schema name of the object.
View name.
Query Parameters
The amount of return records.
Default:
1000
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/data?rows_return=100' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get View definition
Get view definition.
GET /admin/schemas/{schema_name}/views/{view_name}/definition
Request
Path Parameters
Schema name of the object.
View name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/definition -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
Query Parameters
Type of operation.
Allowable values: [
create
,alter
,more
]
Schema name. Only When the action is create or alter, this parameter is needed.
Example:
VIEW_SCHEMA
View name. This parameter is required to modify the view.
Example:
VIEW_NAME
Only when the action is more, this parameter is needed.
- objects
Schema name.
Example:
VIEW_SCHEMA
View name.
Example:
VIEW_NAME
The options used to generate DDL. Select 0 or one or several options. Only when the action is more, this parameter is needed. - create = Generates DDL statements with the CREATE OR REPLACE clause. - creatorname:creatorID = Generates DDL statements for objects that were created with the specified creator ID. - depobj = Generates the basic DDL statements - privilege = Generate the authorization DDL statements such as GRANT statements.
Examples:[ "create", { "creatorname": "creatorID" }, "depobj", "privilege" ]
Specifies the statement delimiter for SQL statements that are generated. Only when the action is more, this parameter is needed.
Example:
;
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create" payload := strings.NewReader("{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\",\"objects\":[{\"schema\":\"VIEW_SCHEMA\",\"name\":\"VIEW_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\",\"objects\":[{\"schema\":\"VIEW_SCHEMA\",\"name\":\"VIEW_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/views/ddl?action=create", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ schema: 'VIEW_SCHEMA', view: 'VIEW_NAME', objects: [{schema: 'VIEW_SCHEMA', name: 'VIEW_NAME'}], options: [{}], stat_terminator: ';' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"VIEW_SCHEMA\",\"view\":\"VIEW_NAME\",\"objects\":[{\"schema\":\"VIEW_SCHEMA\",\"name\":\"VIEW_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/views/ddl?action=create", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/views/ddl?action=create' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"VIEW_SCHEMA","view":"VIEW_NAME","objects":[{"schema":"VIEW_SCHEMA","name":"VIEW_NAME"}],"options":[{}],"stat_terminator":";"}'
Get the dependencies of the object
Get the dependencies of the object.
GET /admin/schemas/{schema_name}/{obj_type}/{object_name}/dependencies
Request
Path Parameters
Schema name of the object.
Type of object.
Allowable values: [
tables
,views
,nicknames
,sequences
,aliases
,mqts
,procedures
,functions
,udts
]Name of the object.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSCAT/views/TABLES/dependencies -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get the dependencies of the tablespace
Get the dependencies of the tablespace.
GET /admin/tablespaces/{tablespace}/dependencies
Request
Path Parameters
Tablespace name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/dependencies -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Query bufferpool detail properties
Query bufferpool detail properties.
GET /admin/bufferpools/{bufferpool_name}/properties
Request
Path Parameters
Name of the object.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/bufferpools/{bufferpool_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the buffer pool.
Whether the buffer pool is automatically managed by DB2.
Number of pages in a block.
Default number of pages in this buffer pool on database partitions in this database partition group.
Number of pages of the buffer pool that are to be in a block-based area. A block-based area of the buffer pool is only used by prefetchers doing a sequential prefetch.
Page size for this buffer pool on database partitions in this database partition group.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query constraint detail properties
Query constraint detail properties.
GET /admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties
Request
Path Parameters
Schema name of the object.
Table name.
Name of the constraint.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the constraint.
Unqualified name of the table to which this constraint applies.
Schema name of the table to which this constraint applies.
Indicates the constraint type.
Referencing key.
Referencing table.
Referencing schema.
Whether it is a enforce constraint.
Members.
Update rule.
Delete rule.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query index detail properties
Query index detail properties.
GET /admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties
Request
Path Parameters
Schema name of the object.
Table name.
Name of the index.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the index.
Schema name of the index.
Name of the column.
Unqualified name of the table or nickname on which the index is defined.
Schema name of the table or nickname on which the index is defined.
Name of the table space.
Type of index.
Whether it is unique.
Whether it is a clustering index
Specifies whether index compression is activated
Whether the index supports reverse scanning
Percentage of each index page to be reserved during the initial building of the index.
Percentage of each index level 2 page to be reserved during initial building of the index.
Authorization ID of the owner of the index.
Owner type.
Whether it is system generated.
Time when the index was created.
Date when the index was last used by any DML statement to perform a scan, or used to enforce referential integrity constraints. This column is not updated when the index is used on an HADR standby database, nor is it updated when rows are inserted into the table on which the index is defined. The default value is '0001-01-01'. This value is updated asynchronously not more than once within a 24 hour period and might not reflect usage within the last 15 minutes.
Last time that any change was made to the recorded statistics for this index. The null value if no statistics are available.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query trigger detail properties
Query trigger detail properties.
GET /admin/schemas/{schema_name}/triggers/{trigger_name}/properties
Request
Path Parameters
Schema name of the object.
Name of the trigger.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/triggers/{trigger_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the trigger.
Unqualified name of the table or view to which this trigger applies.
Schema name of the table or view to which this trigger applies.
Schema name of the trigger.
Time at which triggered actions are applied to the base table, relative to the event that fired the trigger.
Event that fires the trigger.
evel of granularity.
Whether the trigger is valid.
Indicates whether the trigger is secure for row and column access control.
Full text of the CREATE TRIGGER statement, exactly as typed.
User-provided comments, or the null value.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query MQT detail properties
Query MQT detail properties.
GET /admin/schemas/{schema_name}/mqts/{mqt_name}/properties
Request
Path Parameters
Schema name of the object.
Name of the MQT.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the materialized query table.
Schema name of the materialized query table.
Name of the primary table space for the table.
Name of the table space that holds all indexes created on this table.
Name of the table space that holds all long data (LONG or LOB column types) for this table.
Authorization ID of the owner of the materialized query table.
Owner type.
Table organization.
Compression mode for the table.
Row compression mode for the table.
Refresh mode.
Percentage of each page to be reserved for future inserts.
Drop rule.
Volatile.
For row-organized tables, controls how rows are inserted into pages.
Data capture.
Indicates the preferred lock granularity for tables that are accessed by data manipulation language (DML) statements.
Specifies whether the created temporary table is logged.
For REFRESH = 'D' or 'O', time at which the data was last refreshed (REFRESH TABLE statement); null value otherwise.
Time at which the object was created.
Time at which the object was last altered.
Time at which any change was last made to recorded statistics for this object. The null value if statistics are not collected.
Properties for a table.
Full text of the materialized query table CREATE statement, exactly as typed.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query UDF detail properties
Query UDF detail properties.
GET /admin/schemas/{schema_name}/functions/{specific_name}/properties
Request
Path Parameters
Schema name of the object.
Name of the UDF.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/functions/{specific_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the UDF.
Schema name of the UDF.
The full text of the CREATE FUNCTION statement.
Name of the routine instance (might be system-generated).
Implementation language for the routine body (or for the source function body, if this function is sourced on another function).
Parameter style that was declared when the routine was created.
Indicates what type of SQL statements, if any, the database manager should assume is contained in the routine.
Whether the result is deterministic.
Whether the function has external side-effects.
Indicates whether the transaction is committed on successful return from this procedure.
Whether the routine can be executed in parallel.
Indicates if there is a fence.
Implementation
Authorization ID of the owner.
Owner type.
Time at which the object was created.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query tablespace detail properties
Query tablespace detail properties.
GET /admin/tablespaces/{table_space}/properties
Request
Path Parameters
Tablespace name of the object.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces/{table_space}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tablespaces/{table_space}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tablespaces/{table_space}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/tablespaces/{table_space}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/tablespaces/{table_space}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the table space.
Name of the database partition group that is associated with this table space.
Name of the buffer pool.
Name of the storage group the table space is using.
Type of data that can be stored in this table space.
Type of table space.
Indicates if it is reclaimable.
Indicates whether or not tables in this table space can be recovered after a drop table operation.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query procedure detail properties
Query procedure detail properties.
GET /admin/schemas/{schema_name}/procedures/{specific_name}/properties
Request
Path Parameters
Schema name of the object.
Name of the procedure.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/procedures/{specific_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/procedures/{specific_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/procedures/{specific_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/procedures/{specific_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/procedures/{specific_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the procedure.
Schema name of the procedure.
The full text of the CREATE PROCEDURE statement.
Name of the routine instance (might be system-generated).
Implementation language for the routine body (or for the source function body, if this function is sourced on another function).
Parameter style that was declared when the routine was created.
Indicates what type of SQL statements, if any, the database manager should assume is contained in the routine.
Whether the result is deterministic.
Whether the function has external side-effects.
Indicates whether the transaction is committed on successful return from this procedure.
Whether the routine can be executed in parallel.
Indicates if there is a fence.
Implementation.
Authorization ID of the owner.
Owner type.
Time at which the object was created.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query sequence detail properties
Query sequence detail properties.
GET /admin/schemas/{schema_name}/sequences/{sequence_name}/properties
Request
Path Parameters
Schema name of the object.
Name of the sequence.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/sequences/{sequence_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/sequences/{sequence_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/sequences/{sequence_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/sequences/{sequence_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/sequences/{sequence_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the sequence.
Schema name of the sequence.
Unqualified name of the data type.
Precision of the data type of the sequence.
Start value of the sequence.
Increment value.
Maximum value of the sequence.
Minimum value of the sequence.
Indicates whether or not the sequence can continue to generate values after reaching its maximum or minimum value.
Number of sequence values to pre-allocate in memory for faster access.
Indicates whether or not the sequence numbers must be generated in order of request.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query package detail properties
Query package detail properties.
GET /admin/schemas/{schema_name}/packages/{package_name}/properties
Request
Path Parameters
Schema name of the object.
Name of the package.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/packages/{package_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/packages/{package_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/packages/{package_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/packages/{package_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/packages/{package_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the package.
Schema name of the package.
Default schema name used for unqualified names in static SQL statements.
Authorization ID of the binder and owner of the package.
Authorization ID of the binder and owner of the package.
Cursor blocking option.
Number of sections in the package.
Optimization class under which this package was bound. Used for rebind operations.
Value of the EXPLSNAP bind option.
SQL path in effect when the package was bound.
Text of the SQL statement.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query UDT detail properties
Query UDT detail properties.
GET /admin/schemas/{schema_name}/udts/{type_name}/properties
Request
Path Parameters
Schema name of the object.
Name of the user-defined type.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/udts/{type_name}/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/udts/{type_name}/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/{schema_name}/udts/{type_name}/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/{schema_name}/udts/{type_name}/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/{schema_name}/udts/{type_name}/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the data type.
Schema name of the module to which the data type belongs.
Maximum length of the type.
Scale for distinct types or reference representation types based on the built-in DECIMAL type; the number of digits of fractional seconds for distinct types based on the built-in TIMESTAMP type; 6 for the built-in TIMESTAMP type; 0 for all other types (including DECIMAL itself).
For distinct types or array types, the unqualified name of the source data type. For user-defined structured types, the unqualified built-in type name of the reference representation type. Null for other data types.
For distinct types or array types, the schema name of the source data type. For user-defined structured types, the schema name of the built-in type of the reference representation type. Null for other data types.
Meta type.
User-provided comments
Indicates whether the type can be instantiated.
Indicates whether the user-defined type can have subtypes.
Maximum length of a structured type that can be kept with a base table row; 0 otherwise.
Status Code
Returned result was successful.
Not authorized.
Object not found.
Error payload
No Sample Response
Query alias detail properties
Query alias detail properties.
GET /admin/schemas/{schema_name}/aliases/{alias_name}/properties
Request
Path Parameters
Schema name of the object.
Alias name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the object.
Schema name of the object.
The name of the object referenced by the alias.
The schema name of the object referenced by the alias.
Authorization ID of the owner.
Owner type.
Time at which the object was created.
Time at which the object was last altered.
Status Code
Query alias detail properties.
Not authorized.
Schema or alias not found.
Error payload
No Sample Response
Get table detail properties
Get table detail properties.
GET /admin/schemas/{schema_name}/tables/{table_name}/properties
Request
Path Parameters
Schema name of the object.
Table name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/properties" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/properties") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/properties", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/properties", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/properties -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Unqualified name of the object.
Schema name of the object.
Type of object.
Name of the primary table space for the table.
Name of the table space that holds all indexes created on this table.
Name of the table space that holds all long data (LONG or LOB column types) for this table.
Table organization.
Type of temporal table.
Drop rule.
Volatile.
Compression mode for the table.
Row compression mode for the table.
Clustered.
Indicates how data is distributed among database partitions in a partitioned database system.
Average length (in bytes) of both compressed and uncompressed rows in this table; -1 if statistics are not collected.
Status of the object.
For row-organized tables, controls how rows are inserted into pages.
Primary key.
Total number of rows in the table; -1 if statistics are not collected.
Time at which the object was created.
Date when the table was last used by any DML statement or the LOAD command.
Time at which the object was last altered.
Time at which any change was last made to recorded statistics for this object. The null value if statistics are not collected.
Percentage of each page to be reserved for future inserts.
Data capture.
Indicates the preferred lock granularity for tables that are accessed by data manipulation language (DML) statements.
Specifies whether the created temporary table is logged.
Authorization ID of the owner.
Owner type.
Status Code
Get table detail properties.
Not authorized.
Object not found.
Error payload
No Sample Response
Request
The schema of the object based.
Example:
SYSCAT
The name of the object based.
Example:
TABLES
Alias name.
Example:
ALIAS_NAME
Alias schema.
Example:
ALIAS_SCHEMA
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/aliases" payload := strings.NewReader("{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\"}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/aliases") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/aliases", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ base_obj_schema: 'SYSCAT', base_obj_name: 'TABLES', alias_name: 'ALIAS_NAME', alias_schema: 'ALIAS_SCHEMA' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/admin/aliases", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/admin/aliases -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"base_obj_schema":"SYSCAT","base_obj_name":"TABLES","alias_name":"ALIAS_NAME","alias_schema":"ALIAS_SCHEMA"}'
Request
Alias schema.
Example:
ALIAS_SCHEMA
Alias name.
Example:
ALIAS_NAME
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/aliases" payload := strings.NewReader("[{\"schema\":\"ALIAS_SCHEMA\",\"alias\":\"ALIAS_NAME\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"ALIAS_SCHEMA\",\"alias\":\"ALIAS_NAME\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/aliases") .delete(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/aliases", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'ALIAS_SCHEMA', alias: 'ALIAS_NAME'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"ALIAS_SCHEMA\",\"alias\":\"ALIAS_NAME\"}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/aliases", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/aliases -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"ALIAS_SCHEMA","alias":"ALIAS_NAME"}]'
Request
Query Parameters
Type of operation.
Allowable values: [
create
,more
]
The schema of the object based. Only When the action is create, this parameter is needed.
Example:
SYSCAT
The name of the object based. Only When the action is create, this parameter is needed.
Example:
TABLES
Alias name. Only When the action is create, this parameter is needed.
Example:
ALIAS_NAME
Alias schema. Only When the action is create, this parameter is needed.
Example:
ALIAS_SCHEMA
Only when the action is more, this parameter is needed.
- objects
Schema name of the object.
Example:
ALIAS_SCHEMA
Unqualified name of the object.
Example:
ALIAS_NAME
Schema name of the based object.
Example:
TABLE_SCHEMA
Unqualified name of the based object.
Example:
TABLE_NAME
The options used to generate DDL. Select 0 or one or several options. Only when the action is more, this parameter is needed. - create = Generates DDL statements with the CREATE OR REPLACE clause. - creatorname:creatorID = Generates DDL statements for objects that were created with the specified creator ID. - depobj = Generates the basic DDL statements - view = Generate the CREATE VIEW DDL statements - privilege = Generate the authorization DDL statements such as GRANT statements.
Examples:[ "create", { "creatorname": "creatorID" }, "depobj", "view", "privilege" ]
Specifies the statement delimiter for SQL statements that are generated. Only when the action is more, this parameter is needed.
Example:
;
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/aliases/ddl?action=create" payload := strings.NewReader("{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\",\"objects\":[{\"schema\":\"ALIAS_SCHEMA\",\"name\":\"ALIAS_NAME\",\"base_schema\":\"TABLE_SCHEMA\",\"base_name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\",\"objects\":[{\"schema\":\"ALIAS_SCHEMA\",\"name\":\"ALIAS_NAME\",\"base_schema\":\"TABLE_SCHEMA\",\"base_name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/aliases/ddl?action=create") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/aliases/ddl?action=create", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ base_obj_schema: 'SYSCAT', base_obj_name: 'TABLES', alias_name: 'ALIAS_NAME', alias_schema: 'ALIAS_SCHEMA', objects: [ { schema: 'ALIAS_SCHEMA', name: 'ALIAS_NAME', base_schema: 'TABLE_SCHEMA', base_name: 'TABLE_NAME' } ], options: [{}], stat_terminator: ';' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"base_obj_schema\":\"SYSCAT\",\"base_obj_name\":\"TABLES\",\"alias_name\":\"ALIAS_NAME\",\"alias_schema\":\"ALIAS_SCHEMA\",\"objects\":[{\"schema\":\"ALIAS_SCHEMA\",\"name\":\"ALIAS_NAME\",\"base_schema\":\"TABLE_SCHEMA\",\"base_name\":\"TABLE_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/aliases/ddl?action=create", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/aliases/ddl?action=create' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"base_obj_schema":"SYSCAT","base_obj_name":"TABLES","alias_name":"ALIAS_NAME","alias_schema":"ALIAS_SCHEMA","objects":[{"schema":"ALIAS_SCHEMA","name":"ALIAS_NAME","base_schema":"TABLE_SCHEMA","base_name":"TABLE_NAME"}],"options":[{}],"stat_terminator":";"}'
Request
Path Parameters
Schema name of the object.
Alias name.
Query Parameters
The amount of return records.
Default:
1000
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/data?rows_return=10" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/data?rows_return=10") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/data?rows_return=10", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/data?rows_return=10", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSPUBLIC/aliases/DUAL/data?rows_return=10' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get the SQL statement template for creating MQT table
Get the SQL statement template for creating MQT table.
POST /admin/mqts/ddl
Request
Query Parameters
Allowable values: [
create
,more
]
Schema name of the object. Only When the action is create, this parameter is needed.
Example:
schemaName
Only when the action is more, this parameter is needed.
- objects
Schema name of the object.
Example:
MQT_SCHEMA
Unqualified name of the object.
Example:
MQT_NAME
The options used to generate DDL. Select 0 or one or several options. Only when the action is more, this parameter is needed. - create = Generates DDL statements with the CREATE OR REPLACE clause. - creatorname:creatorID = Generates DDL statements for objects that were created with the specified creator ID. - depobj = Generates the basic DDL statements - view = Generate the CREATE VIEW DDL statements - privilege = Generate the authorization DDL statements such as GRANT statements.
Examples:[ "create", { "creatorname": "creatorID" }, "depobj", "view", "privilege" ]
Specifies the statement delimiter for SQL statements that are generated. Only when the action is more, this parameter is needed.
Example:
;
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE" payload := strings.NewReader("{\"schema\":\"schemaName\",\"objects\":[{\"schema\":\"MQT_SCHEMA\",\"name\":\"MQT_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"schemaName\",\"objects\":[{\"schema\":\"MQT_SCHEMA\",\"name\":\"MQT_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ schema: 'schemaName', objects: [{schema: 'MQT_SCHEMA', name: 'MQT_NAME'}], options: [{}], stat_terminator: ';' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"schemaName\",\"objects\":[{\"schema\":\"MQT_SCHEMA\",\"name\":\"MQT_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/mqts/ddl?action=SOME_STRING_VALUE' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"schemaName","objects":[{"schema":"MQT_SCHEMA","name":"MQT_NAME"}],"options":[{}],"stat_terminator":";"}'
Request
Example:
schemaName
Example:
mqtName
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/mqts" payload := strings.NewReader("[{\"schema\":\"schemaName\",\"mqt\":\"mqtName\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"schemaName\",\"mqt\":\"mqtName\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/mqts") .delete(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/mqts", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'schemaName', mqt: 'mqtName'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"schemaName\",\"mqt\":\"mqtName\"}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/mqts", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/mqts -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"schemaName","mqt":"mqtName"}]'
Get the definition of MQT table
Get the definition of MQT table.
GET /admin/schemas/{schema_name}/mqts/{mqt_name}/definition
Request
Path Parameters
Schema name
mqt name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/definition" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/definition") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/definition", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/definition", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/definition -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get the data of specified mqt table
Get the data of specified mqt table.
GET /admin/schemas/{schema_name}/mqts/{mqt_name}/data
Request
Path Parameters
Query Parameters
Default:
1000
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?rows_return=10" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?rows_return=10") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?rows_return=10", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?rows_return=10", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/schemas/DB2GSE/mqts/GSE_SRS_REPLICATED_AST/data?rows_return=10' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get authentications through the authid filter
Get authentications through the authid filter
GET /admin/privileges/authentications
Request
Query Parameters
0 means return all query results
Default:
0
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/authentications?rows_return=10&authid=PUBLIC" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/authentications?rows_return=10&authid=PUBLIC") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/authentications?rows_return=10&authid=PUBLIC", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/privileges/authentications?rows_return=10&authid=PUBLIC", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/privileges/authentications?rows_return=10&authid=PUBLIC' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get the privieles of auth id
Get the privieles of auth id
GET /admin/privileges/{authid_type}/{authid}/{obj_type}
Request
Path Parameters
authid type
Allowable values: [
GROUP
,USER
,ROLE
]Authorization id.
Type of object
Allowable values: [
VIEW
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,TABLESPACE
]
Query Parameters
Default:
1000
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/GROUP/PUBLIC/VIEW?rows_return=10" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/GROUP/PUBLIC/VIEW?rows_return=10") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/GROUP/PUBLIC/VIEW?rows_return=10", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/privileges/GROUP/PUBLIC/VIEW?rows_return=10", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/privileges/GROUP/PUBLIC/VIEW?rows_return=10' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get SQL statement of grant or revoke privileges
Get SQL statement of grant or revoke privileges
POST /admin/privileges/dcl
Request
Example:
SYSCAT
Example:
TABLES
Allowable values: [
VIEW
,SCHEMA
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,INDEX
,TABLESPACE
]Example:
VIEW
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/dcl" payload := strings.NewReader("[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/dcl") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/dcl", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([ { schema: 'SYSCAT', obj_name: 'TABLES', obj_type: 'VIEW', grantee: {authid: 'PUBLIC', authid_type: 'GROUP'}, grant: ['select'], revoke: ['insert'] } ])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/privileges/dcl", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/admin/privileges/dcl -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"SYSCAT","obj_name":"TABLES","obj_type":"VIEW","grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["select"],"revoke":["insert"]}]'
Request
Example:
authid
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles" payload := strings.NewReader("{\"authid\":\"authid\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"authid\":\"authid\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/roles") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/roles", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({authid: 'authid'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"authid\":\"authid\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/privileges/roles", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/admin/privileges/roles -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"authid":"authid"}'
Grant or revoke the privilges of role
Grant or revoke the privilges of role
PUT /admin/privileges/roles
Request
- privileges
Example:
SYSCAT
Example:
TABLES
Allowable values: [
VIEW
,SCHEMA
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,INDEX
,TABLESPACE
]Example:
VIEW
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles" payload := strings.NewReader("{\"stop_on_error\":false,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"stop_on_error\":false,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/roles") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/roles", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ stop_on_error: false, privileges: [ { schema: 'SYSCAT', obj_name: 'TABLES', obj_type: 'VIEW', grantee: {authid: 'PUBLIC', authid_type: 'GROUP'}, grant: ['select'], revoke: ['insert'] } ] })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"stop_on_error\":false,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/admin/privileges/roles", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/admin/privileges/roles -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"stop_on_error":false,"privileges":[{"schema":"SYSCAT","obj_name":"TABLES","obj_type":"VIEW","grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["select"],"revoke":["insert"]}]}'
Request
Path Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/roleName" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/roleName") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/roles/roleName", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/privileges/roles/roleName", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/roleName -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get the membership of authid
Get the membership of authid
GET /admin/privileges/roles/{authid_type}/{authid}
Request
Path Parameters
authid type
Allowable values: [
USER
,GROUP
,ROLE
]authid
Query Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/GROUP/PUBLIC?rows_return=10" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/GROUP/PUBLIC?rows_return=10") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/roles/GROUP/PUBLIC?rows_return=10", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/privileges/roles/GROUP/PUBLIC?rows_return=10", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/GROUP/PUBLIC?rows_return=10' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get SQL statement of grant or revoke role
Get SQL statement of grant or revoke role
POST /admin/privileges/roles/dcl
Request
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/dcl" payload := strings.NewReader("[{\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"<ADD STRING VALUE>\"],\"revoke\":[\"<ADD STRING VALUE>\"]}]") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"<ADD STRING VALUE>\"],\"revoke\":[\"<ADD STRING VALUE>\"]}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/dcl") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/roles/dcl", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([ { grantee: {authid: 'PUBLIC', authid_type: 'GROUP'}, grant: ['<ADD STRING VALUE>'], revoke: ['<ADD STRING VALUE>'] } ])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"<ADD STRING VALUE>\"],\"revoke\":[\"<ADD STRING VALUE>\"]}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/privileges/roles/dcl", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/admin/privileges/roles/dcl -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["<ADD STRING VALUE>"],"revoke":["<ADD STRING VALUE>"]}]'
Get SQL statement for grant or revoke privileges
Get SQL statement for grant or revoke privileges
POST /admin/privileges/multiple_objtypes/dcl
Request
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
- privileges
Allowable values: [
VIEW
,SCHEMA
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,INDEX
,TABLESPACE
]- objects
Example:
SYSCAT
Example:
TABLES
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes/dcl" payload := strings.NewReader("{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}]}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes/dcl") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/multiple_objtypes/dcl", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}], privileges: [ { obj_type: 'VIEW', grant: ['select'], objects: [{schema: 'SYSCAT', obj_name: 'TABLES', specific_name: '<ADD STRING VALUE>'}] } ] })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/privileges/multiple_objtypes/dcl", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes/dcl -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"privileges":[{"obj_type":"VIEW","grant":["select"],"objects":[{"schema":"SYSCAT","obj_name":"TABLES","specific_name":"<ADD STRING VALUE>"}]}]}'
Grant or revole privileges for multiple objects and objects type
Grant or revole privileges for multiple objects and objects type
PUT /admin/privileges/multiple_objtypes
Request
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
- privileges
Allowable values: [
VIEW
,SCHEMA
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,INDEX
,TABLESPACE
]- objects
Example:
SYSCAT
Example:
TABLES
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes" payload := strings.NewReader("{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}],\"stop_on_error\":false}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}],\"stop_on_error\":false}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/multiple_objtypes", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}], privileges: [ { obj_type: 'VIEW', grant: ['select'], objects: [{schema: 'SYSCAT', obj_name: 'TABLES', specific_name: '<ADD STRING VALUE>'}] } ], stop_on_error: false })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"privileges\":[{\"obj_type\":\"VIEW\",\"grant\":[\"select\"],\"objects\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"specific_name\":\"<ADD STRING VALUE>\"}]}],\"stop_on_error\":false}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/admin/privileges/multiple_objtypes", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_objtypes -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"privileges":[{"obj_type":"VIEW","grant":["select"],"objects":[{"schema":"SYSCAT","obj_name":"TABLES","specific_name":"<ADD STRING VALUE>"}]}],"stop_on_error":false}'
Get the SQL statement for grant or revoke multiple roles
Get the SQL statement for grant or revoke multiple roles
POST /admin/privileges/multiple_roles/dcl
Request
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles/dcl" payload := strings.NewReader("[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}]") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles/dcl") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/multiple_roles/dcl", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([ { grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}], grant: ['SYSTS_USR'], revoke: ['SYSTS_USR'] } ])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/privileges/multiple_roles/dcl", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles/dcl -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"grant":["SYSTS_USR"],"revoke":["SYSTS_USR"]}]'
Request
- privileges
- grantee
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles" payload := strings.NewReader("{\"privileges\":[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}],\"stop_on_error\":false}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"privileges\":[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}],\"stop_on_error\":false}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/privileges/multiple_roles", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ privileges: [ { grantee: [{authid: 'PUBLIC', authid_type: 'GROUP'}], grant: ['SYSTS_USR'], revoke: ['SYSTS_USR'] } ], stop_on_error: false })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"privileges\":[{\"grantee\":[{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"}],\"grant\":[\"SYSTS_USR\"],\"revoke\":[\"SYSTS_USR\"]}],\"stop_on_error\":false}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/admin/privileges/multiple_roles", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/admin/privileges/multiple_roles -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"privileges":[{"grantee":[{"authid":"PUBLIC","authid_type":"GROUP"}],"grant":["SYSTS_USR"],"revoke":["SYSTS_USR"]}],"stop_on_error":false}'
Request
Query Parameters
Type of operation.
Allowable values: [
create
]
Type of the connection attribute.
Allowable values: [
GetWorkloadDDLTemplate
,GetWorkloadDDLBySessionAuthID
,GetWorkloadDDLByApplName
,GetWorkloadDDLByClientIPAddr
,GetWorkloadDDLBySystemAuthID
,GetWorkloadDDLByClientUserID
,GetWorkloadDDLByClientApplName
,GetWorkloadDDLByClientWrkstnname
,GetWorkloadDDLByClientAcctng
]Example:
GetWorkloadDDLTemplate
Enable collect activity data or not.
Example:
true
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/workloads/ddl?action=create" payload := strings.NewReader("{\"categorization\":\"GetWorkloadDDLTemplate\",\"enable_coll_act_data\":true}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"categorization\":\"GetWorkloadDDLTemplate\",\"enable_coll_act_data\":true}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/workloads/ddl?action=create") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/workloads/ddl?action=create", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({categorization: 'GetWorkloadDDLTemplate', enable_coll_act_data: true})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"categorization\":\"GetWorkloadDDLTemplate\",\"enable_coll_act_data\":true}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/workloads/ddl?action=create", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/workloads/ddl?action=create' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"categorization":"GetWorkloadDDLTemplate","enable_coll_act_data":true}'
Request
Query Parameters
The amount of return records.
Default:
1000
Workload name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/workloads?rows_return=10&search_name=SEARCH_NAME" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/workloads?rows_return=10&search_name=SEARCH_NAME") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/workloads?rows_return=10&search_name=SEARCH_NAME", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/workloads?rows_return=10&search_name=SEARCH_NAME", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/workloads?rows_return=10&search_name=SEARCH_NAME' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Identifier for the workload.
Name of the workload.
Type of the connection attribute. 1 = APPLNAME 2 = SYSTEM_USER 3 = SESSION_USER 4 = SESSION_USER GROUP 5 = SESSION_USER ROLE 6 = CURRENT CLIENT_USERID 7 = CURRENT CLIENT_APPLNAME 8 = CURRENT CLIENT_WRKSTNNAME 9 = CURRENT CLIENT_ACCTNG 10 = ADDRESS
Value of the connection attribute.
Specifies what activity data should be collected by the applicable event monitor. D = Activity data with details N = None S = Activity data with details and section environment V = Activity data with details and values. Applies when the COLLECT column is set to 'C' W = Activity data without details X = Activity data with details, section environment, and values
Specifies what activity data should be collected by the applicable event monitor. D = Activity data with details N = None S = Activity data with details and section environment V = Activity data with details and values. Applies when the COLLECT column is set to 'C' W = Activity data without details X = Activity data with details, section environment, and values
Status Code
Return the list of workloads
Error payload
No Sample Response
Request
Example:
SEQUENCE_SCHEMA
Example:
SEQUENCE_NAME
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/sequences" payload := strings.NewReader("[{\"schema\":\"SEQUENCE_SCHEMA\",\"sequence\":\"SEQUENCE_NAME\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"SEQUENCE_SCHEMA\",\"sequence\":\"SEQUENCE_NAME\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/sequences") .delete(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/sequences", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'SEQUENCE_SCHEMA', sequence: 'SEQUENCE_NAME'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"SEQUENCE_SCHEMA\",\"sequence\":\"SEQUENCE_NAME\"}]" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/sequences", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/sequences -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"SEQUENCE_SCHEMA","sequence":"SEQUENCE_NAME"}]'
Request
The schema name of procedure.
Example:
PROCEDURE_SCHEMA
The specific name of procedure.
Example:
PROCEDURE_NAME
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/procedures" payload := strings.NewReader("[{\"schema\":\"PROCEDURE_SCHEMA\",\"procedure\":\"PROCEDURE_NAME\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"PROCEDURE_SCHEMA\",\"procedure\":\"PROCEDURE_NAME\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/procedures") .delete(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/procedures", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'PROCEDURE_SCHEMA', procedure: 'PROCEDURE_NAME'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"PROCEDURE_SCHEMA\",\"procedure\":\"PROCEDURE_NAME\"}]" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/procedures", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/procedures -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"PROCEDURE_SCHEMA","procedure":"PROCEDURE_NAME"}]'
Retrieve parameters for procedure
Retrieve parameters for procedure.
GET /admin/schemas/{schema_name}/procedures/{specific_name}/parameters
Request
Path Parameters
The schema name of the procedure
The specificname of procedure
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/PROCEDURE_SCHEMA/procedures/PROCEDURE_NAME/parameters -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the parameter.
Unqualified name of the data type.
Length of the data type.
Scale if the data type is DECIMAL.
Row type of the data type.
Whether the aramater is passed in the form of a locator or not.
Status Code
Retrieve parameters for procedure.
Error information when get procedure parameters.
SQLException
SQLException
Error payload
No Sample Response
Request
Query Parameters
Allowable values: [
create
]
The schema name of procedure.
Example:
PROCEDURE_SCHEMA
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/procedures/ddl?action=create" payload := strings.NewReader("{\"schema\":\"PROCEDURE_SCHEMA\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"PROCEDURE_SCHEMA\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/procedures/ddl?action=create") .post(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/procedures/ddl?action=create", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({schema: 'PROCEDURE_SCHEMA'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"PROCEDURE_SCHEMA\"}" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/procedures/ddl?action=create", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/procedures/ddl?action=create' -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"PROCEDURE_SCHEMA"}'
Request
The schema name of function.
Example:
UDT_SCHEMA
The specific name of function.
Example:
UDT_NAME
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/functions" payload := strings.NewReader("[{\"schema\":\"UDT_SCHEMA\",\"function\":\"UDT_NAME\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"UDT_SCHEMA\",\"function\":\"UDT_NAME\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/functions") .delete(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/functions", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'UDT_SCHEMA', function: 'UDT_NAME'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"UDT_SCHEMA\",\"function\":\"UDT_NAME\"}]" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/functions", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/functions -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"UDT_SCHEMA","function":"UDT_NAME"}]'
Retrieve parameters for specific udf
Retrieve parameters for specific udf.
GET /admin/schemas/{schema_name}/functions/{specific_name}/parameters
Request
Path Parameters
The schema name of the function.
The specific name of function.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/UDF_SCHEMA/functions/UDF_NAME/parameters" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/UDF_SCHEMA/functions/UDF_NAME/parameters") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/UDF_SCHEMA/functions/UDF_NAME/parameters", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/UDF_SCHEMA/functions/UDF_NAME/parameters", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/UDF_SCHEMA/functions/UDF_NAME/parameters -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Name of the parameter.
Unqualified name of the data type.
Length of the data type.
Scale if the data type is DECIMAL.
Row type of the data type.
Whether the aramater is passed in the form of a locator or not.
Status Code
Retrieve parameters for specific udf.
Error information when get procedure parameters
SQLException
SQLException
Error payload
No Sample Response
Request
Query Parameters
Allowable values: [
create
]
The schema name of function.
Example:
UDF_SCHEMA
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/functions/ddl?action=create" payload := strings.NewReader("{\"schema\":\"UDF_SCHEMA\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"UDF_SCHEMA\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/functions/ddl?action=create") .post(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/functions/ddl?action=create", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({schema: 'UDF_SCHEMA'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"UDF_SCHEMA\"}" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/functions/ddl?action=create", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/functions/ddl?action=create' -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"UDF_SCHEMA"}'
Request
Schema name of UDT.
Example:
UDT_SCHEMA
Name of UDT.
Example:
UDT_NAME
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/udts" payload := strings.NewReader("[{\"schema\":\"UDT_SCHEMA\",\"udt\":\"UDT_NAME\"}]") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"UDT_SCHEMA\",\"udt\":\"UDT_NAME\"}]"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/udts") .delete(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/udts", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify([{schema: 'UDT_SCHEMA', udt: 'UDT_NAME'}])); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "[{\"schema\":\"UDT_SCHEMA\",\"udt\":\"UDT_NAME\"}]" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/udts", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/udts -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '[{"schema":"UDT_SCHEMA","udt":"UDT_NAME"}]'
Retrieve row definition for User-defined Type object
Retrieve row definition for User-defined Type object
GET /admin/schemas/{schema_name}/udts/{udt_name}/definition
Request
Path Parameters
The schema name of User-defined Type.
The name of User-defined Type.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/UDT_SCHEMA/udts/UDT_NAME/definition" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/UDT_SCHEMA/udts/UDT_NAME/definition") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/schemas/UDT_SCHEMA/udts/UDT_NAME/definition", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/schemas/UDT_SCHEMA/udts/UDT_NAME/definition", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/schemas/UDT_SCHEMA/udts/UDT_NAME/definition -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Field name.
Unqualified name of the data type of the field.
Attribute name.
Unqualified name of the data type of an attribute.
Position of the field in the definition of the data type, starting with 0.
Length of the data type.
For decimal types, contains the scale of the data type.
Schema name of the data type.
Status Code
Retrieve row definition for User-defined Type object.
Not authorized.
Schema or alias not found.
Error payload
No Sample Response
Generate Create User-defined Types template
Generate Create User-defined Types template.
POST /admin/udts/ddl
Request
Query Parameters
Type of operation.
Allowable values: [
create
]
Schema name of UDT.
Example:
UDT_SCHEMA
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/udts/ddl?action=create" payload := strings.NewReader("{\"schema\":\"UDT_SCHEMA\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"UDT_SCHEMA\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/udts/ddl?action=create") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/udts/ddl?action=create", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({schema: 'UDT_SCHEMA'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"UDT_SCHEMA\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/admin/udts/ddl?action=create", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST 'https://{HOSTNAME}/dbapi/v4/admin/udts/ddl?action=create' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"UDT_SCHEMA"}'
Request
Query Parameters
Tablespace name.
The amount of return records.
Default:
500
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces?search_name=SYSCATSPACE&rows_return=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tablespaces?search_name=SYSCATSPACE&rows_return=50") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tablespaces?search_name=SYSCATSPACE&rows_return=50", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/tablespaces?search_name=SYSCATSPACE&rows_return=50", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/admin/tablespaces?search_name=SYSCATSPACE&rows_return=50' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
Tablespace name.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces" payload := strings.NewReader("{\"tablespaces\":[\"TBSTEST\"]}") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") 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, "{\"tablespaces\":[\"TBSTEST\"]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tablespaces") .delete(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tablespaces", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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({tablespaces: ['TBSTEST']})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"tablespaces\":[\"TBSTEST\"]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/admin/tablespaces", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/admin/tablespaces -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"tablespaces":["TBSTEST"]}'
Get the I/O settings of the tablespace
Get the I/O settings of the tablespace.
GET /admin/tablespaces/{tablespace}/iosetting
Request
Path Parameters
Tablespace name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/iosetting" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/iosetting") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tablespaces/SYSCATSPACE/iosetting", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/tablespaces/SYSCATSPACE/iosetting", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/iosetting -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
File system caching.
Example:
File system caching
Controller overhead and disk seek and latency time, in milliseconds (average for the containers in this table space).
Example:
INHERIT
Time to read one page of size PAGESIZE into the buffer (average for the containers in this table space).
Example:
INHERIT
A tag to identify data stored in this table space.
Example:
INHERIT
Status Code
Get the I/O settings of the tablespace.
Not authorized.
Error payload
No Sample Response
Request
Path Parameters
Tablespace name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/size" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/size") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/admin/tablespaces/SYSCATSPACE/size", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/admin/tablespaces/SYSCATSPACE/size", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/admin/tablespaces/SYSCATSPACE/size -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
File system caching.
Example:
File system caching
Controller overhead and disk seek and latency time, in milliseconds (average for the containers in this table space).
Example:
INHERIT
Time to read one page of size PAGESIZE into the buffer (average for the containers in this table space).
Example:
INHERIT
A tag to identify data stored in this table space.
Example:
INHERIT
Status Code
Get the tablespace size.
Not authorized.
Error payload
No Sample Response
Generate visual explain model for a given sql
Generate visual explain model for a given sql.
POST /explain/explain_model
Request
The SQL query to be explained.
The query's schema.
Example:
sysibm
The SQL query to be explained.
Example:
select * from sysibm.systables where name ='a'
The connection profile name, it must be specified for multiple db model.
Show recommendations for smart alert in visual explain, default is false.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/explain/explain_model" payload := strings.NewReader("{\"schema\":\"sysibm\",\"sql\":\"select * from sysibm.systables where name ='a'\",\"profileName\":\"<ADD STRING VALUE>\",\"showRecomm\":false}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"sysibm\",\"sql\":\"select * from sysibm.systables where name ='a'\",\"profileName\":\"<ADD STRING VALUE>\",\"showRecomm\":false}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/explain/explain_model") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/explain/explain_model", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ schema: 'sysibm', sql: 'select * from sysibm.systables where name =\'a\'', profileName: '<ADD STRING VALUE>', showRecomm: false })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"schema\":\"sysibm\",\"sql\":\"select * from sysibm.systables where name ='a'\",\"profileName\":\"<ADD STRING VALUE>\",\"showRecomm\":false}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/explain/explain_model", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/explain/explain_model -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"schema":"sysibm","sql":"select * from sysibm.systables where name ='\''a'\''","profileName":"<ADD STRING VALUE>","showRecomm":false}'
Get visual explain nodes information
Get visual explain nodes including id and label information.
GET /explain/explain_model/{sessionId}/diagram/nodes/
Request
Path Parameters
The session id that used to generate the basic node information of visual explain.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/ -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
todo
List of node id
List of node labels in visual explain.
List of node cost labels or schema labels in visual explain.
Session id that used to generate the visual explain.
The information for creating optimization profile, just used for Enterprise
Status Code
Return the ids and labels in visual explain
Invalid parameters or invalid content type
Error payload
No Sample Response
Generate visual explain layout
Generate visual explain laytout.
POST /explain/explain_model/{sessionId}/diagram/layout
Request
Path Parameters
The session id that used to generate the basic node information of visual explain.
The ids and labels and their height and width of font that used to generate the layout of visual explain.
The width of view port which the graph is displayed inside.
The height of id label
The skeleton of visual explain
- ids
The text of label
The width of label
The height of label
List of node labels in visual explain.
- label1s
The text of label
The width of label
List of node cost labels or schema labels and the text width in visual explain.
- label2s
The text of label
The width of label
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/layout" payload := strings.NewReader("{\"containerWidth\":0,\"idFontHeight\":0,\"ids\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}],\"label1FontHeight\":0,\"label1s\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}],\"label2s\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}]}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") 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, "{\"containerWidth\":0,\"idFontHeight\":0,\"ids\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}],\"label1FontHeight\":0,\"label1s\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}],\"label2s\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/layout") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/explain/explain_model/{sessionId}/diagram/layout", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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({ containerWidth: 0, idFontHeight: 0, ids: [{text: '<ADD STRING VALUE>', width: 0}], label1FontHeight: 0, label1s: [{text: '<ADD STRING VALUE>', width: 0}], label2s: [{text: '<ADD STRING VALUE>', width: 0}] })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"containerWidth\":0,\"idFontHeight\":0,\"ids\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}],\"label1FontHeight\":0,\"label1s\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}],\"label2s\":[{\"text\":\"<ADD STRING VALUE>\",\"width\":0}]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/explain/explain_model/{sessionId}/diagram/layout", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/layout -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"containerWidth":0,"idFontHeight":0,"ids":[{"text":"<ADD STRING VALUE>","width":0}],"label1FontHeight":0,"label1s":[{"text":"<ADD STRING VALUE>","width":0}],"label2s":[{"text":"<ADD STRING VALUE>","width":0}]}'
Response
The laytout information of visual explain
The advanced search criterias
The platform of Db2
The version for Db2
The explain warning message
List of diagram information in visual explain.
The explain options
The explain time
The recommendation advisor with the related node
The recommendation advisor with the related node
Session id that is used to generate the visual explain.
The explained sql
The PLAN_TABLE view, only for Db2 for z/OS
The tabular view for the access plan, only for Db2 LUW
The tree view for the access plan, only for Db2 LUW
Status Code
Return the layout information in visual explain
Invalid parameters or invalid content type
Error payload
No Sample Response
Get the data of the selected node
Get the data of the selected node
GET /explain/explain_model/{sessionId}/diagram/nodes/{nodeId}/description
Request
Path Parameters
The session id that used to get the node description of visual explain.
The node id that used to get the node description of visual explain.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/{nodeId}/description" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/{nodeId}/description") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/{nodeId}/description", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/{nodeId}/description", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/explain/explain_model/{sessionId}/diagram/nodes/{nodeId}/description -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Search node based on the key word and predefined rule
Search node based on the key word and predefined rule
GET /explain/explain_model/search/{sessionId}/{namePattern}
Request
Path Parameters
The session id that used to get the node description of visual explain.
The key word to search node.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/explain/explain_model/search/{sessionId}/{namePattern}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/explain/explain_model/search/{sessionId}/{namePattern}") .get() .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/explain/explain_model/search/{sessionId}/{namePattern}", "headers": { "content-type": "application/json" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json" } conn.request("GET", "/dbapi/v4/explain/explain_model/search/{sessionId}/{namePattern}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/explain/explain_model/search/{sessionId}/{namePattern} -H 'content-type: application/json'
Response
The description of the selected node in the visual explain
The total cost type
todo
- entries
Total cost
todo
Node id
Node name
The query block index, for Db2 LUW, it is always 0
The query block Name, for Db2 LUW, it is always Query
Status Code
Return the list of nodes
Error payload
No Sample Response
Search node based on the key word and predefined rule
Search node based on the key word and predefined rule
POST /explain/explain_model/search/{sessionId}
Request
Path Parameters
The session id that used to get the node description of visual explain.
The key word and predefined rule to search node
The advanced search predefined rule
- advanacedSearchRequests
The predefined rule
Allowable values: [
COMMON.SEARCHBY.NODE_NAME
,COMMON.SEARCHBY.FILTER_FACTOR_MORE
,COMMON.SEARCHBY.FILTER_FACTOR_LESS
,COMMON.SEARCHBY.CARDINALITY_MORE
,COMMON.SEARCHBY.CARDINALITY_LESS
,COMMON.SEARCHBY.OUTPUT_ROWS
,COMMON.SEARCHBY.RESIDUAL
,COMMON.SEARCHBY.SARGABLE
,COMMON.SEARCHBY.UNMATCHED_IXSCAN
,COMMON.SEARCHBY.NLJOIN_INNER
,COMMON.SEARCHBY.LIST_PREFETCH
,COMMON.SEARCHBY.INDEX_ONLY
,COMMON.SEARCHBY.TABLES
,COMMON.SEARCHBY.TABLES_INDEXES
,COMMON.SEARCHBY.TBSCAN
,COMMON.SEARCHBY.IXSCAN
,COMMON.SEARCHBY.NLJOIN
,COMMON.SEARCHBY.HSJOIN
,COMMON.SEARCHBY.HBJOIN
,COMMON.SEARCHBY.STARJOIN
,COMMON.SEARCHBY.MSJOIN
,COMMON.SEARCHBY.COST
,COMMON.SEARCHBY.CPU
,COMMON.SEARCHBY.IO
,COMMON.SEARCHBY.COST_PCT
,COMMON.SEARCHBY.CPU_PCT
,COMMON.SEARCHBY.IO_PCT
,COMMON.SEARCHBY.CARDINALITY_PCT
,COMMON.SEARCHBY.ZZJOIN
,COMMON.SEARCHBY.IXAND
,COMMON.SEARCHBY.IXOR
]
The key word to search node
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/explain/explain_model/search/{sessionId}" payload := strings.NewReader("{\"advanacedSearchRequests\":[{\"type\":\"COMMON.SEARCHBY.NODE_NAME\"}],\"namePattern\":\"<ADD STRING VALUE>\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") 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, "{\"advanacedSearchRequests\":[{\"type\":\"COMMON.SEARCHBY.NODE_NAME\"}],\"namePattern\":\"<ADD STRING VALUE>\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/explain/explain_model/search/{sessionId}") .post(body) .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/explain/explain_model/search/{sessionId}", "headers": { "content-type": "application/json" } }; 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({ advanacedSearchRequests: [{type: 'COMMON.SEARCHBY.NODE_NAME'}], namePattern: '<ADD STRING VALUE>' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"advanacedSearchRequests\":[{\"type\":\"COMMON.SEARCHBY.NODE_NAME\"}],\"namePattern\":\"<ADD STRING VALUE>\"}" headers = { 'content-type': "application/json" } conn.request("POST", "/dbapi/v4/explain/explain_model/search/{sessionId}", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/explain/explain_model/search/{sessionId} -H 'content-type: application/json' -d '{"advanacedSearchRequests":[{"type":"COMMON.SEARCHBY.NODE_NAME"}],"namePattern":"<ADD STRING VALUE>"}'
Response
The description of the selected node in the visual explain
The total cost type
todo
- entries
Total cost
todo
Node id
Node name
The query block index, for Db2 LUW, it is always 0
The query block Name, for Db2 LUW, it is always Query
Status Code
Return the list of nodes
Error payload
No Sample Response
Returns metadata of an item in the user's home storage
Returns metadata of an item files and folders stored in the user's home storage. Only support file with suffix '.csv','.txt','dat' and 'del'.
GET /home/{path}
Request
Path Parameters
Path of a file or folder
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/home/{path}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/home/{path}") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/home/{path}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/home/{path}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/home/{path} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
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
- contents
Relative URL path for this file or folder.
Size in bytes. The size of a folder will be -1.
Status Code
Metadata about a file or folder
File or folder not found
Error payload
No Sample Response
Deletes a file in the user's home storage
Deletes a file in the user's home storage
DELETE /home/{path}
Request
Path Parameters
File path
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/home/{path}" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/home/{path}") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/home/{path}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/home/{path}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/home/{path} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Download file from user's home storage
Download file from user's home storage.
GET /home_content/{path}
Request
Custom Headers
Allowable values: [
application/json
,application/octet-stream
]
Path Parameters
File path
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/home_content/{path}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/octet-stream") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/home_content/{path}") .get() .addHeader("content-type", "application/octet-stream") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/home_content/{path}", "headers": { "content-type": "application/octet-stream", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/octet-stream", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/home_content/{path}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/home_content/{path} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/octet-stream'
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
- contents
Relative URL path for this file or folder.
Size in bytes. The size of a folder will be -1.
Status Code
Metadata about a file or folder
File not found
Error payload
No Sample Response
Uploads a file to the user's home storage
Uploads a file to a folder under the user's home storage. The target folder is automatically created if it does not exit.
POST /home_content/{path}
Request
Path Parameters
Target folder
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/home_content/{path}" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/home_content/{path}") .post(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/home_content/{path}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/home_content/{path}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/home_content/{path} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
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
- contents
Relative URL path for this file or folder.
Size in bytes. The size of a folder will be -1.
Status Code
Files successfully uploaded
Error payload
No Sample Response
Retrieves current configuration
Returns current encryption key information.
GET /platform-keys/configurations
Request
Query Parameters
Cloud Resource Name (CRN) for db2 instance.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/platform-keys/configurations?db2_crn=SOME_STRING_VALUE" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/platform-keys/configurations?db2_crn=SOME_STRING_VALUE") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/platform-keys/configurations?db2_crn=SOME_STRING_VALUE", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/platform-keys/configurations?db2_crn=SOME_STRING_VALUE", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/platform-keys/configurations?db2_crn=SOME_STRING_VALUE' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Type of key store
Key Protect instance
Key Protect key
If true migration is allowed
Possible values: [
MIGRATION_IN_PROGRESS
,MIGRATION_FAILED
,MIGRATED
,NOT_MIGRATED
]
Status Code
Platform key current configuration
Bad request
Unauthorized
Forbidden, Db2 does not have access to the migrated key.
Internal Server Error
No Sample Response
Migrate key
Migrate existing key, from local key to Key Proect key or from one Key Protect key to another
POST /platform-keys/configurations
Request
key information
- kpInstance
ID of Key Protect instance
Name of Key Protect instance
Region of Key Protect instance
- kpKey
ID of Key Protect key
Name of Key Protect key
Cloud resource name of Db2 instance
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/platform-keys/configurations" payload := strings.NewReader("{\"kpInstance\":{\"kpInstanceID\":\"<ADD STRING VALUE>\",\"kpInstanceName\":\"<ADD STRING VALUE>\",\"kpRegion\":\"<ADD STRING VALUE>\"},\"kpKey\":{\"kpKeyID\":\"<ADD STRING VALUE>\",\"kpKeyName\":\"<ADD STRING VALUE>\"},\"db2CRN\":\"<ADD STRING VALUE>\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") 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, "{\"kpInstance\":{\"kpInstanceID\":\"<ADD STRING VALUE>\",\"kpInstanceName\":\"<ADD STRING VALUE>\",\"kpRegion\":\"<ADD STRING VALUE>\"},\"kpKey\":{\"kpKeyID\":\"<ADD STRING VALUE>\",\"kpKeyName\":\"<ADD STRING VALUE>\"},\"db2CRN\":\"<ADD STRING VALUE>\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/platform-keys/configurations") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/platform-keys/configurations", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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({ kpInstance: { kpInstanceID: '<ADD STRING VALUE>', kpInstanceName: '<ADD STRING VALUE>', kpRegion: '<ADD STRING VALUE>' }, kpKey: {kpKeyID: '<ADD STRING VALUE>', kpKeyName: '<ADD STRING VALUE>'}, db2CRN: '<ADD STRING VALUE>' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"kpInstance\":{\"kpInstanceID\":\"<ADD STRING VALUE>\",\"kpInstanceName\":\"<ADD STRING VALUE>\",\"kpRegion\":\"<ADD STRING VALUE>\"},\"kpKey\":{\"kpKeyID\":\"<ADD STRING VALUE>\",\"kpKeyName\":\"<ADD STRING VALUE>\"},\"db2CRN\":\"<ADD STRING VALUE>\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/platform-keys/configurations", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/platform-keys/configurations -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"kpInstance":{"kpInstanceID":"<ADD STRING VALUE>","kpInstanceName":"<ADD STRING VALUE>","kpRegion":"<ADD STRING VALUE>"},"kpKey":{"kpKeyID":"<ADD STRING VALUE>","kpKeyName":"<ADD STRING VALUE>"},"db2CRN":"<ADD STRING VALUE>"}'
Response
Type of key store
Key Protect instance
Key Protect key
If true migration is allowed
Possible values: [
MIGRATION_IN_PROGRESS
,MIGRATION_FAILED
,MIGRATED
,NOT_MIGRATED
]
Status Code
Key migrated
Bad request
Unauthorized
Forbidden, user has no permission for this API.
Internal Server Error
No Sample Response
Returns Key Protect instance information
Returns Key Protect instance information.
GET /platform-keys/instances
Request
Query Parameters
Cloud Resource Name (CRN) for db2 instance.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/platform-keys/instances?db2_crn=SOME_STRING_VALUE" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/platform-keys/instances?db2_crn=SOME_STRING_VALUE") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/platform-keys/instances?db2_crn=SOME_STRING_VALUE", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/platform-keys/instances?db2_crn=SOME_STRING_VALUE", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/platform-keys/instances?db2_crn=SOME_STRING_VALUE' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Returns keys for given Key Protect instance
Returns keys for given Key Protect instance
GET /platform-keys/instances/{instance_id}/region/{region_id}/keys
Request
Path Parameters
Key Protect instance id
Key Protect region id
Query Parameters
Cloud Resource Name (CRN) for db2 instance.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/platform-keys/instances/{instance_id}/region/{region_id}/keys?db2_crn=SOME_STRING_VALUE" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/platform-keys/instances/{instance_id}/region/{region_id}/keys?db2_crn=SOME_STRING_VALUE") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/platform-keys/instances/{instance_id}/region/{region_id}/keys?db2_crn=SOME_STRING_VALUE", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/platform-keys/instances/{instance_id}/region/{region_id}/keys?db2_crn=SOME_STRING_VALUE", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/platform-keys/instances/{instance_id}/region/{region_id}/keys?db2_crn=SOME_STRING_VALUE' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Returns overall status of system components
Returns overall status of system components.
GET /monitor
Request
Custom Headers
Database profile name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/monitor" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/monitor") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/monitor", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/monitor", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/monitor -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
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://{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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/monitor/connections") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/monitor/connections", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/monitor/connections", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/monitor/connections -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Terminates a database connection **DB ADMIN ONLY**
Terminates an active database connection.
DELETE /monitor/connections/{application_handle}
Request
Custom Headers
Database profile name.
Path Parameters
Application handle name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/monitor/connections/{application_handle}" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/monitor/connections/{application_handle}") .delete(null) .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/monitor/connections/{application_handle}", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/monitor/connections/{application_handle}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/monitor/connections/{application_handle} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Request
Custom Headers
Database profile name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/monitor/storage" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/monitor/storage") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/monitor/storage", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/monitor/storage", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/monitor/storage -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns storage usage history **DB ADMIN ONLY**
Returns a list of storage usage daily stats. Currenlty the history of the last seven days is returned.
GET /monitor/storage/history
Request
Custom Headers
Database profile name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/monitor/storage/history" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/monitor/storage/history") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/monitor/storage/history", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/monitor/storage/history", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/monitor/storage/history -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Storage utilization by schema **DB ADMIN ONLY**
Returns a list where each element represents a schema and its corresponding logical and physical sizes. Physical size is the amount of storage in disk allocated to objects in the schema. Logical size is the actual object size, which might be less than the physical size (e.g. in the case of a logical table truncation).
GET /monitor/storage/by_schema
Request
Custom Headers
Database profile name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/monitor/storage/by_schema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/monitor/storage/by_schema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Storage utilization of a schema **DB ADMIN ONLY**
Returns logical and physical sizes for one schema. Physical size is the amount of storage in disk allocated to objects in the schema. Logical size is the actual object size, which might be less than the physical size (e.g. in the case of a logical table truncation).
GET /monitor/storage/by_schema/{schema_name}
Request
Custom Headers
Database profile name.
Path Parameters
Schema name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema/{schema_name}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema/{schema_name}") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/monitor/storage/by_schema/{schema_name}", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/monitor/storage/by_schema/{schema_name}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/monitor/storage/by_schema/{schema_name} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
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://{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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/statements_count?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/statements_count?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/statements_count?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/statements_count?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the histogram of response time for a specified time frame. **DB ADMIN ONLY**
Return the histogram of response time for a specified time frame.
GET /metrics/response_time_histograms
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/response_time_histograms?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the average response time for a specified time frame. **DB ADMIN ONLY**
Return the average response time for a specified time frame.
GET /metrics/average_response_time
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/average_response_time?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the list of average response time for a specified time frame. **DB ADMIN ONLY**
Return the list of average response time for a specified time frame.
GET /metrics/response_time
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/response_time?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the average number of statements executed every minutes for a specified time frame. **DB ADMIN ONLY**
Return the average number of statements executed every minutes for a specified time frame.
GET /metrics/average_statements_rate
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/average_statements_rate?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return numbers of statements executed every minutes for a specified time frame. **DB ADMIN ONLY**
Return numbers of statements executed every minutes for a specified time frame.
GET /metrics/statements_rate
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/statements_rate?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the average number of rows read(rows/min) for a specified time frame. **DB ADMIN ONLY**
Return the average number of rows read(rows/min) for a specified time frame.
GET /metrics/average_rows_read
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/average_rows_read?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the numbers of rows read(rows/min) for a specified time frame. **DB ADMIN ONLY**
Return the numbers of rows read(rows/min) for a specified time frame.
GET /metrics/rows_read
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/rows_read?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/rows_read?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/rows_read?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } 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://{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'
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://{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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/max_connections_count?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/max_connections_count?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/max_connections_count?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/max_connections_count?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return maximum numbers of concurrent connections for a specified time frame. **DB ADMIN ONLY**
Return maximum numbers of concurrent connections for a specified time frame.
GET /metrics/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://{HOSTNAME}/dbapi/v4/metrics/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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/connections_count?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/connections_count?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/connections_count?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/connections_count?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the maximum lockwaits per minute for a specified time frame. **DB ADMIN ONLY**
Return the maximum lockwaits per minute for a specified time frame.
GET /metrics/max_lockwaits_rate
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/max_lockwaits_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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/max_lockwaits_rate?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/max_lockwaits_rate?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/max_lockwaits_rate?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/max_lockwaits_rate?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the maximum lockwaits per minute for a specified time frame. **DB ADMIN ONLY**
Return the maximum lockwaits per minute for a specified time frame.
GET /metrics/lockwaits_rate
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/lockwaits_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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/lockwaits_rate?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/lockwaits_rate?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/lockwaits_rate?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/lockwaits_rate?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the maximum usage percentage of logs for a specified time frame. **DB ADMIN ONLY**
Return the maximum usage percentage of logs for a specified time frame.
GET /metrics/max_log_space
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/max_log_space?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/max_log_space?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/max_log_space?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/max_log_space?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/max_log_space?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the maximum usage percentages of logs for a specified time frame. **DB ADMIN ONLY**
Return the maximum usage percentages of logs for a specified time frame.
GET /metrics/log_space
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/log_space?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/log_space?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/log_space?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/log_space?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/log_space?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the maximum percent of node CPU usage for a specified time frame. **DB ADMIN ONLY**
Return the maximum percent of node CPU usage for a specified time frame.
GET /metrics/max_cpu
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/max_cpu?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/max_cpu?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/max_cpu?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/max_cpu?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/max_cpu?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the percent of node CPU usage for a specified time frame. **DB ADMIN ONLY**
Return the percent of node CPU usage for a specified time frame.
GET /metrics/cpu_summary
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/cpu_summary?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/cpu_summary?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/cpu_summary?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/cpu_summary?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/cpu_summary?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the maximum percent of node memory usage for a specified time frame. **DB ADMIN ONLY**
Return the maximum percent of node memory usage for a specified time frame.
GET /metrics/max_memory
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/max_memory?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/max_memory?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/max_memory?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/max_memory?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/max_memory?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the percent of node memory usage for a specified time frame. **DB ADMIN ONLY**
Return the percent of node memory usage for a specified time frame.
GET /metrics/memory_summary
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/memory_summary?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/memory_summary?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/memory_summary?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/memory_summary?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/memory_summary?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the maximum usage percent of storage for a specified time frame. **DB ADMIN ONLY**
Return the maximum usage percent of storage for a specified time frame.
GET /metrics/max_storage
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/max_storage?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/max_storage?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/max_storage?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/max_storage?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/max_storage?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the usage percent of storage for a specified time frame. **DB ADMIN ONLY**
Return the usage percent of storage for a specified time frame.
GET /metrics/storage
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/storage?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/storage?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/storage?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/storage?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/storage?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return the time spent in each operation for a specified time frame. **DB ADMIN ONLY**
Return the time spent in each operation for a specified time frame.
GET /metrics/timespent
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/timespent?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return a table storage usage in a time range **DB ADMIN ONLY**
Return a table storage usage in a time range.
GET /metrics/schemas/{tabschema}/tables/{tabname}/storage/timeseries
Request
Custom Headers
Database profile name.
Path Parameters
Tabname
Tabschema
Query Parameters
end
start
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage/timeseries?end=SOME_INTEGER_VALUE&start=SOME_INTEGER_VALUE" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json;charset=utf-8") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage/timeseries?end=SOME_INTEGER_VALUE&start=SOME_INTEGER_VALUE") .get() .addHeader("content-type", "application/json;charset=utf-8") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage/timeseries?end=SOME_INTEGER_VALUE&start=SOME_INTEGER_VALUE", "headers": { "content-type": "application/json;charset=utf-8", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json;charset=utf-8", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage/timeseries?end=SOME_INTEGER_VALUE&start=SOME_INTEGER_VALUE", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage/timeseries?end=SOME_INTEGER_VALUE&start=SOME_INTEGER_VALUE' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json;charset=utf-8' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a list for tables storage **DB ADMIN ONLY**
Returns a list for tables storage. Only returns the last collected data between start and end.
GET /metrics/tables/storage
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if includes system tables in the return list
Default:
false
The amount of return records. Limit and offset should be set together.
Default:
100
The starting position of return records. Limit and offset should be set together
Default:
0
Used to filter by schema
Used to filter by tabname
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/tables/storage?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&tabname=SOME_STRING_VALUE&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/tables/storage?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&tabname=SOME_STRING_VALUE&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/tables/storage?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&tabname=SOME_STRING_VALUE&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/tables/storage?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&tabname=SOME_STRING_VALUE&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/tables/storage?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&tabname=SOME_STRING_VALUE&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a table storage **DB ADMIN ONLY**
Returns a table storage. Only returns the last collected data between start and end.
GET /metrics/schemas/{tabschema}/tables/{tabname}/storage
Request
Custom Headers
Database profile name.
Path Parameters
Used to filter by schema
Used to filter by tabname
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{tabschema}/tables/{tabname}/storage?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a list for schemas storage **DB ADMIN ONLY**
Returns a list for schemas storage. Only returns the last collected data between start and end.
GET /metrics/storage/schemas
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if includes system schemas in the return list
Default:
false
The amount of return records. Limit and offset should be set together.
Default:
100
The starting position of return records. Limit and offset should be set together
Default:
0
Used to filter by schema
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/storage/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/storage/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&tabschema=SOME_STRING_VALUE&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Return a schema used storage in a time range **DB ADMIN ONLY**
Return a schema used storage in a time range.
GET /metrics/storage/schemas/{tabschema}/timeseries
Request
Custom Headers
Database profile name.
Path Parameters
Used to filter by schema
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas/{tabschema}/timeseries?start=1546272000000&end=1546272300000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json;charset=utf-8") req.Header.Add("x-db-profile", "SOME_STRING_VALUE") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas/{tabschema}/timeseries?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json;charset=utf-8") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/storage/schemas/{tabschema}/timeseries?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json;charset=utf-8", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json;charset=utf-8", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/storage/schemas/{tabschema}/timeseries?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas/{tabschema}/timeseries?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json;charset=utf-8' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a schema storage **DB ADMIN ONLY**
Returns a schema storage. Only returns the last collected data between start and end.
GET /metrics/storage/schemas/{tabschema}
Request
Custom Headers
Database profile name.
Path Parameters
Used to filter by schema
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas/{tabschema}?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas/{tabschema}?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/storage/schemas/{tabschema}?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/storage/schemas/{tabschema}?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/storage/schemas/{tabschema}?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Runs a tables storage collection **DB ADMIN ONLY**
Runs asynchronously a tables storage collection. Only allow one thread to run at the same time. If there is already a thread running, the new request will not kick off a new one. The returned handle will be the already running one. If there is no thread running, a new handle will be returned.
POST /metrics/tables/storage/collector
Request
Custom Headers
Database profile name.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/tables/storage/collector" req, _ := http.NewRequest("POST", 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/tables/storage/collector") .post(null) .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/tables/storage/collector", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/metrics/tables/storage/collector", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/metrics/tables/storage/collector -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a list of inflight executions
Returns a list of inflight executions.Only returns the same statement once and the last collected one between start and end.
GET /metrics/statements/inflight_executions
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if include system statements in the return list
Default:
false
The amount of return records. Limit and offset should be set together.
Default:
100
The starting position of return records. Limit and offset should be set together
Default:
0
Used to filter by IP address
Used to filter by statement text
Used to filter by application_name
Used to filter by session_auth_id
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/statements/inflight_executions?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/statements/inflight_executions?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/statements/inflight_executions?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/statements/inflight_executions?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/statements/inflight_executions?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a list of current inflight executions
Returns a list of current inflight executions
GET /metrics/statements/inflight_executions/current/list
Request
Custom Headers
Database profile name.
Query Parameters
Field to set if include system statements in the return list
Default:
false
The amount of return records. Limit and offset should be set together.
Default:
100
The starting position of return records. Limit and offset should be set together
Default:
0
Used to filter by IP address
Used to filter by statement text
Used to filter by application_name
Used to filter by session_auth_id
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/statements/inflight_executions/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/statements/inflight_executions/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/statements/inflight_executions/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/statements/inflight_executions/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/statements/inflight_executions/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&stmt_text=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-entry_time' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
Collection of in flight execution data
Number of statements.
from cache or not. If it's slow to get data from target database, then this API will retreve data from cache and get the last one. iscache identifies it is directly returned from db or from cache. true means from cache, false means from target database.
the collected timestamp from target database. This collected value can be used to set start and end for a history retrieval to get the same list later.
inflight statement Executions
Status Code
Returns a list of current inflight executions
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Returns a infight execution detail
Returns a infight execution detail. Only returns the last one between start and end
GET /metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}
Request
Custom Headers
Database profile name.
Path Parameters
A system-wide unique ID for the application.
The unit of work identifier.
Counter which uniquely identifies an activity for an application within a given unit of work.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
inflight statement Execution details
Application handle
Unit of work ID
Activity ID
Coordinator member
Entry time
Local start time
Total time
Queue time
Idle time
Exec time
Number of threshold violations
Workload manager total queue assignments
Executable ID
Effective isolation
Effective query degree
Actual runtime degree of intrapartition parallelism
Reserved for future use
Reserved for future use
Query cost estimate
Reserved for future use
SQL statement text
Activity state
Activity type
Application ID
Client IP address
Application name
System authorization identifier
Session authorization ID
Client application name
Client workstation name
Client accounting string
Client user ID
Client hostname
Client process ID
Client platform
Client product and version ID
Client port number
Workload name
Application ID
Service superclass name
Service subclass name
Total CPU time
Total routine invocations
FCM receives total
FCM sends total
Complex operations
All overflows
Maximum number of agents that were used
Number of concurrent agents
Total Sorts
Sort overflows
Sort Share Heap Currently Allocated
Max Share Heap Allocated Per Part Percent
Reserved for future use
Max estimated Share Heap Per Part Percent
Sort share heap high watermark
Max Share Heap Peak Per Part Percent
Hash Join Overflows
OLAP Function Overflows
Hash group by overflows
Post threshold sorts
Hash Join Threshold
OLAP function threshold
Hash group by threshold
Columnar vector consumer overflows
Post threshold columnar_vector consumers
Rows read
Rows modified
Rows returned
Lock waits
Lock waits global
Number of lock escalations
Number of global lock escalations
Deadlocks detected
Number of lock timeouts
Lock timeouts global
Number of cluster caching facility waits
Total log disk waits monitor element
Number of times full log buffer caused agents to wait
Unit of Work Log Space Used
Direct reads from database
Direct writes to database
FCM volume
Buffer pool hit ratio
Buffer pool data hit ratio
Buffer pool index hit ratio
Buffer pool XDA hit ratio
Buffer pool column hit ratio
Buffer pool temp hit ratio
Buffer pool temp logical reads
Buffer pool temp physical reads
Buffer pool logical reads
Buffer pool physical reads
Buffer pool writes
Rows deleted by a federation system
Rows inserted by a federation system
Rows updated by a federation system
Rows read by a federation system
Total number of execution times for a federation server
Total data read by external table readers
Total data written by external table writers
Total data sent to external table writers
Total data received from external table readers
Workload manager total queue time
Statement execution time
Total section processing time
Total section sort processing time
Total column-organized processing time
Other section processing time
Total routine user code processing time
Total activity wait time
Lock wait time global
Lock wait time local
Log buffer wait time
Log disk wait time
FCM wait time
cluster caching facility wait time
Time spent by a federation server
Total agent wait time for external table
Total extended latch wait time
Total buffer pool physical read time
Total buffer pool physical read time
Total buffer pool physical write time
Total buffer pool physical write time
Direct Read Time
Direct write time
Time waited for prefetch
Time waited for prefetch
Other wait time
Other processing time
Status Code
Returns a infight execution detail
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Terminates a statement **DB ADMIN ONLY**
Terminates a statement
DELETE /metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}
Request
Custom Headers
Database profile name.
Path Parameters
A system-wide unique ID for the application.
The unit of work identifier.
Counter which uniquely identifies an activity for an application within a given unit of work.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}") .delete(null) .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a list of connections
Returns a list of connections. Each connection represents a row. If there are multiple collections. They'll been aggregated averagely.
GET /metrics/applications/connections
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if include system statements in the return list
Default:
false
The amount of return records. Limit and offset should be set together.
Default:
100
The starting position of return records. Limit and offset should be set together
Default:
0
Used to filter by IP address
Used to filter by application_name
Used to filter by session_auth_id
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/applications/connections?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/applications/connections?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/applications/connections?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/applications/connections?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/applications/connections?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a list of current connections
Returns a list of current connections. Only return the last collected connections. The values are calculated based on the last collected and privious collection rows to get rate like values.
GET /metrics/applications/connections/current/list
Request
Custom Headers
Database profile name.
Query Parameters
Field to set if include system statements in the return list
Default:
false
The amount of return records. Limit and offset should be set together.
Default:
100
The starting position of return records. Limit and offset should be set together
Default:
0
Used to filter by IP address
Used to filter by application_name
Used to filter by session_auth_id
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/applications/connections/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/applications/connections/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/current/list?include_sys=false&limit=100&offset=0&client_ipaddr=SOME_STRING_VALUE&application_name=SOME_STRING_VALUE&session_auth_id=SOME_STRING_VALUE&sort=-application_handle' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
a list of application connections
counts of connections
from cache or not. If it's slow to get data from target database, then this API will retreve data from cache and get the last one. iscache identifies it is directly returned from db or from cache. true means from cache, false means from target database.
the collected timestamp from target database. This collected value can be used to set start and end for a history retrieval to get the same list later.
application connections
Status Code
Returns Connections with the specific profile name
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Returns a connection detail
Returns a connection detail
GET /metrics/applications/connections/{application_handle}
Request
Custom Headers
Database profile name.
Path Parameters
A system-wide unique ID for the application.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle}?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle}?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/applications/connections/{application_handle}?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/applications/connections/{application_handle}?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle}?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
application connections
Application handle
Coordinating member
Connection start time
Unit of work start timestamp
Idle time (in milliseconds)
Workload occurrence state
Workload name
Number of threshold violations
Workload manager total queue assignments
Memory pool used
Rejected rate
Application ID
Client IP address
Application name
System authorization identifier
Session authorization ID
Client application name
Client workstation name
Client accounting string
Client user ID
Client hostname
Client process ID
Client platform
Client product and version ID
Client port number
Service superclass name
Total CPU time
Total routine invocations
Total compilations
FCM recvs total
FCM sends total
Total loads
Total reorganizations
Total runtime statistics
Complex operations
All overflows
Total Sorts
Sort overflows
Sort Share Heap Currently Allocated
Max Share Heap Allocated Per Part Percent
Estimated sort Share Heap top
Max estimated Share Heap Per Part Percent
sort_shrheap_top_pages
max_shrheap_peak_per_part_percent
Total application commits
Total application rollbacks
Total completed activities
Total aborted activities
Total rejected activities
Dynamic SQL Statements Attempted
Static SQL Statements Attempted
Failed SQL Statements Attempted
Select SQL Statements Attempted
UID SQL Statements Attempted
DDL SQL Statements Attempted
Other SQL Statements Attempted
Rows read
Rows modified
Rows returned
Lock waits
Lock waits global
Number of lock escalations
Number of global lock escalations
Deadlocks detected
Number of lock timeouts
Lock timeouts global
Locks held
Number of cluster caching facility waits
Log disk waits total
Number of full log buffers
Unit of Work Log Space Used
Direct reads from database
Direct writes to database
FCM volume
Buffer pool hit ratio
Buffer pool data hit ratio
Buffer pool index hit ratio
Buffer pool XDA hit ratio
Buffer pool column hit ratio
Buffer pool temp hit ratio
Buffer pool temp logical reads
Buffer pool temp physical reads
Buffer pool logical reads
Buffer pool physical reads
Buffer pool writes
Rows deleted by a federation system
Rows inserted by a federation system
Rows updated by a federation system
Rows read by a federation system
Total number of execution times for a federation server
Total data read by external table readers
Total data written by external table writers
Total data sent to external table writers
Total data received from external table readers
Client idle wait time
Total request time
Total compile processing time
Total section processing time
Total section sort processing time
Total column-organized processing time
Total commits processing time
Total rollback processing time
Total runtime statistics processing time
Total reorganization processing time
Total load processing time
Total wait time
Agent wait time
Workload manager total queue time
Lock wait time global
Lock wait time local
Log buffer wait time
Log disk wait time
TCP/IP wait time
FCM wait time
cluster caching facility wait time
Time spent by a federation server
Total agent wait time for external table
Total extended latch wait time
Total buffer pool physical read time
Total buffer pool physical write time
Direct Read Time
Direct write time
Time waited for prefetch
Other wait time
Other processing time
Other section processing time
Status Code
Returns connection details with the specific profile name and specific application handle
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Terminates a database connection **DB ADMIN ONLY**
Terminates an active database connection.
DELETE /metrics/applications/connections/{application_handle}
Request
Custom Headers
Database profile name.
Path Parameters
Application handle name
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/applications/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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle}") .delete(null) .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/applications/connections/{application_handle}", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/metrics/applications/connections/{application_handle}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns a list of timeseries of a connection
Returns a list of timeseries of a connection. The values are calculated based on the last collected and privious collection rows to get rate like values.
GET /metrics/applications/connections/{application_handle}/timeseries
Request
Custom Headers
Database profile name.
Path Parameters
A system-wide unique ID for the application.
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle}/timeseries?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle}/timeseries?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/applications/connections/{application_handle}/timeseries?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/applications/connections/{application_handle}/timeseries?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/applications/connections/{application_handle}/timeseries?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
a list of application connections
counts of connections
application connections timeseries
Status Code
Returns connection details of timeseries with the specific profile name and specific application handle
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Returns performance metrics for schemas **DB ADMIN ONLY**
Returns performance metrics for schemas. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/schemas
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if include system schemas in the return list
Default:
false
Field to set the amount of return records
Default:
100
Field to set the starting position of return records.
Default:
0
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns performance metrics for schemas **DB ADMIN ONLY**
Returns current performance metrics for schemas.
GET /metrics/schemas/current/list
Request
Custom Headers
Database profile name.
Query Parameters
Field to set if include system schemas in the return list
Default:
false
Field to set the amount of return records
Default:
100
Field to set the starting position of return records.
Default:
0
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
a list of Sechmas
counts of statements
from cache or not. If it's slow to get data from target database, then this API will retreve data from cache and get the last one. iscache identifies it is directly returned from db or from cache. true means from cache, false means from target database.
the collected timestamp from target database. This collected value can be used to set start and end for a history retrieval to get the same list later.
Schema Perf
Status Code
returns performance of schemas
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Returns performance metrics for one schema **DB ADMIN ONLY**
Returns performance metrics for one schema. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/schemas/{schema_name}
Request
Custom Headers
Database profile name.
Path Parameters
Schema name
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{schema_name}?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{schema_name}?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
Schema Perf
Table schema name
Table scans
Rows read
Rows inserted
Rows updated
Rows deleted
Logical reads
Physical reads
Buffer pool hit ratio
Rows read versus accessed
Logical data object pages
Logical index object pages
Logical XDA object pages
Logical LOB object pages
Logical Long object pages
Access per minute
Status Code
Returns performance metrics for one schema
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Returns performance metrics on all members for one schema **DB ADMIN ONLY**
Returns performance metrics on all members for one schema. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/schemas/{schema_name}/members
Request
Custom Headers
Database profile name.
Path Parameters
Schema name
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/members?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/members?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{schema_name}/members?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{schema_name}/members?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/members?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns performance metrics timeseries for one schema **DB ADMIN ONLY**
Returns performance metrics timeseries for one schema.
GET /metrics/schemas/{schema_name}/timeseries
Request
Custom Headers
Database profile name.
Path Parameters
Schema name
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/timeseries?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/timeseries?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{schema_name}/timeseries?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{schema_name}/timeseries?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/timeseries?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns performance of tables **DB ADMIN ONLY**
Returns performance of tables. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/tables
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if include system tables in the return list
Default:
false
Field to set the amount of return records
Default:
100
Field to set the starting position of return records.
Default:
0
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/tables?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/tables?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/tables?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/tables?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/tables?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns current performance of tables **DB ADMIN ONLY**
Returns current performance of tables.
GET /metrics/tables/current/list
Request
Custom Headers
Database profile name.
Query Parameters
Field to set if include system tables in the return list
Default:
false
Field to set the amount of return records
Default:
100
Field to set the starting position of return records.
Default:
0
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/tables/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/tables/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/tables/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/tables/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/tables/current/list?include_sys=false&limit=100&offset=0&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
A list of tables
A list of tables
from cache or not. If it's slow to get data from target database, then this API will retreve data from cache and get the last one. iscache identifies it is directly returned from db or from cache. true means from cache, false means from target database.
the collected timestamp from target database. This collected value can be used to set start and end for a history retrieval to get the same list later.
Table performance
Status Code
Returns performance of tables
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Returns performance of one table **DB ADMIN ONLY**
Returns performance of one table. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/schemas/{schema_name}/tables/{table_name}
Request
Custom Headers
Database profile name.
Path Parameters
Schema name
Table name
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Response
Table performance
Table schema name
Table name
Table type
Tablespace name
Table scans
Rows read
Rows inserted
Rows updated
Rows deleted
Logical reads
Physical reads
Buffer pool hit ratio
Rows read versus accessed
Logical data object pages
Logical index object pages
Logical XDA object pages
Logical LOB object pages
Logical Long object pages
Access per minute
Status Code
Returns performance of one table
Current user does not have permission to access this database
Database profile not found
Error payload
No Sample Response
Returns performance on all members for one table **DB ADMIN ONLY**
Returns performance on all members for one table. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/schemas/{schema_name}/tables/{table_name}/members
Request
Custom Headers
Database profile name.
Path Parameters
Schema name
Table name
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/members?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/members?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/members?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/members?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/members?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns performance timeseries for one table **DB ADMIN ONLY**
Returns performance timeseries for one table.
GET /metrics/schemas/{schema_name}/tables/{table_name}/timeseries
Request
Custom Headers
Database profile name.
Path Parameters
Schema name
Table name
Query Parameters
Start timestamp.
End timestamp.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/timeseries?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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/timeseries?start=1546272000000&end=1546272300000") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/timeseries?start=1546272000000&end=1546272300000", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/timeseries?start=1546272000000&end=1546272300000", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/schemas/{schema_name}/tables/{table_name}/timeseries?start=1546272000000&end=1546272300000' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns performance of tables and schemas **DB ADMIN ONLY**
Returns performance of tables and schemas. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/tableperformance
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if include system tables in the return list
Default:
false
Field to set the amount of return records
Default:
100
Field to set the starting position of return records.
Default:
0
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/tableperformance?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/tableperformance?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/tableperformance?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/tableperformance?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/tableperformance?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Returns current performance of tables and schemas **DB ADMIN ONLY**
Returns current performance of tables and schemas. If there are multiple collections. They’ll been aggregated averagely.
GET /metrics/tableperformance/current/list
Request
Custom Headers
Database profile name.
Query Parameters
Start timestamp.
End timestamp.
Field to set if include system tables in the return list
Default:
false
Field to set the amount of return records
Default:
100
Field to set the starting position of return records.
Default:
0
Used to sort by the given field. The name of given field can be found from the response. Plus + or - before the given filed to denote by ASC or DESC. By default if not specified it's by ASC. Note: only support one field each time.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/metrics/tableperformance/current/list?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/metrics/tableperformance/current/list?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema") .get() .addHeader("content-type", "application/json") .addHeader("x-db-profile", "SOME_STRING_VALUE") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/metrics/tableperformance/current/list?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", "headers": { "content-type": "application/json", "x-db-profile": "SOME_STRING_VALUE", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'x-db-profile': "SOME_STRING_VALUE", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/metrics/tableperformance/current/list?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/metrics/tableperformance/current/list?include_sys=false&start=1546272000000&end=1546272300000&limit=100&offset=0&sort=-tabschema' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -H 'x-db-profile: SOME_STRING_VALUE'
Executes SQL statements
Executes one or more SQL statements as a background job. This endpoint returns a job ID that can be used to retrieve the results.
POST /sql_jobs
Request
SQL script and execution options
The SQL script to be executed
Example:
select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;
Maximum number of rows that will be fetched for each result set.
Example:
10
SQL statement terminator. A character that is used to mark the end of a SQL statement when the provided SQL script contains multiple statements.
Example:
;
If 'yes', the job stops executing at the first statement that returns an error. If 'no', the job continues executing if one or more statements returns an error.
Example:
no
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/sql_jobs" payload := strings.NewReader("{\"commands\":\"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;\",\"limit\":10,\"separator\":\";\",\"stop_on_error\":\"no\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"commands\":\"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;\",\"limit\":10,\"separator\":\";\",\"stop_on_error\":\"no\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/sql_jobs") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/sql_jobs", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ commands: 'select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;', limit: 10, separator: ';', stop_on_error: 'no' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"commands\":\"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;\",\"limit\":10,\"separator\":\";\",\"stop_on_error\":\"no\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/sql_jobs", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/sql_jobs -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"commands":"select TABNAME, TABSCHEMA, OWNER from syscat.tables fetch first 5 rows only;select * from INVALID_TABLE fetch first 5 rows only;","limit":10,"separator":";","stop_on_error":"no"}'
Fetches partial results of a SQL job execution
Returns the current status of a SQL job execution along with any results of SQL statements that have already been executed. Clients are supposed to poll this endpoint until the status returned is either 'completed', which indicates all SQL statements have completed executing, or 'failed', which indicates the job failed to execute and therefore is considered terminated. The returned list of results is not cumulative. That means, results that were fetched in a previous call will not be returned again, only new results (i.e. that were not fetched yet) will be included. For example, assuming a job with 10 SQL statements, the first call returns status "running" and 6 results, the second call returns status "running" and an empty list of results, a third call status "completed" and 4 results. Any subsequent calls would return status "completed" and an empty list of results.
GET /sql_jobs/{id}
Request
Path Parameters
ID of the SQL execution job
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/sql_jobs/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/sql_jobs/{id}") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/sql_jobs/{id}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/sql_jobs/{id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/sql_jobs/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Returns the results of a SQL query to CSV
Executes the specified SQL query and returns the data as a CSV file. The amount of data returned is limited to 100,000 rows.
POST /sql_query_export
Request
The SQL query to be executed
The SQL statement to execute
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/sql_query_export" payload := strings.NewReader("{\"command\":\"<ADD STRING VALUE>\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "text/csv") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"command\":\"<ADD STRING VALUE>\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/sql_query_export") .post(body) .addHeader("content-type", "text/csv") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/sql_query_export", "headers": { "content-type": "text/csv", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({command: '<ADD STRING VALUE>'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"command\":\"<ADD STRING VALUE>\"}" headers = { 'content-type': "text/csv", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/sql_query_export", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/sql_query_export -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: text/csv' -d '{"command":"<ADD STRING VALUE>"}'
Create a scaling request
Scale the instance with desired amount of storage and cpu value.
PUT /manage/scaling/add
Request
Contains the number of cores and the amount of storage to scale.
The number of cores to scale
Possible values: value > 0
Example:
12
The amount of storage to scale in GB. Note that value should be greater than the current storage
Possible values: value > 0
Example:
80
Unix timestamp in milliseconds when the scale will be triggered. If this value is not specified , scale will be trigged right away
Possible values: value > 0
Example:
1651782663715
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/manage/scaling/add" payload := strings.NewReader("{\"total_cores\":12,\"total_storage\":80,\"trigger_time_unix_ms\":1651782663715}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") 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, "{\"total_cores\":12,\"total_storage\":80,\"trigger_time_unix_ms\":1651782663715}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/manage/scaling/add") .put(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/manage/scaling/add", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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({total_cores: 12, total_storage: 80, trigger_time_unix_ms: 1651782663715})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"total_cores\":12,\"total_storage\":80,\"trigger_time_unix_ms\":1651782663715}" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/manage/scaling/add", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/manage/scaling/add -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"total_cores":12,"total_storage":80,"trigger_time_unix_ms":1651782663715}'
Cancel a pending scaling request
Cancel a pending scaling request based on request ID
DELETE /manage/scaling/cancel/{id}
Request
Path Parameters
Request ID to be cancelled. This can be obtained from API /manage/scaling/list
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/manage/scaling/cancel/3d09f26e-0abf-4b69-952d-ede90cf912c6-1" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/manage/scaling/cancel/3d09f26e-0abf-4b69-952d-ede90cf912c6-1") .delete(null) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/manage/scaling/cancel/3d09f26e-0abf-4b69-952d-ede90cf912c6-1", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/manage/scaling/cancel/3d09f26e-0abf-4b69-952d-ede90cf912c6-1", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/manage/scaling/cancel/3d09f26e-0abf-4b69-952d-ede90cf912c6-1 -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get the last scaling request status
Get the status from the last scaling request
GET /manage/scaling/last_status
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/manage/scaling/last_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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/manage/scaling/last_status") .get() .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/manage/scaling/last_status", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/manage/scaling/last_status", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/manage/scaling/last_status -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get the complete list of scaling requests
Get the complete list of scaling requests performed on this instance
GET /manage/scaling/list
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/manage/scaling/list" 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}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/manage/scaling/list") .get() .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/manage/scaling/list", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/manage/scaling/list", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/manage/scaling/list -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Get supported scaling ranges and current allocated resources
Get allocated storage and cpu at the time of request. Also, it returns the supported scaling ranges for this IBM Cloud Db2 service.
GET /manage/scaling/resources
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/manage/scaling/resources" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/manage/scaling/resources") .get() .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/manage/scaling/resources", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/manage/scaling/resources", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/manage/scaling/resources -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
Example:
Flex one
current allocated storage and supported storage ranges for scaling
- storage
- range
Example:
1
Example:
80
Example:
80
Example:
GB
- rangeDetail
Example:
80
Example:
true
current allocated cpu and supported cpu ranges for scaling
- compute
- range
Example:
1
Example:
4
Example:
4
- rangeDetail
Example:
4
Example:
true
Example:
true
Configuration of scheduled scaling
- schedule
Status Code
Details for supported scaling ranges and current allocated resources.
Bad request
Unauthorized
Unexpected error
No Sample Response
View scaling history saved in console
View the scaling history data showing in console
GET /manage/scaling/history
Request
Query Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/manage/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/manage/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE") .get() .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/manage/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/manage/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET 'https://{HOSTNAME}/dbapi/v4/manage/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE' -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/settings" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/settings") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/settings", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/settings", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/settings -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
A collection of system settings.
Product name
Host name or IP address of the database server
Port number for non-secured database connections
Port number for secured database connections
Accepts values 'yes' and 'no'. When set to 'yes' clients can only connect to the database server using secured connections
URL to access the web console
Number of physical nodes in the database cluster
Subscription plan
The environment where the service is running
- environment
Name of the environment. For instance, cloud provider such as SoftLayer
Environment which can vary based on type of environment.
- details
Name of the service
For cloud environment, it describes the Geo location where the service is running
Status Code
System settings
Error payload
No Sample Response
Updates the system settings **ADMIN ONLY**
The only setting that can be modified is database_ssl_connections_enforced
.
By setting database_ssl_connections_enforced
to true
database connection requests must be secured.
If set to false
both secured and unsecured database connections are accepted.
This operation is only available to system administrators.
PUT /settings
Request
System settings
Accepts values 'yes' and 'no'. When set to 'yes' clients can only connect to the database server using secured connections
Example:
yes
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/settings" payload := strings.NewReader("{\"database_ssl_connections_enforced\":\"yes\"}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") 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, "{\"database_ssl_connections_enforced\":\"yes\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/settings") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/settings", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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({database_ssl_connections_enforced: 'yes'})); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"database_ssl_connections_enforced\":\"yes\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/settings", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/settings -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"database_ssl_connections_enforced":"yes"}'
Response
A collection of system settings.
Product name
Host name or IP address of the database server
Port number for non-secured database connections
Port number for secured database connections
Accepts values 'yes' and 'no'. When set to 'yes' clients can only connect to the database server using secured connections
URL to access the web console
Number of physical nodes in the database cluster
Subscription plan
The environment where the service is running
- environment
Name of the environment. For instance, cloud provider such as SoftLayer
Environment which can vary based on type of environment.
- details
Name of the service
For cloud environment, it describes the Geo location where the service is running
Status Code
System settings
Error payload
No Sample Response
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/tasks/status" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/tasks/status") .get() .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/tasks/status", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/tasks/status", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/tasks/status -H 'accept: application/json' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
- tasks
Example:
crn:v1:bluemix:public:databases-for-postgresql:us-south:a/274074dce64e9c423ffc238516c755e1:a127f76a-98bf-4f8b-b263-01d9e16b15bd:task:3dc480bd-0cd9-4db6-92f4-b5c96544393b
Example:
restore
Example:
completed
Example:
2018-03-28T10:20:30Z
Status Code
contain tasks status for scaling ,restore etc.
Bad request
Unauthorized
Error
No Sample Response
Generates a new Aspera token
Aspera is a high-speed file transfer technology that can be used to speed up file uploads to Db2 Warehouse on Cloud. This endpoint generates a new token that must be used when uploading files with Aspera.
POST /aspera
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/aspera" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/aspera") .post(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/aspera", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/aspera", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/aspera -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Deletes an Aspera token
Deletes an Aspera token. You should delete a token after the upload is complete. Optionally provide the name of a file that was uploaded using Aspera to prepare it for loading.
DELETE /aspera/{token}
Request
Path Parameters
Aspera token
Query Parameters
Name of file that was uploaded
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/aspera/{token}?filename=SOME_STRING_VALUE" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/aspera/{token}?filename=SOME_STRING_VALUE") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/aspera/{token}?filename=SOME_STRING_VALUE", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/aspera/{token}?filename=SOME_STRING_VALUE", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE 'https://{HOSTNAME}/dbapi/v4/aspera/{token}?filename=SOME_STRING_VALUE' -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Analyzes CSV data to return a list of data types of its values
Schema discovery analyzes data in CSV format and returns a list of suggested data types that can be used when creating a table to store the CSV data.
POST /schema_discovery
Request
Data to analyze
Single character can be used as column delimiter. 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).
Accepts values 'yes' and 'no'. The value 'yes' indicates the first row is a header with the column names and should be ignored whe analyzing the data. The value 'no' indicates all rows will be considered for analysis.
The CSV data to analyze. It should be in json array string format, such as ['Title, Year, Producer','City of God,2002, Katia Lund','Rain,1292,Christine Jeffs','2001: A Space Odyssey,1969, Stanley Kubrick'].
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/schema_discovery" payload := strings.NewReader("{\"column_separator\":\"<ADD STRING VALUE>\",\"includes_header\":\"<ADD STRING VALUE>\",\"data\":\"<ADD STRING VALUE>\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"column_separator\":\"<ADD STRING VALUE>\",\"includes_header\":\"<ADD STRING VALUE>\",\"data\":\"<ADD STRING VALUE>\"}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/schema_discovery") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/schema_discovery", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ column_separator: '<ADD STRING VALUE>', includes_header: '<ADD STRING VALUE>', data: '<ADD STRING VALUE>' })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"column_separator\":\"<ADD STRING VALUE>\",\"includes_header\":\"<ADD STRING VALUE>\",\"data\":\"<ADD STRING VALUE>\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/schema_discovery", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/schema_discovery -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"column_separator":"<ADD STRING VALUE>","includes_header":"<ADD STRING VALUE>","data":"<ADD STRING VALUE>"}'
Returns the list of users
Administrators can retrieve the list of all users in the system. Regular users will receive a list containing only their own user profile.
GET /users
Request
No Request Parameters
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/users", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/users -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Creates a new user. **ADMIN ONLY**
Creates a new user.
This operation is only available to system administrators.
POST /users
Request
User information
The user's ID. It must be between 1 and 128 characters and may only contain letters a-z (lower-case), numbers 0-9, and the special characters '_', '-' or '.'. It can not start with special characters. It may not be "guests", "admins", "users", "local", "idax", "public", "ibm", "dsweb", "sqlj", "root" or "gopher". It cannot begin with "bluadmin", "db2inst1", "nullid", "ibm", "sql" or "sys". Those limits don't apply to IBMid (when "iam" is set to true).
Example:
test_user
The user's password. It must have a minimum of 15 characters. It must contain at least one each of upper-case letters, lower-case letters, numbers, and special characters. Do not use common words in password. For IBMid, password should be absent since the credential is managed by IBMid but not the Console.
Example:
dEkMc43@gfAPl!867^dSbu
The user's role. Administrators have the
bluadmin
role. Regular users have thebluuser
role.Allowable values: [
bluuser
,bluadmin
]Example:
bluuser
Indicate if this user is an IBMid User. When set to true, only "id", "ibmid", "role" and "locked" are needed. The default value is false.
Default:
false
If iam sets to true, ibmid is required. It's the IBMid which will associate with the user id in the Console.
The user's full name. Not needed for IBMid and will be ignored if set.
Example:
test_user
The user's email address. Not needed for IBMid and will be ignored if set.
Example:
test_user@mycompany.com
If set to 'yes', it indicates the user account is locked, which disallows the user from logging into the system
Allowable values: [
yes
,no
]Example:
no
- authentication
The authentication method to be used when the user logs in. Currently only 'internal' is allowed. Not needed for IBMid and will be ignored if set.
Allowable values: [
internal
]Example:
internal
The authentication policy ID for this user account. Only valid when type is set to 'internal'. Not needed for IBMid and will be ignored if set.
Example:
Default
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users" payload := strings.NewReader("{\"id\":\"test_user\",\"iam\":false,\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"test_user\",\"password\":\"dEkMc43@gfAPl!867^dSbu\",\"role\":\"bluuser\",\"email\":\"test_user@mycompany.com\",\"locked\":\"no\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"id\":\"test_user\",\"iam\":false,\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"test_user\",\"password\":\"dEkMc43@gfAPl!867^dSbu\",\"role\":\"bluuser\",\"email\":\"test_user@mycompany.com\",\"locked\":\"no\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users") .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "POST", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ id: 'test_user', iam: false, ibmid: '<ADD STRING VALUE>', name: 'test_user', password: 'dEkMc43@gfAPl!867^dSbu', role: 'bluuser', email: 'test_user@mycompany.com', locked: 'no', authentication: {method: 'internal', policy_id: 'Default'} })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"id\":\"test_user\",\"iam\":false,\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"test_user\",\"password\":\"dEkMc43@gfAPl!867^dSbu\",\"role\":\"bluuser\",\"email\":\"test_user@mycompany.com\",\"locked\":\"no\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("POST", "/dbapi/v4/users", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X POST https://{HOSTNAME}/dbapi/v4/users -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"id":"test_user","iam":false,"ibmid":"<ADD STRING VALUE>","name":"test_user","password":"dEkMc43@gfAPl!867^dSbu","role":"bluuser","email":"test_user@mycompany.com","locked":"no","authentication":{"method":"internal","policy_id":"Default"}}'
Response
The user's ID. It must be between 1 and 128 characters and may only contain letters a-z (lower-case), numbers 0-9, and the special characters '_', '-' or '.'. It can not start with special characters. It may not be "guests", "admins", "users", "local", "idax", "public", "ibm", "dsweb", "sqlj", "root" or "gopher". It cannot begin with "bluadmin", "db2inst1", "nullid", "ibm", "sql" or "sys". Those limits don't apply to IBMid (when "iam" is set to true).
Example:
test_user
The user's password. It must have a minimum of 15 characters. It must contain at least one each of upper-case letters, lower-case letters, numbers, and special characters. Do not use common words in password. For IBMid, password should be absent since the credential is managed by IBMid but not the Console.
Example:
dEkMc43@gfAPl!867^dSbu
The user's role. Administrators have the
bluadmin
role. Regular users have thebluuser
role.Possible values: [
bluuser
,bluadmin
]Example:
bluuser
Indicate if this user is an IBMid User. When set to true, only "id", "ibmid", "role" and "locked" are needed. The default value is false.
If iam sets to true, ibmid is required. It's the IBMid which will associate with the user id in the Console.
The user's full name. Not needed for IBMid and will be ignored if set.
Example:
test_user
The user's email address. Not needed for IBMid and will be ignored if set.
Example:
test_user@mycompany.com
If set to 'yes', it indicates the user account is locked, which disallows the user from logging into the system
Possible values: [
yes
,no
]Example:
no
- authentication
The authentication method to be used when the user logs in. Currently only 'internal' is allowed. Not needed for IBMid and will be ignored if set.
Possible values: [
internal
]Example:
internal
The authentication policy ID for this user account. Only valid when type is set to 'internal'. Not needed for IBMid and will be ignored if set.
Example:
Default
Status Code
User response
Invalid parameters or user already exists
Operation is only available to administrators
Error payload
No Sample Response
Get a specific user by ID
Get a specific user by ID.
System administrators may retrieve user information for any user. Regular users may only retrieve themselves.
GET /users/{id}
Request
Path Parameters
ID of the user to be fetched
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users/bluadmin" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users/bluadmin") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users/bluadmin", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/users/bluadmin", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/users/bluadmin -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
The user's ID. It must be between 1 and 128 characters and may only contain letters a-z (lower-case), numbers 0-9, and the special characters '_', '-' or '.'. It can not start with special characters. It may not be "guests", "admins", "users", "local", "idax", "public", "ibm", "dsweb", "sqlj", "root" or "gopher". It cannot begin with "bluadmin", "db2inst1", "nullid", "ibm", "sql" or "sys". Those limits don't apply to IBMid (when "iam" is set to true).
Example:
test_user
The user's password. It must have a minimum of 15 characters. It must contain at least one each of upper-case letters, lower-case letters, numbers, and special characters. Do not use common words in password. For IBMid, password should be absent since the credential is managed by IBMid but not the Console.
Example:
dEkMc43@gfAPl!867^dSbu
The user's role. Administrators have the
bluadmin
role. Regular users have thebluuser
role.Possible values: [
bluuser
,bluadmin
]Example:
bluuser
Indicate if this user is an IBMid User. When set to true, only "id", "ibmid", "role" and "locked" are needed. The default value is false.
If iam sets to true, ibmid is required. It's the IBMid which will associate with the user id in the Console.
The user's full name. Not needed for IBMid and will be ignored if set.
Example:
test_user
The user's email address. Not needed for IBMid and will be ignored if set.
Example:
test_user@mycompany.com
If set to 'yes', it indicates the user account is locked, which disallows the user from logging into the system
Possible values: [
yes
,no
]Example:
no
- authentication
The authentication method to be used when the user logs in. Currently only 'internal' is allowed. Not needed for IBMid and will be ignored if set.
Possible values: [
internal
]Example:
internal
The authentication policy ID for this user account. Only valid when type is set to 'internal'. Not needed for IBMid and will be ignored if set.
Example:
Default
Status Code
User response
Access to this user is not allowed
The user does not exist
Error payload
No Sample Response
Updates an existing user
Updates an existing user. Attribute 'iam' can not be updated. That means no conversion between IBMid users and normal users.
System administrators may update user information for any user. Regular users may only update themselves.
PUT /users/{id}
Request
Path Parameters
ID of the user to be updated
User information
The user's ID
ibmid is only valid for IBMid users. It's the IBMid which will associate with the user id in the Console.
The user's full name
Current password must be provided when user updates his own profile.
New password
The user's role. Administrators have the
bluadmin
role. Regular users have thebluuser
role.Allowable values: [
bluadmin
,bluuser
]The user's email address
If set to 'yes', it indicates the user account is locked, which disallows the user from logging into the system
Allowable values: [
yes
,no
]- authentication
The authentication method to be used when the user logs in. Currently only 'internal' is allowed. Not needed for IBMid and will be ignored if set.
Allowable values: [
internal
]Example:
internal
The authentication policy ID for this user account. Only valid when type is set to 'internal'. Not needed for IBMid and will be ignored if set.
Example:
Default
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users/{id}" payload := strings.NewReader("{\"id\":\"<ADD STRING VALUE>\",\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"<ADD STRING VALUE>\",\"old_password\":\"<ADD STRING VALUE>\",\"new_password\":\"<ADD STRING VALUE>\",\"role\":\"bluadmin\",\"email\":\"<ADD STRING VALUE>\",\"locked\":\"yes\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"id\":\"<ADD STRING VALUE>\",\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"<ADD STRING VALUE>\",\"old_password\":\"<ADD STRING VALUE>\",\"new_password\":\"<ADD STRING VALUE>\",\"role\":\"bluadmin\",\"email\":\"<ADD STRING VALUE>\",\"locked\":\"yes\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users/{id}") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users/{id}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ id: '<ADD STRING VALUE>', ibmid: '<ADD STRING VALUE>', name: '<ADD STRING VALUE>', old_password: '<ADD STRING VALUE>', new_password: '<ADD STRING VALUE>', role: 'bluadmin', email: '<ADD STRING VALUE>', locked: 'yes', authentication: {method: 'internal', policy_id: 'Default'} })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"id\":\"<ADD STRING VALUE>\",\"ibmid\":\"<ADD STRING VALUE>\",\"name\":\"<ADD STRING VALUE>\",\"old_password\":\"<ADD STRING VALUE>\",\"new_password\":\"<ADD STRING VALUE>\",\"role\":\"bluadmin\",\"email\":\"<ADD STRING VALUE>\",\"locked\":\"yes\",\"authentication\":{\"method\":\"internal\",\"policy_id\":\"Default\"}}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/users/{id}", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/users/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"id":"<ADD STRING VALUE>","ibmid":"<ADD STRING VALUE>","name":"<ADD STRING VALUE>","old_password":"<ADD STRING VALUE>","new_password":"<ADD STRING VALUE>","role":"bluadmin","email":"<ADD STRING VALUE>","locked":"yes","authentication":{"method":"internal","policy_id":"Default"}}'
Response
The user's ID. It must be between 1 and 128 characters and may only contain letters a-z (lower-case), numbers 0-9, and the special characters '_', '-' or '.'. It can not start with special characters. It may not be "guests", "admins", "users", "local", "idax", "public", "ibm", "dsweb", "sqlj", "root" or "gopher". It cannot begin with "bluadmin", "db2inst1", "nullid", "ibm", "sql" or "sys". Those limits don't apply to IBMid (when "iam" is set to true).
Example:
test_user
The user's password. It must have a minimum of 15 characters. It must contain at least one each of upper-case letters, lower-case letters, numbers, and special characters. Do not use common words in password. For IBMid, password should be absent since the credential is managed by IBMid but not the Console.
Example:
dEkMc43@gfAPl!867^dSbu
The user's role. Administrators have the
bluadmin
role. Regular users have thebluuser
role.Possible values: [
bluuser
,bluadmin
]Example:
bluuser
Indicate if this user is an IBMid User. When set to true, only "id", "ibmid", "role" and "locked" are needed. The default value is false.
If iam sets to true, ibmid is required. It's the IBMid which will associate with the user id in the Console.
The user's full name. Not needed for IBMid and will be ignored if set.
Example:
test_user
The user's email address. Not needed for IBMid and will be ignored if set.
Example:
test_user@mycompany.com
If set to 'yes', it indicates the user account is locked, which disallows the user from logging into the system
Possible values: [
yes
,no
]Example:
no
- authentication
The authentication method to be used when the user logs in. Currently only 'internal' is allowed. Not needed for IBMid and will be ignored if set.
Possible values: [
internal
]Example:
internal
The authentication policy ID for this user account. Only valid when type is set to 'internal'. Not needed for IBMid and will be ignored if set.
Example:
Default
Status Code
User response
Access to this user is not allowed
The user does not exist
Error payload
No Sample Response
Deletes an existing user **ADMIN ONLY**
Deletes an existing user.
Only administratos can delete users.
DELETE /users/{id}
Request
Path Parameters
ID of the user to be deleted.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users/{id}" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users/{id}") .delete(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "DELETE", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users/{id}", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("DELETE", "/dbapi/v4/users/{id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X DELETE https://{HOSTNAME}/dbapi/v4/users/{id} -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Locks a user account indefinitely. **ADMIN ONLY**
Admin users can unlock users' accounts which have been locked out following repeated failed authentication attempts.
PUT /users/{id}/lock
Request
Path Parameters
ID of the user who will be locked
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users/{id}/lock" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users/{id}/lock") .put(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users/{id}/lock", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/users/{id}/lock", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/users/{id}/lock -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
The user's ID. It must be between 1 and 128 characters and may only contain letters a-z (lower-case), numbers 0-9, and the special characters '_', '-' or '.'. It can not start with special characters. It may not be "guests", "admins", "users", "local", "idax", "public", "ibm", "dsweb", "sqlj", "root" or "gopher". It cannot begin with "bluadmin", "db2inst1", "nullid", "ibm", "sql" or "sys". Those limits don't apply to IBMid (when "iam" is set to true).
Example:
test_user
The user's password. It must have a minimum of 15 characters. It must contain at least one each of upper-case letters, lower-case letters, numbers, and special characters. Do not use common words in password. For IBMid, password should be absent since the credential is managed by IBMid but not the Console.
Example:
dEkMc43@gfAPl!867^dSbu
The user's role. Administrators have the
bluadmin
role. Regular users have thebluuser
role.Possible values: [
bluuser
,bluadmin
]Example:
bluuser
Indicate if this user is an IBMid User. When set to true, only "id", "ibmid", "role" and "locked" are needed. The default value is false.
If iam sets to true, ibmid is required. It's the IBMid which will associate with the user id in the Console.
The user's full name. Not needed for IBMid and will be ignored if set.
Example:
test_user
The user's email address. Not needed for IBMid and will be ignored if set.
Example:
test_user@mycompany.com
If set to 'yes', it indicates the user account is locked, which disallows the user from logging into the system
Possible values: [
yes
,no
]Example:
no
- authentication
The authentication method to be used when the user logs in. Currently only 'internal' is allowed. Not needed for IBMid and will be ignored if set.
Possible values: [
internal
]Example:
internal
The authentication policy ID for this user account. Only valid when type is set to 'internal'. Not needed for IBMid and will be ignored if set.
Example:
Default
Status Code
User response
Cannot edit this user
The user does not exist
Error payload
No Sample Response
Unlocks a user account **ADMIN ONLY**
Admin users can unlock users' accounts which have been locked out following repeated failed authentication attempts.
PUT /users/{id}/unlock
Request
Path Parameters
ID of the user who will be unlocked
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users/{id}/unlock" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users/{id}/unlock") .put(null) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users/{id}/unlock", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/users/{id}/unlock", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/users/{id}/unlock -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
The user's ID. It must be between 1 and 128 characters and may only contain letters a-z (lower-case), numbers 0-9, and the special characters '_', '-' or '.'. It can not start with special characters. It may not be "guests", "admins", "users", "local", "idax", "public", "ibm", "dsweb", "sqlj", "root" or "gopher". It cannot begin with "bluadmin", "db2inst1", "nullid", "ibm", "sql" or "sys". Those limits don't apply to IBMid (when "iam" is set to true).
Example:
test_user
The user's password. It must have a minimum of 15 characters. It must contain at least one each of upper-case letters, lower-case letters, numbers, and special characters. Do not use common words in password. For IBMid, password should be absent since the credential is managed by IBMid but not the Console.
Example:
dEkMc43@gfAPl!867^dSbu
The user's role. Administrators have the
bluadmin
role. Regular users have thebluuser
role.Possible values: [
bluuser
,bluadmin
]Example:
bluuser
Indicate if this user is an IBMid User. When set to true, only "id", "ibmid", "role" and "locked" are needed. The default value is false.
If iam sets to true, ibmid is required. It's the IBMid which will associate with the user id in the Console.
The user's full name. Not needed for IBMid and will be ignored if set.
Example:
test_user
The user's email address. Not needed for IBMid and will be ignored if set.
Example:
test_user@mycompany.com
If set to 'yes', it indicates the user account is locked, which disallows the user from logging into the system
Possible values: [
yes
,no
]Example:
no
- authentication
The authentication method to be used when the user logs in. Currently only 'internal' is allowed. Not needed for IBMid and will be ignored if set.
Possible values: [
internal
]Example:
internal
The authentication policy ID for this user account. Only valid when type is set to 'internal'. Not needed for IBMid and will be ignored if set.
Example:
Default
Status Code
User response
Cannot edit this user
The user does not exist
Error payload
No Sample Response
Get a specific user's connection privileges
Get a specific user's connection privileges.
If restricted is set to 'yes', the user will only be allowed to make database connections from IP addresses or hostnames in the authorized_hosts list.
System administrators may retrieve connection privilege information for any user. Regular users may only retrieve their own connection privileges.
GET /users/{id}/connection_privileges
Request
Path Parameters
ID of the user who's information is to be fetched
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users/{id}/connection_privileges" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users/{id}/connection_privileges") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "GET", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users/{id}/connection_privileges", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("GET", "/dbapi/v4/users/{id}/connection_privileges", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X GET https://{HOSTNAME}/dbapi/v4/users/{id}/connection_privileges -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json'
Response
The user's ID
If 'yes', database connections will only be allowed from the list of authorized hosts. If 'no', database connections will be allowed from anywhere.
A list of IP addresses or hostnames in which the user can connect from.
Status Code
User's connection privileges
Access to this user's connection privileges is not allowed
The user does not exist
Error payload
No Sample Response
Updates an existing user's connection privileges **ADMIN ONLY**
Updates an existing user's connection privileges.
If restricted is set to 'yes', the user will only be allowed to make database connections from IP addresses or hostnames in the authorized_hosts list.
This operation is only available to system administrators. An administrator may set the privileges of all users other than themself.
PUT /users/{id}/connection_privileges
Request
Path Parameters
ID of the user who's information is to be updated
Connection privilege information
The user's ID
If 'yes', database connections will only be allowed from the list of authorized hosts. If 'no', database connections will be allowed from anywhere.
A list of IP addresses or hostnames in which the user can connect from.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{HOSTNAME}/dbapi/v4/users/{id}/connection_privileges" payload := strings.NewReader("{\"userid\":\"<ADD STRING VALUE>\",\"restricted\":\"<ADD STRING VALUE>\",\"authorized_hosts\":[\"<ADD STRING VALUE>\"]}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {AUTH_TOKEN}") 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>\",\"restricted\":\"<ADD STRING VALUE>\",\"authorized_hosts\":[\"<ADD STRING VALUE>\"]}"); Request request = new Request.Builder() .url("https://{HOSTNAME}/dbapi/v4/users/{id}/connection_privileges") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer {AUTH_TOKEN}") .build(); Response response = client.newCall(request).execute();
var http = require("https"); var options = { "method": "PUT", "hostname": "{HOSTNAME}", "port": null, "path": "/dbapi/v4/users/{id}/connection_privileges", "headers": { "content-type": "application/json", "authorization": "Bearer {AUTH_TOKEN}" } }; 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>', restricted: '<ADD STRING VALUE>', authorized_hosts: ['<ADD STRING VALUE>'] })); req.end();
import http.client conn = http.client.HTTPSConnection("{HOSTNAME}") payload = "{\"userid\":\"<ADD STRING VALUE>\",\"restricted\":\"<ADD STRING VALUE>\",\"authorized_hosts\":[\"<ADD STRING VALUE>\"]}" headers = { 'content-type': "application/json", 'authorization': "Bearer {AUTH_TOKEN}" } conn.request("PUT", "/dbapi/v4/users/{id}/connection_privileges", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
curl -X PUT https://{HOSTNAME}/dbapi/v4/users/{id}/connection_privileges -H 'authorization: Bearer {AUTH_TOKEN}' -H 'content-type: application/json' -d '{"userid":"<ADD STRING VALUE>","restricted":"<ADD STRING VALUE>","authorized_hosts":["<ADD STRING VALUE>"]}'
Response
The user's ID
If 'yes', database connections will only be allowed from the list of authorized hosts. If 'no', database connections will be allowed from anywhere.
A list of IP addresses or hostnames in which the user can connect from.
Status Code
Updated user connection privileges
Access to this user's connection privileges is not allowed
The user does not exist
Error payload