rootly

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURL = "https://api.rootly.com/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Token   string
	BaseURL string
	// contains filtered or unexported fields
}

func NewClient

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

func (*Client) CreateIncident

func (c *Client) CreateIncident(title, summary, severity string) (*Incident, error)

func (*Client) CreateIncidentEvent added in v0.8.0

func (c *Client) CreateIncidentEvent(incidentID, event, visibility string) (*IncidentEvent, error)

func (*Client) CreateWebhookEndpoint

func (c *Client) CreateWebhookEndpoint(url string, events []string) (*WebhookEndpoint, error)

func (*Client) DeleteWebhookEndpoint

func (c *Client) DeleteWebhookEndpoint(id string) error

func (*Client) GetIncident

func (c *Client) GetIncident(id string) (*Incident, error)

func (*Client) GetIncidentDetailed added in v0.9.0

func (c *Client) GetIncidentDetailed(id string) (map[string]any, error)

GetIncidentDetailed fetches an incident with related resources and returns a flattened map containing attributes and resolved relationships.

func (*Client) GetService

func (c *Client) GetService(id string) (*Service, error)

func (*Client) ListIncidents

func (c *Client) ListIncidents() ([]Incident, error)

func (*Client) ListServices

func (c *Client) ListServices() ([]Service, error)

func (*Client) ListSeverities

func (c *Client) ListSeverities() ([]Severity, error)

func (*Client) ListSubStatuses added in v0.8.0

func (c *Client) ListSubStatuses() ([]SubStatus, error)

func (*Client) ListTeams added in v0.8.0

func (c *Client) ListTeams() ([]Team, error)

func (*Client) UpdateIncident added in v0.8.0

func (c *Client) UpdateIncident(id string, attrs UpdateIncidentAttributes) (*Incident, error)

type Configuration

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

type CreateEvent added in v0.8.0

type CreateEvent struct{}

func (*CreateEvent) Actions added in v0.8.0

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

func (*CreateEvent) Cancel added in v0.8.0

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

func (*CreateEvent) Cleanup added in v0.8.0

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

func (*CreateEvent) Color added in v0.8.0

func (c *CreateEvent) Color() string

func (*CreateEvent) Configuration added in v0.8.0

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

func (*CreateEvent) Description added in v0.8.0

func (c *CreateEvent) Description() string

func (*CreateEvent) Documentation added in v0.8.0

func (c *CreateEvent) Documentation() string

func (*CreateEvent) ExampleOutput added in v0.8.0

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

func (*CreateEvent) Execute added in v0.8.0

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

func (*CreateEvent) HandleAction added in v0.8.0

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

func (*CreateEvent) HandleWebhook added in v0.8.0

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

func (*CreateEvent) Icon added in v0.8.0

func (c *CreateEvent) Icon() string

func (*CreateEvent) Label added in v0.8.0

func (c *CreateEvent) Label() string

func (*CreateEvent) Name added in v0.8.0

func (c *CreateEvent) Name() string

func (*CreateEvent) OutputChannels added in v0.8.0

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

func (*CreateEvent) ProcessQueueItem added in v0.8.0

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

func (*CreateEvent) Setup added in v0.8.0

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

type CreateEventSpec added in v0.8.0

type CreateEventSpec struct {
	IncidentID string `json:"incidentId"`
	Event      string `json:"event"`
	Visibility string `json:"visibility"`
}

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 added in v0.7.0

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 CreateIncidentAttributes

type CreateIncidentAttributes struct {
	Title    string `json:"title"`
	Summary  string `json:"summary,omitempty"`
	Severity string `json:"severity,omitempty"`
}

type CreateIncidentData

type CreateIncidentData struct {
	Type       string                   `json:"type"`
	Attributes CreateIncidentAttributes `json:"attributes"`
}

type CreateIncidentEventAttributes added in v0.8.0

type CreateIncidentEventAttributes struct {
	Event      string `json:"event"`
	Visibility string `json:"visibility,omitempty"`
}

type CreateIncidentEventData added in v0.8.0

type CreateIncidentEventData struct {
	Type       string                        `json:"type"`
	Attributes CreateIncidentEventAttributes `json:"attributes"`
}

type CreateIncidentEventRequest added in v0.8.0

type CreateIncidentEventRequest struct {
	Data CreateIncidentEventData `json:"data"`
}

CreateIncidentEventRequest represents the request to create an incident event.

type CreateIncidentRequest

type CreateIncidentRequest struct {
	Data CreateIncidentData `json:"data"`
}

CreateIncidentRequest represents the request to create an incident

type CreateIncidentSpec

type CreateIncidentSpec struct {
	Title    string `json:"title"`
	Summary  string `json:"summary"`
	Severity string `json:"severity"`
}

type CreateWebhookEndpointAttributes

type CreateWebhookEndpointAttributes struct {
	Name           string   `json:"name"`
	URL            string   `json:"url"`
	EventTypes     []string `json:"event_types"`
	Enabled        bool     `json:"enabled"`
	SigningEnabled bool     `json:"signing_enabled"`
}

type CreateWebhookEndpointData

type CreateWebhookEndpointData struct {
	Type       string                          `json:"type"`
	Attributes CreateWebhookEndpointAttributes `json:"attributes"`
}

type CreateWebhookEndpointRequest

type CreateWebhookEndpointRequest struct {
	Data CreateWebhookEndpointData `json:"data"`
}

type GetIncident added in v0.9.0

type GetIncident struct{}

func (*GetIncident) Actions added in v0.9.0

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

func (*GetIncident) Cancel added in v0.9.0

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

func (*GetIncident) Cleanup added in v0.9.0

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

func (*GetIncident) Color added in v0.9.0

func (c *GetIncident) Color() string

func (*GetIncident) Configuration added in v0.9.0

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

func (*GetIncident) Description added in v0.9.0

func (c *GetIncident) Description() string

func (*GetIncident) Documentation added in v0.9.0

func (c *GetIncident) Documentation() string

func (*GetIncident) ExampleOutput added in v0.9.0

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

func (*GetIncident) Execute added in v0.9.0

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

func (*GetIncident) HandleAction added in v0.9.0

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

func (*GetIncident) HandleWebhook added in v0.9.0

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

func (*GetIncident) Icon added in v0.9.0

func (c *GetIncident) Icon() string

func (*GetIncident) Label added in v0.9.0

func (c *GetIncident) Label() string

func (*GetIncident) Name added in v0.9.0

func (c *GetIncident) Name() string

func (*GetIncident) OutputChannels added in v0.9.0

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

func (*GetIncident) ProcessQueueItem added in v0.9.0

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

func (*GetIncident) Setup added in v0.9.0

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

type GetIncidentSpec added in v0.9.0

type GetIncidentSpec struct {
	IncidentID string `json:"incidentId"`
}

type Incident

type Incident struct {
	ID           string `json:"id"`
	SequentialID int    `json:"sequential_id"`
	Title        string `json:"title"`
	Slug         string `json:"slug"`
	Summary      string `json:"summary"`
	Status       string `json:"status"`
	Severity     string `json:"severity"`
	StartedAt    string `json:"started_at"`
	ResolvedAt   string `json:"resolved_at"`
	MitigatedAt  string `json:"mitigated_at"`
	UpdatedAt    string `json:"updated_at"`
	URL          string `json:"url"`
}

Incident represents a Rootly incident

type IncidentAttributes

type IncidentAttributes struct {
	Title        string `json:"title"`
	SequentialID int    `json:"sequential_id"`
	Slug         string `json:"slug"`
	Summary      string `json:"summary"`
	Status       string `json:"status"`
	Severity     any    `json:"severity"`
	StartedAt    string `json:"started_at"`
	ResolvedAt   string `json:"resolved_at"`
	MitigatedAt  string `json:"mitigated_at"`
	UpdatedAt    string `json:"updated_at"`
	URL          string `json:"url"`
}

type IncidentData

type IncidentData struct {
	ID         string             `json:"id"`
	Type       string             `json:"type"`
	Attributes IncidentAttributes `json:"attributes"`
}

type IncidentEvent added in v0.8.0

type IncidentEvent struct {
	ID         string `json:"id"`
	Event      string `json:"event"`
	Visibility string `json:"visibility"`
	OccurredAt string `json:"occurred_at"`
	CreatedAt  string `json:"created_at"`
}

IncidentEvent represents a Rootly incident event (timeline note).

type IncidentEventAttributes added in v0.8.0

type IncidentEventAttributes struct {
	Event      string `json:"event"`
	Visibility string `json:"visibility"`
	OccurredAt string `json:"occurred_at"`
	CreatedAt  string `json:"created_at"`
}

type IncidentEventData added in v0.8.0

type IncidentEventData struct {
	ID         string                  `json:"id"`
	Type       string                  `json:"type"`
	Attributes IncidentEventAttributes `json:"attributes"`
}

type IncidentEventResponse added in v0.8.0

type IncidentEventResponse struct {
	Data IncidentEventData `json:"data"`
}

type IncidentResponse

type IncidentResponse struct {
	Data IncidentData `json:"data"`
}

type IncidentsResponse

type IncidentsResponse struct {
	Data []IncidentData `json:"data"`
}

type LabelEntry added in v0.8.0

type LabelEntry struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Metadata

type Metadata struct {
	Services []Service `json:"services"`
}

type NodeMetadata

type NodeMetadata struct {
	Service *Service `json:"service,omitempty"`
}

NodeMetadata contains metadata stored on trigger and component nodes

type OnIncident

type OnIncident struct{}

func (*OnIncident) Actions

func (t *OnIncident) Actions() []core.Action

func (*OnIncident) Cleanup added in v0.7.0

func (t *OnIncident) Cleanup(ctx core.TriggerContext) error

func (*OnIncident) Color

func (t *OnIncident) Color() string

func (*OnIncident) Configuration

func (t *OnIncident) Configuration() []configuration.Field

func (*OnIncident) Description

func (t *OnIncident) Description() string

func (*OnIncident) Documentation

func (t *OnIncident) Documentation() string

func (*OnIncident) ExampleData

func (t *OnIncident) ExampleData() map[string]any

func (*OnIncident) HandleAction

func (t *OnIncident) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)

func (*OnIncident) HandleWebhook

func (t *OnIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnIncident) Icon

func (t *OnIncident) Icon() string

func (*OnIncident) Label

func (t *OnIncident) Label() string

func (*OnIncident) Name

func (t *OnIncident) Name() string

func (*OnIncident) Setup

func (t *OnIncident) Setup(ctx core.TriggerContext) error

type OnIncidentConfiguration

type OnIncidentConfiguration struct {
	Events []string `json:"events"`
}

type Rootly

type Rootly struct{}

func (*Rootly) Actions

func (r *Rootly) Actions() []core.Action

func (*Rootly) Cleanup

func (r *Rootly) Cleanup(ctx core.IntegrationCleanupContext) error

func (*Rootly) Components

func (r *Rootly) Components() []core.Component

func (*Rootly) Configuration

func (r *Rootly) Configuration() []configuration.Field

func (*Rootly) Description

func (r *Rootly) Description() string

func (*Rootly) HandleAction

func (r *Rootly) HandleAction(ctx core.IntegrationActionContext) error

func (*Rootly) HandleRequest

func (r *Rootly) HandleRequest(ctx core.HTTPRequestContext)

func (*Rootly) Icon

func (r *Rootly) Icon() string

func (*Rootly) Instructions

func (r *Rootly) Instructions() string

func (*Rootly) Label

func (r *Rootly) Label() string

func (*Rootly) ListResources

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

func (*Rootly) Name

func (r *Rootly) Name() string

func (*Rootly) Sync

func (r *Rootly) Sync(ctx core.SyncContext) error

func (*Rootly) Triggers

func (r *Rootly) Triggers() []core.Trigger

type RootlyWebhookHandler added in v0.7.0

type RootlyWebhookHandler struct{}

func (*RootlyWebhookHandler) Cleanup added in v0.7.0

func (*RootlyWebhookHandler) CompareConfig added in v0.7.0

func (h *RootlyWebhookHandler) CompareConfig(a, b any) (bool, error)

func (*RootlyWebhookHandler) Merge added in v0.8.0

func (h *RootlyWebhookHandler) Merge(current, requested any) (any, bool, error)

func (*RootlyWebhookHandler) Setup added in v0.7.0

type Service

type Service struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
}

Service represents a Rootly service

type ServiceAttributes

type ServiceAttributes struct {
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
}

type ServiceData

type ServiceData struct {
	ID         string            `json:"id"`
	Type       string            `json:"type"`
	Attributes ServiceAttributes `json:"attributes"`
}

type ServiceResponse

type ServiceResponse struct {
	Data ServiceData `json:"data"`
}

ServiceResponse represents the JSON:API response for a service

type ServicesResponse

type ServicesResponse struct {
	Data []ServiceData `json:"data"`
}

ServicesResponse represents the JSON:API response for listing services

type SeveritiesResponse

type SeveritiesResponse struct {
	Data []SeverityData `json:"data"`
}

type Severity

type Severity struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
	Severity    string `json:"severity"`
}

Severity represents a Rootly severity level

type SeverityAttributes

type SeverityAttributes struct {
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
	Severity    string `json:"severity"`
}

type SeverityData

type SeverityData struct {
	ID         string             `json:"id"`
	Type       string             `json:"type"`
	Attributes SeverityAttributes `json:"attributes"`
}

type SubStatus added in v0.8.0

type SubStatus struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Slug         string `json:"slug"`
	ParentStatus string `json:"parent_status"`
}

SubStatus represents a Rootly sub-status (custom status)

type SubStatusAttributes added in v0.8.0

type SubStatusAttributes struct {
	Name         string `json:"name"`
	Slug         string `json:"slug"`
	ParentStatus string `json:"parent_status"`
}

type SubStatusData added in v0.8.0

type SubStatusData struct {
	ID         string              `json:"id"`
	Type       string              `json:"type"`
	Attributes SubStatusAttributes `json:"attributes"`
}

type SubStatusesResponse added in v0.8.0

type SubStatusesResponse struct {
	Data []SubStatusData `json:"data"`
}

type Team added in v0.8.0

type Team struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
}

Team represents a Rootly team (group)

type TeamAttributes added in v0.8.0

type TeamAttributes struct {
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
}

type TeamData added in v0.8.0

type TeamData struct {
	ID         string         `json:"id"`
	Type       string         `json:"type"`
	Attributes TeamAttributes `json:"attributes"`
}

type TeamsResponse added in v0.8.0

type TeamsResponse struct {
	Data []TeamData `json:"data"`
}

type UpdateIncident added in v0.8.0

type UpdateIncident struct{}

func (*UpdateIncident) Actions added in v0.8.0

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

func (*UpdateIncident) Cancel added in v0.8.0

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

func (*UpdateIncident) Cleanup added in v0.8.0

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

func (*UpdateIncident) Color added in v0.8.0

func (c *UpdateIncident) Color() string

func (*UpdateIncident) Configuration added in v0.8.0

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

func (*UpdateIncident) Description added in v0.8.0

func (c *UpdateIncident) Description() string

func (*UpdateIncident) Documentation added in v0.8.0

func (c *UpdateIncident) Documentation() string

func (*UpdateIncident) ExampleOutput added in v0.8.0

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

func (*UpdateIncident) Execute added in v0.8.0

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

func (*UpdateIncident) HandleAction added in v0.8.0

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

func (*UpdateIncident) HandleWebhook added in v0.8.0

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

func (*UpdateIncident) Icon added in v0.8.0

func (c *UpdateIncident) Icon() string

func (*UpdateIncident) Label added in v0.8.0

func (c *UpdateIncident) Label() string

func (*UpdateIncident) Name added in v0.8.0

func (c *UpdateIncident) Name() string

func (*UpdateIncident) OutputChannels added in v0.8.0

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

func (*UpdateIncident) ProcessQueueItem added in v0.8.0

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

func (*UpdateIncident) Setup added in v0.8.0

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

type UpdateIncidentAttributes added in v0.8.0

type UpdateIncidentAttributes struct {
	Title       string            `json:"title,omitempty"`
	Summary     string            `json:"summary,omitempty"`
	Status      string            `json:"status,omitempty"`
	SubStatusID string            `json:"sub_status_id,omitempty"`
	SeverityID  string            `json:"severity_id,omitempty"`
	ServiceIDs  []string          `json:"service_ids,omitempty"`
	GroupIDs    []string          `json:"group_ids,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

type UpdateIncidentData added in v0.8.0

type UpdateIncidentData struct {
	ID         string                   `json:"id"`
	Type       string                   `json:"type"`
	Attributes UpdateIncidentAttributes `json:"attributes"`
}

type UpdateIncidentRequest added in v0.8.0

type UpdateIncidentRequest struct {
	Data UpdateIncidentData `json:"data"`
}

UpdateIncidentRequest represents the JSON:API request to update an incident

type UpdateIncidentSpec added in v0.8.0

type UpdateIncidentSpec struct {
	IncidentID string       `json:"incidentId"`
	Title      string       `json:"title"`
	Summary    string       `json:"summary"`
	Status     string       `json:"status"`
	SubStatus  string       `json:"subStatus"`
	Severity   string       `json:"severity"`
	Services   []string     `json:"services"`
	Teams      []string     `json:"teams"`
	Labels     []LabelEntry `json:"labels"`
}

type WebhookConfiguration

type WebhookConfiguration struct {
	Events []string `json:"events"`
}

type WebhookEndpoint

type WebhookEndpoint struct {
	ID     string `json:"id"`
	URL    string `json:"url"`
	Secret string `json:"secret"`
}

WebhookEndpoint represents a Rootly webhook endpoint

type WebhookEndpointAttributes

type WebhookEndpointAttributes struct {
	URL            string   `json:"url"`
	Secret         string   `json:"secret"`
	EventTypes     []string `json:"event_types"`
	Enabled        bool     `json:"enabled"`
	SigningEnabled bool     `json:"signing_enabled"`
}

type WebhookEndpointData

type WebhookEndpointData struct {
	ID         string                    `json:"id"`
	Type       string                    `json:"type"`
	Attributes WebhookEndpointAttributes `json:"attributes"`
}

type WebhookEndpointResponse

type WebhookEndpointResponse struct {
	Data WebhookEndpointData `json:"data"`
}

type WebhookEvent

type WebhookEvent struct {
	ID       string `json:"id"`
	Type     string `json:"type"`
	IssuedAt string `json:"issued_at"`
}

WebhookEvent represents the event metadata in a Rootly webhook

type WebhookMetadata

type WebhookMetadata struct {
	EndpointID string `json:"endpointId"`
}

type WebhookPayload

type WebhookPayload struct {
	Event WebhookEvent   `json:"event"`
	Data  map[string]any `json:"data"`
}

WebhookPayload represents the Rootly webhook payload

Jump to

Keyboard shortcuts

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