status

package
v1.74.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IncidentTypeScheduled = "scheduled"
)

https://www.statuspal.io/api-docs/v2

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Id    *int    `json:"id,omitempty"`
	Title *string `json:"title,omitempty"`
	// The time at which the incident/maintenance started(UTC).
	StartsAt *string `json:"starts_at"`

	Type *string `json:"type"`

	// Services impacted
	ServiceIds []int `json:"service_ids"`
}

Active Maintenance or Incident

type Events

type Events []Event

func (Events) GetActiveEvents

func (e Events) GetActiveEvents(services Services) ([][]string, error)

Get Active Incidents or Maintenances with the full service name (Zone+Product)

type EventsDetails

type EventsDetails [][]string

Details of incident: zone, service, description, start time and type

func (EventsDetails) Len

func (t EventsDetails) Len() int

func (EventsDetails) Less

func (t EventsDetails) Less(i, j int) bool

Implement Sort interface

func (EventsDetails) Swap

func (t EventsDetails) Swap(i, j int)

type Service

type Service struct {
	Id   *int    `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`

	// The type of the current incident:
	//  * `major` - A minor incident is currently taking place.
	//  * `minor` - A major incident is currently taking place.
	//  * `scheduled` - A scheduled maintenance is currently taking place.
	//  * null - No incident is taking place.
	IncidentType *string `json:"current_incident_type,omitempty"`

	// Each product available in the zone
	Children Services `json:"children,omitempty"`
}

A service can contains several child services In our case: - Parent services = Global and all the zones - Child services = products available in a zone or globally

type Services

type Services []Service

func (Services) GetServiceNamebyId

func (s Services) GetServiceNamebyId(id int) (string, error)

Return the Zone and the impacted service = fullname (parent svc + child svc)

func (Services) IsParentService

func (s Services) IsParentService(id int) bool

We have 2 levels of services, check if a service is a parent

type StatusPalStatus

type StatusPalStatus struct {
	// Services: all the services of the StatusPage with the current incident type
	Services Services `json:"services"`

	// Active Incidents and Maintenances
	Incidents    Events `json:"incidents"`
	Maintenances Events `json:"maintenances"`
}

Exoscale Services: Parent / child services Parent services are

func GetStatusPage

func GetStatusPage(subdomain string) (*StatusPalStatus, error)

Get the status of a status page

func (StatusPalStatus) GetStatusByZone

func (s StatusPalStatus) GetStatusByZone() ([][]string, error)

Get the status of global services (status of global or zones, no details of impacted services)

Jump to

Keyboard shortcuts

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