Documentation
¶
Overview ¶
Package statuspage implements the Atlassian Statuspage integration. API reference: https://developer.statuspage.io/
Index ¶
- Constants
- type Client
- func (c *Client) CreateIncident(pageID string, req CreateIncidentRequest) (map[string]any, error)
- func (c *Client) GetIncident(pageID, incidentID string) (map[string]any, error)
- func (c *Client) ListComponents(pageID string) ([]Component, error)
- func (c *Client) ListIncidents(pageID string, q string, limit int) ([]Incident, error)
- func (c *Client) ListPages() ([]Page, error)
- func (c *Client) UpdateIncident(pageID, incidentID string, req UpdateIncidentRequest) (map[string]any, error)
- type Component
- type Configuration
- type CreateIncident
- func (c *CreateIncident) Actions() []core.Action
- func (c *CreateIncident) Cancel(ctx core.ExecutionContext) error
- func (c *CreateIncident) Cleanup(ctx core.SetupContext) error
- func (c *CreateIncident) Color() string
- func (c *CreateIncident) Configuration() []configuration.Field
- func (c *CreateIncident) Description() string
- func (c *CreateIncident) Documentation() string
- func (c *CreateIncident) ExampleOutput() map[string]any
- func (c *CreateIncident) Execute(ctx core.ExecutionContext) error
- func (c *CreateIncident) HandleAction(ctx core.ActionContext) error
- func (c *CreateIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *CreateIncident) Icon() string
- func (c *CreateIncident) Label() string
- func (c *CreateIncident) Name() string
- func (c *CreateIncident) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreateIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *CreateIncident) Setup(ctx core.SetupContext) error
- type CreateIncidentRequest
- type CreateIncidentSpec
- type GetIncident
- func (c *GetIncident) Actions() []core.Action
- func (c *GetIncident) Cancel(ctx core.ExecutionContext) error
- func (c *GetIncident) Cleanup(ctx core.SetupContext) error
- func (c *GetIncident) Color() string
- func (c *GetIncident) Configuration() []configuration.Field
- func (c *GetIncident) Description() string
- func (c *GetIncident) Documentation() string
- func (c *GetIncident) ExampleOutput() map[string]any
- func (c *GetIncident) Execute(ctx core.ExecutionContext) error
- func (c *GetIncident) HandleAction(ctx core.ActionContext) error
- func (c *GetIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *GetIncident) Icon() string
- func (c *GetIncident) Label() string
- func (c *GetIncident) Name() string
- func (c *GetIncident) OutputChannels(configuration any) []core.OutputChannel
- func (c *GetIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *GetIncident) Setup(ctx core.SetupContext) error
- type GetIncidentSpec
- type Incident
- type NodeMetadata
- type Page
- type Statuspage
- func (s *Statuspage) Actions() []core.Action
- func (s *Statuspage) Cleanup(ctx core.IntegrationCleanupContext) error
- func (s *Statuspage) Components() []core.Component
- func (s *Statuspage) Configuration() []configuration.Field
- func (s *Statuspage) Description() string
- func (s *Statuspage) HandleAction(ctx core.IntegrationActionContext) error
- func (s *Statuspage) HandleRequest(ctx core.HTTPRequestContext)
- func (s *Statuspage) Icon() string
- func (s *Statuspage) Instructions() string
- func (s *Statuspage) Label() string
- func (s *Statuspage) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (s *Statuspage) Name() string
- func (s *Statuspage) Sync(ctx core.SyncContext) error
- func (s *Statuspage) Triggers() []core.Trigger
- type UpdateIncident
- func (c *UpdateIncident) Actions() []core.Action
- func (c *UpdateIncident) Cancel(ctx core.ExecutionContext) error
- func (c *UpdateIncident) Cleanup(ctx core.SetupContext) error
- func (c *UpdateIncident) Color() string
- func (c *UpdateIncident) Configuration() []configuration.Field
- func (c *UpdateIncident) Description() string
- func (c *UpdateIncident) Documentation() string
- func (c *UpdateIncident) ExampleOutput() map[string]any
- func (c *UpdateIncident) Execute(ctx core.ExecutionContext) error
- func (c *UpdateIncident) HandleAction(ctx core.ActionContext) error
- func (c *UpdateIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *UpdateIncident) Icon() string
- func (c *UpdateIncident) Label() string
- func (c *UpdateIncident) Name() string
- func (c *UpdateIncident) OutputChannels(configuration any) []core.OutputChannel
- func (c *UpdateIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *UpdateIncident) Setup(ctx core.SetupContext) error
- type UpdateIncidentRequest
- type UpdateIncidentSpec
Constants ¶
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" )
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 ¶
CreateIncident creates an incident and returns the incident object as map[string]any.
func (*Client) GetIncident ¶
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) ListIncidents ¶
ListIncidents returns incidents for a page. Use empty q and limit 0 for defaults.
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 Configuration ¶
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 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 Statuspage ¶
type Statuspage struct{}
func (*Statuspage) Actions ¶
func (s *Statuspage) Actions() []core.Action
func (*Statuspage) Cleanup ¶
func (s *Statuspage) Cleanup(ctx core.IntegrationCleanupContext) error
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.