CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-atlassian-python-api

Python Atlassian REST API Wrapper providing comprehensive access to Jira, Confluence, Bitbucket, and other Atlassian products

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

statuspage.mddocs/

StatusPage API

Comprehensive StatusPage REST API client providing incident management, status communication, subscriber management, and service reliability monitoring. Supports complete StatusPage functionality including components, metrics, incidents, subscribers, and postmortem management for transparent service communication.

Initialization

class StatusPage(AtlassianRestAPI):
    def __init__(self, url: str, username: str = None, password: str = None,
                 token: str = None, **kwargs):
        """
        Initialize StatusPage client.
        
        Parameters:
        - url (str): Base URL of StatusPage instance
        - username (str, optional): Username for authentication
        - password (str, optional): Password or API token
        - token (str, optional): Bearer token for authentication
        """

Capabilities

Page Management

Core StatusPage administration and configuration for managing status pages and organizational access.

def page_list_pages(self) -> List[dict]:
    """
    Get all pages for authenticated user.
    
    Returns:
    List[dict]: Status pages with configuration and access permissions
    """

def get_page(self, page_id: str) -> T_resp_json:
    """
    Get page details.
    
    Parameters:
    - page_id: Page ID
    
    Returns:
    dict: Page information with branding, domain, and settings
    """

def page_update(self, page_id: str, page: dict) -> T_resp_json:
    """
    Update page configuration.
    
    Parameters:
    - page_id: Page ID
    - page: Page configuration updates
    
    Returns:
    dict: Updated page data
    """

Organization and User Management

User permission management and organizational access control for StatusPage administration.

def organization_get_users(self, organization_id: str, page: int = 1, 
                          per_page: int = 100) -> T_resp_json:
    """
    Get organization users.
    
    Parameters:
    - organization_id: Organization ID
    - page: Page number for pagination
    - per_page: Results per page
    
    Returns:
    dict: Users list with roles and permissions
    """

def organization_get_user_permissions(self, organization_id: str, 
                                     user_id: str) -> T_resp_json:
    """
    Get user permissions for organization.
    
    Parameters:
    - organization_id: Organization ID
    - user_id: User ID
    
    Returns:
    dict: User permissions and page access
    """

def organization_set_user_permissions(self, organization_id: str, user_id: str,
                                     pages: List[str]) -> T_resp_json:
    """
    Set user permissions for pages.
    
    Parameters:
    - organization_id: Organization ID
    - user_id: User ID
    - pages: List of page IDs to grant access
    
    Returns:
    dict: Updated permissions
    """

Access Control and Groups

Granular access control for components, metrics, and page visibility with group-based permissions.

def page_access_users_list(self, page_id: str, email: str = None,
                          page: int = 1, per_page: int = 100) -> T_resp_json:
    """
    Get page access users.
    
    Parameters:
    - page_id: Page ID
    - email: Filter by email address
    - page: Page number
    - per_page: Results per page
    
    Returns:
    dict: Access users with component and metric permissions
    """

def page_set_access_user(self, page_id: str, page_access_user_id: str,
                        external_login: str, email: str,
                        page_access_group_ids: List[str]) -> T_resp_json:
    """
    Set access user configuration.
    
    Parameters:
    - page_id: Page ID
    - page_access_user_id: Access user ID
    - external_login: External login identifier
    - email: User email
    - page_access_group_ids: Group IDs for access
    
    Returns:
    dict: Updated access user configuration
    """

def page_create_access_group(self, page_id: str, name: str, 
                           page_access_user_ids: List[str],
                           component_ids: List[str] = None,
                           metric_ids: List[str] = None) -> T_resp_json:
    """
    Create access group.
    
    Parameters:
    - page_id: Page ID
    - name: Group name
    - page_access_user_ids: User IDs to include
    - component_ids: Component IDs for group access
    - metric_ids: Metric IDs for group access
    
    Returns:
    dict: Created access group data
    """

Incident Management

Comprehensive incident lifecycle management including creation, updates, status tracking, and resolution.

def page_create_incident(self, page_id: str, incident: dict) -> T_resp_json:
    """
    Create incident.
    
    Parameters:
    - page_id: Page ID
    - incident: Incident data (name, status, impact, component_ids, etc.)
    
    Returns:
    dict: Created incident with ID and initial status
    """

def page_list_incidents(self, page_id: str, q: str = None,
                       page: int = 1, per_page: int = 100) -> T_resp_json:
    """
    List incidents with search and filtering.
    
    Parameters:
    - page_id: Page ID
    - q: Search query for incident names/descriptions
    - page: Page number
    - per_page: Results per page
    
    Returns:
    dict: Incidents list with status and impact information
    """

def page_update_incident(self, page_id: str, incident_id: str,
                        incident: dict) -> T_resp_json:
    """
    Update incident.
    
    Parameters:
    - page_id: Page ID
    - incident_id: Incident ID
    - incident: Incident updates (status, component_ids, incident_updates, etc.)
    
    Returns:
    dict: Updated incident data
    """

def page_list_unresolved_incidents(self, page_id: str, page: int = 1,
                                  per_page: int = 100) -> T_resp_json:
    """
    Get unresolved incidents.
    
    Parameters:
    - page_id: Page ID
    - page: Page number
    - per_page: Results per page
    
    Returns:
    dict: Active incidents requiring attention
    """

def page_list_scheduled_incidents(self, page_id: str, page: int = 1,
                                 per_page: int = 100) -> T_resp_json:
    """
    Get scheduled maintenance incidents.
    
    Parameters:
    - page_id: Page ID
    - page: Page number
    - per_page: Results per page
    
    Returns:
    dict: Upcoming scheduled maintenance events
    """

Postmortem Management

Incident analysis and postmortem documentation for service reliability improvement.

def page_create_postmortem(self, page_id: str, incident_id: str,
                          postmortem: dict) -> T_resp_json:
    """
    Create incident postmortem.
    
    Parameters:
    - page_id: Page ID
    - incident_id: Incident ID
    - postmortem: Postmortem content and analysis
    
    Returns:
    dict: Created postmortem data
    """

def page_publish_postmortem(self, page_id: str, incident_id: str,
                           postmortem: dict) -> T_resp_json:
    """
    Publish postmortem for public viewing.
    
    Parameters:
    - page_id: Page ID
    - incident_id: Incident ID
    - postmortem: Final postmortem content
    
    Returns:
    dict: Published postmortem with public URL
    """

def page_get_postmortem(self, page_id: str, incident_id: str) -> T_resp_json:
    """
    Get incident postmortem.
    
    Parameters:
    - page_id: Page ID
    - incident_id: Incident ID
    
    Returns:
    dict: Postmortem content and status
    """

Component Management

Service component tracking and status management for granular service visibility.

def page_create_component(self, page_id: str, component: dict) -> T_resp_json:
    """
    Create service component.
    
    Parameters:
    - page_id: Page ID
    - component: Component data (name, description, status, group_id, etc.)
    
    Returns:
    dict: Created component with ID and configuration
    """

def page_get_components(self, page_id: str, per_page: int = 100,
                       page: int = 1) -> T_resp_json:
    """
    Get page components.
    
    Parameters:
    - page_id: Page ID
    - per_page: Results per page
    - page: Page number
    
    Returns:
    dict: Components list with status and uptime data
    """

def page_update_component(self, page_id: str, component_id: str,
                         component: dict) -> T_resp_json:
    """
    Update component.
    
    Parameters:
    - page_id: Page ID
    - component_id: Component ID
    - component: Component updates (status, name, description, etc.)
    
    Returns:
    dict: Updated component data
    """

def page_get_uptime_component(self, page_id: str, component_id: str,
                             start: str = None, end: str = None) -> T_resp_json:
    """
    Get component uptime data.
    
    Parameters:
    - page_id: Page ID
    - component_id: Component ID
    - start: Start date (ISO format)
    - end: End date (ISO format)
    
    Returns:
    dict: Uptime statistics and availability data
    """

def page_create_component_group(self, page_id: str, description: str,
                               components_group: dict) -> T_resp_json:
    """
    Create component group.
    
    Parameters:
    - page_id: Page ID
    - description: Group description
    - components_group: Group configuration (name, component_ids, etc.)
    
    Returns:
    dict: Created component group
    """

Metrics and Monitoring

Performance metrics collection, visualization, and monitoring for service health tracking.

def page_get_list_of_metrics(self, page_id: str, per_page: int = 100,
                            page: int = 1) -> T_resp_json:
    """
    Get page metrics.
    
    Parameters:
    - page_id: Page ID
    - per_page: Results per page
    - page: Page number
    
    Returns:
    dict: Metrics list with data points and configuration
    """

def page_add_data_to_metric(self, page_id: str, metric_id: str,
                           data: dict) -> T_resp_json:
    """
    Add data points to metric.
    
    Parameters:
    - page_id: Page ID
    - metric_id: Metric ID
    - data: Data points with timestamps and values
    
    Returns:
    dict: Confirmation of data ingestion
    """

def page_create_metric_provider(self, page_id: str, 
                               metric_provider: dict) -> T_resp_json:
    """
    Create metric provider for automated data collection.
    
    Parameters:
    - page_id: Page ID
    - metric_provider: Provider configuration (type, settings, etc.)
    
    Returns:
    dict: Created metric provider with authentication details
    """

def page_update_metric(self, page_id: str, metric_id: str,
                      metric: dict) -> T_resp_json:
    """
    Update metric configuration.
    
    Parameters:
    - page_id: Page ID
    - metric_id: Metric ID
    - metric: Metric updates (name, suffix, y_axis_min, etc.)
    
    Returns:
    dict: Updated metric configuration
    """

Subscriber Management

Comprehensive subscriber management for notifications, confirmations, and communication preferences.

def page_get_subscribers(self, page_id: str, search_by: str = None,
                        sort_direction: str = "asc", page: int = 1,
                        per_page: int = 100) -> T_resp_json:
    """
    Get page subscribers.
    
    Parameters:
    - page_id: Page ID
    - search_by: Search term for filtering
    - sort_direction: Sort order ("asc", "desc")
    - page: Page number
    - per_page: Results per page
    
    Returns:
    dict: Subscribers with contact information and preferences
    """

def page_create_subscriber(self, page_id: str, subscriber: dict) -> T_resp_json:
    """
    Create subscriber.
    
    Parameters:
    - page_id: Page ID
    - subscriber: Subscriber data (email, sms, components, etc.)
    
    Returns:
    dict: Created subscriber with confirmation details
    """

def page_count_subscribers_by_type(self, page_id: str, subscriber_type: str,
                                  subscriber_state: str) -> T_resp_json:
    """
    Count subscribers by type and state.
    
    Parameters:
    - page_id: Page ID
    - subscriber_type: Type filter ("email", "sms", "webhook", etc.)
    - subscriber_state: State filter ("active", "pending", "quarantined")
    
    Returns:
    dict: Subscriber counts and statistics
    """

def page_unsubscribe_subscribers(self, page_id: str, subscriber_ids: List[str],
                                subscriber_type: str,
                                skip_unsubscription_notifications: bool = False) -> T_resp_json:
    """
    Bulk unsubscribe subscribers.
    
    Parameters:
    - page_id: Page ID
    - subscriber_ids: List of subscriber IDs
    - subscriber_type: Subscriber type
    - skip_unsubscription_notifications: Skip notification emails
    
    Returns:
    dict: Unsubscription results
    """

Templates and Communication

Template management for standardized incident communications and status updates.

def page_create_template(self, page_id: str, template: dict) -> T_resp_json:
    """
    Create incident template.
    
    Parameters:
    - page_id: Page ID
    - template: Template data (name, title, body, etc.)
    
    Returns:
    dict: Created template for incident communications
    """

def page_get_templates(self, page_id: str, page: int = 1,
                      per_page: int = 100) -> T_resp_json:
    """
    Get incident templates.
    
    Parameters:
    - page_id: Page ID
    - page: Page number
    - per_page: Results per page
    
    Returns:
    dict: Templates list for reusable incident content
    """

Enums and Constants

from enum import Enum

class Status(Enum):
    """Incident status values"""
    INVESTIGATING = "investigating"
    IDENTIFIED = "identified"
    MONITORING = "monitoring"  
    RESOLVED = "resolved"
    SCHEDULED = "scheduled"
    IN_PROGRESS = "in_progress"
    VERIFYING = "verifying"
    COMPLETED = "completed"

class Impact(Enum):
    """Incident impact levels"""
    CRITICAL = "critical"
    MAJOR = "major"
    MINOR = "minor"
    MAINTENANCE = "maintenance"
    NONE = "none"

class SubscriberType(Enum):
    """Subscriber notification types"""
    EMAIL = "email"
    SMS = "sms"
    WEBHOOK = "webhook"
    SLACK = "slack"
    INTEGRATION_PARTNER = "integration_partner"

class SubscriberState(Enum):
    """Subscriber states"""
    ACTIVE = "active"
    PENDING = "pending"
    QUARANTINED = "quarantined"
    ALL = "all"

Usage Examples

Basic StatusPage Operations

from atlassian import StatusPage

statuspage = StatusPage(
    url="https://api.statuspage.io",
    token="your-api-token"
)

# Get all pages
pages = statuspage.page_list_pages()

# Create incident
incident_data = {
    "name": "Database Performance Issues",
    "status": "investigating",
    "impact": "major",
    "component_ids": ["component-123"],
    "incident_updates": [{
        "body": "We are investigating reports of slow database queries.",
        "status": "investigating"
    }]
}
incident = statuspage.page_create_incident(page_id, incident_data)

# Update component status
component_update = {
    "status": "partial_outage"
}
statuspage.page_update_component(page_id, component_id, component_update)

Subscriber Management

# Add subscriber
subscriber_data = {
    "email": "user@example.com",
    "component_ids": ["comp-1", "comp-2"],
    "skip_confirmation": False
}
subscriber = statuspage.page_create_subscriber(page_id, subscriber_data)

# Get subscriber statistics
email_stats = statuspage.page_count_subscribers_by_type(
    page_id, "email", "active"
)

# Get all subscribers
subscribers = statuspage.page_get_subscribers(
    page_id, 
    search_by="@company.com",
    sort_direction="desc"
)

Metrics and Monitoring

# Create metric
metric_data = {
    "name": "Response Time",
    "suffix": "ms",
    "y_axis_min": 0,
    "y_axis_max": 1000
}
metric = statuspage.page_create_metric(page_id, metric_data)

# Add data points
data_points = {
    "data": [
        {"timestamp": 1609459200, "value": 250},
        {"timestamp": 1609462800, "value": 275}
    ]
}
statuspage.page_add_data_to_metric(page_id, metric_id, data_points)

# Get uptime data
uptime = statuspage.page_get_uptime_component(
    page_id, 
    component_id,
    start="2024-01-01",
    end="2024-01-31"
)

Incident Lifecycle

# Create scheduled maintenance
maintenance = {
    "name": "Database Maintenance",
    "status": "scheduled", 
    "impact": "maintenance",
    "scheduled_for": "2024-02-15T02:00:00Z",
    "scheduled_until": "2024-02-15T04:00:00Z",
    "component_ids": ["database-component"]
}
scheduled = statuspage.page_create_incident(page_id, maintenance)

# Update incident with progress
update_data = {
    "incident_updates": [{
        "body": "Maintenance is proceeding as planned.",
        "status": "in_progress"
    }],
    "status": "in_progress"
}
statuspage.page_update_incident(page_id, incident_id, update_data)

# Create postmortem
postmortem_data = {
    "body": "## Root Cause Analysis\n\nThe incident was caused by..."
}
postmortem = statuspage.page_create_postmortem(page_id, incident_id, postmortem_data)

Types

from atlassian.typehints import T_resp_json
from typing import List, Dict, Optional

# Common parameter types
PageId = str
ComponentId = str
IncidentId = str
MetricId = str
SubscriberId = str
TemplateId = str

Install with Tessl CLI

npx tessl i tessl/pypi-atlassian-python-api

docs

administration.md

asset-management.md

bitbucket.md

confluence.md

development-tools.md

index.md

jira.md

service-management.md

statuspage.md

tile.json