Manage announcements
Add to existing asset
To add an announcement to an existing asset:
- dbt
- Java
- Python
- Kotlin
- Raw REST API
Add announcement to existing assets
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.attributesstructure. - You must provide a valid status for the announcement (
information,warningorissue). - (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
Table result = Table.updateAnnouncement( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS", // (3)
AtlanAnnouncementType.WARNING, // (4)
"Caution!", // (5)
"This table was changed."); // (6)
- 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 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 the announcement (the
AtlanAnnouncementTypeenumeration gives the valid values). - A title for the announcement.
- A message to include in the announcement.
Add announcement to existing assets
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Table
from pyatlan.model.core import Announcement
from pyatlan.model.enums import AnnouncementType
client = 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
AnnouncementTypeenum 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 APIs, 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
val result = Table.updateAnnouncement( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS", // (3)
AtlanAnnouncementType.WARNING, // (4)
"Caution!", // (5)
"This table was changed.") // (6)
- 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 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 the announcement (the
AtlanAnnouncementTypeenumeration gives the valid values). - A title for the announcement.
- A message to include in the announcement.
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 type for the announcement.
- (Optional) You can also provide a title and message for the announcement.
Remove from existing asset
To remove an announcement from an existing asset:
- dbt
- Java
- Python
- Kotlin
- Raw REST API
It's currently not possible to remove an announcement from an asset via dbt.
Remove announcement from existing asset
Column column = Column.removeAnnouncement( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS/USER_ID", // (3)
"USER_ID"); // (4)
- 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 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 announcement from existing asset
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Table
client = AtlanClient()
table = client.asset.remove_announcement( # (1)
asset_type=Table, # (2)
qualified_name="default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS/USER_ID",
name="USER_ID",
)
- 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 APIs, and return with the result of the removal operation all-in-one. - Specify the type of asset from which to remove the announcement.
Remove announcement from existing asset
val column = Column.removeAnnouncement( // (1)
client, // (2)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS/USER_ID", // (3)
"USER_ID") // (4)
- 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 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). - You must provide the value
nullfor the type of the announcement, its title, and its message.
When creating asset
To add an announcement when creating an asset:
- dbt
- Java
- Python
- Kotlin
- Raw REST API
Add announcement when creating asset
models:
- name: TOP_BEVERAGE_USERS # (1)
meta:
atlan:
attributes: # (2)
announcementType: information # (3)
announcementTitle: "New!" # (4)
announcementMessage: >- # (5)
This table is newly created.
- You must of course give the name of the object.
- The details for the announcement must be nested within the
meta.atlan.attributesstructure. - You must provide a valid status for the announcement (
information,warningorissue). - (Optional) You can also provide a title for the announcement.
- (Optional) You can also provide a message to include in the announcement.
Add announcement when creating asset
Table table = Table
.creator("TOP_BEVERAGE_USERS", // (1)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV")
.announcementType(AtlanAnnouncementType.INFORMATION) // (2)
.announcementTitle("New!") // (3)
.announcementMessage("This table is newly created.") // (4)
.build(); // (5)
AssetMutationResponse response = table.save(client); // (6)
assert response.getCreatedAssets().size() == 1 // (7)
- Use the
creator()method to initialize the object with all necessary attributes for creating it. - 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. 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 announcement when creating asset
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Table
from pyatlan.model.core import Announcement
from pyatlan.model.enums import AnnouncementType
from pyatlan.model.response import AssetMutationResponse
client = 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)
assert response.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
Announcementto 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 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 announcement when creating asset
val table = Table
.creator("TOP_BEVERAGE_USERS", // (1)
"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV")
.announcementType(AtlanAnnouncementType.INFORMATION) // (2)
.announcementTitle("New!") // (3)
.announcementMessage("This table is newly created.") // (4)
.build() // (5)
val response = table.save(client) // (6)
assert(response.createdAssets.size == 1) // (7)
- Use the
creator()method to initialize the object with all necessary attributes for creating it. - 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. 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)
},
"announcementType": "information", // (6)
"announcementTitle": "New!", // (7)
"announcementMessage": "This table is newly created."
}
}
]
}
- 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 announcement.
- (Optional) You can also provide a title and message for the announcement.