pingera-sdk


Namepingera-sdk JSON
Version 1.0.9 PyPI version JSON
download
home_pagehttps://github.com/pingera/pingera-sdk
SummaryPython SDK for the Pingera monitoring platform API
upload_time2025-10-09 20:31:21
maintainerNone
docs_urlNone
authorPingera Team
requires_python>=3.9
licenseMIT
keywords pingera monitoring api sdk status-page incidents components
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Pingera SDK

A comprehensive Python SDK for the [Pingera monitoring platform API](https://api.pingera.ru), built using OpenAPI Generator for full type safety and complete API coverage.

## Features

- **Complete API Coverage**: Auto-generated from the official OpenAPI specification
- **Type Safety**: Full type hints and Pydantic model validation
- **Easy Authentication**: Support for Bearer tokens and API keys
- **Comprehensive**: All Pingera API endpoints supported:
  - Status Pages Management
  - Status Pages (Components & Incidents)
  - Monitoring Checks
  - Heartbeats
  - Alerts
  - On-demand Checks
  - Unified Results

## Installation

```bash
pip install pingera-sdk
```

Or install from source:

```bash
git clone https://github.com/pingera/pingera-sdk.git
cd pingera-sdk
pip install -e .
```

## Quick Start

### Authentication

Set your API token via environment variable:

```bash
export PINGERA_API_KEY="your_api_token"
```

### Basic Usage

```python
from pingera import ApiClient, Configuration
from pingera.api import ChecksApi, StatusPagesComponentsApi

# Configure the client
configuration = Configuration()
configuration.host = "https://api.pingera.ru"
configuration.api_key['apiKeyAuth'] = "your_api_token"

# Create API client
with ApiClient(configuration) as api_client:
    # Initialize API instances
    checks_api = ChecksApi(api_client)
    components_api = StatusPagesComponentsApi(api_client)
    
    # List status pages
    status_pages_api = StatusPagesApi(api_client)
    pages = status_pages_api.v1_pages_get()
    print(f"Found {len(pages.data)} status pages")
    
    # List monitoring checks
    checks = checks_api.v1_checks_get(page=1, page_size=10)
    print(f"Found {len(checks.checks)} checks")
    
    # List components for a status page
    components = components_api.v1_pages_page_id_components_get("your_page_id")
    print(f"Found {len(components.data)} components")
```

### Available APIs

The SDK provides access to all Pingera API endpoints through these API classes:

```python
from pingera.api import (
    StatusPagesApi,              # Manage status pages
    StatusPagesComponentsApi,    # Manage status page components
    StatusPagesIncidentsApi,     # Manage incidents and maintenance
    ChecksApi,                   # Manage monitoring checks
    AlertsApi,                   # Manage alerts and notifications
    HeartbeatsApi,               # Manage heartbeat monitoring
    OnDemandChecksApi,           # Execute checks on-demand
    ChecksUnifiedResultsApi      # Get unified check results
)
```

### Working with Models

All API requests and responses use typed Pydantic models:

```python
from pingera.models import (
    Component,
    IncidentCreate,
    IncidentUpdateCreate,
    ExecuteCustomCheckRequest
)

# Create a new component
new_component = Component(
    name="API Server",
    description="Main API endpoint",
    status="operational"
)

# Create an incident
new_incident = IncidentCreate(
    name="Database Connectivity Issues", 
    body="We are investigating connectivity issues",
    status="investigating",
    impact="major"
)
```

## Examples

Check the `examples/` directory for comprehensive usage examples:

- [`basic_usage.py`](examples/basic_usage.py) - Basic client setup and operations
- [`status_pages_management.py`](examples/status_pages_management.py) - Status pages CRUD operations
- [`component_management.py`](examples/component_management.py) - Component CRUD operations
- [`incident_management.py`](examples/incident_management.py) - Incident and maintenance management
- [`comprehensive_sdk_usage.py`](examples/comprehensive_sdk_usage.py) - Comprehensive API demonstration
- [`on_demand_synthetic_check.py`](examples/on_demand_synthetic_check.py) - Execute synthetic check with playwright script and get the result

## Configuration

### Environment Variables

| Variable | Description |
|----------|-------------|
| `PINGERA_API_KEY` | Your Pingera API token |
| `PINGERA_PAGE_ID` | Default page ID for status page operations |

### Manual Configuration

```python
from pingera import Configuration

configuration = Configuration()
configuration.host = "https://api.pingera.ru"

# API token authentication
configuration.api_key['apiKeyAuth'] = "your_api_token"

# Optional: configure timeouts, retries, etc.
configuration.timeout = 30
```

## Error Handling

The SDK uses proper exception handling:

```python
from pingera.exceptions import ApiException

try:
    checks = checks_api.v1_checks_get()
except ApiException as e:
    print(f"API Error [{e.status}]: {e.reason}")
    if e.body:
        print(f"Details: {e.body}")
```

## Development

### Regenerating the Client

If the Pingera API specification changes, you can regenerate the client:

```bash
# Install the OpenAPI generator
pip install openapi-generator-cli[jdk4py]

# Regenerate the client
python generate_client.py
```

### Running Tests

```bash
pip install -e ".[dev]"
pytest
```

### Running Examples

```bash
# Set your credentials
export PINGERA_API_KEY="your_api_token"
export PINGERA_PAGE_ID="your_page_id"

# Run examples
python examples/basic_usage.py
python examples/component_management.py
python examples/incident_management.py
```

## API Documentation

For detailed API documentation, visit:
- [Official Pingera API Docs](https://docs.pingera.ru/api/overview)
- [Generated Client Docs](client/README.md)

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Run the test suite
6. Submit a pull request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

- 📧 Email: [privet@pingera.ru](mailto:privet@pingera.ru)  
- 📖 Documentation: [docs.pingera.ru](https://docs.pingera.ru)
- 🌐 Website: [pingera.ru](https://pingera.ru)
- 📊 Status: [status.pingera.ru](https://status.pingera.ru)

## Links

- [Pingera Platform](https://app.pingera.ru)
- [API Documentation](https://docs.pingera.ru/api/overview)
- [Status Page](https://status.pingera.ru)
- [Website](https://pingera.ru)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pingera/pingera-sdk",
    "name": "pingera-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "pingera, monitoring, api, sdk, status-page, incidents, components",
    "author": "Pingera Team",
    "author_email": "Pingera Team <privet@pingera.ru>",
    "download_url": "https://files.pythonhosted.org/packages/92/9a/a4a82aa84b1e829611a0fa48583a47d210e81d62788e23ed8bcd24354777/pingera_sdk-1.0.9.tar.gz",
    "platform": null,
    "description": "\n# Pingera SDK\n\nA comprehensive Python SDK for the [Pingera monitoring platform API](https://api.pingera.ru), built using OpenAPI Generator for full type safety and complete API coverage.\n\n## Features\n\n- **Complete API Coverage**: Auto-generated from the official OpenAPI specification\n- **Type Safety**: Full type hints and Pydantic model validation\n- **Easy Authentication**: Support for Bearer tokens and API keys\n- **Comprehensive**: All Pingera API endpoints supported:\n  - Status Pages Management\n  - Status Pages (Components & Incidents)\n  - Monitoring Checks\n  - Heartbeats\n  - Alerts\n  - On-demand Checks\n  - Unified Results\n\n## Installation\n\n```bash\npip install pingera-sdk\n```\n\nOr install from source:\n\n```bash\ngit clone https://github.com/pingera/pingera-sdk.git\ncd pingera-sdk\npip install -e .\n```\n\n## Quick Start\n\n### Authentication\n\nSet your API token via environment variable:\n\n```bash\nexport PINGERA_API_KEY=\"your_api_token\"\n```\n\n### Basic Usage\n\n```python\nfrom pingera import ApiClient, Configuration\nfrom pingera.api import ChecksApi, StatusPagesComponentsApi\n\n# Configure the client\nconfiguration = Configuration()\nconfiguration.host = \"https://api.pingera.ru\"\nconfiguration.api_key['apiKeyAuth'] = \"your_api_token\"\n\n# Create API client\nwith ApiClient(configuration) as api_client:\n    # Initialize API instances\n    checks_api = ChecksApi(api_client)\n    components_api = StatusPagesComponentsApi(api_client)\n    \n    # List status pages\n    status_pages_api = StatusPagesApi(api_client)\n    pages = status_pages_api.v1_pages_get()\n    print(f\"Found {len(pages.data)} status pages\")\n    \n    # List monitoring checks\n    checks = checks_api.v1_checks_get(page=1, page_size=10)\n    print(f\"Found {len(checks.checks)} checks\")\n    \n    # List components for a status page\n    components = components_api.v1_pages_page_id_components_get(\"your_page_id\")\n    print(f\"Found {len(components.data)} components\")\n```\n\n### Available APIs\n\nThe SDK provides access to all Pingera API endpoints through these API classes:\n\n```python\nfrom pingera.api import (\n    StatusPagesApi,              # Manage status pages\n    StatusPagesComponentsApi,    # Manage status page components\n    StatusPagesIncidentsApi,     # Manage incidents and maintenance\n    ChecksApi,                   # Manage monitoring checks\n    AlertsApi,                   # Manage alerts and notifications\n    HeartbeatsApi,               # Manage heartbeat monitoring\n    OnDemandChecksApi,           # Execute checks on-demand\n    ChecksUnifiedResultsApi      # Get unified check results\n)\n```\n\n### Working with Models\n\nAll API requests and responses use typed Pydantic models:\n\n```python\nfrom pingera.models import (\n    Component,\n    IncidentCreate,\n    IncidentUpdateCreate,\n    ExecuteCustomCheckRequest\n)\n\n# Create a new component\nnew_component = Component(\n    name=\"API Server\",\n    description=\"Main API endpoint\",\n    status=\"operational\"\n)\n\n# Create an incident\nnew_incident = IncidentCreate(\n    name=\"Database Connectivity Issues\", \n    body=\"We are investigating connectivity issues\",\n    status=\"investigating\",\n    impact=\"major\"\n)\n```\n\n## Examples\n\nCheck the `examples/` directory for comprehensive usage examples:\n\n- [`basic_usage.py`](examples/basic_usage.py) - Basic client setup and operations\n- [`status_pages_management.py`](examples/status_pages_management.py) - Status pages CRUD operations\n- [`component_management.py`](examples/component_management.py) - Component CRUD operations\n- [`incident_management.py`](examples/incident_management.py) - Incident and maintenance management\n- [`comprehensive_sdk_usage.py`](examples/comprehensive_sdk_usage.py) - Comprehensive API demonstration\n- [`on_demand_synthetic_check.py`](examples/on_demand_synthetic_check.py) - Execute synthetic check with playwright script and get the result\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `PINGERA_API_KEY` | Your Pingera API token |\n| `PINGERA_PAGE_ID` | Default page ID for status page operations |\n\n### Manual Configuration\n\n```python\nfrom pingera import Configuration\n\nconfiguration = Configuration()\nconfiguration.host = \"https://api.pingera.ru\"\n\n# API token authentication\nconfiguration.api_key['apiKeyAuth'] = \"your_api_token\"\n\n# Optional: configure timeouts, retries, etc.\nconfiguration.timeout = 30\n```\n\n## Error Handling\n\nThe SDK uses proper exception handling:\n\n```python\nfrom pingera.exceptions import ApiException\n\ntry:\n    checks = checks_api.v1_checks_get()\nexcept ApiException as e:\n    print(f\"API Error [{e.status}]: {e.reason}\")\n    if e.body:\n        print(f\"Details: {e.body}\")\n```\n\n## Development\n\n### Regenerating the Client\n\nIf the Pingera API specification changes, you can regenerate the client:\n\n```bash\n# Install the OpenAPI generator\npip install openapi-generator-cli[jdk4py]\n\n# Regenerate the client\npython generate_client.py\n```\n\n### Running Tests\n\n```bash\npip install -e \".[dev]\"\npytest\n```\n\n### Running Examples\n\n```bash\n# Set your credentials\nexport PINGERA_API_KEY=\"your_api_token\"\nexport PINGERA_PAGE_ID=\"your_page_id\"\n\n# Run examples\npython examples/basic_usage.py\npython examples/component_management.py\npython examples/incident_management.py\n```\n\n## API Documentation\n\nFor detailed API documentation, visit:\n- [Official Pingera API Docs](https://docs.pingera.ru/api/overview)\n- [Generated Client Docs](client/README.md)\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Run the test suite\n6. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- \ud83d\udce7 Email: [privet@pingera.ru](mailto:privet@pingera.ru)  \n- \ud83d\udcd6 Documentation: [docs.pingera.ru](https://docs.pingera.ru)\n- \ud83c\udf10 Website: [pingera.ru](https://pingera.ru)\n- \ud83d\udcca Status: [status.pingera.ru](https://status.pingera.ru)\n\n## Links\n\n- [Pingera Platform](https://app.pingera.ru)\n- [API Documentation](https://docs.pingera.ru/api/overview)\n- [Status Page](https://status.pingera.ru)\n- [Website](https://pingera.ru)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for the Pingera monitoring platform API",
    "version": "1.0.9",
    "project_urls": {
        "API Documentation": "https://api.pingera.ru",
        "Bug Tracker": "https://github.com/pingera/pingera-sdk/issues",
        "Documentation": "https://docs.pingera.ru/api/overview",
        "Homepage": "https://pingera.ru",
        "Repository": "https://github.com/pingera/pingera-sdk"
    },
    "split_keywords": [
        "pingera",
        " monitoring",
        " api",
        " sdk",
        " status-page",
        " incidents",
        " components"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "33783a3cb31e6377f17dbbbc8a9dea5163fe3fab7260863b745abf5237dd4e16",
                "md5": "d31911d2e69dc37b5a08463c59969e5c",
                "sha256": "32241b7d2e5bfa4d73920bc846d923012e58aa0b469d9494d1a1524ae5980692"
            },
            "downloads": -1,
            "filename": "pingera_sdk-1.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d31911d2e69dc37b5a08463c59969e5c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 384434,
            "upload_time": "2025-10-09T20:31:20",
            "upload_time_iso_8601": "2025-10-09T20:31:20.157066Z",
            "url": "https://files.pythonhosted.org/packages/33/78/3a3cb31e6377f17dbbbc8a9dea5163fe3fab7260863b745abf5237dd4e16/pingera_sdk-1.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "929aa4a82aa84b1e829611a0fa48583a47d210e81d62788e23ed8bcd24354777",
                "md5": "fe5d52b7d9a1e98447248284892d7565",
                "sha256": "b95d1d9762ae62e405214f41480140a00f20355172c1d35782be7bc872c719ae"
            },
            "downloads": -1,
            "filename": "pingera_sdk-1.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "fe5d52b7d9a1e98447248284892d7565",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 142177,
            "upload_time": "2025-10-09T20:31:21",
            "upload_time_iso_8601": "2025-10-09T20:31:21.283676Z",
            "url": "https://files.pythonhosted.org/packages/92/9a/a4a82aa84b1e829611a0fa48583a47d210e81d62788e23ed8bcd24354777/pingera_sdk-1.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-09 20:31:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pingera",
    "github_project": "pingera-sdk",
    "github_not_found": true,
    "lcname": "pingera-sdk"
}
        
Elapsed time: 2.66656s