Refresh Access Tokens
This recipe checks if API and Refresh Tokens have expired and creates new ones when needed.
The idea is that the script can be run daily and it will make sure that a valid refresh and API token always exist so that other scripts that depend on them can always authenticate.
Written using Python 3.
- Declare libraries
- Set the catalog url and token file name
- Open, read the token file, and close it
This recipe checks if API and Refresh Tokens have expired and creates new ones when needed.
The idea is that the script can be run daily and it will make sure that a valid refresh and API token always exist so that other scripts that depend on them can always authenticate.
Written using Python 3.
This recipe shows how to use the OAuth 2.0 API v2 to authenticate Alation API calls. To use this recipe, you must be an Alation Cloud Service customer on the cloud-native architecture.
Written using Python 3.
This recipe demonstrates how to use the Alation API pagination feature by paginating through all columns in a BI report. Pagination is the process of looping through batches of assets until all have been processed.
Almost all Alation APIs use the same pagination technique so this example can be applied as a general pattern beyond BI reports.
Written in Python 3.
This recipe demonstrates how to use the Alation API pagination feature by paginating through all articles in a catalog. Pagination is the process of looping through batches of assets until all have been processed.
Almost all Alation APIs use the same pagination technique so this example can be applied as a general pattern beyond articles.
Written in Python 3.
This recipe uses the Relational API to get all the schemas for a specific data source.
Written in Python 3.
This recipe uses the Relational Integration API to get the details for a table with a specific ID.
Written using Python 3.
This recipe uses the Relational Integration API to get all tables where a specific custom field is set to a specific value.
Written using Python 3.
This recipe uses the Relational Integration API to update custom field values for a specific table.
It then uses the Job API to monitor and indicate when the update is completed.
Written using Python 3.
This recipe uses the Relational Integration API to create a new column for a specific table.
It then uses the Job API to monitor and indicate when the creation has completed.
Written using Python 3.
This recipe uses the DataFlow API to create a new dataflow object.
It then uses the Job API to monitor and indicate when the creation is completed.
Written using Python 3.
This recipe uses the Relational Integration API to delete a specific table.
It then uses the Job API to monitor and indicate when the delete is completed.
Written using Python 3.
This recipe uses the DataFlow API to delete a dataflow object.
It then uses the Job API to monitor and indicate when the deletion is completed.
Written using Python 3.
This recipe uses the DataFlow API to retrieve details of a dataflow object.
Written using Python 3.
This recipe uses the Lineage API to create a new lineage relationship between two tables.
It then uses the Job API to monitor and indicate when the creation is completed.
Written using Python 3.
This recipe uses the BI Source API to find a specific BI folder in a BI source.
Then it uses the Custom Field ID to find the rich text custom fields on that BI folder and update its value.
This recipe uses the Relational Integration API to get a specific table.
It then uses Upload Logical Metadata API to update two custom fields for the table.
Finally, it uses the Flag API to update a flag for the table.
This recipe uses the Search API to find all columns where the name includes 'lname'.
Written in Python 3.
This recipe uses the Search API to find a specific glossary by name.
Written in Python 3.
This recipe uses the Tags API to demonstrate how to read a pipe-delimited csv file and add tags to columns in an Alation catalog.
Written in Python 3.
This recipe uses the Term API to add terms with titles and descriptions to the catalog.
It reads from a CSV file and also checks to see if the term already exists.
Written in Python 3.
This recipe uses the Relational Integration API to retrieve the steward ID for a column. It then uses the Groups API or User API to get the name depending on whether the steward is a group or a user.
Written in Python 3.
This script uses a pipe-delimited CSV file containing query titles, descriptions, and SQL to create queries in a catalog data source and give them a name.
It's different from the builtin SQL upload capability in the following ways:
- It creates Compose queries not historical queries
- It gives the queries a name
- It gives the queries a description
- It allows the user to upload the queries as draft or saved
- It gives queries a tag
The user should understand that it will not update existing queries. New queries
will be created each time. Also, keep in mind that queries can not be deleted (only discarded).
Written in Python 3.
This recipe uses the Search API to get the total number of columns in the catalog.
The number of columns is a byproduct of the search returning the total number of assets.
Written in Python 3.
This recipe uses the User API to loop through all users and write them out to a CSV file.
Written in Python 3.
This recipe uses the Domains API to demonstrate how to add or remove an asset from membership in the domain.
Written in Python 3.
This recipe writes all the queries for a data source to a CSV file.
Written in Python 3.
This recipe finds the top queries for each data source schema.
Written in Python 3.
This recipe uses the Query API to retreive the latest results of Compose queries and add them to a Pandas dataframe.
Written in Python 3.
This recipe uses the Relational Integration API, BI Source API, Article API, Flag API, and Token API.
It checks for flags on each source and creates a single HTML health status table that is updated in the body of an article.
It can be used to give users a single, consolidated view of data source health.
This recipe uses the Alation Agent API to download, install, and configure an Alation Agent and connect the Agent to Alation. This recipe is written to work on all supported Linux varieties out of the box.
Written in Python 3.
Use this recipe to set up an existing Agent on a new machine. This recipe uses the Alation Agent API to download, install, and configure an Alation Agent and connect the Agent to Alation, then reinstall its connectors. This recipe is written to work on all supported Linux varieties out of the box.
Written in Python 3.
This recipe will reinstall all connectors on an existing agent.
Written in Python 3.
This recipe demonstrates how to use the search API to find all objects belonging to a domain
This recipe uses the Custom Field API to create Custom Fields in bulk. It will return a Job ID, which can be used in the Job API to monitor and indicate when the bulk creation has completed.
Written in Python 3
This recipe can be used to create one or more business policies.
Written using Python 3.
This recipe can be used to update one or more business policies.
Written using Python 3.
This recipe can be used to create one or more workflow change requests.
NOTE - The Create a request endpoint only allows a single workflow request at a time. This script shows how to create the workflow requests with sequential API requests.
Written using Python 3.
This recipe can be used to review one or more workflow change requests.
NOTE - The Approve a review request and Reject a review request endpoints only allow a single workflow request review at a time. This script shows how to review the workflow requests with sequential API requests.
Written using Python 3.
This recipe demonstrates how to migrate child articles to a new parent article in the Alation catalog.
Written using Python 3.
This recipe can be used to upload one or more data dictionary CSV files. Examples are included for data dictionaries starting at the data source level, schema level, and table level.
Written using Python 3, Shell (Bash), Node JS, and PHP (curl).
This recipe can be used to manage user and group permissions for one or more tables in the data catalog.
Written using Python 3, Shell (Bash), Node JS, and PHP (curl).
This recipe can be used to bulk create documents in the data catalog using JSON payload define in a separate file.
The expected JSON payload can be created using the Create documents endpoint.
Written using Python 3, Shell (Bash), Node JS, and PHP (curl).
The script uses Alation REST APIs to update multipicker custom fields for a set of objects specified in a CSV file. It preserves existing values and appends new ones based on predefined variables.
Written in Python 3.
This recipe can be used to bulk add data into a virtual NoSQL data source in the data catalog using a JSON payload defined in a separate file.
The expected JSON payload can be created using the Create NoSQL metadata endpoint.
Written using Python 3, Shell (Bash), Node JS, and PHP (curl).
This recipe can be used to get a listing of built-in and custom fields that are configured in the folder templates assigned to each Document Hub folder.
This recipe does not need external files, only the base URL and access token values need to be updated.
Written using Python 3, Shell (Bash), Node JS, and PHP (curl).
This recipe can be used to bulk create folders in one or more different Document Hubs in the data catalog using a JSON payload defined in a separate file.
The expected JSON payload can be created using the Create folders endpoint.
Written using Python 3, Shell (Bash), Node JS, and PHP (curl).
This recipe can be used to manage the synonym manifest that is used for Synonym Search.
The expected JSON payload must contain a properly formatted listing of synonym pairs.
Written using Python 3, Shell (Bash), Node JS, and PHP (curl).
This recipe can be used to manage homepage preferences for one or more groups using a CSV file.
Written using Python 3, Shell (Bash), Node JS (node-fetch), and PHP (curl).
This recipe is intended to help you identify articles that have attachments in your instance of Alation.
This information should help you rationalize the attachments that currently reside on your instance in order to retire them or move them to a different platform before performing article migration to the new document structure.
NOTE: Currently, Legacy Attachments are migrated, but will be inaccessible soon. New attachments cannot be added to documents.
Written using Python 3, Shell (Bash), Node JS (node-fetch), and PHP (curl).