Client¶
AtlanClient¶
pyatlan.client.atlan
¶
Classes¶
AtlanClient(**data)
¶
Bases: BaseSettings
Source code in pyatlan/client/atlan.py
Functions¶
add_api_token_as_admin(asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]
¶
Deprecated - use user.add_as_admin() instead.
Source code in pyatlan/client/atlan.py
add_api_token_as_viewer(asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]
¶
Deprecated - use user.add_as_viewer() instead.
Source code in pyatlan/client/atlan.py
add_atlan_tags(asset_type: Type[A], qualified_name: str, atlan_tag_names: List[str], propagate: bool = False, remove_propagation_on_delete: bool = True, restrict_lineage_propagation: bool = False, restrict_propagation_through_hierarchy: bool = False) -> None
¶
Deprecated - use asset.add_atlan_tags() instead.
Source code in pyatlan/client/atlan.py
add_user_to_groups(guid: str, group_ids: List[str]) -> None
¶
Deprecated - use user.add_to_groups() instead.
Source code in pyatlan/client/atlan.py
append_terms(asset_type: Type[A], terms: List[AtlasGlossaryTerm], guid: Optional[str] = None, qualified_name: Optional[str] = None) -> A
¶
Deprecated - use asset.append_terms() instead.
Source code in pyatlan/client/atlan.py
change_user_role(guid: str, role_id: str) -> None
¶
Deprecated - use user.change_role() instead.
Source code in pyatlan/client/atlan.py
create_api_token(display_name: str, description: str = '', personas: Optional[Set[str]] = None, validity_seconds: int = -1) -> ApiToken
¶
Deprecated - use token.create() instead.
Source code in pyatlan/client/atlan.py
create_group(group: AtlanGroup, user_ids: Optional[List[str]] = None) -> CreateGroupResponse
¶
Deprecated - use group.create() instead.
Source code in pyatlan/client/atlan.py
create_typedef(typedef: TypeDef) -> TypeDefResponse
¶
Deprecated - use typedef.create() instead.
Source code in pyatlan/client/atlan.py
create_users(users: List[AtlanUser]) -> None
¶
Deprecated - use user.create() instead.
Source code in pyatlan/client/atlan.py
delete_entity_by_guid(guid: Union[str, List[str]]) -> AssetMutationResponse
¶
Deprecated - use asset.delete_by_guid() instead.
Source code in pyatlan/client/atlan.py
find_category_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> List[AtlasGlossaryCategory]
¶
Deprecated - use asset.find_category_by_name() instead.
Source code in pyatlan/client/atlan.py
find_category_fast_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> List[AtlasGlossaryCategory]
¶
Deprecated - use asset.find_category_fast_by_name() instead.
Source code in pyatlan/client/atlan.py
find_connections_by_name(name: str, connector_type: AtlanConnectorType, attributes: Optional[List[str]] = None) -> List[Connection]
¶
Deprecated - use asset.find_connections_by_name() instead.
Source code in pyatlan/client/atlan.py
find_glossary_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> AtlasGlossary
¶
Deprecated - use asset.find_glossary_by_name() instead.
Source code in pyatlan/client/atlan.py
find_personas_by_name(name: str, attributes: Optional[List[str]] = None) -> List[Persona]
¶
Deprecated - use asset.find_personas_by_name() instead.
Source code in pyatlan/client/atlan.py
find_purposes_by_name(name: str, attributes: Optional[List[str]] = None) -> List[Purpose]
¶
Deprecated - use asset.find_personas_by_name() instead.
Source code in pyatlan/client/atlan.py
find_term_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> AtlasGlossaryTerm
¶
Deprecated - use asset.find_term_by_name() instead.
Source code in pyatlan/client/atlan.py
find_term_fast_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> AtlasGlossaryTerm
¶
Deprecated - use asset.find_category_by_name() instead.
Source code in pyatlan/client/atlan.py
from_token_guid(guid: str, base_url: Optional[str] = None, client_id: Optional[str] = None, client_secret: Optional[str] = None) -> AtlanClient
classmethod
¶
Create an AtlanClient instance using an API token GUID.
This method performs a multi-step authentication flow: 1. Obtains Atlan-Argo (superuser) access token 2. Uses Argo token to retrieve the API token's client credentials 3. Exchanges those credentials for an access token 4. Returns a new AtlanClient authenticated with the resolved token
:param guid: API token GUID to resolve :param base_url: Optional base URL for the Atlan service(overrides ATLAN_BASE_URL environment variable) :param client_id: Optional client ID for authentication (overrides CLIENT_ID environment variable) :param client_secret: Optional client secret for authentication (overrides CLIENT_SECRET environment variable) :returns: a new client instance authenticated with the resolved token :raises: ErrorCode.UNABLE_TO_ESCALATE_WITH_PARAM: If any step in the token resolution fails
Source code in pyatlan/client/atlan.py
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | |
get_admin_events(admin_request: AdminEventRequest) -> AdminEventResponse
¶
Deprecated - use admin.get_admin_events() instead.
Source code in pyatlan/client/atlan.py
get_all_groups(limit: int = 20) -> GroupResponse
¶
Deprecated - use group.get_all() instead.
Source code in pyatlan/client/atlan.py
get_all_roles() -> RoleResponse
¶
Deprecated - use self.role.get_all() instead.
Source code in pyatlan/client/atlan.py
get_all_typedefs() -> TypeDefResponse
¶
Deprecated - use typedef.get_all() instead.
Source code in pyatlan/client/atlan.py
get_all_users(limit: int = 20) -> UserResponse
¶
Deprecated - use user.get_all() instead.
Source code in pyatlan/client/atlan.py
get_api_token_by_id(client_id: str) -> Optional[ApiToken]
¶
Deprecated - use token.get_by_id() instead.
Source code in pyatlan/client/atlan.py
get_api_token_by_name(display_name: str) -> Optional[ApiToken]
¶
Deprecated - use token.get_by_name() instead.
Source code in pyatlan/client/atlan.py
get_api_tokens(limit: Optional[int] = None, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0) -> ApiTokenResponse
¶
Deprecated - use token.get() instead.
Source code in pyatlan/client/atlan.py
get_asset_by_guid(guid: str, asset_type: Type[A], min_ext_info: bool = False, ignore_relationships: bool = False) -> A
¶
Deprecated - use asset.get_by_guid() instead.
Source code in pyatlan/client/atlan.py
get_asset_by_qualified_name(qualified_name: str, asset_type: Type[A], min_ext_info: bool = False, ignore_relationships: bool = False) -> A
¶
Deprecated - use asset.get_by_qualified_name() instead.
Source code in pyatlan/client/atlan.py
get_current_user() -> UserMinimalResponse
¶
Deprecated - use user.get_current() instead.
Source code in pyatlan/client/atlan.py
get_group_by_name(alias: str, limit: int = 20) -> Optional[GroupResponse]
¶
Deprecated - use group.get_by_name() instead.
Source code in pyatlan/client/atlan.py
get_group_members(guid: str) -> UserResponse
¶
Deprecated - use group.get_members() instead.
Source code in pyatlan/client/atlan.py
get_groups(limit: Optional[int] = None, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0) -> GroupResponse
¶
Deprecated - use group.get() instead.
Source code in pyatlan/client/atlan.py
get_groups_for_user(guid: str) -> GroupResponse
¶
Deprecated - use user.get_groups() instead.
Source code in pyatlan/client/atlan.py
get_keycloak_events(keycloak_request: KeycloakEventRequest) -> KeycloakEventResponse
¶
Deprecated - use admin.get_keycloak_events() instead.
Source code in pyatlan/client/atlan.py
get_lineage_list(lineage_request: LineageListRequest) -> LineageListResults
¶
Deprecated - use asset.get_lineage_list() instead.
Source code in pyatlan/client/atlan.py
get_roles(limit: int, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0) -> RoleResponse
¶
Deprecated - use role.get() instead.
Source code in pyatlan/client/atlan.py
get_typedefs(type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]]) -> TypeDefResponse
¶
Deprecated - use typedef.get() instead.
Source code in pyatlan/client/atlan.py
get_user_by_username(username: str) -> Optional[AtlanUser]
¶
Deprecated - use user.get_by_username() instead.
Source code in pyatlan/client/atlan.py
get_users(limit: Optional[int] = None, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0) -> UserResponse
¶
Deprecated - use user.get() instead.
Source code in pyatlan/client/atlan.py
get_users_by_email(email: str, limit: int = 20) -> Optional[UserResponse]
¶
Deprecated - use user.get_by_email() instead.
Source code in pyatlan/client/atlan.py
max_retries(max_retries: Retry = CONNECTION_RETRY) -> _GeneratorContextManager[None]
¶
Creates a context manger that can used to temporarily change parameters used for retrying connnections. The original Retry information will be restored when the context is exited.
Source code in pyatlan/client/atlan.py
parse_query(query: QueryParserRequest) -> Optional[ParsedQuery]
¶
Parses the provided query to describe its component parts.
:param query: query to parse and configuration options :returns: parsed explanation of the query :raises AtlanError: on any API communication issue
Source code in pyatlan/client/atlan.py
purge_api_token(guid: str) -> None
¶
Deprecated - use token.purge() instead.
Source code in pyatlan/client/atlan.py
purge_entity_by_guid(guid: Union[str, List[str]]) -> AssetMutationResponse
¶
Deprecated - use asset.purge_by_guid() instead.
Source code in pyatlan/client/atlan.py
purge_group(guid: str) -> None
¶
Deprecated - use group.purge() instead.
Source code in pyatlan/client/atlan.py
purge_typedef(name: str, typedef_type: type) -> None
¶
Deprecated - use typedef.purge() instead.
Source code in pyatlan/client/atlan.py
remove_announcement(asset_type: Type[A], qualified_name: str, name: str) -> Optional[A]
¶
Deprecated - use asset.remove_announcement() instead.
Source code in pyatlan/client/atlan.py
remove_atlan_tag(asset_type: Type[A], qualified_name: str, atlan_tag_name: str) -> None
¶
Deprecated - use asset.remove_atlan_tag() instead.
Source code in pyatlan/client/atlan.py
remove_certificate(asset_type: Type[A], qualified_name: str, name: str) -> Optional[A]
¶
Deprecated - use asset.remove_certificate() instead.
Source code in pyatlan/client/atlan.py
remove_custom_metadata(guid: str, cm_name: str)
¶
Deprecated - use asset.remove_custom_metadata() instead.
Source code in pyatlan/client/atlan.py
remove_terms(asset_type: Type[A], terms: List[AtlasGlossaryTerm], guid: Optional[str] = None, qualified_name: Optional[str] = None) -> A
¶
Deprecated - use asset.remove_terms() instead.
Source code in pyatlan/client/atlan.py
remove_users_from_group(guid: str, user_ids=List[str]) -> None
¶
Deprecated - use group.remove_users() instead.
Source code in pyatlan/client/atlan.py
replace_custom_metadata(guid: str, custom_metadata: CustomMetadataDict)
¶
Deprecated - use asset.replace_custom_metadata() instead.
Source code in pyatlan/client/atlan.py
replace_terms(asset_type: Type[A], terms: List[AtlasGlossaryTerm], guid: Optional[str] = None, qualified_name: Optional[str] = None) -> A
¶
Deprecated - use asset.replace_terms() instead.
Source code in pyatlan/client/atlan.py
restore(asset_type: Type[A], qualified_name: str) -> bool
¶
Deprecated - use asset.restore() instead.
Source code in pyatlan/client/atlan.py
retrieve_minimal(guid: str, asset_type: Type[A]) -> A
¶
Deprecated - use asset.retrieve_minimal() instead.
Source code in pyatlan/client/atlan.py
save(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False, replace_custom_metadata: bool = False, overwrite_custom_metadata: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.save() instead.
Source code in pyatlan/client/atlan.py
save_merging_cm(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.save_merging_cm() instead.
Source code in pyatlan/client/atlan.py
save_replacing_cm(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.save_replacing_cm() instead.
Source code in pyatlan/client/atlan.py
search(criteria: IndexSearchRequest) -> IndexSearchResults
¶
Deprecated - use asset.search() instead.
Source code in pyatlan/client/atlan.py
update_announcement(asset_type: Type[A], qualified_name: str, name: str, announcement: Announcement) -> Optional[A]
¶
Deprecated - use asset.update_announcement() instead.
Source code in pyatlan/client/atlan.py
update_api_token(guid: str, display_name: str, description: str = '', personas: Optional[Set[str]] = None) -> ApiToken
¶
Deprecated - use token.update() instead.
Source code in pyatlan/client/atlan.py
update_certificate(asset_type: Type[A], qualified_name: str, name: str, certificate_status: CertificateStatus, message: Optional[str] = None) -> Optional[A]
¶
Deprecated - use asset.update_certificate() instead.
Source code in pyatlan/client/atlan.py
update_custom_metadata_attributes(guid: str, custom_metadata: CustomMetadataDict)
¶
Deprecated - use asset.update_custom_metadata_attributes() instead.
Source code in pyatlan/client/atlan.py
update_group(group: AtlanGroup) -> None
¶
Deprecated - use group.update() instead.
Source code in pyatlan/client/atlan.py
update_merging_cm(entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.update_merging_cm() instead.
Source code in pyatlan/client/atlan.py
update_replacing_cm(entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.update_replacing_cm() instead.
Source code in pyatlan/client/atlan.py
update_typedef(typedef: TypeDef) -> TypeDefResponse
¶
Deprecated - use typedef.update() instead.
Source code in pyatlan/client/atlan.py
update_user(guid: str, user: AtlanUser) -> UserMinimalResponse
¶
Deprecated - use user.update() instead.
Source code in pyatlan/client/atlan.py
upload_image(file, filename: str) -> AtlanImage
¶
Uploads an image from the provided local file.
:param file: local file to upload :param filename: name of the file to be uploaded :returns: details of the uploaded image :raises AtlanError: on any API communication issue
Source code in pyatlan/client/atlan.py
upsert(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False, replace_custom_metadata: bool = False, overwrite_custom_metadata: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.save() instead.
Source code in pyatlan/client/atlan.py
upsert_merging_cm(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.save_merging_cm() instead.
Source code in pyatlan/client/atlan.py
upsert_replacing_cm(entity: Union[Asset, List[Asset]], replace_atlan_tagss: bool = False) -> AssetMutationResponse
¶
Deprecated - use asset.save_replacing_cm() instead.
Source code in pyatlan/client/atlan.py
Functions¶
client_connection(client: AtlanClient, base_url: Optional[HttpUrl] = None, api_key: Optional[str] = None, connect_timeout: float = 30.0, read_timeout: float = 120.0, retry: Retry = DEFAULT_RETRY) -> Generator[AtlanClient, None, None]
¶
Creates a new client created with the given base_url and/api_key.
:param base_url: the base_url to be used for the new connection. If not specified the current value will be used :param api_key: the api_key to be used for the new connection. If not specified the current value will be used
Source code in pyatlan/client/atlan.py
get_adapter() -> logging.LoggerAdapter
¶
This function creates a LoggerAdapter that will provide the requestid from the ContextVar request_id_var :returns: the LogAdapter
Source code in pyatlan/client/atlan.py
Asset Client¶
pyatlan.client.asset
¶
Classes¶
AssetClient(client: ApiCaller)
¶
This class can be used to retrieve information about assets. This class does not need to be instantiated directly but can be obtained through the asset property of AtlanClient.
Source code in pyatlan/client/asset.py
Functions¶
add_atlan_tags(asset_type: Type[A], qualified_name: str, atlan_tag_names: List[str], propagate: bool = False, remove_propagation_on_delete: bool = True, restrict_lineage_propagation: bool = False, restrict_propagation_through_hierarchy: bool = False) -> A
¶
Add one or more Atlan tags to the provided asset.
:param asset_type: type of asset to which to add the Atlan tags :param qualified_name: qualified_name of the asset to which to add the Atlan tags :param atlan_tag_names: human-readable names of the Atlan tags to add to the asset :param propagate: whether to propagate the Atlan tag (True) or not (False) :param remove_propagation_on_delete: whether to remove the propagated Atlan tags when the Atlan tag is removed from this asset (True) or not (False) :param restrict_lineage_propagation: whether to avoid propagating through lineage (True) or do propagate through lineage (False) :param restrict_propagation_through_hierarchy: whether to prevent this Atlan tag from propagating through hierarchy (True) or allow it to propagate through hierarchy (False) :returns: the asset that was updated (note that it will NOT contain details of the added Atlan tags) :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
add_dq_rule_schedule(asset_type: Type[A], asset_name: str, asset_qualified_name: str, schedule_crontab: str, schedule_time_zone: str) -> AssetMutationResponse
¶
Add a data quality rule schedule to an asset.
:param asset_type: the type of asset to update (e.g., Table)
:param asset_name: the name of the asset to update
:param asset_qualified_name: the qualified name of the asset to update
:param schedule_crontab: cron expression string defining the schedule for the DQ rules, e.g: 5 4 * * *.
:param schedule_time_zone: timezone for the schedule, e.g: Europe/Paris.
:returns: the result of the save
:raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
append_terms(asset_type: Type[A], terms: List[AtlasGlossaryTerm], guid: Optional[str] = None, qualified_name: Optional[str] = None) -> A
¶
Link additional terms to an asset, without replacing existing terms linked to the asset. Note: this operation must make two API calls — one to retrieve the asset's existing terms, and a second to append the new terms. (At least one of the GUID or qualified_name must be supplied, but both are not necessary.)
:param asset_type: type of the asset :param terms: the list of terms to append to the asset :param guid: unique identifier (GUID) of the asset to which to link the terms :param qualified_name: the qualified_name of the asset to which to link the terms :returns: the asset that was updated (note that it will NOT contain details of the appended terms)
Source code in pyatlan/client/asset.py
delete_by_guid(guid: Union[str, List[str]]) -> AssetMutationResponse
¶
Soft-deletes (archives) one or more assets by their unique identifier (GUID). This operation can be reversed by updating the asset and its status to ACTIVE.
:param guid: unique identifier(s) (GUIDs) of one or more assets to soft-delete :returns: details of the soft-deleted asset(s) :raises AtlanError: on any API communication issue :raises ApiError: if the retry limit is overrun waiting for confirmation the asset is deleted :raises InvalidRequestError: if an asset does not support archiving
Source code in pyatlan/client/asset.py
find_category_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> List[AtlasGlossaryCategory]
¶
Find a category by its human-readable name. Note: this operation must run two separate queries to first resolve the qualified_name of the glossary, so will be somewhat slower. If you already have the qualified_name of the glossary, use find_category_by_name_fast instead. Note that categories are not unique by name, so there may be multiple results.
:param name: of the category :param glossary_name: human-readable name of the glossary in which the category exists :param attributes: (optional) collection of attributes to retrieve for the category :returns: the category, if found :raises NotFoundError: if no category with the provided name exists in the glossary
Source code in pyatlan/client/asset.py
find_category_fast_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> List[AtlasGlossaryCategory]
¶
Find a category by its human-readable name. Note: this operation requires first knowing the qualified_name of the glossary in which the category exists. Note that categories are not unique by name, so there may be multiple results.
:param name: of the category :param glossary_qualified_name: qualified_name of the glossary in which the category exists :param attributes: (optional) collection of attributes to retrieve for the category :returns: the category, if found :raises NotFoundError: if no category with the provided name exists in the glossary
Source code in pyatlan/client/asset.py
find_connections_by_name(name: str, connector_type: AtlanConnectorType, attributes: Optional[List[str]] = None) -> List[Connection]
¶
Find a connection by its human-readable name and type.
:param name: of the connection :param connector_type: of the connection :param attributes: (optional) collection of attributes to retrieve for the connection :returns: all connections with that name and type, if found :raises NotFoundError: if the connection does not exist
Source code in pyatlan/client/asset.py
find_domain_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> DataDomain
¶
Find a data domain by its human-readable name.
:param name: of the domain :param attributes: (optional) collection of attributes to retrieve for the domain :returns: the domain, if found :raises NotFoundError: if no domain with the provided name exists
Source code in pyatlan/client/asset.py
find_glossary_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> AtlasGlossary
¶
Find a glossary by its human-readable name.
:param name: of the glossary :param attributes: (optional) collection of attributes to retrieve for the glossary :returns: the glossary, if found :raises NotFoundError: if no glossary with the provided name exists
Source code in pyatlan/client/asset.py
find_personas_by_name(name: str, attributes: Optional[List[str]] = None) -> List[Persona]
¶
Find a persona by its human-readable name.
:param name: of the persona :param attributes: (optional) collection of attributes to retrieve for the persona :returns: all personas with that name, if found :raises NotFoundError: if no persona with the provided name exists
Source code in pyatlan/client/asset.py
find_product_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> DataProduct
¶
Find a data product by its human-readable name.
:param name: of the product :param attributes: (optional) collection of attributes to retrieve for the product :returns: the product, if found :raises NotFoundError: if no product with the provided name exists
Source code in pyatlan/client/asset.py
find_purposes_by_name(name: str, attributes: Optional[List[str]] = None) -> List[Purpose]
¶
Find a purpose by its human-readable name.
:param name: of the purpose :param attributes: (optional) collection of attributes to retrieve for the purpose :returns: all purposes with that name, if found :raises NotFoundError: if no purpose with the provided name exists
Source code in pyatlan/client/asset.py
find_term_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> AtlasGlossaryTerm
¶
Find a term by its human-readable name. Note: this operation must run two separate queries to first resolve the qualified_name of the glossary, so will be somewhat slower. If you already have the qualified_name of the glossary, use find_term_by_name_fast instead.
:param name: of the term :param glossary_name: human-readable name of the glossary in which the term exists :param attributes: (optional) collection of attributes to retrieve for the term :returns: the term, if found :raises NotFoundError: if no term with the provided name exists in the glossary
Source code in pyatlan/client/asset.py
find_term_fast_by_name(name: constr(strip_whitespace=True, min_length=1, strict=True), glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), attributes: Optional[List[StrictStr]] = None) -> AtlasGlossaryTerm
¶
Find a term by its human-readable name. Note: this operation requires first knowing the qualified_name of the glossary in which the term exists.
:param name: of the term :param glossary_qualified_name: qualified_name of the glossary in which the term exists :param attributes: (optional) collection of attributes to retrieve for the term :returns: the term, if found :raises NotFoundError: if no term with the provided name exists in the glossary
Source code in pyatlan/client/asset.py
get_by_guid(guid: str, asset_type: Type[A] = Asset, min_ext_info: bool = False, ignore_relationships: bool = True, attributes: Optional[Union[List[str], List[AtlanField]]] = None, related_attributes: Optional[Union[List[str], List[AtlanField]]] = None) -> A
¶
Retrieves an asset by its GUID.
:param guid: unique identifier (GUID) of the asset to retrieve
:param asset_type: type of asset to be retrieved, defaults to Asset
:param min_ext_info: whether to minimize extra info (True) or not (False)
:param ignore_relationships: whether to include relationships (False) or exclude them (True)
:param attributes: a specific list of attributes to retrieve for the asset
:param related_attributes: a specific list of relationships attributes to retrieve for the asset
:returns: the requested asset
:raises NotFoundError: if the asset does not exist, or is not of the type requested
:raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
get_by_qualified_name(qualified_name: str, asset_type: Type[A], min_ext_info: bool = False, ignore_relationships: bool = True, attributes: Optional[Union[List[str], List[AtlanField]]] = None, related_attributes: Optional[Union[List[str], List[AtlanField]]] = None) -> A
¶
Retrieves an asset by its qualified_name.
:param qualified_name: qualified_name of the asset to be retrieved :param asset_type: type of asset to be retrieved ( must be the actual asset type not a super type) :param min_ext_info: whether to minimize extra info (True) or not (False) :param ignore_relationships: whether to include relationships (False) or exclude them (True) :param attributes: a specific list of attributes to retrieve for the asset :param related_attributes: a specific list of relationships attributes to retrieve for the asset :returns: the requested asset :raises NotFoundError: if the asset does not exist :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
get_hierarchy(glossary: AtlasGlossary, attributes: Optional[List[Union[AtlanField, str]]] = None, related_attributes: Optional[List[Union[AtlanField, str]]] = None) -> CategoryHierarchy
¶
Retrieve category hierarchy in this Glossary, in a traversable form. You can traverse in either depth_first or breadth_first order. Both return an ordered list of Glossary objects. Note: by default, each category will have a minimal set of information (name, GUID, qualifiedName). If you want additional details about each category, specify the attributes you want in the attributes parameter of this method.
:param glossary: the glossary to retrieve the category hierarchy for :param attributes: attributes to retrieve for each category in the hierarchy :param related_attributes: attributes to retrieve for each related asset in the hierarchy :returns: a traversable category hierarchy
Source code in pyatlan/client/asset.py
get_lineage_list(lineage_request: LineageListRequest) -> LineageListResults
¶
Retrieve lineage using the higher-performance "list" API.
:param lineage_request: detailing the lineage query, parameters, and so on to run :returns: the results of the lineage request :raises InvalidRequestError: if the requested lineage direction is 'BOTH' (unsupported for this operation) :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
process_assets(search: IndexSearchRequestProvider, func: Callable[[Asset], None]) -> int
¶
Process assets matching a search query and apply a processing function to each unique asset.
This function iteratively searches for assets using the search provider and processes each unique asset using the provided callable function. The uniqueness of assets is determined based on their GUIDs. If new assets are found in later iterations that haven't been processed yet, the process continues until no more new assets are available to process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search
|
IndexSearchRequestProvider
|
IndexSearchRequestProvider The search provider that generates search queries and contains the criteria for searching the assets such as a FluentSearch. |
required |
func
|
Callable[[Asset], None]
|
Callable[[Asset], None] A callable function that receives each unique asset as its parameter and performs the required operations on it. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The total number of unique assets that have been processed. |
Source code in pyatlan/client/asset.py
purge_by_guid(guid: Union[str, List[str]], delete_type: AtlanDeleteType = AtlanDeleteType.PURGE) -> AssetMutationResponse
¶
Deletes one or more assets by their unique identifier (GUID) using the specified delete type.
:param guid: unique identifier(s) (GUIDs) of one or more assets to delete :param delete_type: type of deletion to perform:
- PURGE: completely removes entity and all audit/history traces (default, irreversible)
- HARD: physically removes entity but keeps audit history (irreversible)
:returns: details of the deleted asset(s) :raises AtlanError: on any API communication issue
.. warning:: PURGE and HARD deletions are irreversible operations. Use with caution.
Source code in pyatlan/client/asset.py
remove_announcement(asset_type: Type[A], qualified_name: str, name: str, glossary_guid: Optional[str] = None) -> Optional[A]
¶
remove_announcement(
asset_type: Type[AtlasGlossaryTerm],
qualified_name: str,
name: str,
glossary_guid: str,
) -> Optional[AtlasGlossaryTerm]
Remove the announcement from an asset.
:param asset_type: type of asset from which to remove the announcement
:param qualified_name: the qualified_name of the asset from which to remove the announcement
:param glossary_guid: unique identifier of the glossary, required
only when the asset type is AtlasGlossaryTerm or AtlasGlossaryCategory
:returns: the result of the removal, or None if the removal failed
Source code in pyatlan/client/asset.py
remove_atlan_tag(asset_type: Type[A], qualified_name: str, atlan_tag_name: str) -> A
¶
Removes a single Atlan tag from the provided asset.
:param asset_type: type of asset to which to add the Atlan tags :param qualified_name: qualified_name of the asset to which to add the Atlan tags :param atlan_tag_name: human-readable name of the Atlan tag to remove from the asset :returns: the asset that was updated (note that it will NOT contain details of the deleted Atlan tag) :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
remove_atlan_tags(asset_type: Type[A], qualified_name: str, atlan_tag_names: List[str]) -> A
¶
Removes one or more Atlan tag from the provided asset.
:param asset_type: type of asset to which to add the Atlan tags :param qualified_name: qualified_name of the asset to which to add the Atlan tags :param atlan_tag_names: human-readable name of the Atlan tag to remove from the asset :returns: the asset that was updated (note that it will NOT contain details of the deleted Atlan tags) :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
remove_certificate(asset_type: Type[A], qualified_name: str, name: str, glossary_guid: Optional[str] = None) -> Optional[A]
¶
remove_certificate(
asset_type: Type[AtlasGlossaryTerm],
qualified_name: str,
name: str,
glossary_guid: str,
) -> Optional[AtlasGlossaryTerm]
Remove the certificate from an asset.
:param asset_type: type of asset from which to remove the certificate
:param qualified_name: the qualified_name of the asset from which to remove the certificate
:param name: the name of the asset from which to remove the certificate
:param glossary_guid: unique identifier of the glossary, required
only when the asset type is AtlasGlossaryTerm or AtlasGlossaryCategory
:returns: the result of the removal, or None if the removal failed
Source code in pyatlan/client/asset.py
remove_custom_metadata(guid: str, cm_name: str)
¶
Remove specific custom metadata from an asset.
:param guid: unique identifier (GUID) of the asset :param cm_name: human-readable name of the custom metadata to remove :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
remove_terms(asset_type: Type[A], terms: List[AtlasGlossaryTerm], guid: Optional[str] = None, qualified_name: Optional[str] = None) -> A
¶
Remove terms from an asset, without replacing all existing terms linked to the asset. Note: this operation must make two API calls — one to retrieve the asset's existing terms, and a second to remove the provided terms.
:param asset_type: type of the asset :param terms: the list of terms to remove from the asset (note: these must be references by GUID to efficiently remove any existing terms) :param guid: unique identifier (GUID) of the asset from which to remove the terms :param qualified_name: the qualified_name of the asset from which to remove the terms :returns: the asset that was updated (note that it will NOT contain details of the resulting terms)
Source code in pyatlan/client/asset.py
replace_custom_metadata(guid: str, custom_metadata: CustomMetadataDict)
¶
Replace specific custom metadata on the asset. This will replace everything within the named custom metadata, but will not change any of hte other named custom metadata on the asset.
:param guid: unique identifier (GUID) of the asset :param custom_metadata: custom metadata to replace, as human-readable names mapped to values :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
replace_terms(asset_type: Type[A], terms: List[AtlasGlossaryTerm], guid: Optional[str] = None, qualified_name: Optional[str] = None) -> A
¶
Replace the terms linked to an asset. (At least one of the GUID or qualified_name must be supplied, but both are not necessary.)
:param asset_type: type of the asset :param terms: the list of terms to replace on the asset, or an empty list to remove all terms from an asset :param guid: unique identifier (GUID) of the asset to which to replace the terms :param qualified_name: the qualified_name of the asset to which to replace the terms :returns: the asset that was updated (note that it will NOT contain details of the replaced terms)
Source code in pyatlan/client/asset.py
restore(asset_type: Type[A], qualified_name: str) -> bool
¶
Restore an archived (soft-deleted) asset to active.
:param asset_type: type of the asset to restore :param qualified_name: of the asset to restore :returns: True if the asset is now restored, or False if not :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
retrieve_minimal(guid: str, asset_type: Type[A] = Asset) -> A
¶
Retrieves an asset by its GUID, without any of its relationships.
:param guid: unique identifier (GUID) of the asset to retrieve
:param asset_type: type of asset to be retrieved, defaults to Asset
:returns: the asset, without any of its relationships
:raises NotFoundError: if the asset does not exist
Source code in pyatlan/client/asset.py
save(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False, replace_custom_metadata: bool = False, overwrite_custom_metadata: bool = False, append_atlan_tags: bool = False) -> AssetMutationResponse
¶
If an asset with the same qualified_name exists, updates the existing asset. Otherwise, creates the asset. If an asset does exist, opertionally overwrites any Atlan tags. Custom metadata will either be overwritten or merged depending on the options provided.
:param entity: one or more assets to save :param replace_atlan_tags: whether to replace AtlanTags during an update (True) or not (False) :param replace_custom_metadata: replaces any custom metadata with non-empty values provided :param overwrite_custom_metadata: overwrites any custom metadata, even with empty values :param append_atlan_tags: whether to add/update/remove AtlanTags during an update (True) or not (False) :returns: the result of the save :raises AtlanError: on any API communication issue :raises ApiError: if a connection was created and blocking until policies are synced overruns the retry limit
Source code in pyatlan/client/asset.py
save_merging_cm(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
If no asset exists, has the same behavior as the upsert() method, while also setting any custom metadata provided. If an asset does exist, optionally overwrites any Atlan tags. Will merge any provided custom metadata with any custom metadata that already exists on the asset.
:param entity: one or more assets to save :param replace_atlan_tags: whether to replace AtlanTags during an update (True) or not (False) :returns: details of the created or updated assets
Source code in pyatlan/client/asset.py
save_replacing_cm(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
If no asset exists, has the same behavior as the upsert() method, while also setting any custom metadata provided. If an asset does exist, optionally overwrites any Atlan tags. Will overwrite all custom metadata on any existing asset with only the custom metadata provided (wiping out any other custom metadata on an existing asset that is not provided in the request).
:param entity: one or more assets to save :param replace_atlan_tags: whether to replace AtlanTags during an update (True) or not (False) :returns: details of the created or updated assets :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
search(criteria: IndexSearchRequest, bulk=False) -> IndexSearchResults
¶
Search for assets using the provided criteria.
Note: if the number of results exceeds the predefined threshold
(100,000 assets) this will be automatically converted into a bulk search.
:param criteria: detailing the search query, parameters, and so on to run
:param bulk: whether to run the search to retrieve assets that match the supplied criteria,
for large numbers of results (> 100,000), defaults to False. Note: this will reorder the results
(based on creation timestamp) in order to iterate through a large number (more than 100,000) results.
:raises InvalidRequestError:
- if bulk search is enabled (`bulk=True`) and any
user-specified sorting options are found in the search request.
- if bulk search is disabled (`bulk=False`) and the number of results
exceeds the predefined threshold (i.e: `100,000` assets)
and any user-specified sorting options are found in the search request.
:raises AtlanError: on any API communication issue :returns: the results of the search
Source code in pyatlan/client/asset.py
set_dq_row_scope_filter_column(asset_type: Type[A], asset_name: str, asset_qualified_name: str, row_scope_filter_column_qualified_name: str) -> AssetMutationResponse
¶
Set the row scope filter column for data quality rules on an asset.
:param asset_type: the type of asset to update (e.g., Table) :param asset_name: the name of the asset to update :param asset_qualified_name: the qualified name of the asset to update :param row_scope_filter_column_qualified_name: the qualified name of the column to use for row scope filtering :returns: the result of the save :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
update_announcement(asset_type: Type[A], qualified_name: str, name: str, announcement: Announcement, glossary_guid: Optional[str] = None) -> Optional[A]
¶
update_announcement(
asset_type: Type[AtlasGlossaryTerm],
qualified_name: str,
name: str,
announcement: Announcement,
glossary_guid: str,
) -> Optional[AtlasGlossaryTerm]
Update the announcement on an asset.
:param asset_type: type of asset on which to update the announcement
:param qualified_name: the qualified_name of the asset on which to update the announcement
:param name: the name of the asset on which to update the announcement
:param announcement: to apply to the asset
:param glossary_guid: unique identifier of the glossary, required
only when the asset type is AtlasGlossaryTerm or AtlasGlossaryCategory
:returns: the result of the update, or None if the update failed
Source code in pyatlan/client/asset.py
update_atlan_tags(asset_type: Type[A], qualified_name: str, atlan_tag_names: List[str], propagate: bool = False, remove_propagation_on_delete: bool = True, restrict_lineage_propagation: bool = True, restrict_propagation_through_hierarchy: bool = False) -> A
¶
Update one or more Atlan tags to the provided asset.
:param asset_type: type of asset to which to update the Atlan tags :param qualified_name: qualified_name of the asset to which to update the Atlan tags :param atlan_tag_names: human-readable names of the Atlan tags to update to the asset :param propagate: whether to propagate the Atlan tag (True) or not (False) :param remove_propagation_on_delete: whether to remove the propagated Atlan tags when the Atlan tag is removed from this asset (True) or not (False) :param restrict_lineage_propagation: whether to avoid propagating through lineage (True) or do propagate through lineage (False) :param restrict_propagation_through_hierarchy: whether to prevent this Atlan tag from propagating through hierarchy (True) or allow it to propagate through hierarchy (False) :returns: the asset that was updated (note that it will NOT contain details of the updated Atlan tags) :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
update_certificate(asset_type: Type[A], qualified_name: str, name: str, certificate_status: CertificateStatus, glossary_guid: Optional[str] = None, message: Optional[str] = None) -> Optional[A]
¶
update_certificate(
asset_type: Type[AtlasGlossaryTerm],
qualified_name: str,
name: str,
certificate_status: CertificateStatus,
glossary_guid: str,
message: Optional[str] = None,
) -> Optional[AtlasGlossaryTerm]
Update the certificate on an asset.
:param asset_type: type of asset on which to update the certificate
:param qualified_name: the qualified_name of the asset on which to update the certificate
:param name: the name of the asset on which to update the certificate
:param certificate_status: specific certificate to set on the asset
:param glossary_guid: unique identifier of the glossary, required
only when the asset type is AtlasGlossaryTerm or AtlasGlossaryCategory
:param message: (optional) message to set (or None for no message)
:returns: the result of the update, or None if the update failed
:raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
update_custom_metadata_attributes(guid: str, custom_metadata: CustomMetadataDict)
¶
ManageCustomMetadata,
UpdateCustomMetadataAttributes,
)
Update only the provided custom metadata attributes on the asset. This will leave all other custom metadata attributes, even within the same named custom metadata, unchanged.
:param guid: unique identifier (GUID) of the asset :param custom_metadata: custom metadata to update, as human-readable names mapped to values :raises AtlanError: on any API communication issue
Source code in pyatlan/client/asset.py
update_merging_cm(entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
If no asset exists, fails with a NotFoundError. Will merge any provided custom metadata with any custom metadata that already exists on the asset. If an asset does exist, optionally overwrites any Atlan tags.
:param entity: the asset to update :param replace_atlan_tags: whether to replace AtlanTags during an update (True) or not (False) :returns: details of the updated asset :raises NotFoundError: if the asset does not exist (will not create it)
Source code in pyatlan/client/asset.py
update_replacing_cm(entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
If no asset exists, fails with a NotFoundError. Will overwrite all custom metadata on any existing asset with only the custom metadata provided (wiping out any other custom metadata on an existing asset that is not provided in the request). If an asset does exist, optionally overwrites any Atlan tags.
:param entity: the asset to update :param replace_atlan_tags: whether to replace AtlanTags during an update (True) or not (False) :returns: details of the updated asset :raises NotFoundError: if the asset does not exist (will not create it)
Source code in pyatlan/client/asset.py
upsert(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False, replace_custom_metadata: bool = False, overwrite_custom_metadata: bool = False) -> AssetMutationResponse
¶
Deprecated - use save() instead.
Source code in pyatlan/client/asset.py
upsert_merging_cm(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
Deprecated - use save_merging_cm() instead.
Source code in pyatlan/client/asset.py
upsert_replacing_cm(entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False) -> AssetMutationResponse
¶
Deprecated - use save_replacing_cm() instead.
Source code in pyatlan/client/asset.py
AssetIdentity(type_name: str, qualified_name: str, case_insensitive: bool = False)
¶
Bases: AtlanObject
Class to uniquely identify an asset by its type and qualifiedName.
Initializes an AssetIdentity.
:param type_name: type of the asset. :param qualified_name: qualified name of the asset. :param case_insensitive: Whether the qualified name should be case insensitive.
Source code in pyatlan/client/asset.py
Functions¶
from_string(combined: str) -> 'AssetIdentity'
staticmethod
¶
Reverse-engineer an asset identity from a string representation.
:param combined: The combined (serialized) asset identity. :return: The actual asset identity.
Source code in pyatlan/client/asset.py
Batch(client: AtlanClient, max_size: int, replace_atlan_tags: bool = False, custom_metadata_handling: CustomMetadataHandling = CustomMetadataHandling.IGNORE, capture_failures: bool = False, update_only: bool = False, track: bool = False, case_insensitive: bool = False, table_view_agnostic: bool = False, creation_handling: AssetCreationHandling = AssetCreationHandling.FULL)
¶
Utility class for managing bulk updates in batches.
Create a new batch of assets to be bulk-saved.
:param client: AtlanClient to use
:param max_size: maximum size of each batch
that should be processed (per API call)
:param replace_atlan_tags: if True, all Atlan tags on an existing
asset will be overwritten; if False, all Atlan tags will be ignored
:param custom_metadata_handling: how to handle custom metadata
(ignore it, replace it (wiping out anything pre-existing), or merge it)
:param capture_failures: when True, any failed batches will be
captured and retained rather than exceptions being raised
(for large amounts of processing this could cause memory issues!)
:param update_only: whether to allow assets to be created (False)
or only allow existing assets to be updated (True)
:param track: whether to track the basic information about
every asset that is created or updated (True) or only track counts (False)
:param case_insensitive: when running with update_only as True,
whether to consider only exact matches (False) or ignore case (True).
:param table_view_agnostic: whether tables and views should be treated interchangeably
(an asset in the batch marked as a table will attempt to match a
view if not found as a table, and vice versa)
:param creation_handling: when allowing assets to be created,
how to handle those creations (full assets or partial assets).
Source code in pyatlan/client/asset.py
2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 | |
Attributes¶
created: List[Asset]
property
¶
Get a list of all the Assets that were created
:returns: a list of all the Assets that were created
failures: List[FailedBatch]
property
¶
Get information on any failed batches
:returns: a list of FailedBatch objects that contain information about any batches that may have failed an empty list will be returned if there are no failures.
num_created: int
property
¶
Number of assets that were created (count only)
num_restored: int
property
¶
Number of assets that were restored (count only)
num_skipped: int
property
¶
Number of assets that were skipped (count only)
num_updated: int
property
¶
Number of assets that were updated (count only)
restored: List[Asset]
property
¶
Get a list of all the Assets that were potentially restored from being archived, or otherwise touched without actually being updated (minimal info only).
:returns: a list of all the Assets that were restored
skipped: List[Asset]
property
¶
Get a list of all the Assets that were skipped. when update only is requested and the asset does not exist in Atlan
:returns: a list of all the Assets that were skipped
updated: List[Asset]
property
¶
Get a list of all the Assets that were updated
:returns: a list of all the Assets that were updated
Functions¶
add(single: Asset) -> Optional[AssetMutationResponse]
¶
Add an asset to the batch to be processed.
:param single: the asset to add to a batch :returns: an AssetMutationResponse containing the results of the save or None if the batch is still queued.
Source code in pyatlan/client/asset.py
flush() -> Optional[AssetMutationResponse]
¶
Flush any remaining assets in the batch.
:returns: n AssetMutationResponse containing the results of the saving any assets that were flushed
Source code in pyatlan/client/asset.py
2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 | |
CategoryHierarchy(top_level: Set[str], stub_dict: Dict[str, AtlasGlossaryCategory])
¶
Source code in pyatlan/client/asset.py
Attributes¶
breadth_first: List[AtlasGlossaryCategory]
property
¶
Retrieve all the categories in the hierarchy in breadth-first traversal order.
:returns: all categories in breadth-first order
depth_first: List[AtlasGlossaryCategory]
property
¶
Retrieve all the categories in the hierarchy in depth-first traversal order.
:returns: all categories in depth-first order
root_categories: List[AtlasGlossaryCategory]
property
¶
Retrieve only the root-level categories (those with no parents).
:returns: the root-level categories of the Glossary
Functions¶
get_category(guid: str) -> AtlasGlossaryCategory
¶
Retrieve a specific category from anywhere in the hierarchy by its unique identifier (GUID).
:param guid: guid of the category to retrieve :returns: the requested category
Source code in pyatlan/client/asset.py
FailedBatch(failed_assets: List[Asset], failure_reason: Exception)
¶
IndexSearchResults(client: ApiCaller, criteria: IndexSearchRequest, start: int, size: int, count: int, assets: List[Asset], aggregations: Optional[Aggregations], bulk: bool = False)
¶
Bases: SearchResults, Iterable
Captures the response from a search against Atlan. Also provides the ability to iteratively page through results, without needing to track or re-run the original query.
Source code in pyatlan/client/asset.py
Functions¶
next_page(start=None, size=None) -> bool
¶
Indicates whether there is a next page of results.
:returns: True if there is a next page of results, otherwise False
Source code in pyatlan/client/asset.py
presorted_by_timestamp(sorts: List[SortItem]) -> bool
staticmethod
¶
Indicates whether the sort options prioritize
creation-time in ascending order as the first
sorting key (True) or anything else (False).
:param sorts: list of sorting options
:returns: True if the sorting options have
creation time and ascending as the first option
Source code in pyatlan/client/asset.py
sort_by_timestamp_first(sorts: List[SortItem]) -> List[SortItem]
staticmethod
¶
Rewrites the sorting options to ensure that sorting by creation time, ascending, is the top priority. Adds this condition if it does not already exist, or moves it up to the top sorting priority if it does already exist in the list.
:param sorts: list of sorting options :returns: sorting options, making sorting by creation time in ascending order the top priority
Source code in pyatlan/client/asset.py
LineageListResults(client: ApiCaller, criteria: LineageListRequest, start: int, size: int, has_more: bool, assets: List[Asset])
¶
Bases: SearchResults, Iterable
Captures the response from a lineage retrieval against Atlan. Also provides the ability to iteratively page through results, without needing to track or re-run the original query.
Source code in pyatlan/client/asset.py
SearchResults(client: ApiCaller, endpoint: API, criteria: SearchRequest, start: int, size: int, assets: List[Asset])
¶
Bases: ABC, Iterable
Abstract class that encapsulates results returned by various searches.
Source code in pyatlan/client/asset.py
Functions¶
current_page() -> List[Asset]
¶
Retrieve the current page of results.
:returns: list of assets on the current page of results
next_page(start=None, size=None) -> bool
¶
Indicates whether there is a next page of results.
:returns: True if there is a next page of results, otherwise False
Source code in pyatlan/client/asset.py
Audit Client¶
pyatlan.client.audit
¶
Classes¶
AuditClient(client: ApiCaller)
¶
This class can be used to configure and run a search against Atlan's activity log. This class does not need to be instantiated directly but can be obtained through the audit property of AtlanClient.
Source code in pyatlan/client/audit.py
Functions¶
search(criteria: AuditSearchRequest, bulk=False) -> AuditSearchResults
¶
Search for assets using the provided criteria.
Note: if the number of results exceeds the predefined threshold
(10,000 assets) this will be automatically converted into an audit bulk search.
:param criteria: detailing the search query, parameters, and so on to run
:param bulk: whether to run the search to retrieve assets that match the supplied criteria,
for large numbers of results (> 10,000), defaults to False. Note: this will reorder the results
(based on creation timestamp) in order to iterate through a large number (more than 10,000) results.
:raises InvalidRequestError:
- if audit bulk search is enabled (`bulk=True`) and any
user-specified sorting options are found in the search request.
- if audit bulk search is disabled (`bulk=False`) and the number of results
exceeds the predefined threshold (i.e: `10,000` assets)
and any user-specified sorting options are found in the search request.
:raises AtlanError: on any API communication issue :returns: the results of the search
Source code in pyatlan/client/audit.py
File Client¶
pyatlan.client.file
¶
Classes¶
FileClient(client: ApiCaller)
¶
A client for operating on Atlan's tenant object storage.
Source code in pyatlan/client/file.py
Functions¶
download_file(presigned_url: str, file_path: str) -> str
¶
Downloads a file from Atlan's tenant object storage.
:param presigned_url: any valid presigned URL. :param file_path: path to the file where you want to download the file. :raises InvalidRequestException: if unable to download the file. :raises AtlanError: on any error during API invocation. :returns: full path to the downloaded file.
Source code in pyatlan/client/file.py
generate_presigned_url(request: PresignedURLRequest) -> str
¶
Generates a presigned URL based on Atlan's tenant object store.
:param request: instance containing object key, expiry, and method (PUT: upload, GET: download). :raises AtlanError: on any error during API invocation. :returns: a response object containing a presigned URL with its cloud provider.
Source code in pyatlan/client/file.py
upload_file(presigned_url: str, file_path: str) -> None
¶
Uploads a file to Atlan's object storage.
:param presigned_url: any valid presigned URL. :param file_path: path to the file to be uploaded. :raises AtlanError: on any error during API invocation. :raises InvalidRequestException: if the upload file path is invalid, or when the presigned URL cloud provider is unsupported.
Source code in pyatlan/client/file.py
Group Client¶
pyatlan.client.group
¶
Classes¶
GroupClient(client: ApiCaller)
¶
This class can be used to retrieve information about groups. This class does not need to be instantiated directly but can be obtained through the group property of AtlanClient.
Source code in pyatlan/client/group.py
Functions¶
create(group: AtlanGroup, user_ids: Optional[List[str]] = None) -> CreateGroupResponse
¶
Create a new group.
:param group: details of the new group :param user_ids: list of unique identifiers (GUIDs) of users to associate with the group :returns: details of the created group and user association :raises AtlanError: on any API communication issue
Source code in pyatlan/client/group.py
get(limit: Optional[int] = 20, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0, columns: Optional[List[str]] = None) -> GroupResponse
¶
Retrieves a GroupResponse object which contains a list of the groups defined in Atlan.
:param limit: maximum number of results to be returned :param post_filter: which groups to retrieve :param sort: property by which to sort the results :param count: whether to return the total number of records (True) or not (False) :param offset: starting point for results to return, for paging :param columns: provides columns projection support for groups endpoint :returns: a GroupResponse object which contains a list of groups that match the provided criteria :raises AtlanError: on any API communication issue
Source code in pyatlan/client/group.py
get_all(limit: int = 20, offset: int = 0, sort: Optional[str] = 'name', columns: Optional[List[str]] = None) -> GroupResponse
¶
Retrieve a GroupResponse object containing a list of all groups defined in Atlan.
:param limit: maximum number of results to be returned :param offset: starting point for the list of groups when paging :param sort: property by which to sort the results, by default : name :param columns: provides columns projection support for groups endpoint :returns: a GroupResponse object with all groups based on the parameters; results are iterable.
Source code in pyatlan/client/group.py
get_by_name(alias: str, limit: int = 20, offset: int = 0) -> Optional[GroupResponse]
¶
Retrieves a GroupResponse object containing a list of groups that match the specified string. (This could include a complete group name, in which case there should be at most a single item in the returned list, or could be a partial group name to retrieve all groups with that naming convention.)
:param alias: name (as it appears in the UI) on which to filter the groups :param limit: maximum number of groups to retrieve :param offset: starting point for the list of groups when paging :returns: a GroupResponse object containing a list of groups whose UI names include the given string; the results are iterable.
Source code in pyatlan/client/group.py
get_members(guid: str, request: Optional[UserRequest] = None) -> UserResponse
¶
Retrieves a UserResponse object which contains a list of the members (users) of a group.
:param guid: unique identifier (GUID) of the group from which to retrieve members :param request: request containing details about which members to retrieve :returns: a UserResponse object which contains a list of users that are members of the group :raises AtlanError: on any API communication issue
Source code in pyatlan/client/group.py
purge(guid: str) -> None
¶
Delete a group.
:param guid: unique identifier (GUID) of the group to delete :raises AtlanError: on any API communication issue
Source code in pyatlan/client/group.py
remove_users(guid: str, user_ids: Optional[List[str]] = None) -> None
¶
Remove one or more users from a group.
:param guid: unique identifier (GUID) of the group from which to remove users :param user_ids: unique identifiers (GUIDs) of the users to remove from the group :raises AtlanError: on any API communication issue
Source code in pyatlan/client/group.py
update(group: AtlanGroup) -> None
¶
Update a group. Note that the provided 'group' must have its id populated.
:param group: details to update on the group :raises AtlanError: on any API communication issue
Source code in pyatlan/client/group.py
Role Client¶
pyatlan.client.role
¶
Classes¶
RoleClient(client: ApiCaller)
¶
This class can be used to retrieve information about roles. This class does not need to be instantiated directly but can be obtained through the role property of AtlanClient.
Source code in pyatlan/client/role.py
Functions¶
get(limit: int, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0) -> RoleResponse
¶
Retrieves a RoleResponse which contains a list of the roles defined in Atlan.
:param limit: maximum number of results to be returned :param post_filter: which roles to retrieve :param sort: property by which to sort the results :param count: whether to return the total number of records (True) or not (False) :param offset: starting point for results to return, for paging :returns: None or a RoleResponse object which contains list of roles that match the provided criteria :raises AtlanError: on any API communication issue
Source code in pyatlan/client/role.py
get_all() -> RoleResponse
¶
Retrieves a RoleResponse which contains a list of all the roles defined in Atlan.
:returns: a RoleResponse which contains a list of all the roles defined in Atlan :raises AtlanError: on any API communication issue
Source code in pyatlan/client/role.py
Token Client¶
pyatlan.client.token
¶
Classes¶
TokenClient(client: ApiCaller)
¶
This class can be used to retrieve information pertaining to API tokens. This class does not need to be instantiated directly but can be obtained through the token property of AtlanClient.
Source code in pyatlan/client/token.py
Functions¶
create(display_name: str, description: str = '', personas: Optional[Set[str]] = None, validity_seconds: int = -1) -> ApiToken
¶
Create a new API token with the provided settings.
:param display_name: human-readable name for the API token :param description: optional explanation of the API token :param personas: qualified_names of personas that should be linked to the token :param validity_seconds: time in seconds after which the token should expire (negative numbers are treated as infinite) :returns: the created API token :raises AtlanError: on any API communication issue
Source code in pyatlan/client/token.py
get(limit: Optional[int] = None, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0) -> ApiTokenResponse
¶
Retrieves an ApiTokenResponse which contains a list of API tokens defined in Atlan.
:param limit: maximum number of results to be returned :param post_filter: which API tokens to retrieve :param sort: property by which to sort the results :param count: whether to return the total number of records (True) or not (False) :param offset: starting point for results to return, for paging :returns: an ApiTokenResponse which contains a list of API tokens that match the provided criteria :raises AtlanError: on any API communication issue
Source code in pyatlan/client/token.py
get_by_guid(guid: str) -> Optional[ApiToken]
¶
Retrieves the API token with a unique ID (GUID) that exactly matches the provided string.
:param guid: unique identifier by which to retrieve the API token :returns: the API token whose clientId matches the provided string, or None if there is none
Source code in pyatlan/client/token.py
get_by_id(client_id: str) -> Optional[ApiToken]
¶
Retrieves the API token with a client ID that exactly matches the provided string.
:param client_id: unique client identifier by which to retrieve the API token :returns: the API token whose clientId matches the provided string, or None if there is none
Source code in pyatlan/client/token.py
get_by_name(display_name: str) -> Optional[ApiToken]
¶
Retrieves the API token with a name that exactly matches the provided string.
:param display_name: name (as it appears in the UI) by which to retrieve the API token :returns: the API token whose name (in the UI) matches the provided string, or None if there is none
Source code in pyatlan/client/token.py
purge(guid: str) -> None
¶
Delete (purge) the specified API token.
:param guid: unique identifier (GUID) of the API token to delete :raises AtlanError: on any API communication issue
Source code in pyatlan/client/token.py
update(guid: str, display_name: str, description: str = '', personas: Optional[Set[str]] = None) -> ApiToken
¶
Update an existing API token with the provided settings.
:param guid: unique identifier (GUID) of the API token :param display_name: human-readable name for the API token :param description: optional explanation of the API token :param personas: qualified_names of personas that should be linked to the token, note that you MUST provide the complete list on any update (any not included in the list will be removed, so if you do not specify any personas then ALL personas will be unlinked from the API token) :returns: the created API token :raises AtlanError: on any API communication issue
Source code in pyatlan/client/token.py
User Client¶
pyatlan.client.user
¶
Classes¶
UserClient(client: ApiCaller)
¶
This class can be used to retrieve information pertaining to users. This class does not need to be instantiated directly but can be obtained through the user property of AtlanClient.
Source code in pyatlan/client/user.py
Functions¶
add_as_admin(asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]
¶
Add the API token configured for the default client as an admin to the asset with the provided GUID. This is primarily useful for connections, to allow the API token to manage policies for the connection, and for query collections, to allow the API token to manage the queries in a collection or the collection itself.
:param asset_guid: unique identifier (GUID) of the asset to which we should add this API token as an admin :param impersonation_token: a bearer token for an actual user who is already an admin for the asset, NOT an API token :returns: a AssetMutationResponse which contains the results of the operation :raises NotFoundError: if the asset to which to add the API token as an admin cannot be found
Source code in pyatlan/client/user.py
add_as_viewer(asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]
¶
Add the API token configured for the default client as a viewer to the asset with the provided GUID. This is primarily useful for query collections, to allow the API token to view or run queries within the collection, but not make any changes to them.
:param asset_guid: unique identifier (GUID) of the asset to which we should add this API token as an admin :param impersonation_token: a bearer token for an actual user who is already an admin for the asset, NOT an API token :returns: a AssetMutationResponse which contains the results of the operation :raises NotFoundError: if the asset to which to add the API token as a viewer cannot be found
Source code in pyatlan/client/user.py
add_to_groups(guid: str, group_ids: List[str]) -> None
¶
Add a user to one or more groups.
:param guid: unique identifier (GUID) of the user to add into groups :param group_ids: unique identifiers (GUIDs) of the groups to add the user into :raises AtlanError: on any API communication issue
Source code in pyatlan/client/user.py
change_role(guid: str, role_id: str) -> None
¶
Change the role of a user.
:param guid: unique identifier (GUID) of the user whose role should be changed :param role_id: unique identifier (GUID) of the role to move the user into :raises AtlanError: on any API communication issue
Source code in pyatlan/client/user.py
create(users: List[AtlanUser], return_info: bool = False) -> Optional[UserResponse]
¶
Create one or more new users.
:param users: the details of the new users
:param return_info: whether to return the details of created users, defaults to False
:raises AtlanError: on any API communication issue
:returns: a UserResponse object which contains the list of details of created users if return_info is True, otherwise None
Source code in pyatlan/client/user.py
get(limit: Optional[int] = 20, post_filter: Optional[str] = None, sort: Optional[str] = None, count: bool = True, offset: int = 0) -> UserResponse
¶
Retrieves a UserResponse which contains a list of users defined in Atlan.
:param limit: maximum number of results to be returned :param post_filter: which users to retrieve :param sort: property by which to sort the results :param count: whether to return the total number of records (True) or not (False) :param offset: starting point for results to return, for paging :returns: a UserResponse which contains a list of users that match the provided criteria :raises AtlanError: on any API communication issue
Source code in pyatlan/client/user.py
get_all(limit: int = 20, offset: int = 0, sort: Optional[str] = 'username') -> UserResponse
¶
Retrieve a UserResponse object containing a list of all users defined in Atlan.
:param limit: maximum number of users to retrieve
:param offset: starting point for the list of users when paging
:param sort: property by which to sort the results, by default : username
:returns: a UserResponse object with all users based on the parameters; results are iterable.
Source code in pyatlan/client/user.py
get_by_email(email: str, limit: int = 20, offset: int = 0) -> Optional[UserResponse]
¶
Retrieves a UserResponse object containing a list of users with email addresses that contain the provided email. (This could include a complete email address, in which case there should be at most a single item in the returned list, or could be a partial email address such as "@example.com" to retrieve all users with that domain in their email address.)
:param email: on which to filter the users :param limit: maximum number of users to retrieve :param offset: starting point for the list of users when pagin :returns: a UserResponse object containing a list of users whose email addresses contain the provided string
Source code in pyatlan/client/user.py
get_by_emails(emails: List[str], limit: int = 20, offset: int = 0) -> Optional[UserResponse]
¶
Retrieves a UserResponse object containing a list of users with email addresses that match the provided list of emails.
:param emails: list of email addresses to filter the users :param limit: maximum number of users to retrieve :param offset: starting point for the list of users when paginating :returns: a UserResponse object containing a list of users whose email addresses match the provided list
Source code in pyatlan/client/user.py
get_by_username(username: str) -> Optional[AtlanUser]
¶
Retrieves a user based on the username. (This attempts an exact match on username rather than a contains search.)
:param username: the username by which to find the user :returns: the with that username
Source code in pyatlan/client/user.py
get_by_usernames(usernames: List[str], limit: int = 5, offset: int = 0) -> Optional[UserResponse]
¶
Retrieves a UserResponse object containing a list of users based on their usernames.
:param usernames: the list of usernames by which to find the users :param limit: maximum number of users to retrieve :param offset: starting point for the list of users when paginating :returns: a UserResponse object containing list of users with the specified usernames
Source code in pyatlan/client/user.py
get_current() -> UserMinimalResponse
¶
Retrieve the current user (representing the API token).
:returns: basic details about the current user (API token) :raises AtlanError: on any API communication issue
Source code in pyatlan/client/user.py
get_groups(guid: str, request: Optional[GroupRequest] = None) -> GroupResponse
¶
Retrieve the groups this user belongs to.
:param guid: unique identifier (GUID) of the user :param request: request containing details about which groups to retrieve :returns: a GroupResponse which contains the groups this user belongs to :raises AtlanError: on any API communication issue
Source code in pyatlan/client/user.py
update(guid: str, user: AtlanUser) -> UserMinimalResponse
¶
Update a user. Note: you can only update users that have already signed up to Atlan. Users that are only invited (but have not yet logged in) cannot be updated.
:param guid: unique identifier (GUID) of the user to update :param user: details to update on the user :returns: basic details about the updated user :raises AtlanError: on any API communication issue
Source code in pyatlan/client/user.py
Typedef Client¶
pyatlan.client.typedef
¶
Classes¶
TypeDefClient(client: ApiCaller)
¶
This class can be used to retrieve information pertaining to TypeDefs. This class does not need to be instantiated directly but can be obtained through the typedef property of AtlanClient.
Source code in pyatlan/client/typedef.py
Functions¶
create(typedef: TypeDef) -> TypeDefResponse
¶
Create a new type definition in Atlan. Note: only custom metadata, enumerations (options), and Atlan tag type definitions are currently supported. Furthermore, if any of these are created their respective cache will be force-refreshed.
:param typedef: type definition to create :returns: the resulting type definition that was created :raises InvalidRequestError: if the typedef you are trying to create is not one of the allowed types :raises AtlanError: on any API communication issue
Source code in pyatlan/client/typedef.py
get(type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]]) -> TypeDefResponse
¶
Retrieves a TypeDefResponse object that contain a list of the specified category type definitions in Atlan.
:param type_category: category of type definitions to retrieve :returns: TypeDefResponse object that contain a list that contains the requested list of type definitions :raises AtlanError: on any API communication issue
Source code in pyatlan/client/typedef.py
get_all() -> TypeDefResponse
¶
Retrieves a TypeDefResponse object that contains a list of all the type definitions in Atlan.
:returns: TypeDefResponse object that contains a list of all the type definitions in Atlan :raises AtlanError: on any API communication issue
Source code in pyatlan/client/typedef.py
get_by_name(name: str) -> TypeDef
¶
Retrieves a specific type definition from Atlan.
:name: internal (hashed-string, if used) name of the type definition :returns: details of that specific type definition :raises ApiError: on receiving an unsupported type definition category or when unable to produce a valid response :raises AtlanError: on any API communication issue
Source code in pyatlan/client/typedef.py
purge(name: str, typedef_type: type) -> None
¶
Delete the type definition. Furthermore, if an Atlan tag, enumeration or custom metadata is deleted their respective cache will be force-refreshed.
:param name: internal hashed-string name of the type definition :param typedef_type: type of the type definition that is being deleted :raises InvalidRequestError: if the typedef you are trying to delete is not one of the allowed types :raises NotFoundError: if the typedef you are trying to delete cannot be found :raises AtlanError: on any API communication issue
Source code in pyatlan/client/typedef.py
update(typedef: TypeDef) -> TypeDefResponse
¶
Update an existing type definition in Atlan. Note: only custom metadata, enumerations (options), and Atlan tag type definitions are currently supported. Furthermore, if any of these are updated their respective cache will be force-refreshed.
:param typedef: type definition to update :returns: the resulting type definition that was updated :raises InvalidRequestError: if the typedef you are trying to update is not one of the allowed types :raises AtlanError: on any API communication issue
Source code in pyatlan/client/typedef.py
Workflow Client¶
pyatlan.client.workflow
¶
Classes¶
WorkflowClient(client: ApiCaller)
¶
This class can be used to retrieve information and rerun workflows. This class does not need to be instantiated directly but can be obtained through the workflow property of AtlanClient.
Source code in pyatlan/client/workflow.py
Functions¶
add_schedule(workflow: Union[WorkflowResponse, WorkflowPackage, WorkflowSearchResult, WorkflowSearchResultDetail], workflow_schedule: WorkflowSchedule) -> WorkflowResponse
¶
add_schedule(
workflow: WorkflowResponse,
workflow_schedule: WorkflowSchedule,
) -> WorkflowResponse
Add a schedule for an existing workflow run.
:param workflow: existing workflow run to schedule.
:param workflow_schedule: a WorkflowSchedule object containing:
- A cron schedule expression, e.g: 5 4 * * *.
- The time zone for the cron schedule, e.g: Europe/Paris.
:returns: a scheduled workflow. :raises AtlanError: on any API communication issue.
Source code in pyatlan/client/workflow.py
delete(workflow_name: str) -> None
¶
Archive (delete) the provided workflow.
:param workflow_name: name of the workflow as displayed
in the UI (e.g: atlan-snowflake-miner-1714638976).
:raises AtlanError: on any API communication issue.
Source code in pyatlan/client/workflow.py
find_by_id(id: str) -> Optional[WorkflowSearchResult]
¶
Find workflows based on their ID (e.g: atlan-snowflake-miner-1714638976)
Note: Only workflows that have been run will be found
:param id: the ID of the workflow to find :returns: the workflow with the provided ID, or None if none is found :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
find_by_type(prefix: WorkflowPackage, max_results: int = 10) -> List[WorkflowSearchResult]
¶
Find workflows based on their type (prefix). Note: Only workflows that have been run will be found.
:param prefix: name of the specific workflow to find (for example CONNECTION_DELETE) :param max_results: the maximum number of results to retrieve :returns: the list of workflows of the provided type, with the most-recently created first :raises ValidationError: If the provided prefix is invalid workflow package :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
find_run_by_id(id: str) -> Optional[WorkflowSearchResult]
¶
Find workflows runs based on their ID (e.g: atlan-snowflake-miner-1714638976-t7s8b)
Note: Only workflow runs will be found
:param id: the ID of the workflow run to find :returns: the workflow run with the provided ID, or None if none is found :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
find_runs_by_status_and_time_range(status: List[AtlanWorkflowPhase], started_at: Optional[str] = None, finished_at: Optional[str] = None, from_: int = 0, size: int = 100) -> WorkflowSearchResponse
¶
Retrieves a WorkflowSearchResponse object containing workflow runs based on their status and time range.
:param status: list of the workflow statuses to filter
:param started_at: (optional) lower bound on 'status.startedAt' (e.g 'now-2h')
:param finished_at: (optional) lower bound on 'status.finishedAt' (e.g 'now-1h')
:param from_:(optional) starting index of the search results (default: 0).
:param size: (optional) maximum number of search results to return (default: 100).
:returns: a WorkflowSearchResponse object containing a list of workflows matching the filters
:raises ValidationError: if inputs are invalid
:raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
find_schedule_query(saved_query_id: str, max_results: int = 10) -> List[WorkflowSearchResult]
¶
Find scheduled query workflows by their saved query identifier.
:param saved_query_id: identifier of the saved query.
:param max_results: maximum number of results to retrieve. Defaults to 10.
:raises AtlanError: on any API communication issue.
:returns: a list of scheduled query workflows.
Source code in pyatlan/client/workflow.py
find_schedule_query_between(request: ScheduleQueriesSearchRequest, missed: bool = False) -> Optional[List[WorkflowRunResponse]]
¶
Find scheduled query workflows within the specified duration.
:param request: a ScheduleQueriesSearchRequest object containing
start and end dates in ISO 8601 format (e.g: 2024-03-25T16:30:00.000+05:30).
:param missed: if True, perform a search for missed
scheduled query workflows. Defaults to False.
:raises AtlanError: on any API communication issue.
:returns: a list of scheduled query workflows found within the specified duration.
Source code in pyatlan/client/workflow.py
get_all_scheduled_runs() -> List[WorkflowScheduleResponse]
¶
Get the details of scheduled run for all workflow.
:returns: list of all the workflow schedules :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
get_runs(workflow_name: str, workflow_phase: AtlanWorkflowPhase, from_: int = 0, size: int = 100) -> Optional[WorkflowSearchResponse]
¶
Retrieves all workflow runs.
:param workflow_name: name of the workflow as displayed
in the UI (e.g: atlan-snowflake-miner-1714638976).
:param workflow_phase: phase of the given workflow (e.g: Succeeded, Running, Failed, etc).
:param from_: starting index of the search results (default: 0).
:param size: maximum number of search results to return (default: 100).
:returns: a list of runs of the given workflow.
:raises AtlanError: on any API communication issue.
Source code in pyatlan/client/workflow.py
get_scheduled_run(workflow_name: str) -> WorkflowScheduleResponse
¶
Get the details of scheduled run for a specific workflow.
:param workflow_name: name of the workflow for which we want the scheduled run details :returns: details of the workflow schedule :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
monitor(workflow_response: Optional[WorkflowResponse] = None, logger: Optional[Logger] = None, workflow_name: Optional[str] = None) -> Optional[AtlanWorkflowPhase]
¶
Monitor a workflow until its completion (or the script terminates).
:param workflow_response: The workflow_response returned from running the workflow
:param logger: the logger to log status information
(logging.INFO for summary info. logging.DEBUG for detail info)
:param workflow_name: name of the workflow to be monitored
:returns: the status at completion or None if the workflow wasn't run
:raises ValidationError: If the provided workflow_response, logger is invalid
:raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
re_run_schedule_query(schedule_query_id: str) -> WorkflowRunResponse
¶
Re-run a scheduled query.
:param schedule_query_id: ID of the scheduled query to re-run :returns: the workflow run response :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
remove_schedule(workflow: Union[WorkflowResponse, WorkflowPackage, WorkflowSearchResult, WorkflowSearchResultDetail]) -> WorkflowResponse
¶
Remove a scheduled run from an existing workflow run.
:param workflow_run: existing workflow run to remove the schedule from. :returns: a workflow. :raises AtlanError: on any API communication issue.
Source code in pyatlan/client/workflow.py
rerun(workflow: Union[WorkflowPackage, WorkflowSearchResultDetail, WorkflowSearchResult], idempotent: bool = False) -> WorkflowRunResponse
¶
Rerun the workflow immediately. Note: this must be a workflow that was previously run.
:param workflow: The workflow to rerun.
:param idempotent: If True, the workflow will only be rerun if it is not already currently running
:returns: the details of the workflow run (if idempotent, will return details of the already-running workflow)
:raises ValidationError: If the provided workflow is invalid
:raises InvalidRequestException: If no prior runs are available for the provided workflow
:raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
run(workflow: Union[Workflow, str], workflow_schedule: Optional[WorkflowSchedule] = None) -> WorkflowResponse
¶
Run the Atlan workflow with a specific configuration.
Note: This method should only be used to create the workflow for the first time. Each invocation creates a new connection and new assets within that connection. Running the workflow multiple times with the same configuration may lead to duplicate assets. Consider using the "rerun()" method instead to re-execute an existing workflow.
:param workflow: workflow object to run or a raw workflow JSON string.
:param workflow_schedule: (Optional) a WorkflowSchedule object containing:
- A cron schedule expression, e.g: 5 4 * * *.
- The time zone for the cron schedule, e.g: Europe/Paris.
:returns: Details of the workflow run.
:raises ValidationError: If the provided workflow is invalid.
:raises AtlanError: on any API communication issue.
Source code in pyatlan/client/workflow.py
stop(workflow_run_id: str) -> WorkflowRunResponse
¶
Stop the provided, running workflow.
:param workflow_run_id: identifier of the specific workflow run :returns: the stopped workflow run :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
update(workflow: Workflow) -> WorkflowResponse
¶
Update a given workflow's configuration.
:param workflow: request full details of the workflow's revised configuration.
:returns: the updated workflow configuration.
:raises ValidationError: If the provided workflow is invalid.
:raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
update_owner(workflow_name: str, username: str) -> WorkflowResponse
¶
Update the owner of a workflow.
:param workflow_name: name of the workflow for which we want to update owner :param username: new username of the user who should own the workflow :returns: workflow response details :raises AtlanError: on any API communication issue
Source code in pyatlan/client/workflow.py
Functions¶
Credential Client¶
pyatlan.client.credential
¶
Classes¶
CredentialClient(client: ApiCaller)
¶
A client for managing credentials within the Atlan platform.
This class provides functionality for interacting with Atlan's credential objects. It allows you to perform operations such as retrieving, testing, and updating given credentials.
Source code in pyatlan/client/credential.py
Functions¶
creator(credential: Credential, test: bool = True) -> CredentialResponse
¶
Create a new credential.
:param credential: provide full details of the credential's to be created.
:param test: whether to validate the credentials (True) or skip validation
(False) before creation, defaults to True.
:returns: A CredentialResponse instance.
:raises ValidationError: If the provided credential is invalid.
:raises InvalidRequestError: If test is False and the credential contains a username or password.
Source code in pyatlan/client/credential.py
get(guid: str) -> CredentialResponse
¶
Retrieves a credential by its unique identifier (GUID). Note that this will never contain sensitive information in the credential, such as usernames, passwords or client secrets or keys.
:param guid: GUID of the credential. :returns: A CredentialResponse instance. :raises: AtlanError on any error during API invocation.
Source code in pyatlan/client/credential.py
get_all(filter: Optional[Dict[str, Any]] = None, limit: Optional[int] = None, offset: Optional[int] = None, workflow_name: Optional[str] = None) -> CredentialListResponse
¶
Retrieves all credentials.
:param filter: (optional) dictionary specifying the filter criteria. :param limit: (optional) maximum number of credentials to retrieve. :param offset: (optional) number of credentials to skip before starting retrieval. :param workflow_name: (optional) name of the workflow to retrieve credentials for. :returns: CredentialListResponse instance. :raises: AtlanError on any error during API invocation.
Source code in pyatlan/client/credential.py
purge_by_guid(guid: str) -> CredentialResponse
¶
Hard-deletes (purges) credential by their unique identifier (GUID). This operation is irreversible.
:param guid: unique identifier(s) (GUIDs) of credential to hard-delete :returns: details of the hard-deleted asset(s) :raises AtlanError: on any API communication issue
Source code in pyatlan/client/credential.py
test(credential: Credential) -> CredentialTestResponse
¶
Tests the given credential by sending it to Atlan for validation.
:param credential: The credential to be tested. :type credential: A CredentialTestResponse instance. :returns: The response indicating the test result. :raises ValidationError: If the provided credential is invalid type. :raises AtlanError: On any error during API invocation.
Source code in pyatlan/client/credential.py
test_and_update(credential: Credential) -> CredentialResponse
¶
Updates this credential in Atlan after first testing it to confirm its successful validation.
:param credential: The credential to be tested and updated. :returns: An updated CredentialResponse instance. :raises ValidationError: If the provided credential is invalid type. :raises InvalidRequestException: if the provided credentials cannot be validated successfully. :raises InvalidRequestException: If the provided credential does not have an ID. :raises AtlanError: on any error during API invocation.
Source code in pyatlan/client/credential.py
Contract Client¶
pyatlan.client.contract
¶
Classes¶
ContractClient(client: ApiCaller)
¶
A client for data contract-specific operations.
Source code in pyatlan/client/contract.py
Functions¶
generate_initial_spec(asset: Asset) -> Optional[str]
¶
Generate an initial contract spec for the provided asset.
The asset must have at least its qualifiedName (and typeName) populated.
:param asset: for which to generate the initial contract spec
:raises AtlanError: if there is an issue interacting with the API :returns: YAML for the initial contract spec for the provided asset
Source code in pyatlan/client/contract.py
Query Client¶
pyatlan.client.query
¶
Classes¶
QueryClient(client: ApiCaller)
¶
A client for running SQL queries.
Source code in pyatlan/client/query.py
Functions¶
stream(request: QueryRequest) -> QueryResponse
¶
Runs the provided query and returns its results.
:param: request query to run. :returns: results of the query. :raises : AtlanError on any issues with API communication.
Source code in pyatlan/client/query.py
Search Log Client¶
pyatlan.client.search_log
¶
Classes¶
SearchLogClient(client: ApiCaller)
¶
This class can be used to configure and run a search against Atlan's searcg log. This class does not need to be instantiated directly but can be obtained through the search_log property of AtlanClient.
Source code in pyatlan/client/search_log.py
Functions¶
search(criteria: SearchLogRequest, bulk=False) -> Union[SearchLogViewResults, SearchLogResults]
¶
Search for search logs using the provided criteria.
Note: if the number of results exceeds the predefined threshold
(10,000 search logs) this will be automatically converted into an search log bulk search.
:param criteria: detailing the search query, parameters, and so on to run
:param bulk: whether to run the search to retrieve search logs that match the supplied criteria,
for large numbers of results (> 10,000), defaults to False. Note: this will reorder the results
(based on creation timestamp) in order to iterate through a large number (more than 10,000) results.
:raises InvalidRequestError:
- if search log bulk search is enabled (`bulk=True`) and any
user-specified sorting options are found in the search request.
- if search log bulk search is disabled (`bulk=False`) and the number of results
exceeds the predefined threshold (i.e: `10,000` assets)
and any user-specified sorting options are found in the search request.
:raises AtlanError: on any API communication issue :returns: the results of the search
Source code in pyatlan/client/search_log.py
Task Client¶
pyatlan.client.task
¶
Classes¶
TaskClient(client: ApiCaller)
¶
A client for operating on tasks.
Source code in pyatlan/client/task.py
Functions¶
search(request: TaskSearchRequest) -> TaskSearchResponse
¶
Search for tasks using the provided criteria.
:param request: search request for tasks :returns: search results for tasks
Source code in pyatlan/client/task.py
SSO Client¶
pyatlan.client.sso
¶
Classes¶
SSOClient(client: ApiCaller)
¶
A client for operating on Atlan's single sign-on (SSO).
Source code in pyatlan/client/sso.py
Functions¶
create_group_mapping(sso_alias: str, atlan_group: AtlanGroup, sso_group_name: str) -> SSOMapper
¶
Creates a new Atlan SSO group mapping.
:param sso_alias: name of the SSO provider. :param atlan_group: existing Atlan group. :param sso_group_name: name of the SSO group. :raises AtlanError: on any error during API invocation. :returns: created SSO group mapping instance.
Source code in pyatlan/client/sso.py
delete_group_mapping(sso_alias: str, group_map_id: str) -> None
¶
Deletes an existing Atlan SSO group mapping.
:param sso_alias: name of the SSO provider.
:param group_map_id: existing SSO group map identifier.
:raises AtlanError: on any error during API invocation.
:returns: an empty response (None).
Source code in pyatlan/client/sso.py
get_all_group_mappings(sso_alias: str) -> List[SSOMapper]
¶
Retrieves all existing Atlan SSO group mappings.
:param sso_alias: name of the SSO provider. :raises AtlanError: on any error during API invocation. :returns: list of existing SSO group mapping instances.
Source code in pyatlan/client/sso.py
get_group_mapping(sso_alias: str, group_map_id: str) -> SSOMapper
¶
Retrieves an existing Atlan SSO group mapping.
:param sso_alias: name of the SSO provider. :param group_map_id: existing SSO group map identifier. :raises AtlanError: on any error during API invocation. :returns: existing SSO group mapping instance.
Source code in pyatlan/client/sso.py
update_group_mapping(sso_alias: str, atlan_group: AtlanGroup, group_map_id: str, group_map_name: str, sso_group_name: str) -> SSOMapper
¶
Update an existing Atlan SSO group mapping.
:param sso_alias: name of the SSO provider. :param atlan_group: existing Atlan group. :param group_map_id: existing SSO group map identifier. :param group_map_name: existing SSO group map name. :param sso_group_name: new SSO group name. :raises AtlanError: on any error during API invocation. :returns: updated SSO group mapping instance.
Source code in pyatlan/client/sso.py
Open Lineage Client¶
pyatlan.client.open_lineage
¶
Classes¶
OpenLineageClient(client: ApiCaller)
¶
A client for interacting with OpenLineage.
Source code in pyatlan/client/open_lineage.py
Functions¶
create_connection(name: str, connector_type: AtlanConnectorType = AtlanConnectorType.SPARK, admin_users: Optional[List[str]] = None, admin_roles: Optional[List[str]] = None, admin_groups: Optional[List[str]] = None) -> AssetMutationResponse
¶
Creates a connection for OpenLineage.
:param name: name for the new connection :param connector_type: for the new connection to be associated with :param admin_users: list of admin users to associate with this connection :param admin_roles: list of admin roles to associate with this connection :param admin_groups:list of admin groups to associate with this connection :return: details of the connection created
Source code in pyatlan/client/open_lineage.py
send(request: Union[OpenLineageEvent, OpenLineageRawEvent, List[Dict[str, Any]], Dict[str, Any], str], connector_type: AtlanConnectorType) -> None
¶
Sends the OpenLineage event to Atlan to be consumed.
:param request: OpenLineage event to send - can be an OpenLineageEvent, OpenLineageRawEvent, list of dicts, dict, or JSON string :param connector_type: of the connection that should receive the OpenLineage event :raises AtlanError: when OpenLineage is not configured OR on any issues with API communication
Source code in pyatlan/client/open_lineage.py
Functions¶
Impersonation Client¶
pyatlan.client.impersonate
¶
Classes¶
ImpersonationClient(client: ApiCaller)
¶
This class can be used for impersonating users as part of Atlan automations (if desired). Note: this will only work when run as part of Atlan's packaged workflow ecosystem (running in the cluster back-end).
Source code in pyatlan/client/impersonate.py
Functions¶
escalate() -> str
¶
Escalate to a privileged user on a short-term basis. Note: this is only possible from within the Atlan tenant, and only when given the appropriate credentials.
:returns: a short-lived bearer token with escalated privileges :raises AtlanError: on any API communication issue
Source code in pyatlan/client/impersonate.py
get_client_secret(client_guid: str) -> Optional[str]
¶
Retrieves the client secret associated with the given client GUID
:param client_guid: GUID of the client whose secret is to be retrieved
:returns: client secret if available, otherwise None
:raises:
- AtlanError: If an API error occurs.
- InvalidRequestError: If the provided GUID is invalid or retrieval fails.
Source code in pyatlan/client/impersonate.py
get_user_id(username: str) -> Optional[str]
¶
Retrieves the user ID from Keycloak for the specified username. This method is particularly useful for impersonating API tokens.
:param username: username of the user whose ID needs to be retrieved. :returns: Keycloak user ID :raises: - AtlanError: If an API error occurs. - InvalidRequestError: If an error occurs while fetching the user ID from Keycloak.
Source code in pyatlan/client/impersonate.py
user(user_id: str) -> str
¶
Retrieves a bearer token that impersonates the provided user.
:param user_id: unique identifier of the user to impersonate :returns: a bearer token that impersonates the provided user :raises AtlanError: on any API communication issue
Source code in pyatlan/client/impersonate.py
Admin Client¶
pyatlan.client.admin
¶
Classes¶
AdminClient(client: ApiCaller)
¶
This class can be used to retrieve keycloak and admin events. This class does not need to be instantiated directly but can be obtained through the admin property of AtlanClient.
Source code in pyatlan/client/admin.py
Functions¶
get_admin_events(admin_request: AdminEventRequest) -> AdminEventResponse
¶
Retrieve admin events based on the supplied filters.
:param admin_request: details of the filters to apply when retrieving admin events :returns: the admin events that match the supplied filters :raises AtlanError: on any API communication issue
Source code in pyatlan/client/admin.py
get_keycloak_events(keycloak_request: KeycloakEventRequest) -> KeycloakEventResponse
¶
Retrieve all events, based on the supplied filters.
:param keycloak_request: details of the filters to apply when retrieving events :returns: the events that match the supplied filters :raises AtlanError: on any API communication issue
Source code in pyatlan/client/admin.py
OAuth¶
pyatlan.client.oauth
¶
Classes¶
OAuthTokenManager(base_url: str, client_id: str, client_secret: str, http_client: Optional[httpx.Client] = None, connect_timeout: float = 30.0, read_timeout: float = 900.0, write_timeout: float = 30.0, pool_timeout: float = 30.0)
¶
Manages OAuth tokens for HTTP clients. :param base_url: Base URL of the Atlan tenant. :param client_id: OAuth client ID. :param client_secret: OAuth client secret. :param http_client: Optional HTTP client to use. :param connect_timeout: Timeout for establishing connections. :param read_timeout: Timeout for reading data. :param write_timeout: Timeout for writing data. :param pool_timeout: Timeout for acquiring a connection from the pool.
Source code in pyatlan/client/oauth.py
Functions¶
close()
¶
get_token() -> str
¶
Retrieves a valid OAuth token, refreshing it if necessary.
Source code in pyatlan/client/oauth.py
pyatlan.client.oauth_client
¶
Classes¶
OAuthClient(client: ApiCaller)
¶
This class can be used to manage OAuth client credentials. This class does not need to be instantiated directly but can be obtained through the oauth_client property of AtlanClient.
Source code in pyatlan/client/oauth_client.py
Functions¶
create(name: str, role: str, description: Optional[str] = None, persona_qualified_names: Optional[List[str]] = None) -> OAuthClientCreateResponse
¶
Create a new OAuth client with the provided settings.
:param name: human-readable name for the OAuth client (displayed in UI) :param role: role description to assign to the OAuth client (e.g., 'Admin', 'Member'). :param description: optional explanation of the OAuth client :param persona_qualified_names: qualified names of personas to associate with the OAuth client :returns: the created OAuthClientCreateResponse (includes client_id and client_secret) :raises AtlanError: on any API communication issue :raises NotFoundError: if the specified role description is not found
Source code in pyatlan/client/oauth_client.py
get(limit: int = 20, offset: int = 0, sort: Optional[str] = None) -> OAuthClientListResponse
¶
Retrieves OAuth clients defined in Atlan with pagination support.
:param limit: maximum number of results to be returned per page (default: 20) :param offset: starting point for results to return, for paging :param sort: property by which to sort the results (e.g., 'createdAt' for descending) :returns: an OAuthClientListResponse containing records and pagination info :raises AtlanError: on any API communication issue
Source code in pyatlan/client/oauth_client.py
get_by_id(client_id: str) -> OAuthClientResponse
¶
Retrieves the OAuth client with the specified client ID.
:param client_id: unique client identifier (e.g., 'oauth-client-xxx') :returns: the OAuthClientResponse with the specified client ID :raises AtlanError: on any API communication issue
Source code in pyatlan/client/oauth_client.py
purge(client_id: str) -> None
¶
Delete (purge) the specified OAuth client.
:param client_id: unique client identifier (e.g., 'oauth-client-xxx') :raises AtlanError: on any API communication issue
Source code in pyatlan/client/oauth_client.py
update(client_id: str, display_name: Optional[str] = None, description: Optional[str] = None) -> OAuthClientResponse
¶
Update an existing OAuth client with the provided settings.
:param client_id: unique client identifier (e.g., 'oauth-client-xxx') :param display_name: human-readable name for the OAuth client :param description: optional explanation of the OAuth client :returns: the updated OAuthClientResponse :raises AtlanError: on any API communication issue