How to integrate the Azion Console and the Azion API using the Console Kit
Azion Console Kit allows you to craft a custom Azion interface to fit your business needs. In this guide, you’ll learn how to show more information from the Azion API on the Console.
To integrate external APIs with the Azion Console interface, you can create a new API Axios service under src/services/axios
, adapt each service as required, and follow the steps below.
Get data from the Azion API and show on the Console interface
In this example, you’ll modify a service in the Console to show two additional fields from the Azion API in the cache settings table of the edge application.
The goal is to show the TTL values for browser and edge cache, informed by the browser_cache_settings_maximum_ttl
and cdn_cache_settings_maximum_ttl
properties in the Cache Settings API. To do so:
- Open the Console Kit project in your IDE.
- Run
azion dev
to initialize a local development server. - In the
src/services
folder, locate thelist-cache-settings-service.js
and add the new properties to the map:
- Now locate the Cache Settings list view and modify it as follows:
- On the browser, access the localhost address and navigate to the Edge Applications page.
- Create an edge application or select an existing one.
- Navigate to the Cache Settings tab. You should now see the new columns appear in the UI.
- After you’re done, run
azion deploy
to launch the changes to the edge.
You can follow this same process to show additional API values by retrieving the property using the service and adding it to the table.