Skip to content

You are viewing documentation for Immuta version 2022.1.

For the latest version, view our documentation for Immuta SaaS or the latest self-hosted version.

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. Search Azure Synapse Analytics data sources.
  2. Update Azure Synapse Analytics data sources.

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 Saves the provided connection information as a data source for the requesting user.
/asa/handler/{handlerId}/triggerHighCardinalityJob Recalculates the high cardinality column for the provided handler ID.

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
}

Save Connection Information as a Data Source

Endpoint

Method Path Purpose
POST /asa/handler Saves the provided connection information as a data source for the requesting user.

Query Parameters

Attribute Description Required
Body array[object] This payload includes data source metadata. Yes

Response Parameters

Attribute Description
ConnectionString string The connection string for the data source.

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"
}

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