models:-name:TOP_BEVERAGE_USERS# (1)meta:atlan:attributes:# (2)announcementType:warning# (3)announcementTitle:"Caution!"# (4)announcementMessage:>-# (5)This table was changed.
You must of course give the name of the object.
The details for the announcement must be nested within the meta.atlan.attributes structure.
You must provide a valid status for the announcement (information, warning or issue).
(Optional) You can also provide a title for the announcement.
(Optional) You can also provide a message to include in the announcement.
Add announcement to existing assets
12345
Tableresult=Table.updateAnnouncement(// (1)"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (2)AtlanAnnouncementType.WARNING,// (3)"Caution!",// (4)"This table was changed.");// (5)
Use the updateAnnouncement() 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 the announcement (the AtlanAnnouncementType enumeration gives the valid values).
A title for the announcement.
A message to include in the announcement.
Add announcement to existing assets
1 2 3 4 5 6 7 8 91011121314151617
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportTablefrompyatlan.model.coreimportAnnouncementfrompyatlan.model.enumsimportAnnouncementTypeclient=AtlanClient()announcement=Announcement(# (1)announcement_title="Caution",announcement_message="This table was changed.",announcement_type=AnnouncementType.WARNING,# (2))table=client.asset.update_announcement(# (3)asset_type=Table,# (4)qualified_name="default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",name="TOP_BEVERAGE_USERS",announcement=announcement,)
Create the announcement.
The type of the announcement (the AnnouncementType enum gives the valid values).
Use the update_announcment() 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.
Specify the type of asset to be updated.
Add announcement to existing assets
12345
valresult=Table.updateAnnouncement(// (1)"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (2)AtlanAnnouncementType.WARNING,// (3)"Caution!",// (4)"This table was changed.")// (5)
Use the updateAnnouncement() 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 the announcement (the AtlanAnnouncementType enumeration gives the valid values).
A title for the announcement.
A message to include in the announcement.
POST /api/meta/entity/bulk
1 2 3 4 5 6 7 8 91011121314
{"entities":[// (1){"typeName":"Table",// (2)"attributes":{"name":"TOP_BEVERAGE_USERS",// (3)"qualifiedName":"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (4)"announcementType":"warning",// (5)"announcementTitle":"Caution!",// (6)"announcementMessage":"This table was changed."}}]}
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 type for the announcement.
(Optional) You can also provide a title and message for the announcement.
Use the removeAnnouncement() 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).
Use the asset.remove_announcement() 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.
Specify the type of asset from which to remove the announcement.
Use the removeAnnouncement() 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 announcement that should be added (in this example, we're using INFORMATION).
Add a title for the announcement.
Add a message for the announcement.
Call the build() method to build the enriched object.
Call the save() method to actually create the asset with this announcement.
The response will include that single asset that was created.
Add announcement when creating asset
1 2 3 4 5 6 7 8 91011121314151617181920
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportTablefrompyatlan.model.coreimportAnnouncementfrompyatlan.model.enumsimportAnnouncementTypefrompyatlan.model.responseimportAssetMutationResponseclient=AtlanClient()table=Table.creator(# (1)name="TOP_BEVERAGE_USERS",schema_qualified_name="default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV",)announcement=Announcement(# (2)announcement_title="New!",announcement_message="This table is newly created.",announcement_type=AnnouncementType.INFORMATION,)table.set_announcement(announcement=announcement)response=client.asset.save(table)# (3)assertresponse.assets_created(Table)# (4)table=response.assets_created(Table)[0]# (5)
Use the create() method to initialize the object with all [necessary attributes for creating it.
Create the Announcement to be used.
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.
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 announcement.
(Optional) You can also provide a title and message for the announcement.