Documentation
¶
Index ¶
- Constants
- type CreateOrUpdateEndpoint
- type CreateOrUpdateEndpointResponse
- type Endpoint
- type EndpointsClient
- func (c *EndpointsClient) CreateEndpoint(endpoint CreateOrUpdateEndpoint) (*CreateOrUpdateEndpointResponse, error)
- func (c *EndpointsClient) DeleteEndpoint(endpointId int64) error
- func (c *EndpointsClient) GetEndpoint(endpointId int64) (*Endpoint, error)
- func (c *EndpointsClient) ListEndpoints() ([]Endpoint, error)
- func (c *EndpointsClient) UpdateEndpoint(id int64, endpoint CreateOrUpdateEndpoint) (*CreateOrUpdateEndpointResponse, error)
Constants ¶
const ( EndpointTypeSlack string = "slack" EndpointTypeCustom string = "custom" EndpointTypePagerDuty string = "pagerduty" EndpointTypeBigPanda string = "bigpanda" EndpointTypeDataDog string = "datadog" EndpointTypeVictorOps string = "victorops" EndpointTypeOpsGenie string = "opsgenie" EndpointTypeServiceNow string = "servicenow" EndpointTypeMicrosoftTeams string = "microsoftteams" )
supported endpoint types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOrUpdateEndpoint ¶ added in v1.8.0
type CreateOrUpdateEndpoint struct { Title string `json:"title"` // all Description string `json:"description"` // all Url string `json:"url,omitempty"` // slack, custom, serviceNow, microsoftTeams Method string `json:"method,omitempty'"` // custom Headers *string `json:"headers,omitempty"` // custom. Set to pointer to allow an empty string BodyTemplate interface{} `json:"bodyTemplate,omitempty"` // custom ServiceKey string `json:"serviceKey,omitempty"` // pagerDuty ApiToken string `json:"apiToken,omitempty"` // bigPanda AppKey string `json:"appKey,omitempty"` // bigPanda ApiKey string `json:"apiKey,omitempty"` // dataDog, opsGenie RoutingKey string `json:"routingKey,omitempty"` // victorOps MessageType string `json:"messageType,omitempty"` // victorOps ServiceApiKey string `json:"serviceApiKey,omitempty"` // victorOps Username string `json:"username,omitempty"` // serviceNow Password string `json:"password,omitempty"` // serviceNow Type string `json:"-"` // only for identification of the endpoint }
type CreateOrUpdateEndpointResponse ¶ added in v1.8.0
type CreateOrUpdateEndpointResponse struct {
Id int32 `json:"id"`
}
type Endpoint ¶
type Endpoint struct { Type string `json:"endpointType"` Id int32 `json:"id"` Title string `json:"title"` Description string `json:"description"` Url string `json:"url,omitempty"` // slack, custom, serviceNow, microsoftTeams Method string `json:"method,omitempty'"` // custom Headers string `json:"headers,omitempty"` // custom BodyTemplate interface{} `json:"bodyTemplate,omitempty"` // custom ServiceKey string `json:"serviceKey,omitempty"` // pagerDuty ApiToken string `json:"apiToken,omitempty"` // bigPanda AppKey string `json:"appKey,omitempty"` // bigPanda ApiKey string `json:"apiKey,omitempty"` // dataDog, opsGenie RoutingKey string `json:"routingKey,omitempty"` // victorOps MessageType string `json:"messageType,omitempty"` //victorOps ServiceApiKey string `json:"serviceApiKey,omitempty"` // victorOps Username string `json:"username,omitempty"` // serviceNow Password string `json:"password,omitempty"` // serviceNow }
type EndpointsClient ¶
func New ¶
func New(apiToken, baseUrl string) (*EndpointsClient, error)
func (*EndpointsClient) CreateEndpoint ¶
func (c *EndpointsClient) CreateEndpoint(endpoint CreateOrUpdateEndpoint) (*CreateOrUpdateEndpointResponse, error)
CreateEndpoint creates a notification endpoint, return the created endpoint's id if successful, an error otherwise
func (*EndpointsClient) DeleteEndpoint ¶
func (c *EndpointsClient) DeleteEndpoint(endpointId int64) error
DeleteEndpoint deletes an endpoint, specified by its unique id, returns an error if a problem is encountered
func (*EndpointsClient) GetEndpoint ¶
func (c *EndpointsClient) GetEndpoint(endpointId int64) (*Endpoint, error)
GetEndpoint returns an endpoint given its unique identifier, an error otherwise
func (*EndpointsClient) ListEndpoints ¶
func (c *EndpointsClient) ListEndpoints() ([]Endpoint, error)
ListEndpoints returns all the endpoints in an array associated with the account identified by the supplied API token, returns an error if any problem occurs during the API call
func (*EndpointsClient) UpdateEndpoint ¶
func (c *EndpointsClient) UpdateEndpoint(id int64, endpoint CreateOrUpdateEndpoint) (*CreateOrUpdateEndpointResponse, error)
UpdateEndpoint updates an existing endpoint, based on the supplied identifier, using the parameters of the specified endpoint Returns the updated endpoint id if successful, an error otherwise