Db2 Warehouse on Cloud v4

Introduction Use the Db2 Warehouse as a Service API to access data, view and create database objects, administer, and monitor your Db2 Warehouse as a Service service. Root URL The context root for the Db2 Warehouse as a Service API is /dbapi/v4/. Error handling This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response indicates success. A 400 type response is some sort of failure. Security Every request must include the Authorization HTTP header with the value Bearer accesstoken. An access token can be obtained with the /auth/tokens endpoint, and it is used by Db2 Warehouse as a Service to identify who you are. Some api methods for example: /schemas and /sqljobs also support direct access to the database using HTTP headers. For example: X-DB-Userid:databaseuser, X-DB-Password:databasepassword, 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 as a Service 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.

MethodPathSummary
POST/auth/tokensRequest a new access token
GET/auth/token/publickeyReturns public key of Json Web Token
DELETE/auth/token/logoutPerform logout operation for a token
POST/auth_policiesCreates a new authentication policy **ADMIN ONLY**
GET/auth_policiesLists all authentication policies **ADMIN ONLY**
GET/auth_policies/{id}Returns an authentication policy **ADMIN ONLY**
PUT/auth_policies/{id}Updates an authentication policy **ADMIN ONLY**
DELETE/auth_policies/{id}Deletes an existing policy **ADMIN ONLY**
PUT/auth/passwordSets a new password using dswebToken
POST/auth/resetRequests a password reset based on user's email
GET/backupsGet a list of backups
POST/backups/restoreRestore
POST/backups/backupCreate a backup
DELETE/backups/{id}Delete a backup
GET/backups/settingGet backup setting
POST/backups/settingUpdate backup setting
POST/load_jobs_ETCreates a data load job, load uses external table technology
GET/load_jobsLists all data load jobs, load uses Db2 load utility technology
POST/load_jobsCreates a data load job
GET/load_jobs/{id}Returns details about a load job including its progress
DELETE/load_jobs/{id}Removes load job from history
GET/load_jobs/{id}/logDowloads log file for a data load job
GET/schemasLists all schemas in the database
GET/schemas/{schema_name}Returns schema information
GET/schemas/{schema_name}/tablesLists tables in a schema
GET/schemas/{schema_name}/tables/{table_name}Returns information about a table
DELETE/schemas/{schema_name}/tables/{table_name}/dataDeletes all table data
GET/admin/schemas/obj_type/{obj_type}Query the list of object schemas
POST/admin/schemasCreate schema
DELETE/admin/schemasDrops an empty schema
GET/admin/privilegesGet single object privilege
POST/admin/privilegesPrivilege list of selected objects
PUT/admin/privilegesGrant or revoke privileges
POST/admin/schemas/ddlGenerate schema DDL
PUT/admin/tablesCreate a new table
DELETE/admin/tablesDrop table
GET/admin/schemas/{schema_name}/tables/{table_name}/definitionGet table definition
GET/admin/schemas/{schema_name}/tables/{table_name}/dataQuery table data
GET/admin/schemas/{schema_name}/tables/{table_name}/columns/{column_name}/propertiesGet column detail properties
GET/admin/tables/meta/datatypeGet the metadata type
POST/admin/tables/ddlGenerate table DDL
GET/admin/schemas/{schema_name}/tables/{table_name}/distribution_keysGet distributin keys
GET/admin/schemas/{schema_name}/tables/{table_name}/distributions/propertiesGet data distributin property
GET/admin/schemas/{schema_name}/tables/{table_name}/partitions/expressionsGet partition expressions
GET/admin/schemas/{schema_name}/tables/{table_name}/partitionsGet data partitions
GET/admin/schemas/{schema_name}/views/{view_name}/propertiesQuery view detail properties
DELETE/admin/viewsDrop views
GET/admin/schemas/{schema_name}/views/{view_name}/dataQuery view data
GET/admin/schemas/{schema_name}/views/{view_name}/definitionGet View definition
POST/admin/views/ddlGenerate view DDL
GET/admin/schemas/{schema_name}/{obj_type}/{object_name}/dependenciesGet the dependencies of the object
GET/admin/tablespaces/{tablespace}/dependenciesGet the dependencies of the tablespace
GET/admin/bufferpools/{bufferpool_name}/propertiesQuery bufferpool detail properties
GET/admin/schemas/{schema_name}/tables/{table_name}/constraints/{constraint_name}/propertiesQuery constraint detail properties
GET/admin/schemas/{schema_name}/tables/{table_name}/indexes/{index_name}/propertiesQuery index detail properties
GET/admin/schemas/{schema_name}/triggers/{trigger_name}/propertiesQuery trigger detail properties
GET/admin/schemas/{schema_name}/mqts/{mqt_name}/propertiesQuery MQT detail properties
GET/admin/schemas/{schema_name}/functions/{specific_name}/propertiesQuery UDF detail properties
GET/admin/tablespaces/{table_space}/propertiesQuery tablespace detail properties
GET/admin/schemas/{schema_name}/procedures/{specific_name}/propertiesQuery procedure detail properties
GET/admin/schemas/{schema_name}/sequences/{sequence_name}/propertiesQuery sequence detail properties
GET/admin/schemas/{schema_name}/packages/{package_name}/propertiesQuery package detail properties
GET/admin/schemas/{schema_name}/udts/{type_name}/propertiesQuery UDT detail properties
GET/admin/schemas/{schema_name}/aliases/{alias_name}/propertiesQuery alias detail properties
GET/admin/schemas/{schema_name}/tables/{table_name}/propertiesGet table detail properties
PUT/admin/aliasesCreate alias
DELETE/admin/aliasesDrop alias
POST/admin/aliases/ddlGenerate Alias DDL
GET/admin/schemas/{schema_name}/aliases/{alias_name}/dataQuery alias data
POST/admin/mqts/ddlGet the SQL statement template for creating MQT table
DELETE/admin/mqtsDelete mqt tables
GET/admin/schemas/{schema_name}/mqts/{mqt_name}/definitionGet the definition of MQT table
GET/admin/schemas/{schema_name}/mqts/{mqt_name}/dataGet the data of specified mqt table
GET/admin/privileges/authenticationsGet authentications through the authid filter
GET/admin/privileges/{authid_type}/{authid}/{obj_type}Get the privieles of auth id
POST/admin/privileges/dclGet SQL statement of grant or revoke privileges
POST/admin/privileges/rolesAdd new role
PUT/admin/privileges/rolesGrant or revoke the privilges of role
DELETE/admin/privileges/roles/{role_name}Delete one role
GET/admin/privileges/roles/{authid_type}/{authid}Get the membership of authid
POST/admin/privileges/roles/dclGet SQL statement of grant or revoke role
POST/admin/privileges/multiple_objtypes/dclGet SQL statement for grant or revoke privileges
PUT/admin/privileges/multiple_objtypesGrant or revole privileges for multiple objects and objects type
POST/admin/privileges/multiple_roles/dclGet the SQL statement for grant or revoke multiple roles
PUT/admin/privileges/multiple_rolesGrant or revoke multiple roles
POST/admin/workloads/ddlGenerate workload DDL
GET/admin/workloadsLists workloads
DELETE/admin/sequencesDrop sequences
DELETE/admin/proceduresDrop procedures
GET/admin/schemas/{schema_name}/procedures/{specific_name}/parametersRetrieve parameters for procedure
POST/admin/procedures/ddlGenerate create procedure template
DELETE/admin/functionsDrop functions
GET/admin/schemas/{schema_name}/functions/{specific_name}/parametersRetrieve parameters for specific udf
POST/admin/functions/ddlGenerate create function template
DELETE/admin/udtsDrop User-defined Types
GET/admin/schemas/{schema_name}/udts/{udt_name}/definitionRetrieve row definition for User-defined Type object
POST/admin/udts/ddlGenerate Create User-defined Types template
GET/admin/tablespacesQuery the list of tablespace
DELETE/admin/tablespacesDrop tablespaces
GET/admin/tablespaces/{tablespace}/iosettingGet the I/O settings of the tablespace
GET/admin/tablespaces/{tablespace}/sizeGet the tablespace size
POST/explain/explain_modelGenerate visual explain model for a given sql
GET/explain/explain_model/{sessionId}/diagram/nodesGet visual explain nodes information
POST/explain/explain_model/{sessionId}/diagram/layoutGenerate visual explain layout
GET/explain/explain_model/{sessionId}/diagram/nodes/{nodeId}/descriptionGet the data of the selected node
GET/explain/explain_model/search/{sessionId}/{namePattern}Search node based on the key word and predefined rule
POST/explain/explain_model/search/{sessionId}Search node based on the key word and predefined rule
GET/home/{path}Returns metadata of an item in the user's home storage
DELETE/home/{path}Deletes a file in the user's home storage
GET/home_content/{path}Download file from user's home storage
POST/home_content/{path}Uploads a file to the user's home storage
GET/platform-keys/configurationsRetrieves current configuration
POST/platform-keys/configurationsMigrate key
GET/platform-keys/instancesReturns Key Protect instance information
GET/platform-keys/instances/{instance_id}/region/{region_id}/keysReturns keys for given Key Protect instance
GET/monitorReturns overall status of system components
GET/monitor/connectionsLists active database connections **DB ADMIN ONLY**
DELETE/monitor/connections/{application_handle}Terminates a database connection **DB ADMIN ONLY**
GET/monitor/storageReturns current storage usage **DB ADMIN ONLY**
GET/monitor/storage/historyReturns storage usage history **DB ADMIN ONLY**
GET/monitor/storage/by_schemaStorage utilization by schema **DB ADMIN ONLY**
GET/monitor/storage/by_schema/{schema_name}Storage utilization of a schema **DB ADMIN ONLY**
GET/metrics/statements_countReturn the number of statements for a specified time frame. **DB ADMIN ONLY**
GET/metrics/response_time_histogramsReturn the histogram of response time for a specified time frame. **DB ADMIN ONLY**
GET/metrics/average_response_timeReturn the average response time for a specified time frame. **DB ADMIN ONLY**
GET/metrics/response_timeReturn the list of average response time for a specified time frame. **DB ADMIN ONLY**
GET/metrics/average_statements_rateReturn the average number of statements executed every minutes for a specified time frame. **DB ADMIN ONLY**
GET/metrics/statements_rateReturn numbers of statements executed every minutes for a specified time frame. **DB ADMIN ONLY**
GET/metrics/average_rows_readReturn the average number of rows read(rows/min) for a specified time frame. **DB ADMIN ONLY**
GET/metrics/rows_readReturn the numbers of rows read(rows/min) for a specified time frame. **DB ADMIN ONLY**
GET/metrics/max_connections_countReturn the maximum number of concurrent connections for a specified time frame **DB ADMIN ONLY**
GET/metrics/connections_countReturn maximum numbers of concurrent connections for a specified time frame. **DB ADMIN ONLY**
GET/metrics/max_lockwaits_rateReturn the maximum lockwaits per minute for a specified time frame. **DB ADMIN ONLY**
GET/metrics/lockwaits_rateReturn the maximum lockwaits per minute for a specified time frame. **DB ADMIN ONLY**
GET/metrics/max_log_spaceReturn the maximum usage percentage of logs for a specified time frame. **DB ADMIN ONLY**
GET/metrics/log_spaceReturn the maximum usage percentages of logs for a specified time frame. **DB ADMIN ONLY**
GET/metrics/max_cpuReturn the maximum percent of node CPU usage for a specified time frame. **DB ADMIN ONLY**
GET/metrics/cpu_summaryReturn the percent of node CPU usage for a specified time frame. **DB ADMIN ONLY**
GET/metrics/max_memoryReturn the maximum percent of node memory usage for a specified time frame. **DB ADMIN ONLY**
GET/metrics/memory_summaryReturn the percent of node memory usage for a specified time frame. **DB ADMIN ONLY**
GET/metrics/max_storageReturn the maximum usage percent of storage for a specified time frame. **DB ADMIN ONLY**
GET/metrics/storageReturn the usage percent of storage for a specified time frame. **DB ADMIN ONLY**
GET/metrics/timespentReturn the time spent in each operation for a specified time frame. **DB ADMIN ONLY**
GET/metrics/schemas/{tabschema}/tables/{tabname}/storage/timeseriesReturn a table storage usage in a time range **DB ADMIN ONLY**
GET/metrics/tables/storageReturns a list for tables storage **DB ADMIN ONLY**
GET/metrics/schemas/{tabschema}/tables/{tabname}/storageReturns a table storage **DB ADMIN ONLY**
GET/metrics/storage/schemasReturns a list for schemas storage **DB ADMIN ONLY**
GET/metrics/storage/schemas/{tabschema}/timeseriesReturn a schema used storage in a time range **DB ADMIN ONLY**
GET/metrics/storage/schemas/{tabschema}Returns a schema storage **DB ADMIN ONLY**
POST/metrics/tables/storage/collectorRuns a tables storage collection **DB ADMIN ONLY**
GET/metrics/statements/inflight_executionsReturns a list of inflight executions
GET/metrics/statements/inflight_executions/current/listReturns a list of current inflight executions
GET/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}Returns a infight execution detail
DELETE/metrics/applications/{application_handle}/uow/{uow_id}/inflight_executions/{activity_id}Terminates a statement **DB ADMIN ONLY**
GET/metrics/applications/connectionsReturns a list of connections
GET/metrics/applications/connections/current/listReturns a list of current connections
GET/metrics/applications/connections/{application_handle}Returns a connection detail
DELETE/metrics/applications/connections/{application_handle}Terminates a database connection **DB ADMIN ONLY**
GET/metrics/applications/connections/{application_handle}/timeseriesReturns a list of timeseries of a connection
GET/metrics/schemasReturns performance metrics for schemas **DB ADMIN ONLY**
GET/metrics/schemas/current/listReturns performance metrics for schemas **DB ADMIN ONLY**
GET/metrics/schemas/{schema_name}Returns performance metrics for one schema **DB ADMIN ONLY**
GET/metrics/schemas/{schema_name}/membersReturns performance metrics on all members for one schema **DB ADMIN ONLY**
GET/metrics/schemas/{schema_name}/timeseriesReturns performance metrics timeseries for one schema **DB ADMIN ONLY**
GET/metrics/tablesReturns performance of tables **DB ADMIN ONLY**
GET/metrics/tables/current/listReturns current performance of tables **DB ADMIN ONLY**
GET/metrics/schemas/{schema_name}/tables/{table_name}Returns performance of one table **DB ADMIN ONLY**
GET/metrics/schemas/{schema_name}/tables/{table_name}/membersReturns performance on all members for one table **DB ADMIN ONLY**
GET/metrics/schemas/{schema_name}/tables/{table_name}/timeseriesReturns performance timeseries for one table **DB ADMIN ONLY**
GET/metrics/tableperformanceReturns performance of tables and schemas **DB ADMIN ONLY**
GET/metrics/tableperformance/current/listReturns current performance of tables and schemas **DB ADMIN ONLY**
POST/sql_jobsExecutes SQL statements
GET/sql_jobs/{id}Fetches partial results of a SQL job execution
POST/sql_query_exportReturns the results of a SQL query to CSV
PUT/manage/scaling/addCreate a scaling request
DELETE/manage/scaling/cancel/{id}Cancel a pending scaling request
GET/manage/scaling/last_statusGet the last scaling request status
GET/manage/scaling/listGet the complete list of scaling requests
GET/manage/scaling/resourcesGet supported scaling ranges and current allocated resources
GET/manage/scaling/historyView scaling history saved in console
GET/settingsReturns the system's current settings
PUT/settingsUpdates the system settings **ADMIN ONLY**
GET/tasks/statusGet tasks status
POST/asperaGenerates a new Aspera token
DELETE/aspera/{token}Deletes an Aspera token
POST/schema_discoveryAnalyzes CSV data to return a list of data types of its values
GET/usersReturns the list of users
POST/usersCreates a new user. **ADMIN ONLY**
GET/users/{id}Get a specific user by ID
PUT/users/{id}Updates an existing user
DELETE/users/{id}Deletes an existing user **ADMIN ONLY**
PUT/users/{id}/lockLocks a user account indefinitely. **ADMIN ONLY**
PUT/users/{id}/unlockUnlocks a user account **ADMIN ONLY**
GET/users/{id}/connection_privilegesGet a specific user's connection privileges
PUT/users/{id}/connection_privilegesUpdates an existing user's connection privileges **ADMIN ONLY**