client

package
v0.0.0-...-40af6fe Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package client provides clients for using the OpsGenie Web API. Also prepares and sends requests. API user first creates a OpsGenieClient instance.

cli := new(ogcli.OpsGenieClient)

Following that he/she can set APIKey and some configurations for HTTP communication layer by setting a proxy definition and/or transport layer options.

cli.SetAPIKey(constants.APIKey)

Then create the client of the API type that he/she wants to use.

alertCli, cliErr := cli.Alert()

if cliErr != nil { panic(cliErr) }

The most fundamental and general use case is being able to access the OpsGenie Web API by coding a Go program. The program -by mean of a client application- can send OpsGenie Web API the requests using the 'client' package in a higher level. For the programmer of the client application, that reduces the number of LoCs. Besides it will result a less error-prone application and reduce the complexity by hiding the low-level networking, error-handling and byte-processing calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPTransportSettings

type HTTPTransportSettings struct {
	ConnectionTimeout time.Duration
	RequestTimeout    time.Duration
	MaxRetryAttempts  int
}

HTTPTransportSettings is the type that contains the HTTP transport layer configurations of the OpsGenieClient.

type OpsGenieAlertClient

type OpsGenieAlertClient struct {
	OpsGenieClient
}

OpsGenieAlertClient is the data type to make Alert API requests.

func (*OpsGenieAlertClient) Acknowledge

Acknowledge method acknowledges an alert at OpsGenie.

func (*OpsGenieAlertClient) AddNote

AddNote method adds a note to an alert at OpsGenie.

func (*OpsGenieAlertClient) AddRecipient

AddRecipient method adds recipient to an alert at OpsGenie.

func (*OpsGenieAlertClient) AddTags

AddTags method adds tags to an alert at OpsGenie.

func (*OpsGenieAlertClient) AddTeam

AddTeam method adds a team to an alert at OpsGenie.

func (*OpsGenieAlertClient) AssignOwner

AssignOwner method assigns the specified user as the owner of the alert at OpsGenie.

func (*OpsGenieAlertClient) AttachFile

AttachFile method attaches a file to an alert at OpsGenie.

func (*OpsGenieAlertClient) Close

Close method closes an alert at OpsGenie.

func (*OpsGenieAlertClient) Create

Create method creates an alert at OpsGenie.

func (*OpsGenieAlertClient) Delete

Delete method deletes an alert at OpsGenie.

func (*OpsGenieAlertClient) ExecuteAction

ExecuteAction method executes a custom action on an alert at OpsGenie.

func (*OpsGenieAlertClient) Get

Get method retrieves specified alert details from OpsGenie.

func (*OpsGenieAlertClient) List

List method retrieves alerts from OpsGenie.

func (*OpsGenieAlertClient) ListLogs

ListLogs method retrieves activity logs of an alert from OpsGenie.

func (*OpsGenieAlertClient) ListNotes

ListNotes method retrieves notes of an alert from OpsGenie.

func (*OpsGenieAlertClient) ListRecipients

ListRecipients method retrieves recipients of an alert from OpsGenie.

func (*OpsGenieAlertClient) Renotify

Renotify re-notifies recipients at OpsGenie.

func (*OpsGenieAlertClient) SetOpsGenieClient

func (cli *OpsGenieAlertClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieAlertClient.

func (*OpsGenieAlertClient) TakeOwnership

TakeOwnership method takes the ownership of an alert at OpsGenie.

type OpsGenieClient

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

OpsGenieClient is a general data type used for: - authenticating callers through their API keys and - instantiating "alert", "heartbeat", "integration" and "policy" clients - setting HTTP transport layer configurations - setting Proxy configurations

func (*OpsGenieClient) APIKey

func (cli *OpsGenieClient) APIKey() string

APIKey returns the API Key value that OpsGenieClient uses to authenticate at OpsGenie.

func (*OpsGenieClient) Alert

func (cli *OpsGenieClient) Alert() (*OpsGenieAlertClient, error)

Alert instantiates a new OpsGenieAlertClient.

func (*OpsGenieClient) Escalation

func (cli *OpsGenieClient) Escalation() (*OpsGenieEscalationClient, error)

Escalation instantiates a new OpsGenieEscalationClient.

func (*OpsGenieClient) Heartbeat

func (cli *OpsGenieClient) Heartbeat() (*OpsGenieHeartbeatClient, error)

Heartbeat instantiates a new OpsGenieHeartbeatClient.

func (*OpsGenieClient) Integration

func (cli *OpsGenieClient) Integration() (*OpsGenieIntegrationClient, error)

Integration instantiates a new OpsGenieIntegrationClient.

func (*OpsGenieClient) OpsGenieAPIUrl

func (cli *OpsGenieClient) OpsGenieAPIUrl() string

OpsGenieAPIUrl returns the current endpoint(base URL) that requests will send.

func (*OpsGenieClient) Policy

func (cli *OpsGenieClient) Policy() (*OpsGeniePolicyClient, error)

Policy instantiates a new OpsGeniePolicyClient.

func (*OpsGenieClient) Schedule

func (cli *OpsGenieClient) Schedule() (*OpsGenieScheduleClient, error)

Schedule instantiates a new OpsGenieScheduleClient.

func (*OpsGenieClient) SetAPIKey

func (cli *OpsGenieClient) SetAPIKey(key string)

SetAPIKey sets API Key of the OpsGenieClient and authenticates callers through the API Key at OpsGenie.

func (*OpsGenieClient) SetHTTPTransportSettings

func (cli *OpsGenieClient) SetHTTPTransportSettings(settings *HTTPTransportSettings)

SetHTTPTransportSettings sets HTTP transport layer configurations of the OpsGenieClient.

func (*OpsGenieClient) SetOpsGenieAPIUrl

func (cli *OpsGenieClient) SetOpsGenieAPIUrl(url string)

SetOpsGenieAPIUrl sets the endpoint(base URL) that requests will send. It can be used for testing purpose.

func (*OpsGenieClient) SetProxyConfiguration

func (cli *OpsGenieClient) SetProxyConfiguration(conf *ProxyConfiguration)

SetProxyConfiguration sets proxy configurations of the OpsGenieClient.

func (*OpsGenieClient) Team

func (cli *OpsGenieClient) Team() (*OpsGenieTeamClient, error)

Team instantiates a new OpsGenieTeamClient.

func (*OpsGenieClient) User

func (cli *OpsGenieClient) User() (*OpsGenieUserClient, error)

User instantiates a new OpsGenieUserClient.

type OpsGenieEscalationClient

type OpsGenieEscalationClient struct {
	OpsGenieClient
}

OpsGenieEscalationClient is the data type to make Escalation API requests.

func (*OpsGenieEscalationClient) Create

Create method creates a escalation at OpsGenie.

func (*OpsGenieEscalationClient) Delete

Delete method deletes a escalation at OpsGenie.

func (*OpsGenieEscalationClient) Get

Get method retrieves specified escalation details from OpsGenie.

func (*OpsGenieEscalationClient) List

List method retrieves escalations from OpsGenie.

func (*OpsGenieEscalationClient) SetOpsGenieClient

func (cli *OpsGenieEscalationClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieEscalationClient.

func (*OpsGenieEscalationClient) Update

Update method updates a escalation at OpsGenie.

type OpsGenieHeartbeatClient

type OpsGenieHeartbeatClient struct {
	OpsGenieClient
}

OpsGenieHeartbeatClient is the data type to make Heartbeat API requests.

func (*OpsGenieHeartbeatClient) Add

Add method creates a heartbeat at OpsGenie.

func (*OpsGenieHeartbeatClient) Delete

Delete method deletes an heartbeat from OpsGenie.

func (*OpsGenieHeartbeatClient) Disable

Disable method disables an heartbeat at OpsGenie.

func (*OpsGenieHeartbeatClient) Enable

Enable method enables an heartbeat at OpsGenie.

func (*OpsGenieHeartbeatClient) Get

Get method retrieves an heartbeat with details from OpsGenie.

func (*OpsGenieHeartbeatClient) List

List method retrieves heartbeats from OpsGenie.

func (*OpsGenieHeartbeatClient) Send

Send method sends an Heartbeat Signal to OpsGenie.

func (*OpsGenieHeartbeatClient) SetOpsGenieClient

func (cli *OpsGenieHeartbeatClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieHeartbeatClient.

func (*OpsGenieHeartbeatClient) Update

Update method changes configuration of an existing heartbeat at OpsGenie.

type OpsGenieIntegrationClient

type OpsGenieIntegrationClient struct {
	OpsGenieClient
}

OpsGenieIntegrationClient is the data type to make Integration API requests.

func (*OpsGenieIntegrationClient) Disable

Disable method disables an Integration at OpsGenie.

func (*OpsGenieIntegrationClient) Enable

Enable method enables an Integration at OpsGenie.

func (*OpsGenieIntegrationClient) SetOpsGenieClient

func (cli *OpsGenieIntegrationClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieIntegrationClient.

type OpsGeniePolicyClient

type OpsGeniePolicyClient struct {
	OpsGenieClient
}

OpsGeniePolicyClient is the data type to make Policy API requests.

func (*OpsGeniePolicyClient) Disable

Disable method disables an Policy at OpsGenie.

func (*OpsGeniePolicyClient) Enable

Enable method enables an Policy at OpsGenie.

func (*OpsGeniePolicyClient) SetOpsGenieClient

func (cli *OpsGeniePolicyClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGeniePolicyClient.

type OpsGenieScheduleClient

type OpsGenieScheduleClient struct {
	OpsGenieClient
}

OpsGenieScheduleClient is the data type to make Schedule API requests.

func (*OpsGenieScheduleClient) Create

Create method creates a schedule at OpsGenie.

func (*OpsGenieScheduleClient) Delete

Delete method deletes a schedule at OpsGenie.

func (*OpsGenieScheduleClient) Get

Get method retrieves specified schedule details from OpsGenie.

func (*OpsGenieScheduleClient) List

List method retrieves schedules from OpsGenie.

func (*OpsGenieScheduleClient) SetOpsGenieClient

func (cli *OpsGenieScheduleClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieScheduleClient.

func (*OpsGenieScheduleClient) Update

Update method updates a schedule at OpsGenie.

type OpsGenieTeamClient

type OpsGenieTeamClient struct {
	OpsGenieClient
}

OpsGenieTeamClient is the data type to make Team API requests.

func (*OpsGenieTeamClient) Create

Create method creates a team at OpsGenie.

func (*OpsGenieTeamClient) Delete

Delete method deletes a team at OpsGenie.

func (*OpsGenieTeamClient) Get

Get method retrieves specified team details from OpsGenie.

func (*OpsGenieTeamClient) List

List method retrieves teams from OpsGenie.

func (*OpsGenieTeamClient) ListLogs

ListLogs method retrieves team logs from OpsGenie.

func (*OpsGenieTeamClient) SetOpsGenieClient

func (cli *OpsGenieTeamClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieTeamClient.

func (*OpsGenieTeamClient) Update

Update method updates a team at OpsGenie.

type OpsGenieUserClient

type OpsGenieUserClient struct {
	OpsGenieClient
}

OpsGenieUserClient is the data type to make User API requests.

func (*OpsGenieUserClient) Create

Create method creates a user at OpsGenie.

func (*OpsGenieUserClient) Delete

Delete method deletes a user at OpsGenie.

func (*OpsGenieUserClient) Get

Get method retrieves specified user details from OpsGenie.

func (*OpsGenieUserClient) List

List method retrieves users from OpsGenie.

func (*OpsGenieUserClient) SetOpsGenieClient

func (cli *OpsGenieUserClient) SetOpsGenieClient(ogCli OpsGenieClient)

SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieUserClient.

func (*OpsGenieUserClient) Update

Update method updates a user at OpsGenie.

type ProxyConfiguration

type ProxyConfiguration struct {
	Host     string
	Port     int
	Username string
	Password string
	ProxyURI string
	Protocol string
}

ProxyConfiguration is the type that contains the proxy configurations of the OpsGenieClient.

Jump to

Keyboard shortcuts

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