Skip to main content

Python client library for AWS DevOps Agent API using boto3

Project description

Community DevOps Agent API - boto3 Service Integration

Python Version License PyPI version

A Python client library that provides native boto3 integration for AWS DevOps services. This library registers multiple custom boto3 services, enabling familiar AWS SDK patterns for DevOps operations.

๐ŸŽ‰ NEW: AWS DevOps Agent Control Plane Service Integration

โœ… Fully Functional: The library now includes complete boto3 integration for the AWS DevOps Agent Control Plane service (community-aidevops), providing access to Agent Spaces, Service Associations, and Operator Applications.

๐Ÿš€ Key Features:

  • 23 API Operations across Agent Spaces, Associations, Services, and Operators
  • Native boto3 Client: boto3.client('community-aidevops', region_name='us-east-1')
  • Full Pagination Support with automatic paginators
  • Comprehensive Error Handling with specific exception types
  • Production Ready with proper endpoint configuration

๐Ÿ“‹ Available Operations:

  • Agent Space Operations (5): create_agent_space, get_agent_space, update_agent_space, delete_agent_space, list_agent_spaces
  • Association Operations (3): associate_service, disassociate_service, get_association
  • Service Operations (9): register_service, deregister_service, get_service, list_services, search_service_accessible_resource, etc.
  • Operator Operations (4): enable_operator_app, disable_operator_app, update_operator_app_teams, get_operator_app_teams

๐Ÿ”ง Quick Start with DevOps Agent Control Plane:

import devopsagent_api  # Registers all services
import boto3

# Create client for AWS DevOps Agent Control Plane
client = boto3.client('community-aidevops', region_name='us-east-1')

# List agent spaces
response = client.list_agent_spaces()
for space in response['agentSpaces']:
    print(f"Agent Space: {space['name']} (ID: {space['agentSpaceId']})")

# Create a new agent space
response = client.create_agent_space(
    name='my-devops-space',
    description='Development operations workspace'
)
print(f"Created agent space: {response['agentSpace']['agentSpaceId']}")

๐Ÿ“‹ Service Overview

This library provides boto3 integration for two AWS DevOps services:

1. Community DevOps Agent (community-devops-agent)

  • Service: Original DevOps Agent API for task management, goals, and recommendations
  • API Version: 2025-12-09
  • Use Case: AI-powered DevOps operations and automation

2. AWS DevOps Agent Control Plane (community-aidevops)

  • Service: AWS DevOps Agent Control Plane for managing agent spaces and service associations
  • API Version: 2018-05-10
  • Use Case: Infrastructure management for DevOps agents and service integrations

๐Ÿš€ Quick Start

Basic Usage

import devopsagent_api  # Registers the service
import boto3

# Create a client using standard boto3 patterns
client = boto3.client('community-devops-agent', region_name='us-east-1')

# List tasks with filtering
response = client.list_tasks(
    agentSpaceId='your-agent-space-uuid',
    filter={'status': ['IN_PROGRESS', 'PENDING_START']}
)

for task in response['tasks']:
    print(f"Task: {task['title']} - Status: {task['status']}")

Using Configuration Module (Recommended)

import devopsagent_api  # Registers the service
from examples.config import get_config

# Get configuration with environment variable support
config = get_config()

# Create configured client
client = config.get_client()

# List tasks using configured settings
response = client.list_tasks(
    agentSpaceId=config.agent_space_id,
    filter={'status': ['IN_PROGRESS', 'PENDING_START']}
)

for task in response['tasks']:
    print(f"Task: {task['title']} - Status: {task['status']}")

๐Ÿ“ฆ Installation

From PyPI (Recommended)

pip install devopsagent-api

From Source

git clone https://github.com/stefansaftic/community-devops-agent.git
cd devopsagent-api
pip install -e .

Development Installation

pip install -e ".[dev]"

๐Ÿ”ง Requirements

  • Python 3.8+
  • AWS credentials configured (via AWS CLI, environment variables, or IAM roles)
  • Access to AWS DevOps Agent service

โš™๏ธ Configuration

Environment Variables

The library supports configuration through environment variables for flexible deployment:

Variable Description Default Required
AGENT_SPACE_ID Your DevOps Agent space UUID None Yes (for API calls)
AWS_REGION AWS region for API calls us-east-1 No
AWS_PROFILE AWS CLI profile to use Default profile No
USER_ID User ID for chat messages UUID 4be32b4a-9675-4dc0-97ff-7126ad28457c No
POLL_INTERVAL Polling interval in seconds 2 No
DEFAULT_LIMIT Default pagination limit 10 No
TIMEOUT_SECONDS Default timeout in seconds 60 No
MAX_CHECKS Maximum number of status checks 10 No

AWS Credentials Setup

Option 1: AWS CLI (Recommended)

aws configure
# Enter your AWS Access Key ID, Secret Access Key, and default region

Option 2: Environment Variables

export AWS_ACCESS_KEY_ID=your-access-key
export AWS_SECRET_ACCESS_KEY=your-secret-key
export AWS_REGION=us-east-1

Option 3: AWS Credentials File

# ~/.aws/credentials
[default]
aws_access_key_id = your-access-key
aws_secret_access_key = your-secret-key

# ~/.aws/config
[default]
region = us-east-1

Configuration Module

All examples use a centralized configuration module (examples/config.py) that provides:

  • Dynamic service discovery: Automatically detects available waiters, paginators, and operations
  • Environment variable support: All configuration values can be overridden via environment variables
  • Validation: Checks for required settings and service registration
  • Consistent defaults: Sensible defaults for all configuration options

Usage:

from examples.config import get_config

config = get_config()
config.print_configuration()  # Shows current settings

client = config.get_client()  # Creates configured boto3 client

๐Ÿ“š Documentation

๐ŸŽฏ Features

Native boto3 Integration

  • Standard boto3 client creation: boto3.client('community-devops-agent')
  • Automatic pagination with client.get_paginator()
  • Waiters for long-running operations: client.get_waiter()
  • Built-in retry logic and error handling

Complete API Coverage

  • Task Management: Create, list, get, and update tasks
  • Goal Management: Automated workflow management
  • Recommendation Engine: AI-generated improvement suggestions
  • Journal API: Execution history and investigation records
  • Topology API: GraphQL infrastructure discovery
  • Support Integration: AWS Support case management

Type Safety & Validation

  • Full Pydantic model validation
  • Type hints throughout the codebase
  • IDE autocomplete support
  • Runtime data validation

๐Ÿ› ๏ธ Development

Setup Development Environment

# Clone the repository
git clone https://github.com/stefansaftic/community-devops-agent.git
cd devopsagent-api

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
black devopsagent_api/
flake8 devopsagent_api/
mypy devopsagent_api/

Project Structure

community-devops-agent/
โ”œโ”€โ”€ devopsagent_api/              # Main library package
โ”‚   โ”œโ”€โ”€ __init__.py               # Service registration & exports
โ”‚   โ”œโ”€โ”€ auth.py                   # Custom credential provider
โ”‚   โ”œโ”€โ”€ models.py                 # Pydantic data models
โ”‚   โ”œโ”€โ”€ exceptions.py             # Custom exception classes
โ”‚   โ”œโ”€โ”€ data/                     # boto3 service model data
โ”‚   โ”‚   โ”œโ”€โ”€ community-devops-agent/    # Original DevOps Agent API
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ 2025-12-09/            # API version directory
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ service-2.json
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ paginators-1.json
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ waiters-2.json
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ endpoint-rule-set-1.json
โ”‚   โ”‚   โ””โ”€โ”€ community-aidevops/        # AWS DevOps Agent Control Plane
โ”‚   โ”‚       โ””โ”€โ”€ 2018-05-10/            # API version directory
โ”‚   โ”‚           โ”œโ”€โ”€ service-2.json
โ”‚   โ”‚           โ”œโ”€โ”€ paginators-1.json
โ”‚   โ”‚           โ”œโ”€โ”€ waiters-2.json
โ”‚   โ”‚           โ””โ”€โ”€ endpoint-rule-set-1.json
โ”‚   โ””โ”€โ”€ loaders/                  # Custom service loader
โ”œโ”€โ”€ examples/                     # Usage examples
โ”‚   โ”œโ”€โ”€ list_agent_spaces.py      # NEW: DevOps Agent Control Plane example
โ”‚   โ””โ”€โ”€ ...                       # Other examples
โ”œโ”€โ”€ tests/                        # Test suite
โ”œโ”€โ”€ docs/                         # Sphinx documentation
โ”œโ”€โ”€ devopsagent_api.egg-info/      # Package metadata
โ”œโ”€โ”€ test_venv/                    # Test virtual environment
โ”œโ”€โ”€ LICENSE                       # Apache 2.0 license
โ”œโ”€โ”€ requirements.txt              # Python dependencies
โ”œโ”€โ”€ pyproject.toml                # Modern Python packaging
โ”œโ”€โ”€ setup.py                      # Traditional packaging
โ”œโ”€โ”€ README.md                     # This file
โ”œโ”€โ”€ publish.py                    # Publishing utilities
โ”œโ”€โ”€ .readthedocs.yaml             # ReadTheDocs configuration
โ””โ”€โ”€ .gitignore                    # Git ignore patterns

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes and add tests
  4. Run the test suite: pytest
  5. Format code: black devopsagent_api/
  6. Check types: mypy devopsagent_api/
  7. Submit a pull request

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

This library is built upon the AWS DevOps Agent API and integrates with the boto3 ecosystem to provide a seamless experience for AWS developers.

๐Ÿ“ž Support


Note: This is a community-built client library for the AWS DevOps Agent API. It is not an official AWS product.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devopsagent_api-1.0.3.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devopsagent_api-1.0.3-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

Details for the file devopsagent_api-1.0.3.tar.gz.

File metadata

  • Download URL: devopsagent_api-1.0.3.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for devopsagent_api-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3e8d4a6d470db2529e7156e8a323e79cdbd46b37d70cb7bc5cc3059dd7193348
MD5 1a83fa79c7fc90c6a8267b0209c286d6
BLAKE2b-256 e59c2af59f1cd4677e958c6724d78907818f09d5f78289997e286f95bfedf70c

See more details on using hashes here.

File details

Details for the file devopsagent_api-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for devopsagent_api-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 29cb9297768258713f84c9a89f66a14030291d5ae54d9870c57eae89f4e1d6aa
MD5 90d559c990356d65dc9e14d646bfbe21
BLAKE2b-256 7b4e8d183157c19fc4595959e82e0009f693c3f2401095d6c9e669de9fc2792d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page