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.attributes structure.
You must provide a valid status for the certificate (DRAFT, VERIFIED or DEPRECATED).
(Optional) You can also provide a message to associate with the certificate.
Add certificate to existing assets
1234
Tableresult=Table.updateCertificate(// (1)"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (2)CertificateStatus.VERIFIED,// (3)"Verified through automation.");// (4)
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 API(s), and return with the result of the update operation all-in-one.
The qualifiedName of the object.
The type of certificate (the CertificateStatus enumeration gives the valid values).
(Optional) A message to include in the certificate.
Add certificate to existing assets
1 2 3 4 5 6 7 8 910111213141516
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportTablefrompyatlan.model.enumsimportCertificateStatusclient=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.",)iftableisNone:# (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 API(s), and return with the result of the update operation all-in-one.
If no change occurs to the asset then None will be returned.
If the asset is updated then the asset will be returned.
Add certificate to existing assets
1234
valresult=Table.updateCertificate(// (1)"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (2)CertificateStatus.VERIFIED,// (3)"Verified through automation.")// (4)
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 API(s), and return with the result of the update operation all-in-one.
The qualifiedName of the object.
The type of certificate (the CertificateStatus enumeration gives the valid values).
(Optional) A message to include in the certificate.
POST /api/meta/entity/bulk
1 2 3 4 5 6 7 8 910111213
{"entities":[// (1){"typeName":"Table",// (2)"attributes":{"name":"TOP_BEVERAGE_USERS",// (3)"qualifiedName":"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (4)"certificateStatus":"VERIFIED",// (5)"certificateStatusMessage":"Verified through automation."// (6)}}]}
All assets must be wrapped in an entities array.
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 qualifiedName of the asset (case-sensitive).
You must provide a valid status for the certificate.
(Optional) You can also provide a status message for the certificate.
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 API(s), and return with the result of the removal operation all-in-one.
The qualifiedName of 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
1 2 3 4 5 6 7 8 910111213
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportColumnclient=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",)ifcolumnisNone:# (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 API(s), and return with the result of the removal operation all-in-one.
If no change occurs to the asset because the certificate is not present then None will be returned.
If certificate is removed from the asset then the asset will be returned.
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 API(s), and return with the result of the removal operation all-in-one.
The qualifiedName of 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).
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.
The response will include that single asset that was created.
Add certificate when creating asset
1 2 3 4 5 6 7 8 9101112131415
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportTablefrompyatlan.model.enumsimportCertificateStatusclient=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)assertresponse.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 ensure a Table asset was created.
Since only one Table should have been created we use an index of 0 to retrieve the newly created table.
Add certificate when creating asset
12345678
valtable: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)valresponse=table.save()// (5)assert(response.createdAssets.size==1)// (6)
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.
The response will include that single asset that was created.
POST /api/meta/entity/bulk
1 2 3 4 5 6 7 8 910111213141516171819
{"entities":[// (1){"typeName":"Table",// (2)"attributes":{"name":"TOP_BEVERAGE_USERS",// (3)"qualifiedName":"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (4)"atlanSchema":{// (5)"typeName":"Schema","uniqueAttributes":{"qualifiedName":"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV"}},"certificateStatus":"VERIFIED",// (6)"certificateStatusMessage":"Verified at creation."// (7)}}]}
All assets must be wrapped in an entities array.
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 qualifiedName must 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 atlanSchema attribute. You must specify both the type (must be Schema) and qualifiedName of the schema within the atlanSchema attribute — 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.