Skip to content

Azure Synapse Analytics API

Audience: All Immuta Users

Content Summary: This page describes the asa (Azure Synapse Analytics data sources) endpoint.

Note

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

ASA Workflow

  1. Create an Azure Synapse Analytics data source.
  2. Search Azure Synapse Analytics data sources.
  3. Update Azure Synapse Analytics data sources.

Create a Data Source

Data source duplicates

In order to avoid two data sources referencing the same table, users can not create duplicate data sources. If you attempt to create a duplicate data source using the API, you will encounter a warning stating "duplicate tables are specified in the payload."

Endpoint

Method Path Purpose
POST /asa/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

The following request saves the provided connection information as a data source.

curl \
    --request POST \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    --data @example_payload.json
    https://your-immuta-url.com/asa/handler

Request Example Payload

{
    "hits": [{
        "name": "Public Credit Accounts",
        "id": 1,
        "recordFormat": "Not Provided",
        "deleted": false,
        "description": null,
        "createdAt": "2021-09-09T14:12:09.511Z",
        "subscriptionPolicy": {
            "type": "subscription",
            "approvals": [{
                "requiredPermission": "OWNER",
                "specificApproverRequired": false
            }]
        },
        "schemaEvolutionId": 1,
        "recordCount": 0,
        "blobHandlerType": "Synapse",
        "subscriptionType": "approval",
        "sqlSchemaName": "public",
        "status": "failed",
        "subscriptionStatus": "owner",
        "connectionString": "your-username@your-dev-workspace.sql.azuresynapse.net:1433/public",
        "policy": "No Conflict",
        "policyHandlerType": "Builder",
        "native": null,
        "workspace": null
    }, {
        "name": "Public Credit Transactions",
        "id": 2,
        "recordFormat": "Not Provided",
        "deleted": false,
        "description": null,
        "createdAt": "2021-09-09T14:12:09.522Z",
        "subscriptionPolicy": {
            "type": "subscription",
            "approvals": [{
                "requiredPermission": "OWNER",
                "specificApproverRequired": false
            }]
        },
        "schemaEvolutionId": 1,
        "recordCount": 0,
        "blobHandlerType": "Synapse",
        "subscriptionType": "approval",
        "sqlSchemaName": "public",
        "status": "passed",
        "subscriptionStatus": "owner",
        "connectionString": "your-username@your-dev-workspace.sql.azuresynapse.net:1433/public",
        "policy": "No Conflict",
        "policyHandlerType": "Builder",
        "native": null,
        "workspace": null
    }, {
        "name": "Public Fake Medical Claims 2017",
        "id": 3,
        "recordFormat": "Not Provided",
        "deleted": false,
        "description": null,
        "createdAt": "2021-09-09T14:12:09.894Z",
        "subscriptionPolicy": null,
        "schemaEvolutionId": 1,
        "recordCount": 0,
        "blobHandlerType": "Synapse",
        "subscriptionType": "manual",
        "sqlSchemaName": "public",
        "status": "passed",
        "subscriptionStatus": "owner",
        "connectionString": "your-username@your-dev-workspace.sql.azuresynapse.net:1433/public",
        "policy": "No Conflict",
        "policyHandlerType": "Builder",
        "native": null,
        "workspace": null
    }, {
        "name": "Public Uciml Census Income Enriched",
        "id": 4,
        "recordFormat": "Not Provided",
        "deleted": false,
        "description": null,
        "createdAt": "2021-09-09T14:12:09.916Z",
        "subscriptionPolicy": null,
        "schemaEvolutionId": 1,
        "recordCount": 0,
        "blobHandlerType": "Synapse",
        "subscriptionType": "manual",
        "sqlSchemaName": "public",
        "status": "passed",
        "subscriptionStatus": "owner",
        "connectionString": "your-username@your-dev-workspace.sql.azuresynapse.net:1433/public",
        "policy": "None",
        "policyHandlerType": "None",
        "native": null,
        "workspace": null
    }],
    "facets": {
        "tags": [],
        "statuses": [{
            "name": "failed",
            "count": 0
        }, {
            "name": "passed",
            "count": 0
        }],
        "blobHandlerTypes": [{
            "name": "Synapse",
            "count": 0
        }],
        "editable": [{
            "name": "owned",
            "count": 4
        }, {
            "name": "expert",
            "count": 0
        }, {
            "name": "notSubscribed",
            "count": 0
        }, {
            "name": "disabled",
            "count": 0
        }]
    },
    "count": 4
}

Response Example

{
  "connectionString": "your-username@your-dev-workspace.sql.azuresynapse.net:1433/public"
}

Search Asa

Search for Handler Metadata

Endpoint

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

Query Parameters

Attribute Description Required
HandlerId integer The specific handler ID. Yes
SkipCache boolean If true the handler cache will be skipped when retrieving the handler data. No

Response Parameters

Attribute Description
DataSourceId integer The data source ID.
Value metadata Details regarding the handler.

Request Example

The following request returns the handler metadata associated with the provided handler ID.

curl \
    --request GET \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://your-immuta-url.com/asa/handler/67

Response Example

{
  "dataSourceId": 67,
  "metadata": {
    "ssl": true,
    "port": 1433,
    "query": null,
    "table": "table_108",
    "schema": "elliott_dev",
    "database": "your_database",
    "hostname": "your-workspace.sql.azuresynapse.net",
    "username": "your-username",
    "eventTime": null,
    "dataSourceName": "Dev Table 108",
    "bodataTableName": "table_108",
    "disableClassify": false,
    "highCardinality": "col_1",
    "bodataSchemaName": "dev",
    "columnsNormalized": false,
    "schemaProjectName": "Dev",
    "staleDataTolerance": 2592000
  },
  "type": "odbcHandler",
  "connectionString": "your-username@your-workspace.sql.azuresynapse.net:1433/public",
  "remoteTableDescription": "[{\"name\":\"col_1\",\"isPrimaryKey\":null,\"dataType\":\"int\",\"nullable\":\"YES\"},{\"name\":\"col_2\",\"isPrimaryKey\":null,\"dataType\":\"decimal(5,2)\",\"nullable\":\"YES\"},{\"name\":\"col_3\",\"isPrimaryKey\":null,\"dataType\":\"varchar(10)\",\"nullable\":\"YES\"}]",
  "id": 67,
  "createdAt": "2021-09-17T14:15:10.256Z",
  "updatedAt": "2021-09-17T14:15:19.547Z",
  "dbms": {
    "name": "asa"
  }
}

Update Asa

Endpoint Purpose
/asa/handler/{handlerId} Updates the handler metadata associated with the provided handler ID.
/asa/bulk Updates the data source metadata associated with the provided connection string.
/asa/handler/{handlerId}/triggerHighCardinalityJob Recalculates the high cardinality column for the provided handler ID.
/asa/handler/{handlerId}/refreshNativeViewJob Refresh the native view of a data source.

Update Handler Metadata

Endpoint

Method Path Purpose
PUT /asa/handler/{handlerId} Updates the handler 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 specific handler ID. Yes
SkipCache boolean If true the handler cache will be skipped when retrieving the handler data. No

Response Parameters

Attribute Description
DataSourceId integer The data source ID.
Body array[object] Details regarding the handler, including schema, name format, and data source metadata.

Request Example

The following request updates the handler metadata (saved in example_payload.json) associated with the provided handler ID.

curl \
    --request PUT \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    --data @example_payload.json
    https://your-immuta-url.com/asa/handler/67
Request Payload Example
{
    "schemaEvolution": {
        "schemas": [
            "string"
        ],
        "disabled": false,
        "ownerProfileId": 0,
        "config": {
            "nameTemplate": {
                "tableFormat": "string",
                "nameFormat": "string",
                "sqlSchemaNameFormat": "string",
                "schemaProjectNameFormat": "string"
            }
        },
        "dataSourceConfig": {},
        "handlerMetadata": {},
        "connectionString": "string"
    },
    "handler": {
        "id": 0,
        "type": "string",
        "dataSourceId": 0,
        "metadata": {
            "blobId": "string",
            "eventTime": "string",
            "highCardinality": "string",
            "bodataSchemaName": "immuta",
            "bodataTableName": "string",
            "format": "string",
            "disableClassify": false,
            "staleDataTolerance": 2592000,
            "dataSourceName": "string",
            "schemaProjectName": "string",
            "username": "string",
            "password": "string",
            "ssl": false,
            "database": "string",
            "schema": "string",
            "table": "string",
            "query": "string",
            "columns": [{
                "name": "string",
                "dataType": "string",
                "remoteColumn": "string",
                "remoteType": "string",
                "srid": 0,
                "statistics": {},
                "nullable": false,
                "isPrimaryKey": false,
                "displayName": "string",
                "description": "string",
                "tags": [
                    "string"
                ],
                "catalogMetadata": {},
                "children": [
                    "string"
                ]
            }],
            "columnsNormalized": false,
            "nativeWorkspaceName": "string",
            "nativeSchemaName": "string",
            "nativeViewName": "string",
            "hostname": "string",
            "port": 0,
            "userFiles": [{
                "keyName": "string",
                "filename": "string",
                "content": "string",
                "userFilename": "string"
            }],
            "scheme": "string",
            "warehouse": "string",
            "connectionStringOptions": "string",
            "native": {
                "type": "string",
                "projectId": 0
            },
            "secureNativeView": false
        },
        "dbms": {
            "name": "string"
        },
        "connectionString": "string",
        "remoteTableDescription": "string",
        "createdAt": "2021-09-20",
        "updatedAt": "2021-09-20",
        "policyHandler": {
            "visibilitySchema": {
                "fields": [
                    "string"
                ],
                "version": "2021-09-20"
            }
        }
    }
}

Response Example

{
  "dataSourceId": 67,
  "metadata": {
    "ssl": true,
    "port": 1433,
    "query": null,
    "table": "table_108",
    "schema": "dev",
    "database": "your_database",
    "hostname": "your-workspace.sql.azuresynapse.net",
    "username": "your-username",
    "eventTime": null,
    "dataSourceName": "Dev Table 108",
    "bodataTableName": "table_108",
    "disableClassify": false,
    "highCardinality": "col_1",
    "bodataSchemaName": "dev",
    "columnsNormalized": false,
    "schemaProjectName": "Dev",
    "staleDataTolerance": 2592000
  },
  "type": "odbcHandler",
  "connectionString": "your-username@your-workspace.sql.azuresynapse.net:1433/public",
  "remoteTableDescription": "[{\"name\":\"col_1\",\"isPrimaryKey\":null,\"dataType\":\"int\",\"nullable\":\"YES\"},{\"name\":\"col_2\",\"isPrimaryKey\":null,\"dataType\":\"decimal(5,2)\",\"nullable\":\"YES\"},{\"name\":\"col_3\",\"isPrimaryKey\":null,\"dataType\":\"varchar(10)\",\"nullable\":\"YES\"}]",
  "id": 67,
  "createdAt": "2021-09-17T14:15:10.256Z",
  "updatedAt": "2021-09-17T14:15:19.547Z",
  "dbms": {
    "name": "asa"
  }
}

Update Multiple Data Sources

Endpoint

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

Query Parameters

Attribute Description Required
Body array[object] This payload includes data source metadata and specifies the connection string. Yes

Response Parameters

Attribute Description
BulkId integer The bulk handler metadata ID.
ConnectionString string The specified connection string.
JobsCreated integer Number of jobs created.

Request Example

The following request updates the handler metadata for the handler ID specified in example_payload.json.

curl \
    --request PUT \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    --data @example_payload.json
    https://your-immuta-url.com/asa/bulk
Request Payload Example
{
    "ids": [
        0
    ],
    "connectionString": "string",
    "handler": {
        "metadata": {
            "blobId": "string",
            "eventTime": "string",
            "highCardinality": "string",
            "bodataTableName": "string",
            "format": "string",
            "disableClassify": false,
            "staleDataTolerance": 2592000,
            "dataSourceName": "string",
            "schemaProjectName": "string",
            "username": "string",
            "password": "string",
            "ssl": false,
            "database": "string",
            "schema": "string",
            "table": "string",
            "query": "string",
            "columns": [{
                "name": "string",
                "dataType": "string",
                "remoteColumn": "string",
                "remoteType": "string",
                "srid": 0,
                "statistics": {},
                "nullable": false,
                "isPrimaryKey": false,
                "displayName": "string",
                "description": "string",
                "tags": [
                    "string"
                ],
                "catalogMetadata": {},
                "children": [
                    "string"
                ]
            }],
            "columnsNormalized": false,
            "nativeWorkspaceName": "string",
            "nativeSchemaName": "string",
            "nativeViewName": "string",
            "authenticationMethod": "string",
            "hostname": "string",
            "port": 0,
            "sid": "string",
            "connectionStringOptions": "string",
            "paths": [
                "string"
            ],
            "clusterName": "string",
            "pathUris": [
                "string"
            ],
            "metastoreTables": [
                "string"
            ],
            "scheme": "string",
            "providers": "string",
            "ephemeral": false,
            "httpPath": "string",
            "userFiles": [{
                "keyName": "string",
                "filename": "string",
                "content": "string",
                "userFilename": "string"
            }],
            "warehouse": "string",
            "workspaceId": 0,
            "authDB": "string",
            "directory": "string",
            "secureNativeView": false,
            "bodataSchemaName": "string"
        }
    },
    "schemaEvolution": {
        "schemas": [
            "string"
        ],
        "disabled": false,
        "ownerProfileId": 0,
        "config": {
            "nameTemplate": {
                "tableFormat": "string",
                "nameFormat": "string",
                "sqlSchemaNameFormat": "string",
                "schemaProjectNameFormat": "string"
            }
        },
        "dataSourceConfig": {},
        "handlerMetadata": {},
        "connectionString": "string"
    }
}

Response Example

{
  "bulkId": "bulk_ds_update_fe48d7fd4c594f96a89438cdb84ec0ba",
  "connectionString": "string@string:0/string",
  "jobsCreated": 1
}

Recalculate High Cardinality Columns

Endpoint

Method Path Purpose
PUT /asa/handler/{handlerId}/triggerHighCardinalityJob Recalculates the high cardinality column for the provided handler ID.

Query Parameters

Attribute Description Required
HandlerId integer The specific handler ID. Yes

Response Parameters

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

Request Example

The following request recalculates the high cardinality column for the provided handler ID.

curl \
    --request PUT \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://your-immuta-url.com/asa/handler/67/triggerHighCardinalityJob

Response Example

25424a50-17df-11ec-b388-0fe1d33b5af1

Refresh a Native View

Endpoint

Method Path Purpose
PUT /asa/handler/{handlerId}/refreshNativeViewJob Refresh the native view of a 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 identifies the refresh view job run.

Request Example

This request refreshes the view for the data source with the handler ID 7.

curl \
    --request PUT \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/asa/handler/7/refreshNativeViewJob

Response Example

53c256d0-eb57-11ec-b275-d95a8e998142