Package com.atlan
Class AtlanClient
java.lang.Object
com.atlan.AtlanClient
- All Implemented Interfaces:
AtlanCloseable,AutoCloseable
Configuration for the SDK against a particular Atlan tenant.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ApiTokensEndpointEndpoint with operations to manage API tokens.final AssetEndpointEndpoint with operations to manage assets.final ContractsEndpointEndpoint with operations to interact with data contracts.final CredentialsEndpointEndpoint with operations to manage credentials (of connectors).static final Stringfinal FilesEndpointEndpoint with operations to manage files.final GroupsEndpointEndpoint with operations to manage groups of users.final ImagesEndpointEndpoint with operations to manage images.final ImpersonationEndpointEndpoint with operations to impersonate users.final LogsEndpointEndpoint with operations to manage logs.final OAuthClientsEndpointEndpoint with operations to manage OAuth clients.final OpenLineageEndpointEndpoint with operations to interact with OpenLineage.final PermissionsEndpointEndpoint with operations to introspect permissions.final PlaybooksEndpointEndpoint with operations to manage playbooks.final QueriesEndpointEndpoint with operations to run SQL queries.final QueryParserEndpointEndpoint with operations to manage query parsing.final RequestsEndpointEndpoint with operations to manage requests.final RolesEndpointEndpoint with operations to manage workspace roles.final SearchLogEndpointEndpoint with operations to search details of past searches.final SSOEndpointEndpoint with operations to manage SSO configuration.final TaskEndpointEndpoint with operations to manage background tasks.final TypeDefsEndpointEndpoint with operations to manage type definitions.final UsersEndpointEndpoint with operations to manage users.final WorkflowsEndpointEndpoint with operations to manage workflows.Fields inherited from interface com.atlan.model.core.AtlanCloseable
log -
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a new client.AtlanClient(String baseURL) Instantiate a new client.AtlanClient(String baseURL, String apiToken) Instantiate a new client.AtlanClient(String baseURL, String oauthClientId, String oauthClientSecret) Instantiate a new client.AtlanClient(String baseURL, String apiToken, String oauthClientId, String oauthClientSecret, String userId, boolean allowEscalation) Instantiate a new client. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthHeader(Map<String, List<String>> headers) Add the necessary authorization details to the headers for a request.voidclose()<T> TconvertValue(com.fasterxml.jackson.databind.JsonNode value, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Converts from a JSON representation into an object.<T> TconvertValue(com.fasterxml.jackson.databind.JsonNode value, Class<T> clazz) Converts from a JSON representation into an object.Information about your application.Client-aware asset deserializer.Cache of Atlan tags specific to this client.Client-aware Atlan tag deserializer.Retrieve the base URL for the tenant of Atlan configured in this client.Cache of connections specific to this client.Proxy to tunnel all Atlan connections.intTimeout value that will be used for making new connections to the Atlan API (in milliseconds).Client-aware custom metadata deserializer.Cache of custom metadata structures specific to this client.Cache of enums specific to this client.Extra headers to include on any requests made by this client.Cache of groups specific to this client.intMaximum number of times requests will be retried.Credential for proxy authorization if required.intTimeout value that will be used for reading a response from an API request (in milliseconds).Client-aware relationship attributes deserializer.Cache of workspace roles specific to this client.Cache of source-synced tags specific to this client.Cache of users specific to this client.booleanIndicates whether the SDK is configured for cluster-internal access (true) or external access (false).booleanisLocal()Indicates whether the SDK is configured to run against a locally-running development instance (true) or not (false).<T> TreadValue(byte[] value, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) Deserialize a string value into an object.<T> TDeserialize a byte-array value into an object.<T> TDeserialize a string value into an object.<T> TDeserialize a string value into an object.voidRefresh the bearer token used by this client.voidsetAppInfo(String name) Sets information about your application.voidsetAppInfo(String name, String version) Sets information about your application.voidsetAppInfo(String name, String version, String url) Sets information about your application.voidsetAppInfo(String name, String version, String url, String partnerId) Sets information about your application.voidsetConnectionProxy(Proxy connectionProxy) Proxy to tunnel all Atlan connections.voidsetConnectTimeout(int connectTimeout) Timeout value that will be used for making new connections to the Atlan API (in milliseconds).voidsetExtraHeaders(Map<String, List<String>> extraHeaders) Extra headers to include on any requests made by this client.voidsetMaxNetworkRetries(int maxNetworkRetries) Maximum number of times requests will be retried.voidsetProxyCredential(PasswordAuthentication proxyCredential) Credential for proxy authorization if required.voidsetReadTimeout(int readTimeout) Timeout value that will be used for reading a response from an API request (in milliseconds).voidConfirm the client is active (able to access information programmatically), by making and retrying a call that should retrieve details only when truly active.voidwriteValue(com.fasterxml.jackson.core.JsonGenerator g, Object value) Serialize an object through the providedJsonGenerator.<T> byte[]writeValueAsBytes(T value) Serialize an object into a JSON byte-array.<T> StringwriteValueAsString(T value) Serialize an object into a JSON string.
-
Field Details
-
DELETED_AUDIT_OBJECT
- See Also:
-
typeDefs
Endpoint with operations to manage type definitions. -
roles
Endpoint with operations to manage workspace roles. -
apiTokens
Endpoint with operations to manage API tokens. -
oauthClients
Endpoint with operations to manage OAuth clients. -
groups
Endpoint with operations to manage groups of users. -
users
Endpoint with operations to manage users. -
workflows
Endpoint with operations to manage workflows. -
queryParser
Endpoint with operations to manage query parsing. -
queries
Endpoint with operations to run SQL queries. -
playbooks
Endpoint with operations to manage playbooks. -
logs
Endpoint with operations to manage logs. -
images
Endpoint with operations to manage images. -
files
Endpoint with operations to manage files. -
assets
Endpoint with operations to manage assets. -
requests
Endpoint with operations to manage requests. -
impersonate
Endpoint with operations to impersonate users. -
permissions
Endpoint with operations to introspect permissions. -
searchLog
Endpoint with operations to search details of past searches. -
credentials
Endpoint with operations to manage credentials (of connectors). -
tasks
Endpoint with operations to manage background tasks. -
sso
Endpoint with operations to manage SSO configuration. -
openLineage
Endpoint with operations to interact with OpenLineage. -
contracts
Endpoint with operations to interact with data contracts.
-
-
Constructor Details
-
AtlanClient
public AtlanClient()Instantiate a new client. This will take the URL of the tenant from the environment variableATLAN_BASE_URLand the API token for accessing the tenant from the environment variableATLAN_API_KEY. -
AtlanClient
Instantiate a new client. This will take the API token for accessing the tenant from the environment variableATLAN_API_KEY(which will take precedence if available), or the OAuth client ID and secret from variablesATLAN_OAUTH_CLIENT_IDandATLAN_OAUTH_CLIENT_SECRET.- Parameters:
baseURL- of the tenant, includinghttps://
-
AtlanClient
Instantiate a new client.- Parameters:
baseURL- of the tenant, includinghttps://oauthClientId- clientId of the OAuth clientoauthClientSecret- secret for the OAuth client
-
AtlanClient
Instantiate a new client.- Parameters:
baseURL- of the tenant, includinghttps://apiToken- API token to use for accessing the tenant
-
AtlanClient
public AtlanClient(String baseURL, String apiToken, String oauthClientId, String oauthClientSecret, String userId, boolean allowEscalation) Instantiate a new client.- Parameters:
baseURL- of the tenant, includinghttps://apiToken- API Token to use for accessing the tenant (takes precedence if provided and non-empty)oauthClientId- clientId of the OAuth client to use for accessing the tenant (second-highest precedence)oauthClientSecret- secret for the OAuth client to use for accessing the tenantuserId- unique identifier (GUID) of a user through which to run (second-lowest precedence)allowEscalation- whether to allow privilege escalation (lowest precedence, only works in-tenant with appropriate config)
-
-
Method Details
-
readValue
Deserialize a string value into an object.- Type Parameters:
T- type of the deserialized object- Parameters:
value- the value to deserializeclazz- the expected object type of the deserialization- Returns:
- the deserialized object
- Throws:
IOException- on any errors doing the deserialization
-
readValue
Deserialize a byte-array value into an object.- Type Parameters:
T- type of the deserialized object- Parameters:
value- the value to deserializeclazz- the expected object type of the deserialization- Returns:
- the deserialized object
- Throws:
IOException- on any errors doing the deserialization
-
readValue
public <T> T readValue(String value, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws IOException Deserialize a string value into an object.- Type Parameters:
T- type of the deserialized object- Parameters:
value- the value to deserializetypeRef- the expected object type of the deserialization- Returns:
- the deserialized object
- Throws:
IOException- on any errors doing the deserialization
-
readValue
public <T> T readValue(byte[] value, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws IOException Deserialize a string value into an object.- Type Parameters:
T- type of the deserialized object- Parameters:
value- the value to deserializetypeRef- the expected object type of the deserialization- Returns:
- the deserialized object
- Throws:
IOException- on any errors doing the deserialization
-
convertValue
public <T> T convertValue(com.fasterxml.jackson.databind.JsonNode value, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) throws IllegalArgumentException Converts from a JSON representation into an object.- Type Parameters:
T- type of the deserialized object- Parameters:
value- the JSON representationtypeReference- the expected object type of the deserialization- Returns:
- the deserialized object
- Throws:
IllegalArgumentException- if conversion fails
-
convertValue
public <T> T convertValue(com.fasterxml.jackson.databind.JsonNode value, Class<T> clazz) throws IllegalArgumentException Converts from a JSON representation into an object.- Type Parameters:
T- type of the deserialized object- Parameters:
value- the JSON representationclazz- the expected object type of the deserialization- Returns:
- the deserialized object
- Throws:
IllegalArgumentException- if conversion fails
-
writeValueAsString
Serialize an object into a JSON string.- Type Parameters:
T- type of the object- Parameters:
value- the object to serialize- Returns:
- a string giving the JSON representing the object
- Throws:
IOException- on any errors doing the serialization
-
writeValueAsBytes
Serialize an object into a JSON byte-array.- Type Parameters:
T- type of the object- Parameters:
value- the object to serialize- Returns:
- a byte-array giving the JSON representing the object
- Throws:
IOException- on any errors doing the serialization
-
writeValue
Serialize an object through the providedJsonGenerator.- Parameters:
g- JSON generator through which to serialize the objectvalue- object to serialize- Throws:
IOException- on any errors doing the serialization
-
isInternal
public boolean isInternal()Indicates whether the SDK is configured for cluster-internal access (true) or external access (false).- Returns:
- boolean indicating whether the SDK is configured for cluster-internal access (true) or not (false)
-
isLocal
public boolean isLocal()Indicates whether the SDK is configured to run against a locally-running development instance (true) or not (false).- Returns:
- boolean indicating whether the SDK is configured for locally-running development instance (true) or not (false)
-
getBaseUrl
Retrieve the base URL for the tenant of Atlan configured in this client. -
setAppInfo
Sets information about your application. The information is passed along to Atlan.- Parameters:
name- Name of your application (e.g. "MyAwesomeApp")
-
setAppInfo
Sets information about your application. The information is passed along to Atlan.- Parameters:
name- Name of your application (e.g. "MyAwesomeApp")version- Version of your application (e.g. "1.2.34")
-
setAppInfo
Sets information about your application. The information is passed along to Atlan.- Parameters:
name- Name of your application (e.g. "MyAwesomeApp")version- Version of your application (e.g. "1.2.34")url- Website for your application (e.g. "https://myawesomeapp.info")
-
setAppInfo
Sets information about your application. The information is passed along to Atlan.- Parameters:
name- Name of your application (e.g. "MyAwesomeApp")version- Version of your application (e.g. "1.2.34")url- Website for your application (e.g. "https://myawesomeapp.info")partnerId- Your Atlan Partner ID (e.g. "pp_partner_1234")
-
addAuthHeader
Add the necessary authorization details to the headers for a request.- Parameters:
headers- to which to add the authorization details- Throws:
AtlanException- on any API communication issue
-
refreshToken
Refresh the bearer token used by this client.- Throws:
AtlanException- on any API communication issue
-
validateActive
Confirm the client is active (able to access information programmatically), by making and retrying a call that should retrieve details only when truly active.- Throws:
AtlanException- on any API communication issue during the active checkInterruptedException
-
close
public void close()- Specified by:
closein interfaceAtlanCloseable- Specified by:
closein interfaceAutoCloseable
-
getConnectTimeout
public int getConnectTimeout()Timeout value that will be used for making new connections to the Atlan API (in milliseconds). -
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Timeout value that will be used for making new connections to the Atlan API (in milliseconds). -
getReadTimeout
public int getReadTimeout()Timeout value that will be used for reading a response from an API request (in milliseconds). Note that this value should be set conservatively because some API requests can take time and a short timeout increases the likelihood of causing a problem in the backend. -
setReadTimeout
public void setReadTimeout(int readTimeout) Timeout value that will be used for reading a response from an API request (in milliseconds). Note that this value should be set conservatively because some API requests can take time and a short timeout increases the likelihood of causing a problem in the backend. -
getMaxNetworkRetries
public int getMaxNetworkRetries()Maximum number of times requests will be retried. -
setMaxNetworkRetries
public void setMaxNetworkRetries(int maxNetworkRetries) Maximum number of times requests will be retried. -
getExtraHeaders
Extra headers to include on any requests made by this client. -
setExtraHeaders
Extra headers to include on any requests made by this client. -
getConnectionProxy
Proxy to tunnel all Atlan connections. -
setConnectionProxy
Proxy to tunnel all Atlan connections. -
getProxyCredential
Credential for proxy authorization if required. -
setProxyCredential
Credential for proxy authorization if required. -
getAppInfo
Information about your application. -
getAtlanTagCache
Cache of Atlan tags specific to this client. -
getCustomMetadataCache
Cache of custom metadata structures specific to this client. -
getEnumCache
Cache of enums specific to this client. -
getGroupCache
Cache of groups specific to this client. -
getRoleCache
Cache of workspace roles specific to this client. -
getUserCache
Cache of users specific to this client. -
getConnectionCache
Cache of connections specific to this client. -
getSourceTagCache
Cache of source-synced tags specific to this client. -
getAssetDeserializer
Client-aware asset deserializer. -
getRelationshipAttributesDeserializer
Client-aware relationship attributes deserializer. -
getCustomMetadataAuditDeserializer
Client-aware custom metadata deserializer. -
getAtlanTagDeserializer
Client-aware Atlan tag deserializer.
-