Manage data contracts via SDKs¶
Limited availability
Data contracts can currently only be managed for tables, views, and materialized views.
Create a new contract¶
To create a contract for an existing asset in Atlan:
Create a data contract | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
-
Start by constructing the data contract JSON. In this example, we're defining it with only the minimal required properties as specified by the API. Please check the reference section for the complete data contract specification.
- type of the asset in Atlan (
Table
,View
, orMaterializedView
). - state of the contract (
DRAFT
orVERIFIED
). - must always be
DataContract
. - name of the asset as it exists inside Atlan.
- name of the asset connection as it exists inside Atlan.
- (Optional) description of this dataset, for documentation purposes.
- (Optional)
columns
:- name of the column as it is defined in the source system (often technical).
- physical data type of values in this column.
- description of this column, for documentation purposes.
- type of the asset in Atlan (
-
You need to provide the the
contract JSON
(must bestring
) and thequalifiedName
of your asset (in this example, thequalifiedName
of a Snowflake table) to thecreator()
method. - Finally, you can call the
save()
method to create the new data contract in Atlan.
Create a data contract | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
-
Start by constructing the data contract JSON. In this example, we're defining it with only the minimal required properties as specified by the API. Please check the reference section for the complete data contract specification.
- type of the asset in Atlan (
Table
,View
, orMaterializedView
). - state of the contract (
DRAFT
orVERIFIED
). - must always be
DataContract
. - name of the asset as it exists inside Atlan.
- name of the asset connection as it exists inside Atlan.
- (Optional) description of this dataset, for documentation purposes.
- (Optional)
columns
:- name of the column as it is defined in the source system (often technical).
- physical data type of values in this column.
- description of this column, for documentation purposes.
- type of the asset in Atlan (
-
You need to provide the
qualified_name
of your asset (in this example, thequalifiedName
of a Snowflake table) and thecontract JSON
(must bestring
) to thecreator()
method. - Finally, you can call the
save()
method to create the new data contract in Atlan.
Create a data contract | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
-
Start by constructing the data contract JSON. In this example, we're defining it with only the minimal required properties as specified by the API. Please check the reference section for the complete data contract specification.
- type of the asset in Atlan (
Table
,View
, orMaterializedView
). - state of the contract (
DRAFT
orVERIFIED
). - must always be
DataContract
. - name of the asset as it exists inside Atlan.
- name of the asset connection as it exists inside Atlan.
- (Optional) description of this dataset, for documentation purposes.
- (Optional)
columns
:- name of the column as it is defined in the source system (often technical).
- physical data type of values in this column.
- description of this column, for documentation purposes.
- type of the asset in Atlan (
-
You need to provide the the
contract JSON
(must bestring
) and thequalifiedName
of your asset (in this example, thequalifiedName
of a Snowflake table) to thecreator()
method. - Finally, you can call the
save()
method to create the new data contract in Atlan.
POST /api/meta/entity/bulk | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- The
typeName
must be exactlyDataContract
. -
Provide the data contract JSON. In this example, we're creating it with only the minimal required properties as specified by the API. Please check the reference section for the complete data contract specification.
- type of the asset in Atlan (
Table
,View
, orMaterializedView
). - state of the contract (
DRAFT
orVERIFIED
). - must always be
DataContract
. - name of the asset as it exists inside Atlan.
- name of the asset connection as it exists inside Atlan.
- (Optional) description of this dataset, for documentation purposes.
- (Optional)
columns
:- name of the column as it is defined in the source system (often technical).
- physical data type of values in this column.
- description of this column, for documentation purposes.
- type of the asset in Atlan (
-
You must provide a human-readable name for your contract.
- The
qualifiedName
should follow the pattern:<assetQualifiedName>/contract
(whereassetQualifiedName
is, in this example, thequalifiedName
of a Snowflake table).
Retrieve a contract¶
By asset:¶
To retrieve the latest contract and certified contract of a given asset using its qualified name:
Retrieve latest and certified data contract of a asset | |
---|---|
1 2 3 |
|
- First, retrieve the asset by its
qualifiedName
. - Retrieve the latest data contract by using
.getDataContractLatest()
. - Retrieve the certified data contract by using the
.getDataContractLatestCertified()
.
Retrieve latest and certified data contract of a asset | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- First, retrieve the asset by its
qualified_name
. - Retrieve the latest data contract by using the
table.data_contract_latest
attribute. - Retrieve the certified data contract by using the
table.data_contract_latest_certified
attribute.
Retrieve latest and certified data contract of a asset | |
---|---|
1 2 3 |
|
- First, retrieve the asset by its
qualifiedName
. - Retrieve the latest data contract by using
.dataContractLatest
. - Retrieve the certified data contract by using the
.dataContractLatestCertified
.
GET /api/meta/entity/uniqueAttribute/type/Table?attr%3AqualifiedName=default%2Fsnowflake%2F1717514525%2FRAW%2FWIDEWORLD%2FSALE_TXN&minExtInfo=False&ignoreRelationships=False | |
---|---|
1 |
|
-
All details are in the URL itself.
URL-encoded filter
Note that the filter is URL-encoded. decoded it would be:
/api/meta/entity/uniqueAttribute/type/Table?attr:qualifiedName=default/snowflake/1717514525/RAW/WIDEWORLD/SALE_TXN&minExtInfo=False&ignoreRelationships=False
By qualified name:¶
To retrieve a contract by its version (V1
, V2
, etc) using its qualified name:
Retrieve a data contract by its version | |
---|---|
1 2 3 |
|
- The
qualifiedName
of the data contract must be in the format:<assetQualifiedName>/<assetType>/contract/V<versionNumber>
. For this example:assetQualifiedName
:qualifiedName
of a Snowflake table.assetType
: type of this asset in Atlan, i.e:Table
.versionNumber
: specific version of the data contract to retrieve, e.g:1
,2
, and so on.
Retrieve a data contract by its version | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- The
qualifiedName
of the data contract must be in the format:<assetQualifiedName>/<assetType>/contract/V<versionNumber>
. For this example:assetQualifiedName
:qualifiedName
of a Snowflake table.assetType
: type of this asset in Atlan, i.e:Table
.versionNumber
: specific version of the data contract to retrieve, e.g:1
,2
, and so on.
Retrieve a data contract by its version | |
---|---|
1 2 3 |
|
- The
qualifiedName
of the data contract must be in the format:<assetQualifiedName>/<assetType>/contract/V<versionNumber>
. For this example:assetQualifiedName
:qualifiedName
of a Snowflake table.assetType
: type of this asset in Atlan, i.e:Table
.versionNumber
: specific version of the data contract to retrieve, e.g:1
,2
, and so on.
GET /api/meta/entity/uniqueAttribute/type/DataContract?attr%3AqualifiedName=dedefault%2Fsnowflake%2F1717514525%2FRAW%2FWIDEWORLD%2FSALE_TXN%2FTable%2Fcontract%2FV1&minExtInfo=False&ignoreRelationships=False | |
---|---|
1 |
|
-
All details are in the URL itself.
URL-encoded filter
Note that the filter is URL-encoded. decoded it would be:
attr:qualifiedName=default/snowflake/1717514525/RAW/WIDEWORLD/SALE_TXN/Table/contract/V1&minExtInfo=False&ignoreRelationships=False
where the
qualifiedName
of the data contract must be in the format:<assetQualifiedName>/<assetType>/contract/V<versionNumber>
. For this example:assetQualifiedName
:qualifiedName
of a Snowflake table.assetType
: type of this asset in Atlan, i.e:Table
.versionNumber
: specific version of the data contract to retrieve, e.g:1
,2
, and so on.
Update a contract¶
In the following example, we are updating the contact
certificateStatus
field to VERIFIED
(shown as PUBLISHED
in the UI):
Update a data contract | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
- Begin by constructing the updated data contract JSON.
-
Use the
updater()
method to update a data contract.qualifiedName
of the data contract, ie:<assetQualifiedName>/contract
(whereassetQualifiedName
is, in this example, thequalifiedName
of a Snowflake table).name
of the data contract. (NOTE:
SDKs and CLI always generate it in the format: "Data contract fordataset
(asset.name
)").
-
You can then add any other updates or attributes. In this example, we're updating the contract JSON (must be
string
). - To update the data contract in Atlan, call the
save()
method with the object you've built.
Update a data contract | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
- Begin by constructing the updated data contract JSON.
-
Use the
updater()
method to update a data contract.qualifiedName
of the data contract, ie:<assetQualifiedName>/contract
(whereassetQualifiedName
is, in this example, thequalifiedName
of a Snowflake table).name
of the data contract. (NOTE:
SDKs and CLI always generate it in the format: "Data contract fordataset
(asset.name
)").
-
You can then add any other updates or attributes. In this example, we're updating the contract JSON (must be
string
). - To update the data contract in Atlan, call the
save()
method with the object you've built.
Update a data contract | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
- Begin by constructing the updated data contract JSON.
-
Use the
updater()
method to update a data contract.qualifiedName
of the data contract, ie:<assetQualifiedName>/contract
(whereassetQualifiedName
is, in this example, thequalifiedName
of a Snowflake table).name
of the data contract. (NOTE:
SDKs and CLI always generate it in the format: "Data contract fordataset
(asset.name
)").
-
You can then add any other updates or attributes. In this example, we're updating the contract JSON (must be
string
). - To update the data contract in Atlan, call the
save()
method with the object you've built.
POST /api/meta/entity/bulk | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- The
typeName
must be exactlyDataContract
. -
Provide the data contract JSON. In this example, we're updating it with only the minimal required properties as specified by the API. Please check the reference section for the complete data contract specification.
- type of the asset in Atlan (
Table
,View
, orMaterializedView
). - state of the contract (
DRAFT
orVERIFIED
). - must always be
DataContract
. - name of the asset as it exists inside Atlan.
- name of the asset connection as it exists inside Atlan.
- (Optional) description of this dataset, for documentation purposes.
- (Optional)
columns
:- name of the column as it is defined in the source system (often technical).
- physical data type of values in this column.
- description of this column, for documentation purposes.
- type of the asset in Atlan (
-
Human-readable name for your contract.
- The
qualifiedName
of your contract, ie:<assetQualifiedName>/contract
(whereassetQualifiedName
is, in this example, thequalifiedName
of a Snowflake table).
Delete a contract¶
Soft-delete (archive)¶
To soft-delete, or archive, a contract:
Coming soon
Coming soon
Coming soon
Coming soon
Hard-delete (purge)¶
To permanently delete (purge) a contract:
Coming soon
Coming soon
Coming soon
Coming soon