Package com.atlan.api

Class ApiTokensEndpoint


public class ApiTokensEndpoint extends HeraclesEndpoint
API endpoints for managing Atlan's API tokens.
  • Constructor Details

    • ApiTokensEndpoint

      public ApiTokensEndpoint(AtlanClient client)
  • Method Details

    • list

      public ApiTokenResponse list() throws AtlanException
      Retrieves a list of the 20 most recently created tokens defined in Atlan.
      Returns:
      a list of the 20 most recently created tokens in Atlan
      Throws:
      AtlanException - on any API communication issue
    • list

      public ApiTokenResponse list(RequestOptions options) throws AtlanException
      Retrieves a list of the 20 most recently created tokens defined in Atlan.
      Parameters:
      options - to override default client settings
      Returns:
      a list of the 20 most recently created tokens in Atlan
      Throws:
      AtlanException - on any API communication issue
    • list

      public ApiTokenResponse list(String filter, String sort, int offset, int limit) throws AtlanException
      Retrieves a list of the API tokens defined in Atlan.
      Parameters:
      filter - which tokens to retrieve
      sort - property by which to sort the results
      offset - starting point for results to return, for paging
      limit - maximum number of results to be returned
      Returns:
      a list of tokens that match the provided criteria
      Throws:
      AtlanException - on any API communication issue
    • list

      public ApiTokenResponse list(String filter, String sort, int offset, int limit, RequestOptions options) throws AtlanException
      Retrieves a list of the API tokens defined in Atlan.
      Parameters:
      filter - which tokens to retrieve
      sort - property by which to sort the results
      offset - starting point for results to return, for paging
      limit - maximum number of results to be returned
      options - to override default client settings
      Returns:
      a list of tokens that match the provided criteria
      Throws:
      AtlanException - on any API communication issue
    • get

      public ApiToken get(String displayName) throws AtlanException
      Retrieves the API token with a name that exactly matches the provided string.
      Parameters:
      displayName - 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 null if there is none
      Throws:
      AtlanException - on any error during API invocation
    • getById

      public ApiToken getById(String clientId) throws AtlanException
      Retrieves the API token with a client ID that exactly matches the provided string.
      Parameters:
      clientId - unique client identifier by which to retrieve the API token
      Returns:
      the API token whose cliendId matches the provided string, or null if there is none
      Throws:
      AtlanException - on any error during API invocation
    • getByGuid

      public ApiToken getByGuid(String guid) throws AtlanException
      Retrieves the API token with a unique ID (GUID) that exactly matches the provided string.
      Parameters:
      guid - unique identifier by which to retrieve the API token
      Returns:
      the API token whose GUID matches the provided string, or null if there is none
      Throws:
      AtlanException - on any error during API invocation
    • create

      public ApiToken create(String displayName, String description, Set<String> personas, Long validitySeconds) throws AtlanException
      Create a new API token with the provided settings.
      Parameters:
      displayName - human-readable name for the API token
      description - optional explanation of the API token
      personas - unique names (qualifiedNames) of personas that should be linked to the token
      validitySeconds - time in seconds after which the token should expire
      Returns:
      the created API token
      Throws:
      AtlanException - on any API communication issue
    • create

      public ApiToken create(String displayName, String description, Set<String> personas, Long validitySeconds, RequestOptions options) throws AtlanException
      Create a new API token with the provided settings.
      Parameters:
      displayName - human-readable name for the API token
      description - optional explanation of the API token
      personas - unique names (qualifiedNames) of personas that should be linked to the token
      validitySeconds - time in seconds after which the token should expire
      options - to override default client settings
      Returns:
      the created API token
      Throws:
      AtlanException - on any API communication issue
    • update

      public ApiToken update(String guid, String displayName, String description, Set<String> personas) throws AtlanException
      Update an existing API token with the provided settings.
      Parameters:
      displayName - human-readable name for the API token
      description - optional explanation of the API token
      personas - unique names (qualifiedNames) of personas that should be linked to the token
      Returns:
      the updated API token
      Throws:
      AtlanException - on any API communication issue
    • update

      public ApiToken update(String guid, String displayName, String description, Set<String> personas, RequestOptions options) throws AtlanException
      Update an existing API token with the provided settings.
      Parameters:
      guid - unique identifier (GUID) of the API token
      displayName - human-readable name for the API token
      description - optional explanation of the API token
      personas - unique names (qualifiedNames) of personas that should be linked to the token
      options - to override default client settings
      Returns:
      the updated API token
      Throws:
      AtlanException - on any API communication issue
    • purge

      public void purge(String guid) throws AtlanException
      Delete (purge) the specified API token.
      Parameters:
      guid - unique identifier (GUID) of the API token to delete
      Throws:
      AtlanException - on any API communication issue
    • purge

      public void purge(String guid, RequestOptions options) throws AtlanException
      Delete (purge) the specified API token.
      Parameters:
      guid - unique identifier (GUID) of the API token to delete
      options - to override default client settings
      Throws:
      AtlanException - on any API communication issue