statuspage package - github.com/yannh/statuspage-go-sdk - Go Packages

statuspage

package module
v0.0.0-...-2638993 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MPL-2.0 Imports: 10 Imported by: 1

README

Golang SDK for Statuspage.io

Currently built as support for https://github.com/yannh/terraform-provider-statuspage

Documentation

Index

Constants

View Source
const (
	StatusRateLimitExceeded = 420
)

Variables

This section is empty.

Functions

func DeleteComponent

func DeleteComponent(client *Client, pageID, componentID string) (err error)

func DeleteComponentGroup

func DeleteComponentGroup(client *Client, pageID, componentGroupID string) (err error)

func DeleteIncident

func DeleteIncident(client *Client, pageID, incidentID string) (err error)

func DeleteIncidentTemplate

func DeleteIncidentTemplate(client *Client, pageID, incidentTemplateID string) (err error)

func DeleteMetric

func DeleteMetric(client *Client, pageID, metricID string) (err error)

func DeleteMetricsProvider

func DeleteMetricsProvider(client *Client, pageID, metricsProviderID string) (err error)

func NewRetryableClient

func NewRetryableClient() *retryablehttp.Client

Types

type Client

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

func NewClient

func NewClient(token string) *Client

func (*Client) UseHTTPClient

func (client *Client) UseHTTPClient(httpClient HTTPClient)

Allows overriding the HTTP Client, leaving the choice of using a retry library to the user

type Component

type Component struct {
	Name               *string `json:"name"`
	Description        *string `json:"description,omitempty"`
	GroupID            *string `json:"group_id,omitempty"`
	Showcase           *bool   `json:"showcase,omitempty"`
	Status             *string `json:"status,omitempty"`
	OnlyShowIfDegraded *bool   `json:"only_show_if_degraded,omitempty"`
	StartDate          *string `json:"start_date,omitempty"`
}

type ComponentFull

type ComponentFull struct {
	Component
	ID              *string `json:"id"`
	PageID          *string `json:"page_id"`
	Position        *int32  `json:"position"`
	CreatedAt       *string `json:"created_at"`
	UpdatedAt       *string `json:"updated_at"`
	AutomationEmail *string `json:"automation_email"`
	StartDate       *string `json:"start_date,omitempty"`
}

func CreateComponent

func CreateComponent(client *Client, pageID string, component *Component) (*ComponentFull, error)

func GetComponent

func GetComponent(client *Client, pageID string, componentID string) (*ComponentFull, error)

func UpdateComponent

func UpdateComponent(client *Client, pageID, componentID string, component *Component) (*ComponentFull, error)

type ComponentGroup

type ComponentGroup struct {
	Name        *string  `json:"name"`
	Description *string  `json:"description,omitempty"`
	Components  []string `json:"components,omitempty"`
}

type ComponentGroupFull

type ComponentGroupFull struct {
	ComponentGroup
	ID        *string `json:"id"`
	PageID    *string `json:"page_id"`
	Position  *int32  `json:"position"`
	CreatedAt *string `json:"created_at"`
	UpdatedAt *string `json:"updated_at"`
}

func CreateComponentGroup

func CreateComponentGroup(client *Client, pageID string, componentGroup *ComponentGroup) (*ComponentGroupFull, error)

func GetComponentGroup

func GetComponentGroup(client *Client, pageID, componentGroupID string) (*ComponentGroupFull, error)

func UpdateComponentGroup

func UpdateComponentGroup(client *Client, pageID, componentGroupID string, componentGroup *ComponentGroup) (*ComponentGroupFull, error)

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the http wrapper for the application

type IClient

type IClient interface {
	// contains filtered or unexported methods
}

type Incident

type Incident struct {
	Name           string      `json:"name"`
	Status         string      `json:"status"`
	ImpactOverride string      `json:"impact_override"`
	ScheduledFor   string      `json:"scheduled_for"`
	ScheduledUntil string      `json:"scheduled_until"`
	Body           string      `json:"body"`
	ComponentIDs   []string    `json:"component_ids"`
	Components     []Component `json:"components"`
}

type IncidentFull

type IncidentFull struct {
	Incident
	ID        string `json:"id"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

func CreateIncident

func CreateIncident(client *Client, pageID string, incident *Incident) (*IncidentFull, error)

func GetIncident

func GetIncident(client *Client, pageID, incidentID string) (*IncidentFull, error)

func UpdateIncident

func UpdateIncident(client *Client, pageID, incidentID string, incident *Incident) (*IncidentFull, error)

type IncidentTemplate

type IncidentTemplate struct {
	Name         *string  `json:"name"`
	GroupID      *string  `json:"group_id"`
	UpdateStatus *string  `json:"update_status"`
	Title        *string  `json:"suffix"`
	Body         *string  `json:"y_axis_min"`
	ComponentIDs []string `json:"component_ids"`
	ShouldTweet  *bool    `json:"should_tweet"`
}

type IncidentTemplateFull

type IncidentTemplateFull struct {
	IncidentTemplate
	ID        *string `json:"id"`
	CreatedAt *string `json:"created_at"`
	UpdatedAt *string `json:"updated_at"`
}

func CreateIncidentTemplate

func CreateIncidentTemplate(client *Client, pageID string, incidentTemplate *IncidentTemplate) (*IncidentTemplateFull, error)

func GetIncidentTemplate

func GetIncidentTemplate(client *Client, pageID, incidentTemplateID string) (*IncidentTemplateFull, error)

func UpdateIncidentTemplate

func UpdateIncidentTemplate(client *Client, pageID, incidentTemplateID string, incidentTemplate *IncidentTemplate) (*IncidentTemplateFull, error)

type Metric

type Metric struct {
	Name               *string  `json:"name"`
	MetricIdentifier   *string  `json:"metric_identifier,omitempty"`
	Transform          *string  `json:"transform,omitempty"`
	Suffix             *string  `json:"suffix,omitempty"`
	YAxisMin           *float64 `json:"y_axis_min,omitempty"`
	YAxisMax           *float64 `json:"y_axis_max,omitempty"`
	YAxisHidden        *bool    `json:"y_axis_hidden,omitempty"`
	Display            *bool    `json:"display,omitempty"`
	DecimalPlaces      *int     `json:"decimal_places,omitempty"`
	TooltipDescription *string  `json:"tooltip_description,omitempty"`
}

type MetricFull

type MetricFull struct {
	Metric
	ID                *string `json:"id"`
	MetricsProviderID *string `json:"metrics_provider_id"`
	MetricsDisplayID  *string `json:"metrics_display_id"`
	Backfilled        *bool   `json:"backfilled"`
	MostRecentDataAt  *string `json:"most_recent_data_at"`
	CreatedAt         *string `json:"created_at"`
	UpdatedAt         *string `json:"updated_at"`
}

func CreateMetric

func CreateMetric(client *Client, pageID, metricsProviderID string, metric *Metric) (*MetricFull, error)

func GetMetric

func GetMetric(client *Client, pageID, metricID string) (*MetricFull, error)

func UpdateMetric

func UpdateMetric(client *Client, pageID, metricID string, metric *Metric) (*MetricFull, error)

type MetricsProvider

type MetricsProvider struct {
	Email          *string `json:"email,omitempty"`
	Password       *string `json:"password,omitempty"`
	APIKey         *string `json:"api_key,omitempty"`
	APIToken       *string `json:"api_token,omitempty"`
	ApplicationKey *string `json:"application_key,omitempty"`
	MetricBaseUri  *string `json:"metric_base_uri,omitempty"`
	Type           *string `json:"type,omitempty"`
}

type MetricsProviderFull

type MetricsProviderFull struct {
	MetricsProvider
	ID                 *string `json:"id"`
	Name               *string `json:"name"`
	MetricIdentifider  *string `json:"metric_identifier"`
	Suffix             *string `json:"suffix"`
	Display            *string `json:"display"`
	ToolTipDescription *string `json:"tooltip_description"`
	YAxisMin           *string `json:"y_axis_min"`
	YAxisMax           *string `json:"y_axis_max"`
	DecimalPlaces      *string `json:"decimal_places"`
	Disabled           *bool   `json:"disabled"`
	AccountID          *string `json:"account_id"`
	LastRevalidatedAt  *string `json:"last_revalidated_at"`
	CreatedAt          *string `json:"created_at"`
	UpdatedAt          *string `json:"updated_at"`
}

func CreateMetricsProvider

func CreateMetricsProvider(client *Client, pageID string, metricsProvider *MetricsProvider) (*MetricsProviderFull, error)

func GetMetricsProvider

func GetMetricsProvider(client *Client, pageID string, metricsProviderID string) (*MetricsProviderFull, error)

func UpdateMetricsProvider

func UpdateMetricsProvider(client *Client, pageID, metricsProviderID string, metricsProvider *MetricsProvider) (*MetricsProviderFull, error)

Jump to

Keyboard shortcuts

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