Introduction
Watson Query for Cloud Pak for Data integrates data sources across multiple types and locations and turns all this data into one logical data view.
The Watson Query REST API connects to your service deployment, so you can manage your virtual data, data sources, and user roles. Additionally, by using the Watson Query REST API, you can virtualize and publish data to the default catalog in IBM Knowledge Catalog.
Authentication
To authenticate to the API, you pass an access token in an Authorization header. The token is associated with a user name, for example: admin. To generate an access token, call the Get authorization token method.
Endpoint URL
The Watson Query API endpoint URL is based on your IBM Cloud Pak deployment URL.
Watson Query provides two different endpoint URLs that you can use depending on the method that you are using. If the method indicates that it uses the Data Management Console (DMC) URL, use the second endpoint URL.
https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/{method}
https://{cpd_cluster_host}{:port}/icp4data-addons/{dmc-instance}/{namespace}/dbapi/{method}
When you call the API, add the path for each method to form the complete API endpoint for your request. For example, if your instance is deployed at https://www.example.com:31843
and your Data Management Console instance name is DMC-13845673250
, you can access the APIs at https://www.example.com:31843/icp4data-databases/dv/{namespace}/dvapiserver/{method}
or https://www.example.com:31843/icp4data-addons/DMC-13845673250/{namespace}/dbapi/{method}
.
Example
curl -H "cache-control: no-cache" -X {request_method} -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/{method}"
or
curl -H "x-db-profile: {dv-instance}" -H "X-Namespace: {dv-namespace}" -H "Authorization: Bearer {token}" -X {request_method} "https://{cpd_cluster_host}{:port}/icp4data-addons/{dmc-instance}/{namespace}/dbapi/{method}"
Disabling SSL verification
The Watson Query service uses Secure Sockets Layer (SSL) (or Transport Layer Security (TLS)) for secure connections between the client and server. The connection is verified against the local certificate store to ensure authentication, integrity, and confidentiality.
If you use a self-signed certificate, you need to disable SSL verification to make a successful connection.
Enabling SSL verification is highly recommended. Disabling SSL jeopardizes the security of the connection and data. Disable SSL only if necessary, and take steps to enable SSL as soon as possible.
To disable SSL verification for a curl request, use the --insecure
(-k
) option with the request.
Example that disables SSL verification
curl -k -X {request_method} -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "{url}/icp4data-databases/dv/{namespace}/dvapiserver/v2/{method}"
Error handling
Watson Query uses standard HTTP response codes to indicate whether a method completed successfully. HTTP response codes in the 2xx range indicate success. A response in the 4xx range is some sort of failure, and a response in the 5xx range usually indicates an internal system error that cannot be resolved by the user. Response codes are listed with the method.
Methods
Request
No Request Parameters
curl -k -X GET -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/agent_nodes"
Response
- agent_node_array
The type of connector used by the data source. This includes internal and remote connectors.
Number of connectors.
Name of the host of the connector.
Determines whether the data source uses Docker.
Describes the connector.
Name of the node.
Name of the operating system user.
Specifies the node port that the connector will use on the remote data source. Each connector that you install on the remote data source can use a different node port.
Status Code
Success
Bad Request
Unauthorized
Internal Server Error
{ "agent_node_array": { "agent_class": "F", "dscount": "0", "hostname": "dv-0.dv.tns.svc.cluster.local", "is_docker": "false", "node_description": "Not specified", "node_name": "AdminNode", "os_user": "bigsql", "port": "6414" } }
Delete data source connection
Deletes a data source connection from the Watson Query service.
DELETE /v2/datasource/connections/{connection_id}
Request
Path Parameters
The connection identifier for the platform.
Example:
75e4d01b-7417-4abc-b267-8ffb393fb970
Query Parameters
The connection identifier for Watson Query.
Example:
DB210013
curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer $token" "https://{HOSTNAME}:{PORT_NUMBER}/icp4data-databases/dv/{namespace}/dvapiserver/v2/datasource/connections/75e4d01b-7417-4abc-b267-8ffb393fb970?cid=DB210013"
Get data source connections
Gets all data source connections that are connected to the service.
GET /v2/datasource/connections
Request
No Request Parameters
curl -k -X GET -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer $token" "https://{HOSTNAME}:{PORT_NUMBER}/icp4data-databases/dv/{namespace}/dvapiserver/v2/datasource/connections"
Response
- datasource_connections
The name of the node that a datasource connection associates.
The description of the node that a datasource connection associates.
The type of connector, for example, H stands for Hosted, ie running within the cluster, F means Fenced Mode Process, ie direct within Watson Query instance.
The hostname or IP address that is used to access the connection.
The port number that is used to access the connection.
Determines whether the data source uses Docker.
The number of data sources.
- data_sources
The connection identifier for Watson Query.
The name of the database.
The connection identifier for the platform.
The hostname or IP address of the data source.
The port number of the data source.
The type of the data source.
The user that has access to the data source.
The URI of the data source.
The status of the data source.
The name of the connection.
Status Code
Success
Bad Request
Unauthorized
Internal Server Error
{ "datasource_connections": [ { "agent_class": "F", "dscount": "0", "hostname": "dv-0.dv.tns.svc.cluster.local", "is_docker": "N", "node_name": "AdminNode", "node_description": "Not specified", "port": "6414", "os_user": "bigsql", "data_sources": [ { "cid": "MSSQL10000", "dbname": "mssql2014db1", "connection_id": "75e4d01b-7417-4abc-b267-8ffb393fb970", "srchostname": "example.ibm.com", "srcport": "1433", "srctype": "MSSQLServer", "status": "string", "usr": "DV-user", "uri": "example.ibm.com:1433/" } ] } ] }
Add data source connection
Adds a data source connection to the Watson Query service.
POST /v2/datasource/connections
Request
The type of data source that you want to add.
Example:
db2
The name of the data source
Example:
DB2
The location of the data source that you want to add.
Example:
us
- properties
Example:
ya29.Il-_
Example:
ibmdatastage.us-east-1
Example:
ApiKey-a31d60c5-0f7b-4995-a4ae-69bf09d3de50
Example:
Bearer Token
Example:
81571342315
Example:
uIn8rVyIRsd
Example:
test_collection
Example:
-----BEGIN PRIVATE KEY-----
Example:
TPCDS
Example:
192.168.0.1
Example:
cliservice
Example:
/v2/asset_files/dbdrivers/ngdbc.jar
Example:
Snowflake
Example:
/v2/asset_files/dbdrivers/ngdbc.jar
Example:
password
Example:
50000
Example:
housecanary-com
Example:
key=value
Example:
1//06uwhP7_312g
Example:
SYSADMIN
Example:
https://sapes5.sapdevcenter.com
Example:
ol_informix1410
Example:
pdborcl.fyre.ibm.com
Example:
orcl
Example:
false
Example:
-----BEGIN CERTIFICATE-----
Example:
test.com
Example:
false
Example:
db2inst1
Example:
wdpcondev
Example:
USER
curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer $token" -d "{\"datasource_type\":\"db2\",\"name\":\"db2\",\"origin_country\":\"us\",\"properties\":{\"database\":\"TPDCS\",\"host\":\"{hostname}\", \"password\":\"myPassword\", \"port\":\"50000\", \"ssl\":\"true\", \"username\":\"DV-user\"}}" "https://{HOSTNAME}:{PORT_NUMBER}/icp4data-databases/dv/{namespace}/dvapiserver/v2/datasource/connections"
Discover data sources
Automatically discovers the data sources that can be connected to Watson Query.
GET /v2/discover_datasource
Request
No Request Parameters
curl -k -X GET -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/discover_datasource"
Response
- datasource_array
The hostname or IP address that is required to access the database.
Determines whether the data source is configured.
Determines whether the data source is connected.
Determines whether the data source was discovered.
The description of the node.
The name of the node.
The port number that is required to access the connection.
The type of the data source.
Status Code
Success
Bad Request
Unauthorized
Internal Server Error
{ "datasource_array": [ { "db_hostname": "halon1", "is_configured": "0", "is_connected": "0", "is_discovered": "1", "node_description": "This is my example node description.", "node_name": "halon1:6421", "port": "50000", "src_type": "DB2" } ] }
Generate installation script for remote connectors
Generates a script to install connectors on remote data sources.
GET /v2/endpoint_script
Request
Query Parameters
Specifies the external hostname of the
dv-engine
service component.Specifies the external port of the
dv-engine
service component.Default:
443
Specifies whether to use SSL connection for the remote data source.
Default:
true
Specifies the operating system of the remote data source.
Default:
Linux
Specifies the type of the installation package.
Default:
tar
Specifies the directory where Java is installed on the remote data source.
Default:
/opt/ibm/java
Specifies the directory where you want to install the remote connector.
Default:
/opt/ibm/dv
Specifies the service node.
Specifies the service node description.
Specifies the node port that the connector will use on the remote data source. Each connector that you install on the remote data source can use a different node port.
Default:
6414
curl -k -X GET -H "cache-control: no-cache" -H "Authorization: Bearer {token}" -d "{\"admin_host\":\"{EXTERNAL_HOSTNAME}\",\"admin_port\":\"443\",\"use_ssl\":\"true\",\"platform\":\"Linux\",\"file_type\":\"TAR\",\"java_home\":\"/opt/ibm/java\",\"install_path\":\"/opt/ibm/dv\",\"node_name\":\"dv-node\",\"node_desc\":\"my DV node\",\"data_port\":\"6414\"\}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/endpoint_script"
Request
- body
The name of the virtual object.
Possible values: length ≥ 1
Example:
EMPLOYEE
The schema of the virtual object.
Possible values: length ≥ 1
Example:
USER999
The identifier of the authorization.
Possible values: length ≥ 1
Example:
PUBLIC
curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer {token}" -d "{\"table_name\":\"EMPLOYEE\",\"table_schema\":\"USER999\", \"authid\":\"PUBLIC\"}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/privileges/users"
Revoke user acccess
Revokes user access to the virtualized table.
DELETE /v2/privileges/users/{authid}
Request
Path Parameters
The Watson Query user name. If this value is Public, this API revokes access privilege from all Watson Query users.
Example:
PUBLIC
Query Parameters
The virtualized table's name.
Example:
EMPLOYEE
The virtualized table's schema name.
Example:
dv_ibmid_060000s4y5
curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer $token" "https://{HOSTNAME}:{PORT_NUMBER}/icp4data-databases/dv/{namespace}/dvapiserver/v2/privileges/users/PUBLIC?table_schema=dv_ibmid_060000s4y5&table_name=EMPLOYEE"
Request
Grants a role to manage virtual objects.
The name of the virtual object.
Possible values: length ≥ 1
Example:
EMPLOYEE
The schema of the virtual object.
Possible values: length ≥ 1
Example:
USER999
The role to grant to the user.
Possible values: length ≥ 1
Example:
DV_ENGINEER
curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer {token}" -d "{\"table_name\":\"EMPLOYEE\",\"table_schema\":\"USER999\",\"role_name\":\"DV_ENGINEER\"}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/privileges/roles"
Request
Path Parameters
The Watson Query role. Values can be DV_ADMIN, DV_ENGINEER, DV_STEWARD, or DV_WORKER, which correspond to MANAGER, ENGINEER, STEWARD, and USER roles in the user interface.
Example:
DV_ENGINEER
Query Parameters
The virtualized table's name.
Example:
EMPLOYEE
The virtualized table's schema name.
Example:
dv_ibmid_060000s4y5
curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer $token" "https://{HOSTNAME}:{PORT_NUMBER}/icp4data-databases/dv/{namespace}/dvapiserver/v2/privileges/roles/DV_ENGINEER?table_schema=dv_ibmid_060000s4y5&table_name=EMPLOYEE"
Get objects by role
Retrieves the list of virtual objects that have a specific role.
GET /v1/privileges/objects/role/{rolename}
Turn policy enforcement status on or off
Enforcement of data protection rules is enabled automatically when an IBM Knowledge Catalog instance is provisioned.
PUT /v2/security/policy/status
Request
Query Parameters
Sets the status of the policy enforcement.
Example:
enabled
curl -k -X PUT -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer $token" "https://{HOSTNAME}:{PORT_NUMBER}/icp4data-databases/dv/{namespace}/dvapiserver/v2/security/policy/status?status=enabled"
Get policy enforcement status
Gets the policy enforcement status. The function returns enabled or disabled depending on the status.
GET /v2/security/policy/status
Create remote table for data files in the remote connector
Creates a remote table for data files in the remote connector.
POST /v2/virtualize/files
Request
Creates a remote table for data files on the remote connectors.
Specifies the column names for the virtual table.
Specifies the column data types for the virtual table.
Specifies the full path on the remote data source.
Example:
/home/data.csv
Specifies the name of the node where the file will be created.
Example:
qpendpoint_1:6415
Specifies the virtual table name.
Specifies the virtual table schema.
Specifies whether the creation of the virtual table is case sensitive.
Default:
false
Specifies whether to replace an existing file with the new virtual table.
Default:
false
Lists all options that you can specify to create a virtualized file.
Example:
COLNAMES=true
curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer {token}" -d "{\"column_names\":\"{COLUMN_NAMES}\",\"column_types\":\"{COLUMN_DATA_TYPES}\",\"file_path\":\"/home/data.csv\",\"is_ignore_case\":\"false\",\"is_replace\":\"false\",\"node_name\":\"AdminNode\",\"options\":\"COLNAMES=true\",\"virtual_name\":\"Tab1\",\"virtual_schema\":\"USER999\"}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/virtualize/files"
Virtualize table
Transforms a given data source table into a virtual table.
POST /v2/virtualization/tables
Request
request body
The name of the source table.
Example:
Tab1
- source_table_def
The name of the column.
Example:
Column1
The type of the column.
Example:
INTEGER
The name of virtual table.
Example:
Tab1
The schema of the virtual table.
Example:
USER999
- virtual_table_def
The name of the column.
Example:
Column_1
The type of the column.
Example:
INTEGER
The columns that are included in the table.
Example:
Y, Y, N
Determines whether to replace columns in the virtual table.
curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer {token}" -d "{\"is_included_columns\":\"Y, Y, N\",\"replace\":\false\,\"source_name\":\"Tab1\",\"source_table_def\":\[{\"column_name\":\"Column1\",\"column_type\":\"INTEGER\"}],\"sources\":\"DB210001:\"Hjq1\"\",\"virtual_name\":\"Tab1\",\"virtual_schema\":\"USER999\",\"virtual_table_def\":\[{\"column_name\":\"Column1\",\"column_type\":\"INTEGER\"}]}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/virtualization/tables"
Delete virtualized data
Removes the specified table. You must specify the schema, name, and type. You must use the Data Management Console (DMC) endpoint URL.
POST /v4/dv/delete_virtualize_task
Request
Custom Headers
The dv instance.
Example:
dv-1683880621681965
The namespace that the dv instance is in.
Example:
cpd47x
- delete_assets
The schema of the virtual object.
The name of the virtual object.
The type of the virtual object.
Allowable values: [
table
,view
,objectStore
]
curl -k -X POST "https://{cpd_cluster_host}{:port}/icp4data-addons/{dmc-instance}/{namespace}/dbapi/v4/dv/delete_virtualize_task" -H "Authorization: Bearer {token}" -H "x-db-profile: {dv_instance}" -H "X-Namespace: {dv_namespace}" -H "Content-Type: application/json" -d "{\"delete_assets\": [{\"virtual_schema\": \"string\",\"virtual_name\": \"string\",\"type\": \"table\"}]}"
Response
- delete_assets_result
- delete_sucess
The schema of the virtual object.
The name of the virtual object.
- delete_failed
The schema of the virtual object.
The name of the virtual object.
Error message.
Status Code
Success
Bad Request
Internal Server Error
{ "response": { "value": { "delete_assets_result": { "delete_sucess": [ { "virtual_schema": "schema1", "virtual_name": "table1" } ], "delete_failed": [ { "virtual_schema": "schema2", "virtual_name": "table2", "message": "SQLExecute: {42704} [IBM][CLI Driver][DB2/LINUXX8664] SQL0204N \"schema2.table2\" is an undefined name. SQLSTATE=42704\n" } ] } } } }
Delete table
Removes the specified table. You must specify the schema and table name.
DELETE /v2/mydata/tables/{schema_name}/{table_name}
Delete view
Removes the specified table. You must specify the schema and view name.
DELETE /v2/mydata/views/{schema_name}/{view_name}
Request
Path Parameters
The schema of the view to be deleted.
The name of the view to be deleted.
curl -k -X DELETE -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/mydata/views/{schema_name}/{view_name}"
Request
Query Parameters
Indicates whether to verify that the cache can be created using the SQL that was was supplied. If dry_run is set to true, the cache is not created, it is just validated.
A JSON body with the cache's SQL definition and a name for the cache.
{
"name": "cache1",
"query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6",
"refresh_schedule": "* * */5 * *"
}
A unique user-defined name for the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Cache definition provided by user and expressed in SQL.
Possible values: 1 ≤ length ≤ 10000000, Value must match regular expression
.*
An optional cron-style schedule to refresh the cache (Refer: https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer {token}" -d "{\"name\":\"cache1\",\"query\":\"SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6\",\"refresh_schedule\":\"* * */5 * *\"}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/caching/caches"
Response
A cache and its metadata.
Unique user-defined name of the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Unique internal-generated ID of the cache.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
SQL query that defines the cache.
Possible values: 0 ≤ length ≤ 10000000, Value must match regular expression
.*
The login user ID that created this cache.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
.*
Timestamp when the cache was created.
Timestamp when the cache was last modified.
State of the cache:
populating
- the state when data is being inserted into the cacheactivating
- the state when cache is being readied for usageenabling
- the state when a disabled cache is being enableddisabling
- the state when an enabled cache is being disableddeleting
- the state when a cache is being deletedenabled
- the state of an active cachedisabled
- the state of an inactive cachedeleted
- the state of a deleted cacherefreshing
- the state when the cache is being updated with new datafailed
- the state of a cache when it fails to be created or deleted.
Possible values: [
populating
,activating
,enabling
,disabling
,deleting
,enabled
,disabled
,deleted
,refreshing
,failed
]Size of the cache, in KiB.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of rows in the cache.
Possible values: 0 ≤ value ≤ 9223372036854776000
Time taken to refresh the cache at the last attempt in milliseconds.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of times the cache has been refreshed after it was created.
Possible values: 0 ≤ value ≤ 2147483647
Number of times the cache has been used by queries.
Possible values: 0 ≤ value ≤ 2147483647
Timestamp when the cache was last refreshed.
Timestamp when the cache was last used.
A cron-style representation of the cache refresh schedule (Refer https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
An english representation of the cache's refresh schedule.
Possible values: 0 ≤ length ≤ 1000, Value must match regular expression
.*
Status Code
Cache has been created and will start to populate.
Cache SQL validated
Client side error
Unauthorized operation
Server side error
{ "name": "cache1", "id": "DV20220920162021591055", "query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6", "owner_id": "ADMIN", "created_at": "2022-09-20T16:20:21.497519Z", "last_modified_at": "2022-09-20T16:20:21.497519Z", "state": "populating", "size": 0, "cardinality": 0, "time_taken_for_refresh": 0, "refresh_count": 0, "hit_count": 0, "refresh_schedule": "* * */5 * *", "refresh_schedule_description": "every minute every 5 days" }
{ "status_code": 400, "trace": "d50ea1bf-438a-42fb-84e2-f0b0fe95a6ac", "errors": [ { "code": "", "message": "The request was invalid. Cache definition/query null is invalid", "more_info": "" } ] }
Return details of a specific cache
Return the metadata of the specified cache ID.
GET /v2/caching/caches/{id}
Request
Path Parameters
The ID of the cache
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
Example:
DV20220920162021591055
curl -k -X GET -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/caching/caches/{id}"
Response
A cache and its metadata.
Unique user-defined name of the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Unique internal-generated ID of the cache.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
SQL query that defines the cache.
Possible values: 0 ≤ length ≤ 10000000, Value must match regular expression
.*
The login user ID that created this cache.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
.*
Timestamp when the cache was created.
Timestamp when the cache was last modified.
State of the cache:
populating
- the state when data is being inserted into the cacheactivating
- the state when cache is being readied for usageenabling
- the state when a disabled cache is being enableddisabling
- the state when an enabled cache is being disableddeleting
- the state when a cache is being deletedenabled
- the state of an active cachedisabled
- the state of an inactive cachedeleted
- the state of a deleted cacherefreshing
- the state when the cache is being updated with new datafailed
- the state of a cache when it fails to be created or deleted.
Possible values: [
populating
,activating
,enabling
,disabling
,deleting
,enabled
,disabled
,deleted
,refreshing
,failed
]Size of the cache, in KiB.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of rows in the cache.
Possible values: 0 ≤ value ≤ 9223372036854776000
Time taken to refresh the cache at the last attempt in milliseconds.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of times the cache has been refreshed after it was created.
Possible values: 0 ≤ value ≤ 2147483647
Number of times the cache has been used by queries.
Possible values: 0 ≤ value ≤ 2147483647
Timestamp when the cache was last refreshed.
Timestamp when the cache was last used.
A cron-style representation of the cache refresh schedule (Refer https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
An english representation of the cache's refresh schedule.
Possible values: 0 ≤ length ≤ 1000, Value must match regular expression
.*
Status Code
Successfully retrieved information about cache.
Client side error
Unauthorized operation
Object not found
Server side error
{ "name": "cache1", "id": "DV20220920162021591055", "query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6", "owner_id": "ADMIN", "created_at": "2022-09-20T16:20:21.497519Z", "last_modified_at": "2022-09-20T16:20:43.773141Z", "last_refreshed_at": "2022-09-20T16:20:34.592605Z", "state": "enabled", "size": 6, "cardinality": 5, "time_taken_for_refresh": 0, "refresh_count": 0, "hit_count": 0, "refresh_schedule": "* * */5 * *", "refresh_schedule_description": "every minute every 5 days" }
Drop an existing cache
Drop and delete the cache with the specified ID.
DELETE /v2/caching/caches/{id}
Request
Path Parameters
The ID of the cache to drop.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
curl -k -X DELETE -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/caching/caches/{id}"
Response
A cache and its metadata.
Unique user-defined name of the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Unique internal-generated ID of the cache.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
SQL query that defines the cache.
Possible values: 0 ≤ length ≤ 10000000, Value must match regular expression
.*
The login user ID that created this cache.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
.*
Timestamp when the cache was created.
Timestamp when the cache was last modified.
State of the cache:
populating
- the state when data is being inserted into the cacheactivating
- the state when cache is being readied for usageenabling
- the state when a disabled cache is being enableddisabling
- the state when an enabled cache is being disableddeleting
- the state when a cache is being deletedenabled
- the state of an active cachedisabled
- the state of an inactive cachedeleted
- the state of a deleted cacherefreshing
- the state when the cache is being updated with new datafailed
- the state of a cache when it fails to be created or deleted.
Possible values: [
populating
,activating
,enabling
,disabling
,deleting
,enabled
,disabled
,deleted
,refreshing
,failed
]Size of the cache, in KiB.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of rows in the cache.
Possible values: 0 ≤ value ≤ 9223372036854776000
Time taken to refresh the cache at the last attempt in milliseconds.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of times the cache has been refreshed after it was created.
Possible values: 0 ≤ value ≤ 2147483647
Number of times the cache has been used by queries.
Possible values: 0 ≤ value ≤ 2147483647
Timestamp when the cache was last refreshed.
Timestamp when the cache was last used.
A cron-style representation of the cache refresh schedule (Refer https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
An english representation of the cache's refresh schedule.
Possible values: 0 ≤ length ≤ 1000, Value must match regular expression
.*
Status Code
This request will change the cache state to deleting. When the cache has been deleted, its state will turn to deleted.
Client side error
Unauthorized operation
Object not found
Operation cannot be performed
Server side error
{ "name": "cache2", "id": "DV20220920162021591055", "query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6", "owner_id": "ADMIN", "created_at": "2022-09-20T16:20:21.497519Z", "last_modified_at": "2022-09-20T16:31:28.816238Z", "last_refreshed_at": "2022-09-20T16:20:34.592605Z", "state": "deleting", "size": 6, "cardinality": 5, "time_taken_for_refresh": 26443, "refresh_count": 1, "hit_count": 0, "refresh_schedule": "10 * * * *", "refresh_schedule_description": "every hour at minute 10" }
Edit an existing cache
Edit the name of the cache with the specific ID, the refresh schedule of the cache, or both.
PATCH /v2/caching/caches/{id}
Request
Path Parameters
The ID of the cache to edit.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
A JSON body with the cache's new name, new refresh schedule, or both.
{
"refresh_schedule": "10 * * * *",
"name": "cache2"
}
New refresh schedule in a cron-style format (Refer https://www.unix.com/man-page/linux/5/crontab/). An empty input schedule string will stop all scheduling jobs of the cache immediately. In all other cases, the new schedule will take effect after the older schedule, if any, is canceled.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
A new unique name for the cache. An empty name is invalid.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
curl -k -X PATCH -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer {token}" -d "{\"name\":\"cache2\",\"refresh_schedule\":\"10 * * * *\"}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/caching/caches/{id}"
Response
A cache and its metadata.
Unique user-defined name of the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Unique internal-generated ID of the cache.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
SQL query that defines the cache.
Possible values: 0 ≤ length ≤ 10000000, Value must match regular expression
.*
The login user ID that created this cache.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
.*
Timestamp when the cache was created.
Timestamp when the cache was last modified.
State of the cache:
populating
- the state when data is being inserted into the cacheactivating
- the state when cache is being readied for usageenabling
- the state when a disabled cache is being enableddisabling
- the state when an enabled cache is being disableddeleting
- the state when a cache is being deletedenabled
- the state of an active cachedisabled
- the state of an inactive cachedeleted
- the state of a deleted cacherefreshing
- the state when the cache is being updated with new datafailed
- the state of a cache when it fails to be created or deleted.
Possible values: [
populating
,activating
,enabling
,disabling
,deleting
,enabled
,disabled
,deleted
,refreshing
,failed
]Size of the cache, in KiB.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of rows in the cache.
Possible values: 0 ≤ value ≤ 9223372036854776000
Time taken to refresh the cache at the last attempt in milliseconds.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of times the cache has been refreshed after it was created.
Possible values: 0 ≤ value ≤ 2147483647
Number of times the cache has been used by queries.
Possible values: 0 ≤ value ≤ 2147483647
Timestamp when the cache was last refreshed.
Timestamp when the cache was last used.
A cron-style representation of the cache refresh schedule (Refer https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
An english representation of the cache's refresh schedule.
Possible values: 0 ≤ length ≤ 1000, Value must match regular expression
.*
Status Code
Successfully edited cache
Client side error
Unauthorized operation
Object not found
Server side error
{ "name": "cache2", "id": "DV20220920162021591055", "query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6", "owner_id": "ADMIN", "created_at": "2022-09-20T16:20:21.497519Z", "last_modified_at": "2022-09-20T16:31:28.816238Z", "last_refreshed_at": "2022-09-20T16:20:34.592605Z", "state": "enabled", "size": 6, "cardinality": 5, "time_taken_for_refresh": 0, "refresh_count": 0, "hit_count": 0, "refresh_schedule": "10 * * * *", "refresh_schedule_description": "every hour at minute 10" }
Enable an inactive cache
Enable an inactive cache with the specified ID.
POST /v2/caching/caches/{id}/enable
Request
Path Parameters
The ID of the cache to be enabled.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
curl -k -X POST -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/caching/caches/{id}/enable"
Response
A cache and its metadata.
Unique user-defined name of the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Unique internal-generated ID of the cache.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
SQL query that defines the cache.
Possible values: 0 ≤ length ≤ 10000000, Value must match regular expression
.*
The login user ID that created this cache.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
.*
Timestamp when the cache was created.
Timestamp when the cache was last modified.
State of the cache:
populating
- the state when data is being inserted into the cacheactivating
- the state when cache is being readied for usageenabling
- the state when a disabled cache is being enableddisabling
- the state when an enabled cache is being disableddeleting
- the state when a cache is being deletedenabled
- the state of an active cachedisabled
- the state of an inactive cachedeleted
- the state of a deleted cacherefreshing
- the state when the cache is being updated with new datafailed
- the state of a cache when it fails to be created or deleted.
Possible values: [
populating
,activating
,enabling
,disabling
,deleting
,enabled
,disabled
,deleted
,refreshing
,failed
]Size of the cache, in KiB.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of rows in the cache.
Possible values: 0 ≤ value ≤ 9223372036854776000
Time taken to refresh the cache at the last attempt in milliseconds.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of times the cache has been refreshed after it was created.
Possible values: 0 ≤ value ≤ 2147483647
Number of times the cache has been used by queries.
Possible values: 0 ≤ value ≤ 2147483647
Timestamp when the cache was last refreshed.
Timestamp when the cache was last used.
A cron-style representation of the cache refresh schedule (Refer https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
An english representation of the cache's refresh schedule.
Possible values: 0 ≤ length ≤ 1000, Value must match regular expression
.*
Status Code
This request will change the cache state to enabling. When the cache has been enabled, its state will turn to enabled.
Client side error
Unauthorized operation
Object not found
Operation cannot be performed
Server side error
{ "name": "cache2", "id": "DV20220920162021591055", "query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6", "owner_id": "ADMIN", "created_at": "2022-09-20T16:20:21.497519Z", "last_modified_at": "2022-09-20T16:31:28.816238Z", "last_refreshed_at": "2022-09-20T16:20:34.592605Z", "state": "enabling", "size": 6, "cardinality": 5, "time_taken_for_refresh": 0, "refresh_count": 0, "hit_count": 0, "refresh_schedule": "10 * * * *", "refresh_schedule_description": "every hour at minute 10" }
Disable an active cache
Disable an active cache with the specified ID.
POST /v2/caching/caches/{id}/disable
Request
Path Parameters
The ID of the cache to disable.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
curl -k -X POST -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/caching/caches/{id}/disable"
Response
A cache and its metadata.
Unique user-defined name of the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Unique internal-generated ID of the cache.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
SQL query that defines the cache.
Possible values: 0 ≤ length ≤ 10000000, Value must match regular expression
.*
The login user ID that created this cache.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
.*
Timestamp when the cache was created.
Timestamp when the cache was last modified.
State of the cache:
populating
- the state when data is being inserted into the cacheactivating
- the state when cache is being readied for usageenabling
- the state when a disabled cache is being enableddisabling
- the state when an enabled cache is being disableddeleting
- the state when a cache is being deletedenabled
- the state of an active cachedisabled
- the state of an inactive cachedeleted
- the state of a deleted cacherefreshing
- the state when the cache is being updated with new datafailed
- the state of a cache when it fails to be created or deleted.
Possible values: [
populating
,activating
,enabling
,disabling
,deleting
,enabled
,disabled
,deleted
,refreshing
,failed
]Size of the cache, in KiB.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of rows in the cache.
Possible values: 0 ≤ value ≤ 9223372036854776000
Time taken to refresh the cache at the last attempt in milliseconds.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of times the cache has been refreshed after it was created.
Possible values: 0 ≤ value ≤ 2147483647
Number of times the cache has been used by queries.
Possible values: 0 ≤ value ≤ 2147483647
Timestamp when the cache was last refreshed.
Timestamp when the cache was last used.
A cron-style representation of the cache refresh schedule (Refer https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
An english representation of the cache's refresh schedule.
Possible values: 0 ≤ length ≤ 1000, Value must match regular expression
.*
Status Code
This request will change the cache state to disabling. When the cache has been disabled, its state will turn to disabled.
Client side error
Unauthorized operation
Object not found
Operation cannot be performed
Server side error
{ "name": "cache2", "id": "DV20220920162021591055", "query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 6", "owner_id": "ADMIN", "created_at": "2022-09-20T16:20:21.497519Z", "last_modified_at": "2022-09-20T16:31:28.816238Z", "last_refreshed_at": "2022-09-20T16:20:34.592605Z", "state": "disabling", "size": 6, "cardinality": 5, "time_taken_for_refresh": 0, "refresh_count": 0, "hit_count": 0, "refresh_schedule": "10 * * * *", "refresh_schedule_description": "every hour at minute 10" }
Refresh an active cache
Refresh an active cache with the specified ID.
POST /v2/caching/caches/{id}/refresh
Request
Path Parameters
The ID of the cache to refresh.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
curl -k -X POST -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/caching/caches/{id}/refresh"
Response
A cache and its metadata.
Unique user-defined name of the cache.
Possible values: 1 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9-_ .]*$
Unique internal-generated ID of the cache.
Possible values: 20 ≤ length ≤ 25, Value must match regular expression
^DV\d+$
SQL query that defines the cache.
Possible values: 0 ≤ length ≤ 10000000, Value must match regular expression
.*
The login user ID that created this cache.
Possible values: 0 ≤ length ≤ 128, Value must match regular expression
.*
Timestamp when the cache was created.
Timestamp when the cache was last modified.
State of the cache:
populating
- the state when data is being inserted into the cacheactivating
- the state when cache is being readied for usageenabling
- the state when a disabled cache is being enableddisabling
- the state when an enabled cache is being disableddeleting
- the state when a cache is being deletedenabled
- the state of an active cachedisabled
- the state of an inactive cachedeleted
- the state of a deleted cacherefreshing
- the state when the cache is being updated with new datafailed
- the state of a cache when it fails to be created or deleted.
Possible values: [
populating
,activating
,enabling
,disabling
,deleting
,enabled
,disabled
,deleted
,refreshing
,failed
]Size of the cache, in KiB.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of rows in the cache.
Possible values: 0 ≤ value ≤ 9223372036854776000
Time taken to refresh the cache at the last attempt in milliseconds.
Possible values: 0 ≤ value ≤ 9223372036854776000
Number of times the cache has been refreshed after it was created.
Possible values: 0 ≤ value ≤ 2147483647
Number of times the cache has been used by queries.
Possible values: 0 ≤ value ≤ 2147483647
Timestamp when the cache was last refreshed.
Timestamp when the cache was last used.
A cron-style representation of the cache refresh schedule (Refer https://www.unix.com/man-page/linux/5/crontab/).
Possible values: 6 ≤ length ≤ 128, Value must match regular expression
^[a-zA-Z0-9\/ \-*,]*$
An english representation of the cache's refresh schedule.
Possible values: 0 ≤ length ≤ 1000, Value must match regular expression
.*
Status Code
To refresh a cache, its current state must be enabled. When the cache has been refreshed, its state will change to enabled.
Client side error
Unauthorized operation
Object not found
Operation cannot be performed
Server side error
{ "name": "cache3", "id": "DV20220920191349389436", "query": "SELECT * FROM ADMIN.CUSTOMER WHERE C_CUSTOMER_SK < 7", "owner_id": "ADMIN", "created_at": "2022-09-20T19:13:49.28874Z", "last_modified_at": "2022-09-21T00:07:40.689536Z", "last_refreshed_at": "2022-09-21T00:07:18.403959Z", "last_used_at": "2022-09-21T00:02:24.962Z", "state": "refreshing", "size": 6, "cardinality": 6, "time_taken_for_refresh": 17553, "refresh_count": 22, "hit_count": 6, "refresh_schedule": "* * */5 * *", "refresh_schedule_description": "every minute every 5 days" }
Request
No Request Parameters
curl -k -X GET -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dv-caching/api/v1/caches"
Response
- caches
The name of this cache.
The unique ID of this cache.
The query that defines this cache.
Owner ID of this cache.
Type of the cache - User-defined (U), Recommended (R).
Database timestamp at the time of cache creation.
Database timestamp when this cache was last modified (state change).
Database timestamp when this cache was last refreshed.
Database timestamp when this cache was last used.
State of this cache - one of Enabled,Disabled,Deleted,Failed,Populating,Activating,Enabling,Disabling,Refreshing,Deleting.
Size of this cache (in KB).
Cardinality (number of rows) of this cache.
Time taken to refresh this cache most recently (in milliseconds).
Number of times this cache has been refreshed since creation.
Hit Count of the cache (number of times this cache was used).
Encoded cron-style representation of the cache refresh schedule.
Human-readable description of the cache refresh schedule.
Status message indicating the most recent error/issue with the cache, if any.
Status Code
Success
Bad Request
Unauthorized
Internal Server Error
{ "caches": [ { "name": "ItemsCache", "id": "DV20210427043634532286", "query": "SELECT A0.\"I_ITEM_SK\" as COL3, A0.\"I_CATEGORY\" as COL2, A0.\"I_CATEGORY_ID\" as COL1 FROM \"ADMIN\".\"ITEM\" as A0", "owner_id": "ADMIN", "type": "R", "created_timestamp": "2021-04-27 04:36:34.531234", "last_modified_timestamp": "2021-04-27 04:36:50.883267", "last_refresh_timestamp": "2021-04-27 05:00:20.729498", "last_used_timestamp": "2021-04-29 16:33:32.319953", "state": "Enabled", "size": "14171", "cardinality": "2880404", "time_taken_for_refresh": "20", "refresh_count": "1", "hit_count": "1", "refresh_schedule": "0 0 0/5 ? * * *", "refresh_schedule_desc": "every 5 hours at minute 0", "status_msg": "" }, { "name": "TestCache_DELETED_20210406034223883688", "id": "DV20210406034041592922", "query": "select * from ADMIN.CUSTOMER", "owner_id": "ADMIN", "type": "U", "created_timestamp": "2021-04-06 03:40:41.590105", "last_modified_timestamp": "2021-04-06 03:42:23.97146", "last_refresh_timestamp": "2021-04-06 03:40:52.872691", "last_used_timestamp": "", "state": "Deleted", "size": "136", "cardinality": "100", "time_taken_for_refresh": "0", "refresh_count": "0", "hit_count": "0", "refresh_schedule": "", "refresh_schedule_desc": "", "status_msg": "" } ] }
Request
Path Parameters
The ID of the cache to be listed.
curl -k -X GET -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dv-caching/api/v1/caches/{id}"
Response
The name of this cache.
The unique ID of this cache.
The query that defines this cache.
Owner ID of this cache.
Type of the cache - User-defined (U), Recommended (R).
Database timestamp at the time of cache creation.
Database timestamp when this cache was last modified (state change).
Database timestamp when this cache was last refreshed.
Database timestamp when this cache was last used.
State of this cache - one of Enabled,Disabled,Deleted,Failed,Populating,Activating,Enabling,Disabling,Refreshing,Deleting.
Size of this cache (in KB).
Cardinality (number of rows) of this cache.
Time taken to refresh this cache most recently (in milliseconds).
Number of times this cache has been refreshed since creation.
Hit Count of the cache (number of times this cache was used).
Encoded cron-style representation of the cache refresh schedule.
Human-readable description of the cache refresh schedule.
Status message indicating the most recent error/issue with the cache, if any.
Status Code
Success
Bad Request
Unauthorized
Not found
Internal Server Error
{ "name": "ItemsCache", "id": "DV20210427043634532286", "query": "SELECT A0.\"I_ITEM_SK\" as COL3, A0.\"I_CATEGORY\" as COL2, A0.\"I_CATEGORY_ID\" as COL1 FROM \"ADMIN\".\"ITEM\" as A0", "owner_id": "ADMIN", "type": "R", "created_timestamp": "2021-04-27 04:36:34.531234", "last_modified_timestamp": "2021-04-27 04:36:50.883267", "last_refresh_timestamp": "2021-04-27 05:00:20.729498", "last_used_timestamp": "2021-04-29 16:33:32.319953", "state": "Enabled", "size": "14171", "cardinality": "2880404", "time_taken_for_refresh": "20", "refresh_count": "1", "hit_count": "1", "refresh_schedule": "0 0 0/5 ? * * *", "refresh_schedule_desc": "every 5 hours at minute 0", "status_msg": "" }
Fetch the cache storage
Fetch the total cache storage and used capacities for active and inactive caches in Watson Query.
GET /dv-caching/api/v1/caches/storage
Request
No Request Parameters
curl -k -X GET -H "cache-control: no-cache" -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dv-caching/api/v1/caches/storage"
Response
Total cache storage size.
Storage details of active caches.
- enabled
Total size of all active caches (in KB).
Number of active caches.
Storage details of inactive caches.
- disabled
Total size of all inactive caches (in KB).
Number of inactive caches.
Status Code
Success
Bad Request
Unauthorized
Internal Server Error
{ "total_size": "100Gi", "enabled": { "size": 16918, "count": 4 }, "disabled": { "size": 0, "count": 0 } }
Publish virtual data to the default catalog
Publishes your virtual data to the default catalog in IBM Knowledge Catalog.
POST /v2/integration/catalog/publish
Request
- assets
The schema of the virtual object.
The name of the virtual object.
Determines whether the virtual object can be duplicated in the catalog.
Default:
false
The catalog ID.
curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "Authorization: Bearer {token}" -d "{\"allow_duplicates\":\"false\",\"assets\":\[\"schema\":\"USER999\",\"table\":\"Tab1\"]\}" "https://{cpd_cluster_host}{:port}/icp4data-databases/dv/{namespace}/dvapiserver/v2/integration/catalog/publish"
Response
Total publish tasks size.
Publish tasks list
- data
The catalog name
The status of the publish task
Possible values: [
Success
,Failed
,Started
,Waiting
,Skipped
,Canceled
]The catalog ID
Publish
Timestamp when the task was done.
Timestamp when the task was started.
Timestamp when the task was submitted.
The task creator
The message
Status Code
Success
Bad Request
Unauthorized
Internal Server Error
{ "published_assets": { "schema_name": "USER999", "table_name": "customer", "wkc_asset_id": "37fa4a15-1071-4a20-bc9e-0283d3dfb6e1" }, "duplicate_assets": [ { "schema_name": "USER999", "table_name": "customer" } ] }
Publishes virtual data to a catalog
Publishes your virtual data to a catalog in IBM Knowledge Catalog asynchronously. You must use the Data Management Console (DMC) endpoint URL.
POST /v4/dv/catalog/publish
Request
Custom Headers
The dv instance.
Example:
dv-1683880621681965
The namespace that the dv instance is in.
Example:
cpd47x
Determines whether the virtual object can be duplicated in the catalog.
- assets
The schema of the virtual object.
The name of the virtual object.
The catalog ID.
The catalog name.
curl -k -X POST "https://{cpd_cluster_host}{:port}/icp4data-addons/{dmc-instance}/{namespace}/dbapi/v4/dv/catalog/publish" -H "Authorization: Bearer {token}" -H "x-db-profile: {dv_instance}" -H "X-Namespace: {dv_namespace}" -H "Content-Type: application/json" -d "{\"assets\":[{\"table\":\"customer_view\",\"schema\":\"ADMIN\"}],\"allow_duplicates\":false,\"catalog_id\":\"b5ce2ed2-d3ee-45af-8d1b-c2aa7dd6bd44\",\"catalog_name\":\"testcat\"}"
Fetch publishing task results
Fetch publishing task results of the specified virtualized object. You must use the Data Management Console (DMC) endpoint URL.
GET /v4/dv/published_assignment_status
Request
Query Parameters
The schema of the virtual object.
Example:
schema1
The name of the virtual object.
Example:
table1
Number of returned task results.
Example:
3
curl -k -X GET -H "Authorization: Bearer {token}" -H "x-db-profile: {dv-instance}" -H "X-Namespace: {dv-namespace}" "https://{HOSTNAME}:{PORT_NUMBER}/icp4data-addons/{dmc-instance}/{namespace}/dbapi/v4/dv/published_assignment_status?schema=schema1&name=table1&type=Publish&limit=3"
Response
Total publish tasks size.
Publish tasks list
- data
The catalog name
The status of the publish task
Possible values: [
Success
,Failed
,Started
,Waiting
,Skipped
,Canceled
]The catalog ID
Publish
Timestamp when the task was done.
Timestamp when the task was started.
Timestamp when the task was submitted.
The task creator
The message
Status Code
Success
Bad Request
Internal Server Error
{ "total": 1, "data": [ { "name": "testcat", "status": "Success", "object_id": "d0e543dc-2775-4328-b5e4-cf61794a8354", "type": "Publish", "sub_type": "Catalog", "create_on": 1695307697670, "begin_time": 1695307680359, "creator_by": "DV_ADMIN", "message": "{\"duplicate_assets\":null,\"failed_assets\":null,\"published_assets\":[{\"schema_name\":\"schema1\",\"table_name\":\"table1\",\"wkc_asset_id\":\"daf76500-1e37-4ddc-9f20-080bb3722206\"}]}\n", "submit_time": 1695307680264 } ] }