Introduction

Watson Query 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, so you can manage your virtual data, data sources, and user roles.

Endpoint URLs

Identify the base URL for your service instance.

The base URLs come from the service instance. To find the URL, view the service credentials by clicking the name of the service in the Resource list. Use the value of the URL. Add the method to form the complete API endpoint for your request.

Authentication

Before you can call an IBM Watson Query API, you must create an IAM bearer token. Each token is valid for one hour. After a token expires, you must create a new one if you want to continue to use the API. The method to retrieve a token programmatically is to create an API key for your IBM Cloud identity and then use the API key call IAM API to generate a bearer token.

If the API key is zVxeuKGuf2i2lXhdHm25kg38BHOKNhhGQ2QySxgH9iuP, the generate command looks like this:

curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=zVxeuKGuf2i2lXhdHm25kg38BHOKNhhGQ2QySxgH9iuP'

An X-Db-Profile is also required when you call an IBM Watson Query API. This profile represents which instance the request is for. For example:

 crn%3Av1%3Astaging%3Apublic%3Adata-virtualization%3Aus-south%3Aa%AorQ%CX3VpfQ7GXqj84Gii91c7cBp%zia7aoSN3mXvD2u-jTVQ-1rKj-zEo7-5Ue8jePrP6JblQj2eS

The following example shows a complete API call.

curl -X GET "https://us-south.data-virtualization.cloud.ibm.com/dvapiserver/v2/datasource/connections" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token"

After you get the bearer token, pass the token in the request header, the user will be authorized to access Watson Query API services.

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.

ErrorResponse

Name Description
code{: .parameter-name .required}
string
An identifier of the response.
message{: .parameter-name .required}
string
An explanation of the problem.

Methods

Get data source connections

Gets all data source connections that are connected to the service.

Gets all data source connections that are connected to the service.

Gets all data source connections that are connected to the service.

Gets all data source connections that are connected to the service.

Gets all data source connections that are connected to the service.

GET /dvapiserver/v2/datasource/connections
(watsonQuery *WatsonQueryV1) ListDatasourceConnections(listDatasourceConnectionsOptions *ListDatasourceConnectionsOptions) (result *DatasourceConnectionsList, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) ListDatasourceConnectionsWithContext(ctx context.Context, listDatasourceConnectionsOptions *ListDatasourceConnectionsOptions) (result *DatasourceConnectionsList, response *core.DetailedResponse, err error)
ServiceCall<DatasourceConnectionsList> listDatasourceConnections()
list_datasource_connections(self,
        **kwargs
    ) -> DetailedResponse
listDatasourceConnections(params)

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

  • curl -k -X GET -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/datasource/connections"
  • listDatasourceConnectionsOptions := watsonQueryService.NewListDatasourceConnectionsOptions()
    
    datasourceConnectionsList, response, err := watsonQueryService.ListDatasourceConnections(listDatasourceConnectionsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(datasourceConnectionsList, "", "  ")
    fmt.Println(string(b))
  • ListDatasourceConnectionsOptions listDatasourceConnectionsOptions = new ListDatasourceConnectionsOptions();
    
    Response<DatasourceConnectionsList> response = watsonQueryService.listDatasourceConnections(listDatasourceConnectionsOptions).execute();
    DatasourceConnectionsList datasourceConnectionsList = response.getResult();
    
    System.out.println(datasourceConnectionsList);
  • let res;
    try {
      res = await watsonQueryService.listDatasourceConnections({});
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • datasource_connections_list = watson_query_service.list_datasource_connections().get_result()
    
    print(json.dumps(datasource_connections_list, indent=2))

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

Example responses
  • {
      "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/"
            }
          ]
        }
      ]
    }
  • {
      "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.

Adds a data source connection to the Watson Query service.

Adds a data source connection to the Watson Query service.

Adds a data source connection to the Watson Query service.

Adds a data source connection to the Watson Query service.

POST /dvapiserver/v2/datasource/connections
(watsonQuery *WatsonQueryV1) AddDatasourceConnection(addDatasourceConnectionOptions *AddDatasourceConnectionOptions) (result *PostDatasourceConnection, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) AddDatasourceConnectionWithContext(ctx context.Context, addDatasourceConnectionOptions *AddDatasourceConnectionOptions) (result *PostDatasourceConnection, response *core.DetailedResponse, err error)
ServiceCall<PostDatasourceConnection> addDatasourceConnection(AddDatasourceConnectionOptions addDatasourceConnectionOptions)
add_datasource_connection(self,
        datasource_type: str,
        name: str,
        origin_country: str,
        properties: 'PostDatasourceConnectionParametersProperties',
        *,
        asset_category: str = None,
        **kwargs
    ) -> DetailedResponse
addDatasourceConnection(params)

Request

Instantiate the AddDatasourceConnectionOptions struct and set the fields to provide parameter values for the AddDatasourceConnection method.

Use the AddDatasourceConnectionOptions.Builder to create a AddDatasourceConnectionOptions object that contains the parameter values for the addDatasourceConnection method.

WithContext method only

The AddDatasourceConnection options.

The addDatasourceConnection options.

parameters

  • The type of data source that you want to add.

    Examples:
    value
    _source
    _lines
    _html
  • The name of data source.

    Examples:
    value
    _source
    _lines
    _html
  • The location of data source that you want to add.

    Examples:
    value
    _source
    _lines
    _html
  • Examples:
    value
    _source
    _lines
    _html

parameters

  • The type of data source that you want to add.

    Examples:
    value
    _source
    _lines
    _html
  • The name of data source.

    Examples:
    value
    _source
    _lines
    _html
  • The location of data source that you want to add.

    Examples:
    value
    _source
    _lines
    _html
  • Examples:
    value
    _source
    _lines
    _html
  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -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://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/datasource/connections"
  • postDatasourceConnectionParametersPropertiesModel := &watsonqueryv1.PostDatasourceConnectionParametersProperties{
    }
    
    addDatasourceConnectionOptions := watsonQueryService.NewAddDatasourceConnectionOptions(
      "DB2",
      "DB2",
      "us",
      postDatasourceConnectionParametersPropertiesModel,
    )
    
    postDatasourceConnection, response, err := watsonQueryService.AddDatasourceConnection(addDatasourceConnectionOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(postDatasourceConnection, "", "  ")
    fmt.Println(string(b))
  • PostDatasourceConnectionParametersProperties postDatasourceConnectionParametersPropertiesModel = new PostDatasourceConnectionParametersProperties.Builder()
      .build();
    AddDatasourceConnectionOptions addDatasourceConnectionOptions = new AddDatasourceConnectionOptions.Builder()
      .datasourceType("DB2")
      .name("DB2")
      .originCountry("us")
      .xProperties(postDatasourceConnectionParametersPropertiesModel)
      .build();
    
    Response<PostDatasourceConnection> response = watsonQueryService.addDatasourceConnection(addDatasourceConnectionOptions).execute();
    PostDatasourceConnection postDatasourceConnection = response.getResult();
    
    System.out.println(postDatasourceConnection);
  • // Request models needed by this operation.
    
    // PostDatasourceConnectionParametersProperties
    const postDatasourceConnectionParametersPropertiesModel = {
    };
    
    const params = {
      datasourceType: 'DB2',
      name: 'DB2',
      originCountry: 'us',
      properties: postDatasourceConnectionParametersPropertiesModel,
    };
    
    let res;
    try {
      res = await watsonQueryService.addDatasourceConnection(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • post_datasource_connection_parameters_properties_model = {
    }
    
    post_datasource_connection = watson_query_service.add_datasource_connection(
      datasource_type='DB2',
      name='DB2',
      origin_country='us',
      properties=post_datasource_connection_parameters_properties_model
    ).get_result()
    
    print(json.dumps(post_datasource_connection, indent=2))

Response

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Conflict

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Delete data source connection

Deletes a data source connection from the Watson Query service.

Deletes a data source connection from the Watson Query service.

Deletes a data source connection from the Watson Query service.

Deletes a data source connection from the Watson Query service.

Deletes a data source connection from the Watson Query service.

DELETE /dvapiserver/v2/datasource/connections/{connection_id}
(watsonQuery *WatsonQueryV1) DeleteDatasourceConnection(deleteDatasourceConnectionOptions *DeleteDatasourceConnectionOptions) (response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) DeleteDatasourceConnectionWithContext(ctx context.Context, deleteDatasourceConnectionOptions *DeleteDatasourceConnectionOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deleteDatasourceConnection(DeleteDatasourceConnectionOptions deleteDatasourceConnectionOptions)
delete_datasource_connection(self,
        connection_id: str,
        *,
        cid: str = None,
        **kwargs
    ) -> DetailedResponse
deleteDatasourceConnection(params)

Request

Instantiate the DeleteDatasourceConnectionOptions struct and set the fields to provide parameter values for the DeleteDatasourceConnection method.

Use the DeleteDatasourceConnectionOptions.Builder to create a DeleteDatasourceConnectionOptions object that contains the parameter values for the deleteDatasourceConnection method.

Path Parameters

  • The connection identifier for the platform.

    Example: 75e4d01b-7417-4abc-b267-8ffb393fb970

Query Parameters

  • The connection identifier for Watson Query.

    Example: DB210013

WithContext method only

The DeleteDatasourceConnection options.

The deleteDatasourceConnection options.

parameters

  • The connection identifier for the platform..

    Examples:
    value
    _source
    _lines
    _html
  • The identifier of the connection for the Watson Query.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The connection identifier for the platform..

    Examples:
    value
    _source
    _lines
    _html
  • The identifier of the connection for the Watson Query.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/datasource/connections/75e4d01b-7417-4abc-b267-8ffb393fb970?cid=DB210013"
  • deleteDatasourceConnectionOptions := watsonQueryService.NewDeleteDatasourceConnectionOptions(
      "75e4d01b-7417-4abc-b267-8ffb393fb970",
    )
    deleteDatasourceConnectionOptions.SetCid("DB210013")
    
    response, err := watsonQueryService.DeleteDatasourceConnection(deleteDatasourceConnectionOptions)
    if err != nil {
      panic(err)
    }
  • DeleteDatasourceConnectionOptions deleteDatasourceConnectionOptions = new DeleteDatasourceConnectionOptions.Builder()
      .connectionId("75e4d01b-7417-4abc-b267-8ffb393fb970")
      .cid("DB210013")
      .build();
    
    Response<Void> response = watsonQueryService.deleteDatasourceConnection(deleteDatasourceConnectionOptions).execute();
  • const params = {
      connectionId: '75e4d01b-7417-4abc-b267-8ffb393fb970',
      cid: 'DB210013',
    };
    
    try {
      await watsonQueryService.deleteDatasourceConnection(params);
    } catch (err) {
      console.warn(err);
    }
  • response = watson_query_service.delete_datasource_connection(
      connection_id='75e4d01b-7417-4abc-b267-8ffb393fb970',
      cid='DB210013'
    )

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Gets the object store connection details.

GET /dvapiserver/v2/datasource/objectstore_connections
(watsonQuery *WatsonQueryV1) GetObjectStoreConnectionsV2(getObjectStoreConnectionsV2Options *GetObjectStoreConnectionsV2Options) (result *ObjStoreConnectionResponseV2, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) GetObjectStoreConnectionsV2WithContext(ctx context.Context, getObjectStoreConnectionsV2Options *GetObjectStoreConnectionsV2Options) (result *ObjStoreConnectionResponseV2, response *core.DetailedResponse, err error)
ServiceCall<ObjStoreConnectionResponseV2> getObjectStoreConnectionsV2(GetObjectStoreConnectionsV2Options getObjectStoreConnectionsV2Options)
get_object_store_connections_v2(self,
        *,
        jwt_auth_user_payload: str = None,
        **kwargs
    ) -> DetailedResponse
getObjectStoreConnectionsV2(params)

Request

Instantiate the GetObjectStoreConnectionsV2Options struct and set the fields to provide parameter values for the GetObjectStoreConnectionsV2 method.

Use the GetObjectStoreConnectionsV2Options.Builder to create a GetObjectStoreConnectionsV2Options object that contains the parameter values for the getObjectStoreConnectionsV2 method.

Custom Headers

  • Supplied by proxy. Do NOT add your own value.

WithContext method only

The GetObjectStoreConnectionsV2 options.

The getObjectStoreConnectionsV2 options.

parameters

  • Supplied by proxy. Do NOT add your own value.

parameters

  • Supplied by proxy. Do NOT add your own value.

  • curl -k -X GET -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/datasource/objectstore_connections"
  • getObjectStoreConnectionsV2Options := watsonQueryService.NewGetObjectStoreConnectionsV2Options()
    
    objStoreConnectionResponseV2, response, err := watsonQueryService.GetObjectStoreConnectionsV2(getObjectStoreConnectionsV2Options)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(objStoreConnectionResponseV2, "", "  ")
    fmt.Println(string(b))
  • GetObjectStoreConnectionsV2Options getObjectStoreConnectionsV2Options = new GetObjectStoreConnectionsV2Options.Builder()
      .build();
    
    Response<ObjStoreConnectionResponseV2> response = watsonQueryService.getObjectStoreConnectionsV2(getObjectStoreConnectionsV2Options).execute();
    ObjStoreConnectionResponseV2 objStoreConnectionResponseV2 = response.getResult();
    
    System.out.println(objStoreConnectionResponseV2);
  • let res;
    try {
      res = await watsonQueryService.getObjectStoreConnectionsV2({});
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • obj_store_connection_response_v2 = watson_query_service.get_object_store_connections_v2().get_result()
    
    print(json.dumps(obj_store_connection_response_v2, indent=2))

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Grant user access

Grants user access to a specific virtualized table.

Grants a user access to a specific virtualized table.

Grants a user access to a specific virtualized table.

Grants a user access to a specific virtualized table.

Grants a user access to a specific virtualized table.

POST /dvapiserver/v2/privileges/users
(watsonQuery *WatsonQueryV1) GrantUserToVirtualTable(grantUserToVirtualTableOptions *GrantUserToVirtualTableOptions) (response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) GrantUserToVirtualTableWithContext(ctx context.Context, grantUserToVirtualTableOptions *GrantUserToVirtualTableOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> grantUserToVirtualTable(GrantUserToVirtualTableOptions grantUserToVirtualTableOptions)
grant_user_to_virtual_table(self,
        table_name: str,
        table_schema: str,
        authid: str,
        **kwargs
    ) -> DetailedResponse
grantUserToVirtualTable(params)

Request

Instantiate the GrantUserToVirtualTableOptions struct and set the fields to provide parameter values for the GrantUserToVirtualTable method.

Use the GrantUserToVirtualTableOptions.Builder to create a GrantUserToVirtualTableOptions object that contains the parameter values for the grantUserToVirtualTable method.

WithContext method only

The GrantUserToVirtualTable options.

The grantUserToVirtualTable options.

parameters

  • The name of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The schema of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The identifier of the authorization, if grant access to all users, the value is PUBLIC, othervise the value is the Watson Query username.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The name of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The schema of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The identifier of the authorization, if grant access to all users, the value is PUBLIC, othervise the value is the Watson Query username.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" -d "\{\"table_name\":\"EMPLOYEE\",\"table_schema\":\"dv_ibmid_060000s4y5\", \"authid\":\"PUBLIC\"}" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/privileges/users"
  • grantUserToVirtualTableOptions := watsonQueryService.NewGrantUserToVirtualTableOptions(
      "EMPLOYEE",
      "dv_ibmid_060000s4y5",
      "PUBLIC",
    )
    
    response, err := watsonQueryService.GrantUserToVirtualTable(grantUserToVirtualTableOptions)
    if err != nil {
      panic(err)
    }
  • GrantUserToVirtualTableOptions grantUserToVirtualTableOptions = new GrantUserToVirtualTableOptions.Builder()
      .tableName("EMPLOYEE")
      .tableSchema("dv_ibmid_060000s4y5")
      .authid("PUBLIC")
      .build();
    
    Response<Void> response = watsonQueryService.grantUserToVirtualTable(grantUserToVirtualTableOptions).execute();
  • const params = {
      tableName: 'EMPLOYEE',
      tableSchema: 'dv_ibmid_060000s4y5',
      authid: 'PUBLIC',
    };
    
    try {
      await watsonQueryService.grantUserToVirtualTable(params);
    } catch (err) {
      console.warn(err);
    }
  • response = watson_query_service.grant_user_to_virtual_table(
      table_name='EMPLOYEE',
      table_schema='dv_ibmid_060000s4y5',
      authid='PUBLIC'
    )

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Revoke user acccess

Revokes user access to the virtualized table.

Revokes user access to the virtualized table.

Revokes user access to the virtualized table.

Revokes user access to the virtualized table.

Revokes user access to the virtualized table.

DELETE /dvapiserver/v2/privileges/users/{authid}
(watsonQuery *WatsonQueryV1) RevokeUserFromObject(revokeUserFromObjectOptions *RevokeUserFromObjectOptions) (response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) RevokeUserFromObjectWithContext(ctx context.Context, revokeUserFromObjectOptions *RevokeUserFromObjectOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> revokeUserFromObject(RevokeUserFromObjectOptions revokeUserFromObjectOptions)
revoke_user_from_object(self,
        authid: str,
        table_name: str,
        table_schema: str,
        **kwargs
    ) -> DetailedResponse
revokeUserFromObject(params)

Request

Instantiate the RevokeUserFromObjectOptions struct and set the fields to provide parameter values for the RevokeUserFromObject method.

Use the RevokeUserFromObjectOptions.Builder to create a RevokeUserFromObjectOptions object that contains the parameter values for the revokeUserFromObject method.

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

WithContext method only

The RevokeUserFromObject options.

The revokeUserFromObject options.

parameters

  • The Watson Query user name, if the value is PUBLIC, it means revoke access privilege from all Watson Query users.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's name.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's schema name.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The Watson Query user name, if the value is PUBLIC, it means revoke access privilege from all Watson Query users.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's name.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's schema name.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/privileges/users/PUBLIC?table_schema=dv_ibmid_060000s4y5&table_name=EMPLOYEE"
  • revokeUserFromObjectOptions := watsonQueryService.NewRevokeUserFromObjectOptions(
      "PUBLIC",
      "EMPLOYEE",
      "dv_ibmid_060000s4y5",
    )
    
    response, err := watsonQueryService.RevokeUserFromObject(revokeUserFromObjectOptions)
    if err != nil {
      panic(err)
    }
  • RevokeUserFromObjectOptions revokeUserFromObjectOptions = new RevokeUserFromObjectOptions.Builder()
      .authid("PUBLIC")
      .tableName("EMPLOYEE")
      .tableSchema("dv_ibmid_060000s4y5")
      .build();
    
    Response<Void> response = watsonQueryService.revokeUserFromObject(revokeUserFromObjectOptions).execute();
  • const params = {
      authid: 'PUBLIC',
      tableName: 'EMPLOYEE',
      tableSchema: 'dv_ibmid_060000s4y5',
    };
    
    try {
      await watsonQueryService.revokeUserFromObject(params);
    } catch (err) {
      console.warn(err);
    }
  • response = watson_query_service.revoke_user_from_object(
      authid='PUBLIC',
      table_name='EMPLOYEE',
      table_schema='dv_ibmid_060000s4y5'
    )

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Grant user role

Grants a user role access to a specific virtualized table.

Grants a user role access to a specific virtualized table.

Grants a user role access to a specific virtualized table.

Grants a user role access to a specific virtualized table.

Grants a user role access to a specific virtualized table.

POST /dvapiserver/v2/privileges/roles
(watsonQuery *WatsonQueryV1) GrantRolesToVirtualizedTable(grantRolesToVirtualizedTableOptions *GrantRolesToVirtualizedTableOptions) (response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) GrantRolesToVirtualizedTableWithContext(ctx context.Context, grantRolesToVirtualizedTableOptions *GrantRolesToVirtualizedTableOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> grantRolesToVirtualizedTable(GrantRolesToVirtualizedTableOptions grantRolesToVirtualizedTableOptions)
grant_roles_to_virtualized_table(self,
        table_name: str,
        table_schema: str,
        *,
        role_name: str = None,
        **kwargs
    ) -> DetailedResponse
grantRolesToVirtualizedTable(params)

Request

Instantiate the GrantRolesToVirtualizedTableOptions struct and set the fields to provide parameter values for the GrantRolesToVirtualizedTable method.

Use the GrantRolesToVirtualizedTableOptions.Builder to create a GrantRolesToVirtualizedTableOptions object that contains the parameter values for the grantRolesToVirtualizedTable method.

WithContext method only

The GrantRolesToVirtualizedTable options.

The grantRolesToVirtualizedTable options.

parameters

  • The name of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The schema of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The identifier of the authorization, if grant access to all users, the value is PUBLIC, othervise the value is the Watson Query username.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The name of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The schema of the virtualized table.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • The identifier of the authorization, if grant access to all users, the value is PUBLIC, othervise the value is the Watson Query username.

    Possible values: length ≥ 1

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" -d "{\"table_name\":\"EMPLOYEE\",\"table_schema\":\"dv_ibmid_060000s4y5\",\"role_to_grant\":\"DV_ENGINEER\"}" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/privileges/roles"
  • grantRolesToVirtualizedTableOptions := watsonQueryService.NewGrantRolesToVirtualizedTableOptions(
      "EMPLOYEE",
      "dv_ibmid_060000s4y5",
    )
    
    response, err := watsonQueryService.GrantRolesToVirtualizedTable(grantRolesToVirtualizedTableOptions)
    if err != nil {
      panic(err)
    }
  • GrantRolesToVirtualizedTableOptions grantRolesToVirtualizedTableOptions = new GrantRolesToVirtualizedTableOptions.Builder()
      .tableName("EMPLOYEE")
      .tableSchema("dv_ibmid_060000s4y5")
      .build();
    
    Response<Void> response = watsonQueryService.grantRolesToVirtualizedTable(grantRolesToVirtualizedTableOptions).execute();
  • const params = {
      tableName: 'EMPLOYEE',
      tableSchema: 'dv_ibmid_060000s4y5',
    };
    
    try {
      await watsonQueryService.grantRolesToVirtualizedTable(params);
    } catch (err) {
      console.warn(err);
    }
  • response = watson_query_service.grant_roles_to_virtualized_table(
      table_name='EMPLOYEE',
      table_schema='dv_ibmid_060000s4y5'
    )

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Delete role

Revokes roles for a virtualized table.

Revokes roles for a virtualized table.

Revokes roles for a virtualized table.

Revokes roles for a virtualized table.

Revokes roles for a virtualized table.

DELETE /dvapiserver/v2/privileges/roles/{role_name}
(watsonQuery *WatsonQueryV1) DvaasRevokeRoleFromTable(dvaasRevokeRoleFromTableOptions *DvaasRevokeRoleFromTableOptions) (response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) DvaasRevokeRoleFromTableWithContext(ctx context.Context, dvaasRevokeRoleFromTableOptions *DvaasRevokeRoleFromTableOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> dvaasRevokeRoleFromTable(DvaasRevokeRoleFromTableOptions dvaasRevokeRoleFromTableOptions)
dvaas_revoke_role_from_table(self,
        role_name: str,
        table_name: str,
        table_schema: str,
        **kwargs
    ) -> DetailedResponse
dvaasRevokeRoleFromTable(params)

Request

Instantiate the DvaasRevokeRoleFromTableOptions struct and set the fields to provide parameter values for the DvaasRevokeRoleFromTable method.

Use the DvaasRevokeRoleFromTableOptions.Builder to create a DvaasRevokeRoleFromTableOptions object that contains the parameter values for the dvaasRevokeRoleFromTable method.

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

WithContext method only

The DvaasRevokeRoleFromTable options.

The dvaasRevokeRoleFromTable options.

parameters

  • The Watson Query role type. 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.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's name.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's schema name.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The Watson Query role type. 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.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's name.

    Examples:
    value
    _source
    _lines
    _html
  • The virtualized table's schema name.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/privileges/roles/DV_ENGINEER?table_schema=dv_ibmid_060000s4y5&table_name=EMPLOYEE"
  • dvaasRevokeRoleFromTableOptions := watsonQueryService.NewDvaasRevokeRoleFromTableOptions(
      "DV_ENGINEER",
      "EMPLOYEE",
      "dv_ibmid_060000s4y5",
    )
    
    response, err := watsonQueryService.DvaasRevokeRoleFromTable(dvaasRevokeRoleFromTableOptions)
    if err != nil {
      panic(err)
    }
  • DvaasRevokeRoleFromTableOptions dvaasRevokeRoleFromTableOptions = new DvaasRevokeRoleFromTableOptions.Builder()
      .roleName("DV_ENGINEER")
      .tableName("EMPLOYEE")
      .tableSchema("dv_ibmid_060000s4y5")
      .build();
    
    Response<Void> response = watsonQueryService.dvaasRevokeRoleFromTable(dvaasRevokeRoleFromTableOptions).execute();
  • const params = {
      roleName: 'DV_ENGINEER',
      tableName: 'EMPLOYEE',
      tableSchema: 'dv_ibmid_060000s4y5',
    };
    
    try {
      await watsonQueryService.dvaasRevokeRoleFromTable(params);
    } catch (err) {
      console.warn(err);
    }
  • response = watson_query_service.dvaas_revoke_role_from_table(
      role_name='DV_ENGINEER',
      table_name='EMPLOYEE',
      table_schema='dv_ibmid_060000s4y5'
    )

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Get virtualized tables by role

Retrieves the list of virtualized tables that have a specific role.

Retrieves the list of virtualized tables that have a specific role.

Retrieves the list of virtualized tables that have a specific role.

Retrieves the list of virtualized tables that have a specific role.

Retrieves the list of virtualized tables that have a specific role.

GET /dvapiserver/v2/privileges/tables
(watsonQuery *WatsonQueryV1) ListTablesForRole(listTablesForRoleOptions *ListTablesForRoleOptions) (result *TablesForRoleResponse, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) ListTablesForRoleWithContext(ctx context.Context, listTablesForRoleOptions *ListTablesForRoleOptions) (result *TablesForRoleResponse, response *core.DetailedResponse, err error)
ServiceCall<TablesForRoleResponse> listTablesForRole(ListTablesForRoleOptions listTablesForRoleOptions)
list_tables_for_role(self,
        rolename: str,
        **kwargs
    ) -> DetailedResponse
listTablesForRole(params)

Request

Instantiate the ListTablesForRoleOptions struct and set the fields to provide parameter values for the ListTablesForRole method.

Use the ListTablesForRoleOptions.Builder to create a ListTablesForRoleOptions object that contains the parameter values for the listTablesForRole method.

Query Parameters

  • Watson Query has four roles: MANAGER, STEWARD, ENGINEER and USER. The value of rolename should be one of these.

    Example: MANAGER | STEWARD | ENGINEER | USER

WithContext method only

The ListTablesForRole options.

The listTablesForRole options.

parameters

  • Watson Query has four roles: MANAGER, STEWARD, ENGINEER and USER. The value of rolename should be one of these.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Watson Query has four roles: MANAGER, STEWARD, ENGINEER and USER. The value of rolename should be one of these.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X GET -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/privileges/tables?rolename=ENGINEER"
  • listTablesForRoleOptions := watsonQueryService.NewListTablesForRoleOptions(
      "MANAGER | STEWARD | ENGINEER | USER",
    )
    
    tablesForRoleResponse, response, err := watsonQueryService.ListTablesForRole(listTablesForRoleOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(tablesForRoleResponse, "", "  ")
    fmt.Println(string(b))
  • ListTablesForRoleOptions listTablesForRoleOptions = new ListTablesForRoleOptions.Builder()
      .rolename("MANAGER | STEWARD | ENGINEER | USER")
      .build();
    
    Response<TablesForRoleResponse> response = watsonQueryService.listTablesForRole(listTablesForRoleOptions).execute();
    TablesForRoleResponse tablesForRoleResponse = response.getResult();
    
    System.out.println(tablesForRoleResponse);
  • const params = {
      rolename: 'MANAGER | STEWARD | ENGINEER | USER',
    };
    
    let res;
    try {
      res = await watsonQueryService.listTablesForRole(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • tables_for_role_response = watson_query_service.list_tables_for_role(
      rolename='MANAGER | STEWARD | ENGINEER | USER'
    ).get_result()
    
    print(json.dumps(tables_for_role_response, indent=2))

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

Example responses
  • {
      "objects": [
        {
          "table_name": "TEST_TABLE",
          "table_schema": "ADMIN"
        }
      ]
    }
  • {
      "objects": [
        {
          "table_name": "TEST_TABLE",
          "table_schema": "ADMIN"
        }
      ]
    }

Turn policy enforcement status on or off

Turns policy enforcement status on or off.

Turns policy enforcement status on or off.

Turns policy enforcement status on or off.

Turns policy enforcement status on or off.

Turns policy enforcement status on or off.

PUT /dvapiserver/v2/security/policy/status
(watsonQuery *WatsonQueryV1) TurnOnPolicyV2(turnOnPolicyV2Options *TurnOnPolicyV2Options) (result *TurnOnPolicyV2Response, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) TurnOnPolicyV2WithContext(ctx context.Context, turnOnPolicyV2Options *TurnOnPolicyV2Options) (result *TurnOnPolicyV2Response, response *core.DetailedResponse, err error)
ServiceCall<TurnOnPolicyV2Response> turnOnPolicyV2(TurnOnPolicyV2Options turnOnPolicyV2Options)
turn_on_policy_v2(self,
        status: str,
        **kwargs
    ) -> DetailedResponse
turnOnPolicyV2(params)

Request

Instantiate the TurnOnPolicyV2Options struct and set the fields to provide parameter values for the TurnOnPolicyV2 method.

Use the TurnOnPolicyV2Options.Builder to create a TurnOnPolicyV2Options object that contains the parameter values for the turnOnPolicyV2 method.

Query Parameters

  • Sets the status of the policy enforcement.

    Example: enabled

WithContext method only

The TurnOnPolicyV2 options.

The turnOnPolicyV2 options.

parameters

  • Set the status of policy enforcement.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Set the status of policy enforcement.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/security/policy/status?status=enabled"
  • turnOnPolicyV2Options := watsonQueryService.NewTurnOnPolicyV2Options(
      "enabled",
    )
    
    turnOnPolicyV2Response, response, err := watsonQueryService.TurnOnPolicyV2(turnOnPolicyV2Options)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(turnOnPolicyV2Response, "", "  ")
    fmt.Println(string(b))
  • TurnOnPolicyV2Options turnOnPolicyV2Options = new TurnOnPolicyV2Options.Builder()
      .status("enabled")
      .build();
    
    Response<TurnOnPolicyV2Response> response = watsonQueryService.turnOnPolicyV2(turnOnPolicyV2Options).execute();
    TurnOnPolicyV2Response turnOnPolicyV2Response = response.getResult();
    
    System.out.println(turnOnPolicyV2Response);
  • const params = {
      status: 'enabled',
    };
    
    let res;
    try {
      res = await watsonQueryService.turnOnPolicyV2(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • turn_on_policy_v2_response = watson_query_service.turn_on_policy_v2(
      status='enabled'
    ).get_result()
    
    print(json.dumps(turn_on_policy_v2_response, indent=2))

Response

Status Code

  • Success

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Get policy enforcement status

Gets the policy enforcement status. The function returns enabled or disabled depending on the status.

Get policy enforcement status, return enabled or disabled.

Get policy enforcement status, return enabled or disabled.

Get policy enforcement status, return enabled or disabled.

Get policy enforcement status, return enabled or disabled.

GET /dvapiserver/v2/security/policy/status
(watsonQuery *WatsonQueryV1) CheckPolicyStatusV2(checkPolicyStatusV2Options *CheckPolicyStatusV2Options) (result *CheckPolicyStatusV2Response, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) CheckPolicyStatusV2WithContext(ctx context.Context, checkPolicyStatusV2Options *CheckPolicyStatusV2Options) (result *CheckPolicyStatusV2Response, response *core.DetailedResponse, err error)
ServiceCall<CheckPolicyStatusV2Response> checkPolicyStatusV2()
check_policy_status_v2(self,
        **kwargs
    ) -> DetailedResponse
checkPolicyStatusV2(params)

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

  • curl -k -X GET -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/security/policy/status"
  • checkPolicyStatusV2Options := watsonQueryService.NewCheckPolicyStatusV2Options()
    
    checkPolicyStatusV2Response, response, err := watsonQueryService.CheckPolicyStatusV2(checkPolicyStatusV2Options)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(checkPolicyStatusV2Response, "", "  ")
    fmt.Println(string(b))
  • CheckPolicyStatusV2Options checkPolicyStatusV2Options = new CheckPolicyStatusV2Options();
    
    Response<CheckPolicyStatusV2Response> response = watsonQueryService.checkPolicyStatusV2(checkPolicyStatusV2Options).execute();
    CheckPolicyStatusV2Response checkPolicyStatusV2Response = response.getResult();
    
    System.out.println(checkPolicyStatusV2Response);
  • let res;
    try {
      res = await watsonQueryService.checkPolicyStatusV2({});
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • check_policy_status_v2_response = watson_query_service.check_policy_status_v2().get_result()
    
    print(json.dumps(check_policy_status_v2_response, indent=2))

Response

Status Code

  • Success

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Virtualize table

Transforms a given data source table into a virtualized table.

Transforms a given data source table into a virtualized table.

Transforms a given data source table into a virtualized table.

Transforms a given data source table into a virtualized table.

Transforms a given data source table into a virtualized table.

POST /dvapiserver/v2/virtualization/tables
(watsonQuery *WatsonQueryV1) DvaasVirtualizeTable(dvaasVirtualizeTableOptions *DvaasVirtualizeTableOptions) (result *VirtualizeTableResponse, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) DvaasVirtualizeTableWithContext(ctx context.Context, dvaasVirtualizeTableOptions *DvaasVirtualizeTableOptions) (result *VirtualizeTableResponse, response *core.DetailedResponse, err error)
ServiceCall<VirtualizeTableResponse> dvaasVirtualizeTable(DvaasVirtualizeTableOptions dvaasVirtualizeTableOptions)
dvaas_virtualize_table(self,
        source_name: str,
        source_table_def: List['VirtualizeTableParameterSourceTableDefItem'],
        sources: List[str],
        virtual_name: str,
        virtual_schema: str,
        virtual_table_def: List['VirtualizeTableParameterVirtualTableDefItem'],
        *,
        is_included_columns: str = None,
        replace: bool = None,
        **kwargs
    ) -> DetailedResponse
dvaasVirtualizeTable(params)

Request

Instantiate the DvaasVirtualizeTableOptions struct and set the fields to provide parameter values for the DvaasVirtualizeTable method.

Use the DvaasVirtualizeTableOptions.Builder to create a DvaasVirtualizeTableOptions object that contains the parameter values for the dvaasVirtualizeTable method.

Request body

WithContext method only

The DvaasVirtualizeTable options.

The dvaasVirtualizeTable options.

parameters

  • The name of the source table.

    Examples:
    value
    _source
    _lines
    _html
  • The name of the table that will be virtualized.

    Examples:
    value
    _source
    _lines
    _html
  • The schema of the table that will be virtualized.

    Examples:
    value
    _source
    _lines
    _html
  • The columns that are included in the source table.

    Examples:
    value
    _source
    _lines
    _html
  • Determines whether to replace columns in the virtualized table.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The name of the source table.

    Examples:
    value
    _source
    _lines
    _html
  • The name of the table that will be virtualized.

    Examples:
    value
    _source
    _lines
    _html
  • The schema of the table that will be virtualized.

    Examples:
    value
    _source
    _lines
    _html
  • The columns that are included in the source table.

    Examples:
    value
    _source
    _lines
    _html
  • Determines whether to replace columns in the virtualized table.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -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\":\"dv_ibmid_060000s4y5\",\"virtual_table_def\":\[{\"column_name\":\"Column1\",\"column_type\":\"INTEGER\"}]}" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/virtualization/tables"
  • virtualizeTableParameterSourceTableDefItemModel := &watsonqueryv1.VirtualizeTableParameterSourceTableDefItem{
      ColumnName: core.StringPtr("Column1"),
      ColumnType: core.StringPtr("INTEGER"),
    }
    
    virtualizeTableParameterVirtualTableDefItemModel := &watsonqueryv1.VirtualizeTableParameterVirtualTableDefItem{
      ColumnName: core.StringPtr("Column_1"),
      ColumnType: core.StringPtr("INTEGER"),
    }
    
    dvaasVirtualizeTableOptions := watsonQueryService.NewDvaasVirtualizeTableOptions(
      "Tab1",
      []watsonqueryv1.VirtualizeTableParameterSourceTableDefItem{*virtualizeTableParameterSourceTableDefItemModel},
      []string{`DB210001:"Hjq1"`},
      "Tab1",
      "dv_ibmid_060000s4y5",
      []watsonqueryv1.VirtualizeTableParameterVirtualTableDefItem{*virtualizeTableParameterVirtualTableDefItemModel},
    )
    
    virtualizeTableResponse, response, err := watsonQueryService.DvaasVirtualizeTable(dvaasVirtualizeTableOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(virtualizeTableResponse, "", "  ")
    fmt.Println(string(b))
  • VirtualizeTableParameterSourceTableDefItem virtualizeTableParameterSourceTableDefItemModel = new VirtualizeTableParameterSourceTableDefItem.Builder()
      .columnName("Column1")
      .columnType("INTEGER")
      .build();
    VirtualizeTableParameterVirtualTableDefItem virtualizeTableParameterVirtualTableDefItemModel = new VirtualizeTableParameterVirtualTableDefItem.Builder()
      .columnName("Column_1")
      .columnType("INTEGER")
      .build();
    DvaasVirtualizeTableOptions dvaasVirtualizeTableOptions = new DvaasVirtualizeTableOptions.Builder()
      .sourceName("Tab1")
      .sourceTableDef(new java.util.ArrayList<VirtualizeTableParameterSourceTableDefItem>(java.util.Arrays.asList(virtualizeTableParameterSourceTableDefItemModel)))
      .sources(new java.util.ArrayList<String>(java.util.Arrays.asList("DB210001:\"Hjq1\"")))
      .virtualName("Tab1")
      .virtualSchema("dv_ibmid_060000s4y5")
      .virtualTableDef(new java.util.ArrayList<VirtualizeTableParameterVirtualTableDefItem>(java.util.Arrays.asList(virtualizeTableParameterVirtualTableDefItemModel)))
      .build();
    
    Response<VirtualizeTableResponse> response = watsonQueryService.dvaasVirtualizeTable(dvaasVirtualizeTableOptions).execute();
    VirtualizeTableResponse virtualizeTableResponse = response.getResult();
    
    System.out.println(virtualizeTableResponse);
  • // Request models needed by this operation.
    
    // VirtualizeTableParameterSourceTableDefItem
    const virtualizeTableParameterSourceTableDefItemModel = {
      column_name: 'Column1',
      column_type: 'INTEGER',
    };
    
    // VirtualizeTableParameterVirtualTableDefItem
    const virtualizeTableParameterVirtualTableDefItemModel = {
      column_name: 'Column_1',
      column_type: 'INTEGER',
    };
    
    const params = {
      sourceName: 'Tab1',
      sourceTableDef: [virtualizeTableParameterSourceTableDefItemModel],
      sources: ['DB210001:"Hjq1"'],
      virtualName: 'Tab1',
      virtualSchema: 'dv_ibmid_060000s4y5',
      virtualTableDef: [virtualizeTableParameterVirtualTableDefItemModel],
    };
    
    let res;
    try {
      res = await watsonQueryService.dvaasVirtualizeTable(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • virtualize_table_parameter_source_table_def_item_model = {
      'column_name': 'Column1',
      'column_type': 'INTEGER',
    }
    
    virtualize_table_parameter_virtual_table_def_item_model = {
      'column_name': 'Column_1',
      'column_type': 'INTEGER',
    }
    
    virtualize_table_response = watson_query_service.dvaas_virtualize_table(
      source_name='Tab1',
      source_table_def=[virtualize_table_parameter_source_table_def_item_model],
      sources=['DB210001:"Hjq1"'],
      virtual_name='Tab1',
      virtual_schema='dv_ibmid_060000s4y5',
      virtual_table_def=[virtualize_table_parameter_virtual_table_def_item_model]
    ).get_result()
    
    print(json.dumps(virtualize_table_response, indent=2))

Response

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Delete virtualized table

Removes the virtual table. You must specify the schema and table name.

Removes the specified virtualized table. You must specify the schema and table name.

Removes the specified virtualized table. You must specify the schema and table name.

Removes the specified virtualized table. You must specify the schema and table name.

Removes the specified virtualized table. You must specify the schema and table name.

DELETE /dvapiserver/v2/virtualization/tables/{virtual_name}
(watsonQuery *WatsonQueryV1) DeleteTable(deleteTableOptions *DeleteTableOptions) (response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) DeleteTableWithContext(ctx context.Context, deleteTableOptions *DeleteTableOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deleteTable(DeleteTableOptions deleteTableOptions)
delete_table(self,
        virtual_schema: str,
        virtual_name: str,
        **kwargs
    ) -> DetailedResponse
deleteTable(params)

Request

Instantiate the DeleteTableOptions struct and set the fields to provide parameter values for the DeleteTable method.

Use the DeleteTableOptions.Builder to create a DeleteTableOptions object that contains the parameter values for the deleteTable method.

Path Parameters

  • The name of virtualized table to be deleted.

Query Parameters

  • The schema of virtualized table to be deleted.

WithContext method only

The DeleteTable options.

The deleteTable options.

parameters

  • The schema of virtualized table to be deleted.

  • The name of virtualized table to be deleted.

parameters

  • The schema of virtualized table to be deleted.

  • The name of virtualized table to be deleted.

  • curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/virtualization/tables/EMPLOYEE?virtual_schema=dv_ibmid_060000s4y5"
  • deleteTableOptions := watsonQueryService.NewDeleteTableOptions(
      "testString",
      "testString",
    )
    
    response, err := watsonQueryService.DeleteTable(deleteTableOptions)
    if err != nil {
      panic(err)
    }
  • DeleteTableOptions deleteTableOptions = new DeleteTableOptions.Builder()
      .virtualSchema("testString")
      .virtualName("testString")
      .build();
    
    Response<Void> response = watsonQueryService.deleteTable(deleteTableOptions).execute();
  • const params = {
      virtualSchema: 'testString',
      virtualName: 'testString',
    };
    
    try {
      await watsonQueryService.deleteTable(params);
    } catch (err) {
      console.warn(err);
    }
  • response = watson_query_service.delete_table(
      virtual_schema='testString',
      virtual_name='testString'
    )

Response

Status Code

  • Success

  • Bad Request

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Create a remote table for the ORC or Parquet file on a cloud object store (COS).

Create a remote table for the ORC or Parquet file on a cloud object store (COS).

Create a remote table for the ORC or Parquet file on a cloud object store (COS).

Create a remote table for the ORC or Parquet file on a cloud object store (COS).

Create a remote table for the ORC or Parquet file on a cloud object store (COS).

Create a remote table for the ORC or Parquet file on a cloud object store (COS).

POST /dvapiserver/v2/virtualization/cloud_object_storages
(watsonQuery *WatsonQueryV1) VirtualizeCosV2(virtualizeCosV2Options *VirtualizeCosV2Options) (result *SuccessResponse, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) VirtualizeCosV2WithContext(ctx context.Context, virtualizeCosV2Options *VirtualizeCosV2Options) (result *SuccessResponse, response *core.DetailedResponse, err error)
ServiceCall<SuccessResponse> virtualizeCosV2(VirtualizeCosV2Options virtualizeCosV2Options)
virtualize_cos_v2(self,
        url: str,
        virtual_name: str,
        virtual_schema: str,
        virtual_table_def: List['VirtualizeCosV2RequestVirtualTableDefItem'],
        *,
        is_replace: bool = None,
        options: str = None,
        jwt_auth_user_payload: str = None,
        **kwargs
    ) -> DetailedResponse
virtualizeCosV2(params)

Request

Instantiate the VirtualizeCosV2Options struct and set the fields to provide parameter values for the VirtualizeCosV2 method.

Use the VirtualizeCosV2Options.Builder to create a VirtualizeCosV2Options object that contains the parameter values for the virtualizeCosV2 method.

Custom Headers

  • Supplied by proxy. Do NOT add your own value.

WithContext method only

The VirtualizeCosV2 options.

The virtualizeCosV2 options.

parameters

  • the file path with bucket name.

    Examples:
    value
    _source
    _lines
    _html
  • the virtual table name.

  • the virtual table schema.

  • if repalce the existing one when create the virtual table.

    Default: false

  • the options used to virtualize file.

    Examples:
    value
    _source
    _lines
    _html
  • Supplied by proxy. Do NOT add your own value.

parameters

  • the file path with bucket name.

    Examples:
    value
    _source
    _lines
    _html
  • the virtual table name.

  • the virtual table schema.

  • if repalce the existing one when create the virtual table.

    Default: false

  • the options used to virtualize file.

    Examples:
    value
    _source
    _lines
    _html
  • Supplied by proxy. Do NOT add your own value.

  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" -d "{\"is_replace\":\"false\",\"options\":\"INCPARTS=true\",\"url\":\"s3a://testBucket/home/data.csv\",\"virtual_name\":\"employee\",\"virtual_schema\":\"db2inst1\",\"virtual_table_def\":\[{\"column_name\":\"Column1\",\"column_type\":\"INTEGER\"}]}" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/virtualization/cloud_object_storages"
  • virtualizeCosV2RequestVirtualTableDefItemModel := &watsonqueryv1.VirtualizeCosV2RequestVirtualTableDefItem{
      ColumnName: core.StringPtr("Column_1"),
      ColumnType: core.StringPtr("INTEGER"),
    }
    
    virtualizeCosV2Options := watsonQueryService.NewVirtualizeCosV2Options(
      "s3a://testBucket/home/data.csv",
      "testString",
      "testString",
      []watsonqueryv1.VirtualizeCosV2RequestVirtualTableDefItem{*virtualizeCosV2RequestVirtualTableDefItemModel},
    )
    
    successResponse, response, err := watsonQueryService.VirtualizeCosV2(virtualizeCosV2Options)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(successResponse, "", "  ")
    fmt.Println(string(b))
  • VirtualizeCosV2RequestVirtualTableDefItem virtualizeCosV2RequestVirtualTableDefItemModel = new VirtualizeCosV2RequestVirtualTableDefItem.Builder()
      .columnName("Column_1")
      .columnType("INTEGER")
      .build();
    VirtualizeCosV2Options virtualizeCosV2Options = new VirtualizeCosV2Options.Builder()
      .url("s3a://testBucket/home/data.csv")
      .virtualName("testString")
      .virtualSchema("testString")
      .virtualTableDef(new java.util.ArrayList<VirtualizeCosV2RequestVirtualTableDefItem>(java.util.Arrays.asList(virtualizeCosV2RequestVirtualTableDefItemModel)))
      .build();
    
    Response<SuccessResponse> response = watsonQueryService.virtualizeCosV2(virtualizeCosV2Options).execute();
    SuccessResponse successResponse = response.getResult();
    
    System.out.println(successResponse);
  • // Request models needed by this operation.
    
    // VirtualizeCosV2RequestVirtualTableDefItem
    const virtualizeCosV2RequestVirtualTableDefItemModel = {
      column_name: 'Column_1',
      column_type: 'INTEGER',
    };
    
    const params = {
      url: 's3a://testBucket/home/data.csv',
      virtualName: 'testString',
      virtualSchema: 'testString',
      virtualTableDef: [virtualizeCosV2RequestVirtualTableDefItemModel],
    };
    
    let res;
    try {
      res = await watsonQueryService.virtualizeCosV2(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • virtualize_cos_v2_request_virtual_table_def_item_model = {
      'column_name': 'Column_1',
      'column_type': 'INTEGER',
    }
    
    success_response = watson_query_service.virtualize_cos_v2(
      url='s3a://testBucket/home/data.csv',
      virtual_name='testString',
      virtual_schema='testString',
      virtual_table_def=[virtualize_cos_v2_request_virtual_table_def_item_model]
    ).get_result()
    
    print(json.dumps(success_response, indent=2))

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Get primary catalog ID

Gets the primary catalog ID from the DVSYS.INSTANCE_INFO table.

Gets the primary catalog ID from the DVSYS.INSTANCE_INFO table.

Gets the primary catalog ID from the DVSYS.INSTANCE_INFO table.

Gets the primary catalog ID from the DVSYS.INSTANCE_INFO table.

Gets the primary catalog ID from the DVSYS.INSTANCE_INFO table.

GET /dvapiserver/v2/catalog/primary
(watsonQuery *WatsonQueryV1) GetPrimaryCatalog(getPrimaryCatalogOptions *GetPrimaryCatalogOptions) (result *PrimaryCatalogInfo, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) GetPrimaryCatalogWithContext(ctx context.Context, getPrimaryCatalogOptions *GetPrimaryCatalogOptions) (result *PrimaryCatalogInfo, response *core.DetailedResponse, err error)
ServiceCall<PrimaryCatalogInfo> getPrimaryCatalog()
get_primary_catalog(self,
        **kwargs
    ) -> DetailedResponse
getPrimaryCatalog(params)

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

No Request Parameters

This method does not accept any request parameters.

  • curl -k -X GET -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/catalog/primary"
  • getPrimaryCatalogOptions := watsonQueryService.NewGetPrimaryCatalogOptions()
    
    primaryCatalogInfo, response, err := watsonQueryService.GetPrimaryCatalog(getPrimaryCatalogOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(primaryCatalogInfo, "", "  ")
    fmt.Println(string(b))
  • GetPrimaryCatalogOptions getPrimaryCatalogOptions = new GetPrimaryCatalogOptions();
    
    Response<PrimaryCatalogInfo> response = watsonQueryService.getPrimaryCatalog(getPrimaryCatalogOptions).execute();
    PrimaryCatalogInfo primaryCatalogInfo = response.getResult();
    
    System.out.println(primaryCatalogInfo);
  • let res;
    try {
      res = await watsonQueryService.getPrimaryCatalog({});
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • primary_catalog_info = watson_query_service.get_primary_catalog().get_result()
    
    print(json.dumps(primary_catalog_info, indent=2))

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Add primary catalog

Inserts primary catalog ID into the DVSYS.INSTANCE_INFO table.

Inserts primary catalog ID into table DVSYS.INSTANCE_INFO.

Inserts primary catalog ID into table DVSYS.INSTANCE_INFO.

Inserts primary catalog ID into table DVSYS.INSTANCE_INFO.

Inserts primary catalog ID into table DVSYS.INSTANCE_INFO.

POST /dvapiserver/v2/catalog/primary
(watsonQuery *WatsonQueryV1) PostPrimaryCatalog(postPrimaryCatalogOptions *PostPrimaryCatalogOptions) (result *PostPrimaryCatalog, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) PostPrimaryCatalogWithContext(ctx context.Context, postPrimaryCatalogOptions *PostPrimaryCatalogOptions) (result *PostPrimaryCatalog, response *core.DetailedResponse, err error)
ServiceCall<PostPrimaryCatalog> postPrimaryCatalog(PostPrimaryCatalogOptions postPrimaryCatalogOptions)
post_primary_catalog(self,
        guid: str,
        **kwargs
    ) -> DetailedResponse
postPrimaryCatalog(params)

Request

Instantiate the PostPrimaryCatalogOptions struct and set the fields to provide parameter values for the PostPrimaryCatalog method.

Use the PostPrimaryCatalogOptions.Builder to create a PostPrimaryCatalogOptions object that contains the parameter values for the postPrimaryCatalog method.

Request body

WithContext method only

The PostPrimaryCatalog options.

The postPrimaryCatalog options.

parameters

  • Examples:
    value
    _source
    _lines
    _html

parameters

  • Examples:
    value
    _source
    _lines
    _html
  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" -d "{\"guid\": \"d77fc432-9b1a-4938-a2a5-9f37e08041f6\"}" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/catalog/primary"
  • postPrimaryCatalogOptions := watsonQueryService.NewPostPrimaryCatalogOptions(
      "d77fc432-9b1a-4938-a2a5-9f37e08041f6",
    )
    
    postPrimaryCatalog, response, err := watsonQueryService.PostPrimaryCatalog(postPrimaryCatalogOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(postPrimaryCatalog, "", "  ")
    fmt.Println(string(b))
  • PostPrimaryCatalogOptions postPrimaryCatalogOptions = new PostPrimaryCatalogOptions.Builder()
      .guid("d77fc432-9b1a-4938-a2a5-9f37e08041f6")
      .build();
    
    Response<PostPrimaryCatalog> response = watsonQueryService.postPrimaryCatalog(postPrimaryCatalogOptions).execute();
    PostPrimaryCatalog postPrimaryCatalog = response.getResult();
    
    System.out.println(postPrimaryCatalog);
  • const params = {
      guid: 'd77fc432-9b1a-4938-a2a5-9f37e08041f6',
    };
    
    let res;
    try {
      res = await watsonQueryService.postPrimaryCatalog(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • post_primary_catalog = watson_query_service.post_primary_catalog(
      guid='d77fc432-9b1a-4938-a2a5-9f37e08041f6'
    ).get_result()
    
    print(json.dumps(post_primary_catalog, indent=2))

Response

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Delete primary catalog

Deletes primary catalog item in the DVSYS.INSTANCE_INFO table.

Delete primary catalog item in the DVSYS.INSTANCE_INFO table.

Delete primary catalog item in the DVSYS.INSTANCE_INFO table.

Delete primary catalog item in the DVSYS.INSTANCE_INFO table.

Delete primary catalog item in the DVSYS.INSTANCE_INFO table.

DELETE /dvapiserver/v2/catalog/primary
(watsonQuery *WatsonQueryV1) DeletePrimaryCatalog(deletePrimaryCatalogOptions *DeletePrimaryCatalogOptions) (response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) DeletePrimaryCatalogWithContext(ctx context.Context, deletePrimaryCatalogOptions *DeletePrimaryCatalogOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deletePrimaryCatalog(DeletePrimaryCatalogOptions deletePrimaryCatalogOptions)
delete_primary_catalog(self,
        guid: str,
        **kwargs
    ) -> DetailedResponse
deletePrimaryCatalog(params)

Request

Instantiate the DeletePrimaryCatalogOptions struct and set the fields to provide parameter values for the DeletePrimaryCatalog method.

Use the DeletePrimaryCatalogOptions.Builder to create a DeletePrimaryCatalogOptions object that contains the parameter values for the deletePrimaryCatalog method.

Query Parameters

  • The Watson Query user name. If the value is Public, this API revokes access privileges from all Watson Query users.

    Example: d77fc432-9b1a-4938-a2a5-9f37e08041f6

WithContext method only

The DeletePrimaryCatalog options.

The deletePrimaryCatalog options.

parameters

  • The Watson Query user name, if the value is PUBLIC, it means revoke access privilege from all Watson Query users.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The Watson Query user name, if the value is PUBLIC, it means revoke access privilege from all Watson Query users.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X DELETE -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/catalog/primary?guid=d77fc432-9b1a-4938-a2a5-9f37e08041f6"
  • deletePrimaryCatalogOptions := watsonQueryService.NewDeletePrimaryCatalogOptions(
      "d77fc432-9b1a-4938-a2a5-9f37e08041f6",
    )
    
    response, err := watsonQueryService.DeletePrimaryCatalog(deletePrimaryCatalogOptions)
    if err != nil {
      panic(err)
    }
  • DeletePrimaryCatalogOptions deletePrimaryCatalogOptions = new DeletePrimaryCatalogOptions.Builder()
      .guid("d77fc432-9b1a-4938-a2a5-9f37e08041f6")
      .build();
    
    Response<Void> response = watsonQueryService.deletePrimaryCatalog(deletePrimaryCatalogOptions).execute();
  • const params = {
      guid: 'd77fc432-9b1a-4938-a2a5-9f37e08041f6',
    };
    
    try {
      await watsonQueryService.deletePrimaryCatalog(params);
    } catch (err) {
      console.warn(err);
    }
  • response = watson_query_service.delete_primary_catalog(
      guid='d77fc432-9b1a-4938-a2a5-9f37e08041f6'
    )

Response

Status Code

  • Success

  • Bad Request

  • Unauthorized

  • Internal Server Error

No Sample Response

This method does not specify any sample responses.

Publishes virtual tables to a catalog.

Publishes virtual tables to a catalog.

Publishes virtual tables to a catalog.

Publishes virtual tables to a catalog.

Publishes virtual tables to a catalog.

Publishes virtual tables to a catalog.

POST /dvapiserver/v2/integration/catalog/publish
(watsonQuery *WatsonQueryV1) PublishAssets(publishAssetsOptions *PublishAssetsOptions) (result *CatalogPublishResponse, response *core.DetailedResponse, err error)
(watsonQuery *WatsonQueryV1) PublishAssetsWithContext(ctx context.Context, publishAssetsOptions *PublishAssetsOptions) (result *CatalogPublishResponse, response *core.DetailedResponse, err error)
ServiceCall<CatalogPublishResponse> publishAssets(PublishAssetsOptions publishAssetsOptions)
publish_assets(self,
        catalog_id: str,
        allow_duplicates: bool,
        assets: List['PostPrimaryCatalogParametersAssetsItem'],
        **kwargs
    ) -> DetailedResponse
publishAssets(params)

Request

Instantiate the PublishAssetsOptions struct and set the fields to provide parameter values for the PublishAssets method.

Use the PublishAssetsOptions.Builder to create a PublishAssetsOptions object that contains the parameter values for the publishAssets method.

WithContext method only

The PublishAssets options.

The publishAssets options.

parameters

  • Examples:
    value
    _source
    _lines
    _html
  • The type of data source that you want to add.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Examples:
    value
    _source
    _lines
    _html
  • The type of data source that you want to add.

    Examples:
    value
    _source
    _lines
    _html
  • curl -k -X POST -H "cache-control: no-cache" -H "content-type: application/json" -H "X-Db-Profile: $url_encoded_crn" -H "Authorization: Bearer $token" -d "{\"catalog_id\": \"648fb4e0-3f6c-4ce3-afbb-317acc03faa5\",\"assets\": [{\"schema\": \"db2inst1\",\"table\": \"employee\"}]}" "https://{region}.data-virtualization.cloud.ibm.com/dvapiserver/v2/integration/catalog/publish"
  • postPrimaryCatalogParametersAssetsItemModel := &watsonqueryv1.PostPrimaryCatalogParametersAssetsItem{
      Schema: core.StringPtr("db2inst1"),
      Table: core.StringPtr("EMPLOYEE"),
    }
    
    publishAssetsOptions := watsonQueryService.NewPublishAssetsOptions(
      "2b6b9fc5-626c-47a9-a836-56b76c0bc826",
      false,
      []watsonqueryv1.PostPrimaryCatalogParametersAssetsItem{*postPrimaryCatalogParametersAssetsItemModel},
    )
    
    catalogPublishResponse, response, err := watsonQueryService.PublishAssets(publishAssetsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(catalogPublishResponse, "", "  ")
    fmt.Println(string(b))
  • PostPrimaryCatalogParametersAssetsItem postPrimaryCatalogParametersAssetsItemModel = new PostPrimaryCatalogParametersAssetsItem.Builder()
      .schema("db2inst1")
      .table("EMPLOYEE")
      .build();
    PublishAssetsOptions publishAssetsOptions = new PublishAssetsOptions.Builder()
      .catalogId("2b6b9fc5-626c-47a9-a836-56b76c0bc826")
      .allowDuplicates(false)
      .assets(new java.util.ArrayList<PostPrimaryCatalogParametersAssetsItem>(java.util.Arrays.asList(postPrimaryCatalogParametersAssetsItemModel)))
      .build();
    
    Response<CatalogPublishResponse> response = watsonQueryService.publishAssets(publishAssetsOptions).execute();
    CatalogPublishResponse catalogPublishResponse = response.getResult();
    
    System.out.println(catalogPublishResponse);
  • // Request models needed by this operation.
    
    // PostPrimaryCatalogParametersAssetsItem
    const postPrimaryCatalogParametersAssetsItemModel = {
      schema: 'db2inst1',
      table: 'EMPLOYEE',
    };
    
    const params = {
      catalogId: '2b6b9fc5-626c-47a9-a836-56b76c0bc826',
      allowDuplicates: false,
      assets: [postPrimaryCatalogParametersAssetsItemModel],
    };
    
    let res;
    try {
      res = await watsonQueryService.publishAssets(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • post_primary_catalog_parameters_assets_item_model = {
      'schema': 'db2inst1',
      'table': 'EMPLOYEE',
    }
    
    catalog_publish_response = watson_query_service.publish_assets(
      catalog_id='2b6b9fc5-626c-47a9-a836-56b76c0bc826',
      allow_duplicates=False,
      assets=[post_primary_catalog_parameters_assets_item_model]
    ).get_result()
    
    print(json.dumps(catalog_publish_response, indent=2))

Response