Skip to content

Sybase Data Source API

Audience: Data Owners

Content Summary: The sybase endpoint allows you to connect and manage Sybase data sources in Immuta.

Note

Additional fields may be included in some responses you receive; however, these attributes are for internal purposes and are therefore undocumented.

Sybase Workflow

  1. Create a data source.
  2. Get information about a data source.
  3. Manage data sources.

Create a Data Source

Endpoint

Method Path Purpose
POST /sybase/handler Save the provided connection information as a data source.

Query Parameters

None.

Payload Parameters

Attribute Description Required
Private boolean When false, the data source will be publicly available in the Immuta UI. Yes
BlobHandler array[object] A list of full URLs providing the locations of all blob store handlers to use with this data source. Yes
BlobHandlerType string Describes the type of underlying blob handler that will be used with this data source (e.g., MS SQL). Yes
RecordFormat string The data format of blobs in the data source, such as json, xml, html, or jpeg. Yes
Type string The type of data source: ingested (metadata will exist in Immuta) or queryable (metadata is dynamically queried). Yes
Name string The name of the data source. It must be unique within the Immuta instance. Yes
SqlTableName string A string that represents this data source's table in the Query Engine. Yes
Organization string The organization that owns the data source. Yes
Category string The category of the data source. No
Description string The description of the data source. No
Owner array[object] Users and groups that should be added as owners to this data source. Profiles must be a list of profile IDs and groups must be a list of group IDs: { "profiles": [3, 5], "groups": [4, 1999] }. No
Expert array[object] Users and groups that should be added as expert users to this data source. Profiles must be a list of profile IDs and groups must be a list of group IDs: { "profiles": [87, 199], "groups": [324] }. No
Ingest array[object] Users and groups that should be added as ingest users to this data source. Profiles must be a list of profile IDs and groups must be a list of group IDs: { "profiles": [34, 23], "groups": [32] }. No
HasExamples boolean When true, the data source contains examples. No

Response Parameters

Attribute Description
Id integer The handler ID.
DataSourceId integer The ID of the data source.
Warnings string This message describes issues with the created data source, such as the data source being unhealthy.
ConnectionString string The connection string used to connect the data source to Immuta.

Request Example

This request creates two Sybase data sources, which are specified in example-payload.json.

curl \
    --request POST \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    --data @example-payload.json \
    https://demo.immuta.com/sybase/handler

Payload Example

{
  "handler": [{
    "metadata": {
      "ssl": true,
      "userFiles": [],
      "port": 5000,
      "hostname": "sybase.database.example.io",
      "database": "example",
      "username": "yourusername",
      "password": "yourpassword",
      "schemaProjectName": "Sybase Data Project",
      "staleDataTolerance": 86400,
      "bodataSchemaName": "dbo",
      "bodataTableName": "randomized",
      "dataSourceName": "Dbo Randomized",
      "table": "randomized",
      "schema": "dbo"
    }
  }, {
    "metadata": {
      "ssl": true,
      "userFiles": [],
      "port": 5000,
      "hostname": "sybase.database.example.io",
      "database": "example",
      "username": "yourusername",
      "password": "yourpassword",
      "schemaProjectName": "Sybase Data Project",
      "staleDataTolerance": 86400,
      "bodataSchemaName": "dbo",
      "bodataTableName": "web_sales",
      "dataSourceName": "Dbo Web Sales",
      "table": "web_sales",
      "schema": "dbo"
    }
  }],
  "dataSource": {
    "blobHandler": {
      "scheme": "https",
      "url": ""
    },
    "expiration": "2021-11-01T03:59:59.999Z",
    "blobHandlerType": "Sybase ASE",
    "recordFormat": "",
    "type": "queryable",
    "schemaEvolutionId": null,
    "columnEvolutionEnabled": true
  },
  "schemaEvolution": {
    "ownerProfileId": 2,
    "config": {
      "nameTemplate": {
        "nameFormat": "<Schema> <Tablename>",
        "tableFormat": "<tablename>",
        "sqlSchemaNameFormat": "<schema>",
        "schemaProjectNameFormat": "<Schema>"
      }
    },
    "schemas": []
  }
}

Response Example

{
  "connectionString":"yourusername@sybase.database.example.io:5000/example"
}

Get Information About a Data Source

Endpoint

Method Path Purpose
GET /sybase/handler/{handlerId} Get the handler metadata associated with the provided handler ID.

Query Parameters

Attribute Description Required
HandlerID integer The ID of the handler. Yes
SkipCache boolean When true, will skip the handler cache when retrieving metadata. No

Response Parameters

Attribute Description
Body array[object] Metadata about the data source, including the data source ID, schema, database, and connection string.

Request Example

This request returns metadata for the handler with the ID 40.

curl \
    --request GET \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/sybase/handler/40

Response Example

{
  "dataSourceId": 40,
  "metadata": {
    "ssl": true,
    "port": 5000,
    "query": null,
    "table": "web_sales",
    "schema": "dbo",
    "database": "example",
    "hostname": "sybase.database.example.io",
    "username": "yourusername",
    "eventTime": null,
    "userFiles": [],
    "dataSourceName": "Dbo Web Sales",
    "bodataTableName": "web_sales",
    "bodataSchemaName": "dbo",
    "columnsNormalized": false,
    "schemaProjectName": "Sybase Data Project",
    "staleDataTolerance": 86400
  },
  "type": "odbcHandler",
  "connectionString": "yourusername@sybase.database.example.io:5000/example",
  "remoteTableDescription": "[{\"name\":\"ws_sold_date_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_sold_time_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ship_date_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_item_sk\",\"dataType\":\"int\",\"nullable\":0,\"isPrimaryKey\":null},{\"name\":\"ws_bill_customer_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_bill_cdemo_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_bill_hdemo_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_bill_addr_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ship_customer_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ship_cdemo_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ship_hdemo_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ship_addr_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_web_page_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_web_site_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ship_mode_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_warehouse_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_promo_sk\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_order_number\",\"dataType\":\"int\",\"nullable\":0,\"isPrimaryKey\":null},{\"name\":\"ws_quantity\",\"dataType\":\"int\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_wholesale_cost\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_list_price\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_sales_price\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ext_discount_amt\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ext_sales_price\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ext_wholesale_cost\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ext_list_price\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ext_tax\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_coupon_amt\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_ext_ship_cost\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_net_paid\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_net_paid_inc_tax\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_net_paid_inc_ship\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_net_paid_inc_ship_tax\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null},{\"name\":\"ws_net_profit\",\"dataType\":\"decimal\",\"nullable\":1,\"isPrimaryKey\":null}]",
  "id": 40,
  "createdAt": "2021-10-01T17:41:22.692Z",
  "updatedAt": "2021-10-01T17:41:22.841Z",
  "dbms": {
    "name": "sybase"
  }
}

Manage Data Sources

Method Path Purpose
PUT /sybase/handler/{handlerId} Update the data source metadata associated with the provided handler ID. This endpoint does not perform partial updates, but will allow the dictionary to be omitted. In this case, it uses the current dictionary.
PUT /sybase/bulk Update the data source metadata associated with the provided connection string.
PUT /sybase/handler/{handlerId}/triggerHighCardinalityJob Recalculate the high cardinality column for the specified data source.

Update a Specific Data Source

Endpoint

Method Path Purpose
PUT /sybase/handler/{handlerId} Update the data source metadata associated with the provided handler ID. This endpoint does not perform partial updates, but will allow the dictionary to be omitted. In this case, it uses the current dictionary.

Query Parameters

Attribute Description Required
HandlerID integer The ID of the handler. Yes
SkipCache boolean When true, will skip the handler cache when retrieving metadata. No

Payload Parameters

Attribute Description Required
Handler metadata Includes metadata about the handler, such as ssl, port, database, hostname, username, and password. Yes
ConnectionString string The connection string used to connect to the data source. Yes

Response Parameters

Attribute Description
Id integer The ID of the handler.
Ca string The certificate authority.
Columns array[object] This is a Data Dictionary object, which provides metadata about the columns in the data source, including the name and data type of the column.

Request Example

This request updates the metadata for the data source with the handler ID 39.

curl \
    --request PUT \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    --data @example-payload.json \
    https://demo.immuta.com/sybase/handler/39
Payload Example

The payload below removes the id column from the data source, leaving only the cat_1, num_1, and num_2 columns.

{
  "handler": {
    "policyHandler": null,
    "dataSourceId": 39,
    "metadata": {
      "ssl": true,
      "port": 5000,
      "table": "randomized",
      "schema": "dbo",
      "database": "tpc",
      "hostname": "sybase.database.example.io",
      "username": "yourusername",
      "eventTime": null,
      "userFiles": [],
      "dataSourceName": "Dbo Randomized",
      "bodataTableName": "randomized",
      "bodataSchemaName": "dbo",
      "columnsNormalized": false,
      "schemaProjectName": "Sybase Data Project",
      "staleDataTolerance": 86400,
      "columns": [{
        "name": "cat_1",
        "dataType": "text",
        "remoteType": "varchar",
        "nullable": false
      }, {
        "name": "num_1",
        "dataType": "int",
        "remoteType": "int",
        "nullable": false
      }, {
        "name": "num_2",
        "dataType": "decimal",
        "remoteType": "decimal",
        "nullable": false
      }],
      "password": "yourpassword"
    },
    "type": "odbcHandler",
    "connectionString": "yourusername@sybase.database.example.io:5000/tpc",
    "remoteTableDescription": "[{\"name\":\"id\",\"dataType\":\"bigint\",\"nullable\":0,\"isPrimaryKey\":null},{\"name\":\"cat_1\",\"dataType\":\"varchar\",\"nullable\":0,\"isPrimaryKey\":null},{\"name\":\"num_1\",\"dataType\":\"int\",\"nullable\":0,\"isPrimaryKey\":null},{\"name\":\"num_2\",\"dataType\":\"decimal\",\"nullable\":0,\"isPrimaryKey\":null}]",
    "id": 39,
    "createdAt": "2021-10-01T17:41:22.692Z",
    "updatedAt": "2021-10-01T17:41:23.702Z",
    "dbms": {
      "name": "sybase"
    }
  }
}

Response Example

{
  "id": 39,
  "ca": ["-----BEGIN CERTIFICATE-----\ncertificatedata\n-----END CERTIFICATE-----"],
  "metadata": {
    "columns": [{
      "name": "cat_1",
      "dataType": "text",
      "remoteType": "varchar",
      "nullable": false
    }, {
      "name": "num_1",
      "dataType": "int",
      "remoteType": "int",
      "nullable": false
    }, {
      "name": "num_2",
      "dataType": "decimal",
      "remoteType": "decimal",
      "nullable": false
    }]
  }
}

Update Multiple Data Sources

Endpoint

Method Path Purpose
PUT /sybase/bulk Update the data source metadata associated with the provided connection string.

Query Parameters

None.

Payload Parameters

Attribute Description Required
Handler metadata Includes metadata about the handler, such as ssl, port, database, hostname, username, and password. Yes
ConnectionString string The connection string used to connect to the data sources. Yes

Response Parameters

Attribute Description
BulkId string The ID of the bulk data source update.
ConnectionString string The connection string shared by the data sources bulk updated.
JobsCreated integer The number of jobs that ran to update the data sources; this number corresponds to the number of data sources updated.

Request Example

This request updates the metadata for all data sources with the connection string specified in example-payload.json.

curl \
    --request PUT \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    --data @example-payload.json \
    https://demo.immuta.com/sybase/bulk
Payload Example

The payload below adds a certificate (certificate.json) to connect to the data sources with the provided connection string.

{
  "handler": {
    "metadata": {
      "ssl": true,
      "port": 5000,
      "database": "tpc",
      "hostname": "sybase.database.example.io",
      "username": "yourusername",
      "userFiles": [{
        "keyName": "testcert",
        "filename": "bf349cbbfd3bc4eaf4ace7824a599fbc7cb5f7d5.json",
        "userFilename": "certificate.json"
      }],
      "password": "yourpassword"
    }
  },
  "connectionString": "yourusername@sybase.database.example.io:5000/tpc"
}

Response Example

{
  "bulkId": "bulk_ds_update_f50a8010dca03c07bcd0dc55eaf13c07",
  "connectionString": "yourusername@sybase.database.example.io:5000/tpc",
  "jobsCreated": 2
}

Recalculate the High Cardinality Column for a Data Source

Endpoint

Method Path Purpose
PUT /sybase/handler/{handlerId}/triggerHighCardinalityJob Recalculate the high cardinality column for the specified data source.

Query Parameters

Attribute Description Required
HandlerID integer The ID of the handler. Yes

Response Parameters

The response returns a string of characters that identify the high cardinality job run.

Request Example

This request re-runs the job that calculates the high cardinality column for the data source with the handler ID 39.

curl \
    --request PUT \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/sybase/handler/39/triggerHighCardinalityJob

Response Example

d7781580-22e1-11ec-b2b8-874838eeef05