Certify assets
Add to existing asset
To add a certificate to an existing asset:
- dbt
- Java
- Python
- Kotlin
- Raw REST API
Add certificate to existing assets
models:
- name: TOP_BEVERAGE_USERS # (1)
meta:
atlan:
attributes: # (2)
certificateStatus: VERIFIED # (3)
certificateStatusMessage: >- # (4)
Verified through automation.
- You must of course give the name of the object.
- The details for the certificate must be nested within the
meta.atlan.attributesstructure. - You must provide a valid status for the certificate (
DRAFT,VERIFIEDorDEPRECATED). - (Optional) You can also provide a message to associate with the certificate.
Add certificate to existing assets
Table result = Table.updateCertificate( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS", // (3)
CertificateStatus.VERIFIED, // (4)
"Verified through automation."); // (5)
- Use the
updateCertificate()helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary APIs, and return with the result of the update operation all-in-one. - Because this operation will directly change the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - The
qualifiedNameof the object. - The type of certificate (the
CertificateStatusenumeration gives the valid values). - (Optional) A message to include in the certificate.
Add certificate to existing assets
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Table
from pyatlan.model.enums import CertificateStatus
client = AtlanClient()
table = client.asset.update_certificate( # (1)
asset_type=Table,
qualified_name="default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",
name="TOP_BEVERAGE_USERS",
certificate_status=CertificateStatus.VERIFIED,
message="Verified through automation.",
)
if table is None: # (2)
print("Certificate status did not change")
else: # (3)
print("Certificate status updated")
- Use the
asset.update_certificate()helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary APIs, and return with the result of the update operation all-in-one. - If no change occurs to the asset then
Nonewill be returned. - If the asset is updated then the asset will be returned.
Add certificate to existing assets
val result = Table.updateCertificate( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS", // (3)
CertificateStatus.VERIFIED, // (4)
"Verified through automation.") // (5)
- Use the
updateCertificate()helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary APIs, and return with the result of the update operation all-in-one. - Because this operation will directly change the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - The
qualifiedNameof the object. - The type of certificate (the
CertificateStatusenumeration gives the valid values). - (Optional) A message to include in the certificate.
POST /api/meta/entity/bulk
{
"entities": [ // (1)
}
]
}
- All assets must be wrapped in an
entitiesarray. - You must provide the exact type name for the asset (case-sensitive).
- You must provide the exact name of the asset (case-sensitive).
- You must provide the exact
qualifiedNameof the asset (case-sensitive). - You must provide a valid status for the certificate.
- (Optional) You can also provide a status message for the certificate.
Remove from existing asset
To remove a certificate from an existing asset:
- dbt
- Java
- Python
- Kotlin
- Raw REST API
It's currently not possible to remove a certificate from an asset via dbt.
Remove certificate from existing asset
Column column = Column.removeCertificate( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS/USER_ID", // (3)
"USER_ID"); // (4)
- Use the
removeCertificate()helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary APIs, and return with the result of the removal operation all-in-one. - Because this operation will directly change the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - The
qualifiedNameof the column (this is generally needed on all assets). - The name of the column (this varies by asset, but most assets need the name specified).
Remove certificate from existing asset
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Column
client = AtlanClient()
column = client.asset.remove_certificate( # (1)
asset_type=Column,
qualified_name="default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS/USER_ID",
name="USER_ID",
)
if column is None: # (2)
print("Certificate was not present")
else: # (3)
print("Certificate was removed")
- Use the
asset.remove_certificate()helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary APIs, and return with the result of the removal operation all-in-one. - If no change occurs to the asset because the certificate isn't present then
Nonewill be returned. - If certificate is removed from the asset then the asset will be returned.
Remove certificate from existing asset
val column = Column.removeCertificate( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS/USER_ID", // (3)
"USER_ID") // (4)
- Use the
removeCertificate()helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary APIs, and return with the result of the removal operation all-in-one. - Because this operation will directly change the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - The
qualifiedNameof the column (this is generally needed on all assets). - The name of the column (this varies by asset, but most assets need the name specified).
POST /api/meta/entity/bulk
{
"entities": [ // (1)
}
]
}
- All assets must be wrapped in an
entitiesarray. - You must provide the exact type name for the asset (case-sensitive).
- You must provide the exact name of the asset (case-sensitive).
- You must provide the exact
qualifiedNameof the asset (case-sensitive). - To remove the certificate, set its status and message to
null.
When creating asset
To add a certificate when creating an asset:
- dbt
- Java
- Python
- Kotlin
- Raw REST API
Add certificate when creating asset
models:
- name: TOP_BEVERAGE_USERS # (1)
meta:
atlan:
attributes: # (2)
certificateStatus: VERIFIED # (3)
certificateStatusMessage: >- # (4)
Verified at creation.
- You must of course give the name of the object.
- The details for the certificate must be nested within the
meta.atlan.attributesstructure. - You must provide a valid status for the certificate (
DRAFT,VERIFIEDorDEPRECATED). - (Optional) You can also provide a message to associate with the certificate.
Add certificate when creating asset
Table table = Table
.creator("TOP_BEVERAGE_USERS", // (1)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV")
.certificateStatus(CertificateStatus.VERIFIED) // (2)
.certificateStatusMessage("Verified at creation.") // (3)
.build(); // (4)
AssetMutationResponse response = table.save(client); // (5)
assert response.getCreatedAssets().size() == 1 // (6)
- Use the
creator()method to initialize the object with all necessary attributes for creating it. - Set the certificate that should be added (in this example, we're using
VERIFIED). - (Optional) Add a message for the certificate.
- Call the
build()method to build the enriched object. - Call the
save()method to actually create the asset with this certificate. Because this operation will persist the asset in Atlan, you must provide it anAtlanClientthrough which to connect to the tenant. - The response will include that single asset that was created.
Add certificate when creating asset
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Table
from pyatlan.model.enums import CertificateStatus
client = AtlanClient()
table = Table.creator( # (1)
name="TOP_BEVERAGE_USERS",
schema_qualified_name="default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV",
)
table.certificate_status = CertificateStatus.VERIFIED # (2)
table.certificate_status_message = "Verified at creation." # (3)
response = client.asset.save(table) # (4)
assert response.assets_created(Table) # (5)
table = response.assets_created(Table)[0] # (6)
- Use the
create()method to initialize the object with all necessary attributes for creating it. - Set the certificate that should be added (in this example, we're using
VERIFIED). - (Optional) Add a message for the certificate.
- Invoke the
save()method with asset. This method will return an AssetMutationResponse object that encapsulates the results. - Since a save can add, update, delete or partially update multiple assets the
assets_created()method can be used to return a list of the assets of the specified type that were added. The assert statement is present to make sure aTableasset was created. - Since only one
Tableshould have been created we use an index of 0 to retrieve the newly created table.
Add certificate when creating asset
val table: Table = Table
.creator("TOP_BEVERAGE_USERS", // (1)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV")
.certificateStatus(CertificateStatus.VERIFIED) // (2)
.certificateStatusMessage("Verified at creation.") // (3)
.build() // (4)
val response = table.save(client) // (5)
assert(response.createdAssets.size == 1) // (6)
- Use the
creator()method to initialize the object with all necessary attributes for creating it. - Set the certificate that should be added (in this example, we're using
VERIFIED). - (Optional) Add a message for the certificate.
- Call the
build()method to build the enriched object. - Call the
save()method to actually create the asset with this certificate. Because this operation will persist the asset in Atlan, you must provide it anAtlanClientthrough which to connect to the tenant. - The response will include that single asset that was created.
POST /api/meta/entity/bulk
{
"entities": [ // (1)
},
"certificateStatus": "VERIFIED", // (6)
"certificateStatusMessage": "Verified at creation." // (7)
}
}
]
}
- All assets must be wrapped in an
entitiesarray. - You must provide the exact type name for the asset (case-sensitive).
- You must provide a name for the asset.
- In the case of a table, the
qualifiedNamemust be the concatenation of the parent schema's qualifiedName and the name of the table. - When creating a table, you must specify the schema to create it within. This is defined by the
atlanSchemaattribute. You must specify both the type (must beSchema) and qualifiedName of the schema within theatlanSchemaattribute—and the schema must already exist. - You must provide a valid status for the certificate.
- (Optional) You can also provide a status message for the certificate.