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
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.
file_options
If set to 'INSERT' data is appended to the existing table data. If set to 'REPLACE' the table data is replaced with the data being loaded.
Allowable values: [
INSERT
,REPLACE
]Default:
INSERT
Maximum number of rows to be loaded. If set to zero or not specified, all rows from the source data are loaded. Not supported in multi-partitioned (MPP) Db2 Warehouse on Cloud environments.
Default:
0
Maximum number of warnings that are tolerated before failing the load operation. A warning is generated for each row that is not loaded correctly.
Default:
1000
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.
Allowable values: [
yes
,no
]Optional list of column names for the target table. When not provided, the system will auto-generate the column names.
auto_create_table
Required when load_type is set to "S3" or "SOFTLAYER". It specifies how to located the data to be loaded from a cloud storage service.
URL of the cloud storage endpoint where data is located. Amazon S3 valid endpoints are "s3.amazonaws.com", "s3.us-east-2.amazonaws.com", "s3-us-west-1.amazonaws.com, "s3-us-west-2.amazonaws.com", "s3.ca-central-1.amazonaws.com", "s3.ap-south-1.amazonaws.com", "s3.ap-northeast-2.amazonaws.com", "s3-ap-southeast-1.amazonaws.com", "s3-ap-southeast-2.amazonaws.com", "s3-ap-northeast-1.amazonaws.com", "s3.eu-central-1.amazonaws.com", "s3-eu-west-1.amazonaws.com", "s3.eu-west-2.amazonaws.com", "s3-sa-east-1.amazonaws.com". SoftLayer object storage valid endpoints are "https://ams01.objectstorage.softlayer.net/auth/v1.0", "https://che01.objectstorage.softlayer.net/auth/v1.0", "https://dal05.objectstorage.softlayer.net/auth/v1.0", "https://fra02.objectstorage.softlayer.net/auth/v1.0", "https://hkg02.objectstorage.softlayer.net/auth/v1.0", "https://lon02.objectstorage.softlayer.net/auth/v1.0", "https://mel01.objectstorage.softlayer.net/auth/v1.0", "https://mex01.objectstorage.softlayer.net/auth/v1.0", "https://mil01.objectstorage.softlayer.net/auth/v1.0", "https://mon01.objectstorage.softlayer.net/auth/v1.0", "https://par01.objectstorage.softlayer.net/auth/v1.0", "https://sao01.objectstorage.softlayer.net/auth/v1.0", "https://seo01.objectstorage.softlayer.net/auth/v1.0", "https://sjc01.objectstorage.softlayer.net/auth/v1.0", "https://sng01.objectstorage.softlayer.net/auth/v1.0", "https://syd01.objectstorage.softlayer.net/auth/v1.0", "https://tok02.objectstorage.softlayer.net/auth/v1.0", "https://tor01.objectstorage.softlayer.net/auth/v1.0", "https://wdc.objectstorage.softlayer.net/auth/v1.0".
Path used to find and retrieve the data in the cloud storage service
Username (SoftLayer) or Access Key (S3).
API Key (SoftLayer) or Secret Key (S3).
cloud_source
Required when load_type is set to "SERVER". It specifies how to source filein the server.
File path in the server relative to the user's home folder.
server_source
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{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
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
file_options
If set to 'INSERT' data is appended to the existing table data. If set to 'REPLACE' the table data is replaced with the data being loaded.
Allowable values: [
INSERT
,REPLACE
]Default:
INSERT
Maximum number of rows to be loaded. If set to zero or not specified, all rows from the source data are loaded. Not supported in multi-partitioned (MPP) Db2 Warehouse on Cloud environments.
Default:
0
Maximum number of warnings that are tolerated before failing the load operation. A warning is generated for each row that is not loaded correctly.
Default:
1000
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.
Allowable values: [
yes
,no
]Optional list of column names for the target table. When not provided, the system will auto-generate the column names.
auto_create_table
Required when load_type is set to "S3" or "SOFTLAYER". It specifies how to located the data to be loaded from a cloud storage service.
URL of the cloud storage endpoint where data is located. Amazon S3 valid endpoints are "s3.amazonaws.com", "s3.us-east-2.amazonaws.com", "s3-us-west-1.amazonaws.com, "s3-us-west-2.amazonaws.com", "s3.ca-central-1.amazonaws.com", "s3.ap-south-1.amazonaws.com", "s3.ap-northeast-2.amazonaws.com", "s3-ap-southeast-1.amazonaws.com", "s3-ap-southeast-2.amazonaws.com", "s3-ap-northeast-1.amazonaws.com", "s3.eu-central-1.amazonaws.com", "s3-eu-west-1.amazonaws.com", "s3.eu-west-2.amazonaws.com", "s3-sa-east-1.amazonaws.com". SoftLayer object storage valid endpoints are "https://ams01.objectstorage.softlayer.net/auth/v1.0", "https://che01.objectstorage.softlayer.net/auth/v1.0", "https://dal05.objectstorage.softlayer.net/auth/v1.0", "https://fra02.objectstorage.softlayer.net/auth/v1.0", "https://hkg02.objectstorage.softlayer.net/auth/v1.0", "https://lon02.objectstorage.softlayer.net/auth/v1.0", "https://mel01.objectstorage.softlayer.net/auth/v1.0", "https://mex01.objectstorage.softlayer.net/auth/v1.0", "https://mil01.objectstorage.softlayer.net/auth/v1.0", "https://mon01.objectstorage.softlayer.net/auth/v1.0", "https://par01.objectstorage.softlayer.net/auth/v1.0", "https://sao01.objectstorage.softlayer.net/auth/v1.0", "https://seo01.objectstorage.softlayer.net/auth/v1.0", "https://sjc01.objectstorage.softlayer.net/auth/v1.0", "https://sng01.objectstorage.softlayer.net/auth/v1.0", "https://syd01.objectstorage.softlayer.net/auth/v1.0", "https://tok02.objectstorage.softlayer.net/auth/v1.0", "https://tor01.objectstorage.softlayer.net/auth/v1.0", "https://wdc.objectstorage.softlayer.net/auth/v1.0".
Path used to find and retrieve the data in the cloud storage service
Username (SoftLayer) or Access Key (S3).
API Key (SoftLayer) or Secret Key (S3).
cloud_source
Required when load_type is set to "SERVER". It specifies how to source filein the server.
File path in the server relative to the user's home folder.
server_source
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://{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
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
stats
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
Example:
SYSCAT
Example:
TABLES
filter
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
Example:
SYSCAT
Example:
TABLES
Allowable values: [
VIEW
,SCHEMA
,TABLE
,DATABASE
,PROCEDURE
,FUNCTION
,MQT
,SEQUENCE
,HADOOP_TABLE
,NICKNAME
,INDEX
,TABLESPACE
]Example:
VIEW
Example:
PUBLIC
Allowable values: [
GROUP
,ROLE
,USER
]Example:
GROUP
grantee
privileges
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.
Schema name.
Example:
SCHEMA_NAME
objects
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:ViewSpecifies 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
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
column_info
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.
Data type
Example:
column_info