incident

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type Client

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

Client implements the Opsgenie client for the incidents API.

func NewClient

func NewClient(config *client.Config) (*Client, error)

NewClient creates a new Opsgenie client for the incidents API. This is required because the incident client from the opsgenie-go-sdk-v2 doesn't implement the timeline api and the api to resolve incidents.

func (*Client) GetTimeline

func (c *Client) GetTimeline(ctx context.Context, id string) ([]Entry, error)

GetTimeline can be used to get the timeline entries for an Opsgenie incident.

func (*Client) Resolve

func (c *Client) Resolve(ctx context.Context, id, note string) error

Resolve can be used to resolve an incident by it's id. We can also add an optional note.

type Description

type Description struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type Entry

type Entry struct {
	ID          string      `json:"id"`
	Group       string      `json:"group"`
	Type        string      `json:"type"`
	EventTime   time.Time   `json:"eventTime"`
	Hidden      bool        `json:"hidden"`
	Actor       Actor       `json:"actor"`
	Description Description `json:"description"`
	LastEdit    LastEdit    `json:"lastEdit"`
}

Entry is the structure for a single incident timeline entry.

type LastEdit

type LastEdit struct {
	EditTime time.Time `json:"editTime"`
	Actor    Actor     `json:"actor"`
}

type ResolveIncidentData

type ResolveIncidentData struct {
	Note string `json:"note"`
}

ResolveIncidentData is the data which can be sent to the Opsgenie api within the body of an resolve incident request.

type Response

type Response struct {
	Data struct {
		Entries    []Entry `json:"entries"`
		NextOffset string  `json:"nextOffset"`
	} `json:"data"`
	Took      float64 `json:"took"`
	RequestID string  `json:"requestId"`
}

Response is the structure of the Opsgenie API response.

Jump to

Keyboard shortcuts

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