A user-friendly command-line tool for managing and auditing Akamai CDN configurations. This tool helps you easily view and manage your Akamai properties, hostnames, and SSL certificates without navigating through the complex Akamai Control Center.
- Features
- Why Use This Tool?
- Prerequisites
- Quick Start
- Detailed Setup
- Usage Guide
- Configuration
- Example Workflows
- Troubleshooting
- Code Structure
- Contributing
- License
-
Property Management
- π View all your Akamai properties in a simple list
- π See all hostnames associated with each property
-
Hostname Analysis
- π Resolve edge hostnames to their IP addresses
- π Compare production and staging configurations
- π Export hostname data in Confluence-ready formats
-
SSL Certificate Management
- π List all certificate enrollments
- π View detailed certificate configurations
- π Check certificate status across environments
-
Performance & Usability
- β‘ Intelligent caching of API responses for faster operation
- π Export data as HTML or Markdown tables for documentation
- π Multi-threaded processing for faster data retrieval
- Save Time: Get all your Akamai configuration data without navigating through the Akamai Control Center
- Documentation: Generate formatted tables for your team documentation
- Auditing: Easily review your Akamai configurations across multiple properties
- Troubleshooting: Quickly verify DNS configurations and certificate statuses
- Python 3.6 or higher
- Akamai API credentials with access to:
- Property Manager API (PAPI)
- Certificate Provisioning System API (CPS)
- Basic knowledge of Akamai CDN concepts
# Clone the repository
git clone https://github.com/yourusername/akamai-api-manager.git
# Navigate to the project directory
cd akamai-api-manager
# Set up virtual environment and install dependencies
python -m venv akamai-venv
source akamai-venv/bin/activate # On Windows: akamai-venv\Scripts\activate
pip install -r requirements.txt
# Configure your credentials (see Detailed Setup below)
# Run the tool
python main.py
git clone https://github.com/yourusername/akamai-api-manager.git
cd akamai-api-manager
# Create a virtual environment
python -m venv akamai-venv
# Activate the virtual environment
# On macOS/Linux:
source akamai-venv/bin/activate
# On Windows:
akamai-venv\Scripts\activate
pip install -r requirements.txt
[papi]
client_secret = your_client_secret
host = akab-xxxxxxxxxxxxx.luna.akamaiapis.net
access_token = akab-xxxxxxxxxxxxx
client_token = akab-xxxxxxxxxxxxx
AKAMAI_CONTRACT_ID='your_contract_id'
AKAMAI_GROUP_ID='your_group_id'
OR
Copy the .env.example
file to .env
and add your Akamai credentials:
cp .env.example .env
# Then edit .env with your details
To find your contract ID and group ID:
- Log in to the Akamai Control Center
- Navigate to Property Manager
- Look at the URL - you'll see something like
/papi/v1/groups/XXXXX/contracts/YYYYY/
- Your group ID is XXXXX and contract ID is YYYYY
# Start with normal caching (faster for repeated queries)
python main.py
# Start with fresh data on each query (slower but always up-to-date)
python main.py --non-cache
When you run the application, you'll see this menu:
Select operation:
1. List All Properties
2. Get Hostnames for a Property
3. Manage SSL Certificates (CPS)
4. Exit
This option shows all properties and their hostnames:
- Lists property names and IDs
- Shows all hostnames associated with each property
- Provides Confluence-ready tables for documentation
This option provides detailed information for a selected property:
- Shows CNAME mappings
- Displays edge hostname details
- Resolves IP addresses for both production and staging
- Shows certificate status
- Generates formatted tables for documentation
This submenu provides certificate management options:
=== SSL Certificate Management (CPS) ===
1. List All Certificate Enrollments
2. Get Detailed Certificate Information
3. Return to Main Menu
- List All Enrollments: Shows all certificates with their basic information
- Get Detailed Information: Provides in-depth technical details about a specific certificate
- You can save certificate details to a file for documentation
--non-cache
: Disables caching of API responses, ensuring fresh data on each query
Edit the .env
file to change:
AKAMAI_CONTRACT_ID
: Your Akamai contract IDAKAMAI_GROUP_ID
: Your Akamai group ID
- Run
python main.py
- Select option 1: "List All Properties"
- Review the list of all properties and their hostnames
- Copy the HTML or Markdown table for documentation
- Run
python main.py
- Select option 3: "Manage SSL Certificates (CPS)"
- Select option 1: "List All Certificate Enrollments"
- Identify the certificate you want to examine
- Return to the certificate menu and select option 2
- Enter the number of the certificate to see detailed information
- Choose to save the details to a file if needed
If you see authentication errors:
- Verify your
.edgerc
file has the correct credentials - Check that your API user has the necessary permissions
- Ensure your credentials haven't expired
If properties or hostnames are missing:
- Verify your contract ID and group ID in the
.env
file - Check that your API user has access to those properties
- Try running with the
--non-cache
flag to fetch fresh data
If IP address resolution fails:
- Check your internet connection
- Verify the hostname exists and is correctly configured
- There might be DNS propagation delays if changes were recently made
main.py
- Main application entry point and interactive menuutils.py
- Utility functions for DNS resolution and table generationakamai_papi.py
- Functions for interacting with Akamai Property Manager APIakamai_cps.py
- Functions for interacting with Akamai Certificate Provisioning System API
Contributions are welcome and appreciated! Here's how you can contribute:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add some amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
Please make sure your code follows the existing style and includes appropriate comments.
This project is licensed under the MIT License - see the LICENSE file for details. You are free to use, modify, and distribute this code as you wish.