cloudera.services.atlas_entity_info module – Retrieve an entity from Apache Atlas
Note
This module is part of the cloudera.services collection (version 1.0.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install git+https://github.com/cloudera-labs/cloudera.services.git.
To use it in a playbook, specify: cloudera.services.atlas_entity_info.
New in cloudera.services 1.1.0
Synopsis
Retrieve a single entity instance from Apache Atlas, with its attributes, labels, classifications, and business metadata.
Identify the entity either by its GUID or by its type name and unique attributes, usually its
qualifiedName.Returns no entities, and does not fail, when the entity does not exist.
Parameters
Parameter |
Comments |
|---|---|
The path to a client certificate for authenticating to the API endpoint. |
|
The path to a client key for authenticating to the API endpoint. |
|
A flag to enable debug logging of the module’s execution. Choices:
|
|
A flag to force a refresh of the API request, ignoring any cached results. Choices:
|
|
A flag to force basic authentication for API requests. Choices:
|
|
GUID of the entity. Atlas deletes entities softly, so a GUID lookup can return an entity whose Mutually exclusive with |
|
The User-Agent string to send with API requests. Default: |
|
The number of items to return per page in a paginated API response. Default: |
|
Value of the Shorthand for Requires |
|
The timeout in seconds for any API requests. Default: |
|
Name of the entity type, e.g. Requires A type name that does not exist fails the module, so a misspelled type is not mistaken for a missing entity. A lookup by unique attributes never returns a deleted entity. |
|
Unique attribute names and values that identify the entity within Attribute names are Atlas names and are used as given, e.g. Requires |
|
The base URL of the API endpoint, including the port if necessary. |
|
The password for authenticating to the API endpoint. |
|
The username for authenticating to the API endpoint. |
|
A flag to enable or disable GSSAPI authentication for API requests. Choices:
|
|
A flag to enable or disable the use of a proxy for API requests. Choices:
|
|
A flag to enable or disable SSL certificate validation for API requests. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
This module supports check mode. |
Examples
# NOTE: Examples do not include connection and authentication fields
- name: Retrieve an entity by its qualified name
cloudera.services.atlas_entity_info:
type_name: hive_table
qualified_name: default.sales@cluster1
register: table
- name: Retrieve an entity by its GUID
cloudera.services.atlas_entity_info:
guid: fc0fd256-be16-4775-99ad-9e0b7e304ae5
register: entity
- name: Retrieve an entity by several unique attributes
cloudera.services.atlas_entity_info:
type_name: my_custom_type
unique_attributes:
qualifiedName: orders@cluster1
register: orders
- name: Fail unless the entity exists and is active
ansible.builtin.assert:
that:
- table.entities | length == 1
- table.entities[0].status == 'ACTIVE'
- name: List the classifications attached to an entity
ansible.builtin.debug:
msg: "{{ table.entities[0].classifications | map(attribute='type_name') | list }}"
when: table.entities | length > 0
- name: Wait for a hook to register a table before using it
cloudera.services.atlas_entity_info:
type_name: hive_table
qualified_name: default.sales@cluster1
register: table
until: table.entities | length > 0
retries: 12
delay: 10
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The entity, as a list with zero or one item. Top-level keys are snake_case; the names inside the attribute dictionaries are exactly the names Atlas uses (e.g. Returned: always |
|
The entity attributes, keyed by Atlas attribute name. Returned: success |
|
The business metadata attached to the entity, keyed by business metadata name and then attribute name. Returned: success |
|
The classifications attached to or propagated to the entity. Returned: success |
|
The classification attributes, keyed by Atlas attribute name. Returned: success |
|
GUID of the entity the classification is attached to. A different GUID than the entity’s own means it was propagated. Returned: success |
|
Status of the entity the classification is attached to. Returned: success |
|
Whether the classification propagates to related entities. Returned: success |
|
Whether propagations are removed when the entity is deleted. Returned: success |
|
Name of the classification. Returned: success |
|
The time windows in which the classification is valid. Returned: success |
|
Creation time in epoch milliseconds. Returned: success |
|
User that created the entity. Returned: success |
|
The user-defined custom attributes. Returned: success |
|
Atlas-assigned identifier. Returned: success |
|
Whether Atlas holds only a partial copy of the entity. Returned: success |
|
The labels attached to the entity. Returned: success |
|
The relationship attributes, keyed by Atlas attribute name. Returned: success |
|
Entity status, Returned: success |
|
Name of the entity type. Returned: success |
|
Last update time in epoch milliseconds. Returned: success |
|
User that last updated the entity. Returned: success |
|
Atlas version number of the entity. Returned: success |