statuspage

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package statuspage implements the Atlassian Statuspage integration. API reference: https://developer.statuspage.io/

Index

Constants

View Source
const (
	ResourceTypePage                    = "page"
	ResourceTypeComponent               = "component"
	ResourceTypeIncident                = "incident"
	ResourceTypeImpact                  = "impact"
	ResourceTypeImpactUpdate            = "impact_update" // includes Don't override (__none__), maintenance for Update Incident
	ResourceTypeIncidentStatusRealtime  = "incident_status_realtime"
	ResourceTypeIncidentStatusScheduled = "incident_status_scheduled"
	ResourceTypeComponentStatus         = "component_status"
)
View Source
const IncidentUseExpressionID = "__use_expression__"

IncidentUseExpressionID is the sentinel value when user selects "Use expression" from the dropdown (shown when page is expression or invalid). The incidentExpression field then holds the actual expression.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(http core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) CreateIncident

func (c *Client) CreateIncident(pageID string, req CreateIncidentRequest) (map[string]any, error)

CreateIncident creates an incident and returns the incident object as map[string]any.

func (*Client) GetIncident

func (c *Client) GetIncident(pageID, incidentID string) (map[string]any, error)

GetIncident fetches a single incident by ID and returns the full response including incident_updates (timeline). incident_updates ordering is preserved as returned by the Statuspage API.

func (*Client) ListComponents

func (c *Client) ListComponents(pageID string) ([]Component, error)

func (*Client) ListIncidents

func (c *Client) ListIncidents(pageID string, q string, limit int) ([]Incident, error)

ListIncidents returns incidents for a page. Use empty q and limit 0 for defaults.

func (*Client) ListPages

func (c *Client) ListPages() ([]Page, error)

func (*Client) UpdateIncident

func (c *Client) UpdateIncident(pageID, incidentID string, req UpdateIncidentRequest) (map[string]any, error)

UpdateIncident updates an incident and returns the full response as map[string]any.

type Component

type Component struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"`
}

type Configuration

type Configuration struct {
	APIKey  string `json:"apiKey"`
	BaseURL string `json:"baseURL"`
}

type CreateIncident

type CreateIncident struct{}

func (*CreateIncident) Actions

func (c *CreateIncident) Actions() []core.Action

func (*CreateIncident) Cancel

func (c *CreateIncident) Cancel(ctx core.ExecutionContext) error

func (*CreateIncident) Cleanup

func (c *CreateIncident) Cleanup(ctx core.SetupContext) error

func (*CreateIncident) Color

func (c *CreateIncident) Color() string

func (*CreateIncident) Configuration

func (c *CreateIncident) Configuration() []configuration.Field

func (*CreateIncident) Description

func (c *CreateIncident) Description() string

func (*CreateIncident) Documentation

func (c *CreateIncident) Documentation() string

func (*CreateIncident) ExampleOutput

func (c *CreateIncident) ExampleOutput() map[string]any

func (*CreateIncident) Execute

func (c *CreateIncident) Execute(ctx core.ExecutionContext) error

func (*CreateIncident) HandleAction

func (c *CreateIncident) HandleAction(ctx core.ActionContext) error

func (*CreateIncident) HandleWebhook

func (c *CreateIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*CreateIncident) Icon

func (c *CreateIncident) Icon() string

func (*CreateIncident) Label

func (c *CreateIncident) Label() string

func (*CreateIncident) Name

func (c *CreateIncident) Name() string

func (*CreateIncident) OutputChannels

func (c *CreateIncident) OutputChannels(configuration any) []core.OutputChannel

func (*CreateIncident) ProcessQueueItem

func (c *CreateIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*CreateIncident) Setup

func (c *CreateIncident) Setup(ctx core.SetupContext) error

type CreateIncidentRequest

type CreateIncidentRequest struct {
	Name                    string            `json:"name"`
	Body                    string            `json:"body"`
	Status                  string            `json:"status"`
	ImpactOverride          string            `json:"impact_override"`
	ComponentIDs            []string          `json:"component_ids"`
	Components              map[string]string `json:"components"` // component_id -> status
	ScheduledFor            string            `json:"scheduled_for"`
	ScheduledUntil          string            `json:"scheduled_until"`
	ScheduledRemindPrior    bool              `json:"scheduled_remind_prior"`
	ScheduledAutoInProgress bool              `json:"scheduled_auto_in_progress"`
	ScheduledAutoCompleted  bool              `json:"scheduled_auto_completed"`
	DeliverNotifications    *bool             `json:"deliver_notifications"`
	Realtime                bool              `json:"-"` // if true, send as realtime; else scheduled
}

CreateIncidentRequest holds the payload for creating an incident. Realtime: name, body, status, impactOverride, components (list of { componentId, status }), deliverNotifications. Scheduled: name, body, scheduledFor, scheduledUntil, scheduledRemindPrior, scheduledAutoInProgress, scheduledAutoCompleted, components, deliverNotifications.

type CreateIncidentSpec

type CreateIncidentSpec struct {
	Page            string  `json:"page"`
	IncidentType    string  `json:"incidentType"`
	Name            string  `json:"name"`
	Body            string  `json:"body"`
	StatusRealtime  *string `json:"statusRealtime,omitempty"`
	StatusScheduled *string `json:"statusScheduled,omitempty"`
	ImpactOverride  *string `json:"impactOverride,omitempty"`
	Components      []struct {
		ComponentID string `json:"componentId"`
		Status      string `json:"status"`
	} `json:"components"`
	ScheduledFor            *string `json:"scheduledFor,omitempty"`
	ScheduledUntil          *string `json:"scheduledUntil,omitempty"`
	ScheduledTimezone       *string `json:"scheduledTimezone,omitempty"`
	ScheduledRemindPrior    *bool   `json:"scheduledRemindPrior,omitempty"`
	ScheduledAutoInProgress *bool   `json:"scheduledAutoInProgress,omitempty"`
	ScheduledAutoCompleted  *bool   `json:"scheduledAutoCompleted,omitempty"`
	DeliverNotifications    *bool   `json:"deliverNotifications,omitempty"`
}

CreateIncidentSpec is the strongly typed configuration for the Create Incident component. Conditionally visible fields use pointers so they can be nil when not shown.

type GetIncident

type GetIncident struct{}

func (*GetIncident) Actions

func (c *GetIncident) Actions() []core.Action

func (*GetIncident) Cancel

func (c *GetIncident) Cancel(ctx core.ExecutionContext) error

func (*GetIncident) Cleanup

func (c *GetIncident) Cleanup(ctx core.SetupContext) error

func (*GetIncident) Color

func (c *GetIncident) Color() string

func (*GetIncident) Configuration

func (c *GetIncident) Configuration() []configuration.Field

func (*GetIncident) Description

func (c *GetIncident) Description() string

func (*GetIncident) Documentation

func (c *GetIncident) Documentation() string

func (*GetIncident) ExampleOutput

func (c *GetIncident) ExampleOutput() map[string]any

func (*GetIncident) Execute

func (c *GetIncident) Execute(ctx core.ExecutionContext) error

func (*GetIncident) HandleAction

func (c *GetIncident) HandleAction(ctx core.ActionContext) error

func (*GetIncident) HandleWebhook

func (c *GetIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*GetIncident) Icon

func (c *GetIncident) Icon() string

func (*GetIncident) Label

func (c *GetIncident) Label() string

func (*GetIncident) Name

func (c *GetIncident) Name() string

func (*GetIncident) OutputChannels

func (c *GetIncident) OutputChannels(configuration any) []core.OutputChannel

func (*GetIncident) ProcessQueueItem

func (c *GetIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*GetIncident) Setup

func (c *GetIncident) Setup(ctx core.SetupContext) error

type GetIncidentSpec

type GetIncidentSpec struct {
	Page               string `json:"page"`
	Incident           string `json:"incident"`
	IncidentExpression string `json:"incidentExpression"`
}

GetIncidentSpec is the strongly typed configuration for the Get Incident component.

type Incident

type Incident struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Incident is a minimal incident representation for listing.

type NodeMetadata

type NodeMetadata struct {
	PageName       string   `json:"pageName"`
	ComponentNames []string `json:"componentNames,omitempty"`
	IncidentName   string   `json:"incidentName,omitempty"`
}

NodeMetadata contains metadata stored on component nodes for display in the UI.

type Page

type Page struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Statuspage

type Statuspage struct{}

func (*Statuspage) Actions

func (s *Statuspage) Actions() []core.Action

func (*Statuspage) Cleanup

func (*Statuspage) Components

func (s *Statuspage) Components() []core.Component

func (*Statuspage) Configuration

func (s *Statuspage) Configuration() []configuration.Field

func (*Statuspage) Description

func (s *Statuspage) Description() string

func (*Statuspage) HandleAction

func (s *Statuspage) HandleAction(ctx core.IntegrationActionContext) error

func (*Statuspage) HandleRequest

func (s *Statuspage) HandleRequest(ctx core.HTTPRequestContext)

func (*Statuspage) Icon

func (s *Statuspage) Icon() string

func (*Statuspage) Instructions

func (s *Statuspage) Instructions() string

func (*Statuspage) Label

func (s *Statuspage) Label() string

func (*Statuspage) ListResources

func (s *Statuspage) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Statuspage) Name

func (s *Statuspage) Name() string

func (*Statuspage) Sync

func (s *Statuspage) Sync(ctx core.SyncContext) error

func (*Statuspage) Triggers

func (s *Statuspage) Triggers() []core.Trigger

type UpdateIncident

type UpdateIncident struct{}

func (*UpdateIncident) Actions

func (c *UpdateIncident) Actions() []core.Action

func (*UpdateIncident) Cancel

func (c *UpdateIncident) Cancel(ctx core.ExecutionContext) error

func (*UpdateIncident) Cleanup

func (c *UpdateIncident) Cleanup(ctx core.SetupContext) error

func (*UpdateIncident) Color

func (c *UpdateIncident) Color() string

func (*UpdateIncident) Configuration

func (c *UpdateIncident) Configuration() []configuration.Field

func (*UpdateIncident) Description

func (c *UpdateIncident) Description() string

func (*UpdateIncident) Documentation

func (c *UpdateIncident) Documentation() string

func (*UpdateIncident) ExampleOutput

func (c *UpdateIncident) ExampleOutput() map[string]any

func (*UpdateIncident) Execute

func (c *UpdateIncident) Execute(ctx core.ExecutionContext) error

func (*UpdateIncident) HandleAction

func (c *UpdateIncident) HandleAction(ctx core.ActionContext) error

func (*UpdateIncident) HandleWebhook

func (c *UpdateIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*UpdateIncident) Icon

func (c *UpdateIncident) Icon() string

func (*UpdateIncident) Label

func (c *UpdateIncident) Label() string

func (*UpdateIncident) Name

func (c *UpdateIncident) Name() string

func (*UpdateIncident) OutputChannels

func (c *UpdateIncident) OutputChannels(configuration any) []core.OutputChannel

func (*UpdateIncident) ProcessQueueItem

func (c *UpdateIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*UpdateIncident) Setup

func (c *UpdateIncident) Setup(ctx core.SetupContext) error

type UpdateIncidentRequest

type UpdateIncidentRequest struct {
	Status               string            `json:"status,omitempty"`
	Body                 string            `json:"body,omitempty"`
	ImpactOverride       string            `json:"impact_override,omitempty"`
	ComponentIDs         []string          `json:"component_ids,omitempty"`
	Components           map[string]string `json:"components,omitempty"`
	DeliverNotifications *bool             `json:"deliver_notifications,omitempty"`
}

UpdateIncidentRequest holds the payload for PATCH /pages/{page_id}/incidents/{incident_id}.

type UpdateIncidentSpec

type UpdateIncidentSpec struct {
	Page               string `json:"page"`
	Incident           string `json:"incident"`
	IncidentExpression string `json:"incidentExpression"`
	IncidentType       string `json:"incidentType"`
	StatusRealtime     string `json:"statusRealtime"`
	StatusScheduled    string `json:"statusScheduled"`
	Body               string `json:"body"`
	ImpactOverride     string `json:"impactOverride"`
	Components         []struct {
		ComponentID string `json:"componentId"`
		Status      string `json:"status"`
	} `json:"components"`
	DeliverNotifications *bool `json:"deliverNotifications,omitempty"`
}

UpdateIncidentSpec is the strongly typed configuration for the Update Incident component.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL