Skip to content

You are viewing documentation for Immuta version 2021.5.

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

Azure Data Lake Storage Gen2 Data Source API

Audience: Data Owners

Content Summary: The adls-gen2 endpoint allows you to connect and manage Azure Data Lake Storage Gen2 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.

Azure Data Lake Storage Gen2 Workflow

  1. Create a data source.
  2. Get information about a data source.
  3. Update a specific data source.

Create a Data Source

Endpoint

Method Path Purpose
POST /adls-gen2/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 Azure Data Lake Storage Gen2 data sources.

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

Payload Example

{
  "handler": {
    "metadata": {
      "tagAttributes": [],
      "eventTimeAttribute": "",
      "useDirectoryForTags": false,
      "sasToken": "your-sas-token",
      "sasTokenUrl": "your-sas-token-url",
      "authenticationMethod": "sasToken",
      "fileSystem": "bens-test-data"
    }
  },
  "dataSource": {
    "blobHandler": {
      "scheme": "https",
      "url": ""
    },
    "expiration": "2021-11-19T04:59:59.999Z",
    "blobHandlerType": "Azure Data Lake Storage Gen2",
    "recordFormat": "",
    "type": "ingested",
    "name": "Test-Data",
    "sqlTableName": "test_data"
  }
}

Response Example

{
  "id": 17,
  "dataSourceId": 17
}

Get Information About a Data Source

Endpoint

Method Path Purpose
GET /adls-gen2/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 17.

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

Response Example

{
  "dataSourceId": 17,
  "metadata": {
    "fileSystem": "bens-test-data",
    "accountName": "your-account-name",
    "sasTokenUrl": "https://your.blob.core.windows.net/",
    "ingestUserId": "azure data lake storage gen2_indexer_17",
    "tagAttributes": [],
    "dataSourceName": "Test-Data",
    "refreshInterval": 0,
    "eventTimeAttribute": "",
    "useDirectoryForTags": false,
    "authenticationMethod": "sasToken"
  },
  "type": "azureDataLakeStorageGen2Handler",
  "connectionString": "your-connection-string",
  "remoteTableDescription": null,
  "id": 17,
  "createdAt": "2021-10-19T16:41:16.161Z",
  "updatedAt": "2021-10-19T16:41:16.390Z"
}

Update a Specific Data Source

Endpoint

Method Path Purpose
PUT /adls-gen2/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 17.

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

Payload Example

The payload below updates the dataSourceName to Customer Details.

{
  "dataSourceId": 17,
  "metadata": {
    "fileSystem": "bens-test-data",
    "accountName": "your-account-name",
    "sasTokenUrl": "https://your.blob.core.windows.net/",
    "ingestUserId": "azure data lake storage gen2_indexer_17",
    "tagAttributes": [],
    "dataSourceName": "Customer Details",
    "refreshInterval": 0,
    "eventTimeAttribute": "",
    "useDirectoryForTags": false,
    "authenticationMethod": "sasToken"
  },
  "type": "azureDataLakeStorageGen2Handler",
  "connectionString": "your-connection-string",
  "remoteTableDescription": null,
  "id": 17,
  "createdAt": "2021-10-19T16:41:16.161Z",
  "updatedAt": "2021-10-19T16:41:16.390Z"
}

Response Example

{
  "id": 17,
  "ca": ["-----BEGIN CERTIFICATE-----\ncertificatedata\n-----END CERTIFICATE-----"]
}