Documentation
¶
Index ¶
- func CheckResponse(r *http.Response) error
- type Alert
- type AlertEvalMatch
- type AlertPayload
- type AlertService
- type Client
- type CreateEscalationChainOptions
- type CreateEscalationOptions
- type CreateIntegrationOptions
- type CreateOnCallShiftOptions
- type CreateRouteOptions
- type CreateScheduleOptions
- type CreateUserNotificationRuleOptions
- type CreateWebhookOptions
- type DefaultRoute
- type DeleteEscalationChainOptions
- type DeleteEscalationOptions
- type DeleteIntegrationOptions
- type DeleteOnCallShiftOptions
- type DeleteRouteOptions
- type DeleteScheduleOptions
- type DeleteUserNotificationRuleOptions
- type DeleteWebhookOptions
- type ErrorResponse
- type Escalation
- type EscalationChain
- type EscalationChainService
- func (service *EscalationChainService) CreateEscalationChain(opt *CreateEscalationChainOptions) (*EscalationChain, *http.Response, error)
- func (service *EscalationChainService) DeleteEscalationChain(id string, opt *DeleteEscalationChainOptions) (*http.Response, error)
- func (service *EscalationChainService) GetEscalationChain(id string, opt *GetEscalationChainOptions) (*EscalationChain, *http.Response, error)
- func (service *EscalationChainService) ListEscalationChains(opt *ListEscalationChainOptions) (*PaginatedEscalationChainsResponse, *http.Response, error)
- func (service *EscalationChainService) UpdateEscalationChain(id string, opt *UpdateEscalationChainOptions) (*EscalationChain, *http.Response, error)
- type EscalationService
- func (service *EscalationService) CreateEscalation(opt *CreateEscalationOptions) (*Escalation, *http.Response, error)
- func (service *EscalationService) DeleteEscalation(id string, opt *DeleteEscalationOptions) (*http.Response, error)
- func (service *EscalationService) GetEscalation(id string, opt *GetEscalationOptions) (*Escalation, *http.Response, error)
- func (service *EscalationService) ListEscalations(opt *ListEscalationOptions) (*PaginatedEscalationsResponse, *http.Response, error)
- func (service *EscalationService) UpdateEscalation(id string, opt *UpdateEscalationOptions) (*Escalation, *http.Response, error)
- type GetEscalationChainOptions
- type GetEscalationOptions
- type GetIntegrationOptions
- type GetOnCallShiftOptions
- type GetRouteOptions
- type GetScheduleOptions
- type GetTeamOptions
- type GetUserNotificationRuleOptions
- type GetUserOptions
- type GetWebhookOptions
- type ImageURLTemplate
- type Integration
- type IntegrationService
- func (service *IntegrationService) CreateIntegration(opt *CreateIntegrationOptions) (*Integration, *http.Response, error)
- func (service *IntegrationService) DeleteIntegration(id string, opt *DeleteIntegrationOptions) (*http.Response, error)
- func (service *IntegrationService) GetIntegration(id string, opt *GetIntegrationOptions) (*Integration, *http.Response, error)
- func (service *IntegrationService) ListIntegrations(opt *ListIntegrationOptions) (*PaginatedIntegrationsResponse, *http.Response, error)
- func (service *IntegrationService) UpdateIntegration(id string, opt *UpdateIntegrationOptions) (*Integration, *http.Response, error)
- type ListAlertOptions
- type ListEscalationChainOptions
- type ListEscalationOptions
- type ListIntegrationOptions
- type ListOnCallShiftOptions
- type ListOptions
- type ListRouteOptions
- type ListScheduleOptions
- type ListSlackChannelOptions
- type ListTeamOptions
- type ListUserGroupOptions
- type ListUserNotificationRuleOptions
- type ListUserOptions
- type ListWebhookOptions
- type MSTeamsRoute
- type MessageTemplate
- type OnCallShift
- type OnCallShiftService
- func (service *OnCallShiftService) CreateOnCallShift(opt *CreateOnCallShiftOptions) (*OnCallShift, *http.Response, error)
- func (service *OnCallShiftService) DeleteOnCallShift(id string, opt *DeleteOnCallShiftOptions) (*http.Response, error)
- func (service *OnCallShiftService) GetOnCallShift(id string, opt *GetOnCallShiftOptions) (*OnCallShift, *http.Response, error)
- func (service *OnCallShiftService) ListOnCallShifts(opt *ListOnCallShiftOptions) (*PaginatedOnCallShiftsResponse, *http.Response, error)
- func (service *OnCallShiftService) UpdateOnCallShift(id string, opt *UpdateOnCallShiftOptions) (*OnCallShift, *http.Response, error)
- type PaginatedAlertsResponse
- type PaginatedEscalationChainsResponse
- type PaginatedEscalationsResponse
- type PaginatedIntegrationsResponse
- type PaginatedOnCallShiftsResponse
- type PaginatedResponse
- type PaginatedRoutesResponse
- type PaginatedSchedulesResponse
- type PaginatedSlackChannelsResponse
- type PaginatedTeamsResponse
- type PaginatedUserGroupsResponse
- type PaginatedUserNotificationRulesResponse
- type PaginatedUsersResponse
- type PaginatedWebhooksResponse
- type Route
- type RouteService
- func (service *RouteService) CreateRoute(opt *CreateRouteOptions) (*Route, *http.Response, error)
- func (service *RouteService) DeleteRoute(id string, opt *DeleteRouteOptions) (*http.Response, error)
- func (service *RouteService) GetRoute(id string, opt *GetRouteOptions) (*Route, *http.Response, error)
- func (service *RouteService) ListRoutes(opt *ListRouteOptions) (*PaginatedRoutesResponse, *http.Response, error)
- func (service *RouteService) UpdateRoute(id string, opt *UpdateRouteOptions) (*Route, *http.Response, error)
- type Schedule
- type ScheduleService
- func (service *ScheduleService) CreateSchedule(opt *CreateScheduleOptions) (*Schedule, *http.Response, error)
- func (service *ScheduleService) DeleteSchedule(id string, opt *DeleteScheduleOptions) (*http.Response, error)
- func (service *ScheduleService) GetSchedule(id string, opt *GetScheduleOptions) (*Schedule, *http.Response, error)
- func (service *ScheduleService) ListSchedules(opt *ListScheduleOptions) (*PaginatedSchedulesResponse, *http.Response, error)
- func (service *ScheduleService) UpdateSchedule(id string, opt *UpdateScheduleOptions) (*Schedule, *http.Response, error)
- type SlackChannel
- type SlackChannelService
- type SlackRoute
- type SlackSchedule
- type SlackUserGroup
- type Team
- type TeamService
- type TelegramRoute
- type Templates
- type TitleMessageImageTemplate
- type TitleMessageTemplate
- type TitleTemplate
- type UpdateEscalationChainOptions
- type UpdateEscalationOptions
- type UpdateIntegrationOptions
- type UpdateOnCallShiftOptions
- type UpdateRouteOptions
- type UpdateScheduleOptions
- type UpdateUserNotificationRuleOptions
- type UpdateWebhookOptions
- type User
- type UserGroup
- type UserGroupService
- type UserNotificationRule
- type UserNotificationRuleService
- func (service *UserNotificationRuleService) CreateUserNotificationRule(opt *CreateUserNotificationRuleOptions) (*UserNotificationRule, *http.Response, error)
- func (service *UserNotificationRuleService) DeleteUserNotificationRule(id string, opt *DeleteUserNotificationRuleOptions) (*http.Response, error)
- func (service *UserNotificationRuleService) GetUserNotificationRule(id string, opt *GetUserNotificationRuleOptions) (*UserNotificationRule, *http.Response, error)
- func (service *UserNotificationRuleService) ListUserNotificationRules(opt *ListUserNotificationRuleOptions) (*PaginatedUserNotificationRulesResponse, *http.Response, error)
- func (service *UserNotificationRuleService) UpdateUserNotificationRule(id string, opt *UpdateUserNotificationRuleOptions) (*UserNotificationRule, *http.Response, error)
- type UserService
- type Webhook
- type WebhookService
- func (service *WebhookService) CreateWebhook(opt *CreateWebhookOptions) (*Webhook, *http.Response, error)
- func (service *WebhookService) DeleteWebhook(id string, opt *DeleteWebhookOptions) (*http.Response, error)
- func (service *WebhookService) GetWebhook(id string, opt *GetWebhookOptions) (*Webhook, *http.Response, error)
- func (service *WebhookService) ListWebhooks(opt *ListWebhookOptions) (*PaginatedWebhooksResponse, *http.Response, error)
- func (service *WebhookService) UpdateWebhook(id string, opt *UpdateWebhookOptions) (*Webhook, *http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
Types ¶
type Alert ¶ added in v0.0.5
type Alert struct { ID string `json:"id"` AlertGroupID string `json:"alert_group_id"` CreatedAt string `json:"created_at"` Payload AlertPayload `json:"payload"` }
Alert represents an on-call alert.
type AlertEvalMatch ¶ added in v0.0.5
type AlertEvalMatch struct { Tags []string `json:"tags"` Value int64 `json:"value"` Metric string `json:"metric"` }
AlertEvalMatch represents an on-call alert payload evalMatch.
type AlertPayload ¶ added in v0.0.5
type AlertPayload struct { State string `json:"state"` Title string `json:"title"` RuleID int `json:"ruleId"` Message string `json:"message"` RuleURL string `json:"ruleUrl"` RuleName string `json:"ruleName"` EvalMatches []AlertEvalMatch `json:"evalMatches"` }
AlertPayload represents an on-call alert payload.
type AlertService ¶ added in v0.0.5
type AlertService struct {
// contains filtered or unexported fields
}
AlertService handles requests to the on-call alerts endpoint.
// https://grafana.com/docs/oncall/latest/oncall-api-reference/alerts/
func NewAlertService ¶ added in v0.0.5
func NewAlertService(client *Client) *AlertService
NewAlertService creates an AlertService with the defined URL.
func (*AlertService) ListAlerts ¶ added in v0.0.5
func (service *AlertService) ListAlerts(opt *ListAlertOptions) (*PaginatedAlertsResponse, *http.Response, error)
ListAlerts fetches all on-call alerts for authorized organization.
https://grafana.com/docs/oncall/latest/oncall-api-reference/alerts/
type Client ¶
type Client struct { UserAgent string // List of Services. Keep in sync with func newClient Alerts *AlertService Integrations *IntegrationService EscalationChains *EscalationChainService Escalations *EscalationService Users *UserService Schedules *ScheduleService Routes *RouteService SlackChannels *SlackChannelService UserGroups *UserGroupService OnCallShifts *OnCallShiftService Teams *TeamService Webhooks *WebhookService UserNotificationRules *UserNotificationRuleService // contains filtered or unexported fields }
func NewWithGrafanaURL ¶ added in v0.0.18
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.
func (*Client) GrafanaURL ¶ added in v0.0.18
func (*Client) NewRequest ¶
type CreateEscalationOptions ¶
type CreateEscalationOptions struct { EscalationChainId string `json:"escalation_chain_id,omitempty"` Position *int `json:"position,omitempty"` Type *string `json:"type"` Duration int `json:"duration,omitempty"` PersonsToNotify *[]string `json:"persons_to_notify,omitempty"` PersonsToNotifyNextEachTime *[]string `json:"persons_to_notify_next_each_time,omitempty"` TeamToNotify string `json:"team_to_notify,omitempty"` NotifyOnCallFromSchedule string `json:"notify_on_call_from_schedule,omitempty"` ActionToTrigger string `json:"action_to_trigger,omitempty"` GroupToNotify string `json:"group_to_notify,omitempty"` ManualOrder bool `json:"manual_order,omitempty"` Important *bool `json:"important,omitempty"` NotifyIfTimeFrom string `json:"notify_if_time_from,omitempty"` NotifyIfTimeTo string `json:"notify_if_time_to,omitempty"` Severity string `json:"severity,omitempty"` }
type CreateIntegrationOptions ¶
type CreateIntegrationOptions struct { TeamId string `json:"team_id"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Templates *Templates `json:"templates,omitempty"` DefaultRoute *DefaultRoute `json:"default_route,omitempty"` }
type CreateOnCallShiftOptions ¶
type CreateOnCallShiftOptions struct { TeamId string `json:"team_id"` Type string `json:"type"` Name string `json:"name"` Level *int `json:"level,omitempty"` Start string `json:"start"` Duration int `json:"duration"` Until *string `json:"until"` Frequency *string `json:"frequency"` Users *[]string `json:"users"` Interval *int `json:"interval"` WeekStart *string `json:"week_start,omitempty"` ByDay *[]string `json:"by_day"` ByMonth *[]int `json:"by_month"` ByMonthday *[]int `json:"by_monthday"` Source int `json:"source"` RollingUsers *[][]string `json:"rolling_users"` TimeZone *string `json:"time_zone"` StartRotationFromUserIndex *int `json:"start_rotation_from_user_index"` }
type CreateRouteOptions ¶
type CreateRouteOptions struct { IntegrationId string `json:"integration_id,omitempty"` EscalationChainId string `json:"escalation_chain_id,omitempty"` Position *int `json:"position,omitempty"` RoutingRegex string `json:"routing_regex,omitempty"` RoutingType string `json:"routing_type,omitempty"` Slack *SlackRoute `json:"slack,omitempty"` Telegram *TelegramRoute `json:"telegram,omitempty"` MSTeams *MSTeamsRoute `json:"msteams,omitempty"` ManualOrder bool `url:"manual_order,omitempty" json:"manual_order,omitempty"` }
type CreateScheduleOptions ¶
type CreateScheduleOptions struct { TeamId string `json:"team_id"` Name string `json:"name"` Type string `json:"type"` ICalUrlPrimary *string `json:"ical_url_primary"` ICalUrlOverrides *string `json:"ical_url_overrides"` EnableWebOverrides bool `json:"enable_web_overrides"` TimeZone string `json:"time_zone,omitempty"` Slack *SlackSchedule `json:"slack,omitempty"` Shifts *[]string `json:"shifts"` }
type CreateUserNotificationRuleOptions ¶ added in v0.0.12
type CreateUserNotificationRuleOptions struct { UserId string `json:"user_id,omitempty"` Position *int `json:"position,omitempty"` Duration *int `json:"duration,omitempty"` Important bool `json:"important,omitempty"` Type string `json:"type,omitempty"` ManualOrder bool `json:"manual_order,omitempty"` }
type CreateWebhookOptions ¶ added in v0.0.11
type CreateWebhookOptions struct { Name string `json:"name"` Team string `json:"team"` Url string `json:"url"` TriggerType string `json:"trigger_type"` HttpMethod string `json:"http_method"` Data *string `json:"data"` Username *string `json:"username"` Password *string `json:"password"` AuthorizationHeader *string `json:"authorization_header"` TriggerTemplate *string `json:"trigger_template"` Headers *string `json:"headers"` ForwardAll bool `json:"forward_all"` IntegrationFilter *[]string `json:"integration_filter"` IsWebhookEnabled bool `json:"is_webhook_enabled"` }
type DefaultRoute ¶
type DefaultRoute struct { ID string `json:"id"` EscalationChainId *string `json:"escalation_chain_id"` SlackRoute *SlackRoute `json:"slack,omitempty"` TelegramRoute *TelegramRoute `json:"telegram,omitempty"` MSTeamsRoute *MSTeamsRoute `json:"msteams,omitempty"` }
type DeleteEscalationChainOptions ¶
type DeleteEscalationChainOptions struct { }
type DeleteEscalationOptions ¶
type DeleteEscalationOptions struct { }
type DeleteIntegrationOptions ¶
type DeleteIntegrationOptions struct { }
type DeleteOnCallShiftOptions ¶
type DeleteOnCallShiftOptions struct { }
type DeleteRouteOptions ¶
type DeleteRouteOptions struct { }
type DeleteScheduleOptions ¶
type DeleteScheduleOptions struct { }
type DeleteUserNotificationRuleOptions ¶ added in v0.0.12
type DeleteUserNotificationRuleOptions struct { }
type DeleteWebhookOptions ¶ added in v0.0.11
type DeleteWebhookOptions struct { }
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type Escalation ¶
type Escalation struct { ID string `json:"id"` EscalationChainId string `json:"escalation_chain_id"` Position int `json:"position"` Type *string `json:"type"` Duration *int `json:"duration"` PersonsToNotify *[]string `json:"persons_to_notify"` PersonsToNotifyEachTime *[]string `json:"persons_to_notify_next_each_time"` TeamToNotify *string `json:"team_to_notify"` NotifyOnCallFromSchedule *string `json:"notify_on_call_from_schedule"` ActionToTrigger *string `json:"action_to_trigger"` GroupToNotify *string `json:"group_to_notify"` Important *bool `json:"important"` NotifyIfTimeFrom *string `json:"notify_if_time_from"` NotifyIfTimeTo *string `json:"notify_if_time_to"` Severity *string `json:"severity"` }
type EscalationChain ¶
type EscalationChainService ¶
type EscalationChainService struct {
// contains filtered or unexported fields
}
EscalationChainService handles requests to escalation chain endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/escalation_chains/
func NewEscalationChainService ¶
func NewEscalationChainService(client *Client) *EscalationChainService
NewEscalationChainService creates EscalationChainService with corresponding url part
func (*EscalationChainService) CreateEscalationChain ¶
func (service *EscalationChainService) CreateEscalationChain(opt *CreateEscalationChainOptions) (*EscalationChain, *http.Response, error)
CreateEscalationChain creates escalation chain with name and team_id.
func (*EscalationChainService) DeleteEscalationChain ¶
func (service *EscalationChainService) DeleteEscalationChain(id string, opt *DeleteEscalationChainOptions) (*http.Response, error)
DeleteEscalationChain deletes escalation chain.
func (*EscalationChainService) GetEscalationChain ¶
func (service *EscalationChainService) GetEscalationChain(id string, opt *GetEscalationChainOptions) (*EscalationChain, *http.Response, error)
GetEscalationChain fetches escalation chain by given id.
func (*EscalationChainService) ListEscalationChains ¶
func (service *EscalationChainService) ListEscalationChains(opt *ListEscalationChainOptions) (*PaginatedEscalationChainsResponse, *http.Response, error)
ListEscalationChains fetches all escalation chains for current organization.
func (*EscalationChainService) UpdateEscalationChain ¶
func (service *EscalationChainService) UpdateEscalationChain(id string, opt *UpdateEscalationChainOptions) (*EscalationChain, *http.Response, error)
UpdateEscalationChain updates escalation chain with name.
type EscalationService ¶
type EscalationService struct {
// contains filtered or unexported fields
}
EscalationService handles requests to escalation endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/escalation_policies/
func NewEscalationService ¶
func NewEscalationService(client *Client) *EscalationService
NewEscalationService creates EscalationService with defined url
func (*EscalationService) CreateEscalation ¶
func (service *EscalationService) CreateEscalation(opt *CreateEscalationOptions) (*Escalation, *http.Response, error)
CreateEscalation creates an escalation
func (*EscalationService) DeleteEscalation ¶
func (service *EscalationService) DeleteEscalation(id string, opt *DeleteEscalationOptions) (*http.Response, error)
DeleteEscalation deletes an escalation
func (*EscalationService) GetEscalation ¶
func (service *EscalationService) GetEscalation(id string, opt *GetEscalationOptions) (*Escalation, *http.Response, error)
GetEscalation fetches an escalation by given id
func (*EscalationService) ListEscalations ¶
func (service *EscalationService) ListEscalations(opt *ListEscalationOptions) (*PaginatedEscalationsResponse, *http.Response, error)
ListEscalations gets all escalations for authorized organization
func (*EscalationService) UpdateEscalation ¶
func (service *EscalationService) UpdateEscalation(id string, opt *UpdateEscalationOptions) (*Escalation, *http.Response, error)
UpdateEscalation updates an escalation with new templates and/or name. At least one field in template is required
type GetEscalationChainOptions ¶
type GetEscalationChainOptions struct { }
type GetEscalationOptions ¶
type GetEscalationOptions struct { }
type GetIntegrationOptions ¶
type GetIntegrationOptions struct { }
type GetOnCallShiftOptions ¶
type GetOnCallShiftOptions struct { }
type GetRouteOptions ¶
type GetRouteOptions struct { }
type GetScheduleOptions ¶
type GetScheduleOptions struct { }
type GetTeamOptions ¶
type GetTeamOptions struct { }
type GetUserNotificationRuleOptions ¶ added in v0.0.12
type GetUserNotificationRuleOptions struct { }
type GetUserOptions ¶
type GetUserOptions struct { }
type GetWebhookOptions ¶ added in v0.0.11
type GetWebhookOptions struct { }
type ImageURLTemplate ¶ added in v0.0.7
type ImageURLTemplate struct {
ImageURL *string `json:"image_url"`
}
type Integration ¶
type IntegrationService ¶
type IntegrationService struct {
// contains filtered or unexported fields
}
IntegrationService handles requests to integration endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/integrations/
func NewIntegrationService ¶
func NewIntegrationService(client *Client) *IntegrationService
NewIntegrationService creates IntegrationService with corresponding url part
func (*IntegrationService) CreateIntegration ¶
func (service *IntegrationService) CreateIntegration(opt *CreateIntegrationOptions) (*Integration, *http.Response, error)
CreateIntegration creates integration with type, team_id and optional given name.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/integrations/#get-integration
func (*IntegrationService) DeleteIntegration ¶
func (service *IntegrationService) DeleteIntegration(id string, opt *DeleteIntegrationOptions) (*http.Response, error)
DeleteIntegration deletes integration.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/integrations/#delete-integration
func (*IntegrationService) GetIntegration ¶
func (service *IntegrationService) GetIntegration(id string, opt *GetIntegrationOptions) (*Integration, *http.Response, error)
GetIntegration fetches integration by given id.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/integrations/#get-integration
func (*IntegrationService) ListIntegrations ¶
func (service *IntegrationService) ListIntegrations(opt *ListIntegrationOptions) (*PaginatedIntegrationsResponse, *http.Response, error)
ListIntegrations fetches all integrations for current organization.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/integrations/#get-integration
func (*IntegrationService) UpdateIntegration ¶
func (service *IntegrationService) UpdateIntegration(id string, opt *UpdateIntegrationOptions) (*Integration, *http.Response, error)
UpdateIntegration updates integration with new templates, name and default route. To update template it is enough to provide at least one field.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/integrations/#update-integration
type ListAlertOptions ¶ added in v0.0.5
type ListAlertOptions struct { ListOptions AlertGroupID string `url:"alert_group_id,omitempty" json:"alert_group_id,omitempty"` Name string `url:"search,omitempty" json:"search,omitempty"` }
ListAlertOptions represent filter options supported by the on-call alerts API.
type ListEscalationChainOptions ¶
type ListEscalationChainOptions struct { ListOptions Name string `url:"name,omitempty" json:"name,omitempty"` }
type ListEscalationOptions ¶
type ListEscalationOptions struct {
ListOptions
}
Empty struct is here in case we want to add request params to ListEscalations.
type ListIntegrationOptions ¶
type ListIntegrationOptions struct {
ListOptions
}
type ListOnCallShiftOptions ¶
type ListOnCallShiftOptions struct { ListOptions ScheduleId string `url:"schedule_id,omitempty" json:"schedule_id,omitempty"` Name string `url:"name,omitempty" json:"name,omitempty"` }
type ListOptions ¶
type ListOptions struct {
Page int `url:"page,omitempty" json:"page,omitempty"`
}
type ListRouteOptions ¶
type ListRouteOptions struct { ListOptions IntegrationId string `url:"integration_id,omitempty" json:"integration_id,omitempty"` RoutingRegex string `url:"routing_regex,omitempty" json:"routing_regex,omitempty"` RoutingType string `url:"routing_type,omitempty" json:"routing_type,omitempty"` }
type ListScheduleOptions ¶
type ListScheduleOptions struct { ListOptions Name string `url:"name,omitempty" json:"name,omitempty"` }
type ListSlackChannelOptions ¶
type ListSlackChannelOptions struct { ListOptions ChannelName string `url:"channel_name,omitempty" json:"channel_name,omitempty"` }
type ListTeamOptions ¶
type ListTeamOptions struct { ListOptions Name string `url:"name,omitempty" json:"name,omitempty"` }
type ListUserGroupOptions ¶
type ListUserGroupOptions struct { ListOptions SlackHandle string `url:"slack_handle,omitempty" json:"slack_handle,omitempty"` }
type ListUserNotificationRuleOptions ¶ added in v0.0.12
type ListUserNotificationRuleOptions struct { ListOptions UserId string `url:"user_id,omitempty" json:"user_id,omitempty"` Important string `url:"important,omitempty" json:"important,omitempty"` }
type ListUserOptions ¶
type ListUserOptions struct { ListOptions Username string `url:"username,omitempty" json:"username,omitempty"` }
type ListWebhookOptions ¶ added in v0.0.11
type ListWebhookOptions struct { ListOptions Name string `url:"name,omitempty" json:"name,omitempty"` }
type MSTeamsRoute ¶ added in v0.0.5
type MessageTemplate ¶ added in v0.0.7
type MessageTemplate struct {
Message *string `json:"message"`
}
type OnCallShift ¶
type OnCallShift struct { ID string `json:"id"` TeamId string `json:"team_id"` Type string `json:"type"` Name string `json:"name"` Level int `json:"level"` Start string `json:"start"` Duration int `json:"duration"` Until *string `json:"until"` Frequency *string `json:"frequency"` Users *[]string `json:"users"` Interval *int `json:"interval"` WeekStart *string `json:"week_start"` ByDay *[]string `json:"by_day"` ByMonth *[]int `json:"by_month"` ByMonthday *[]int `json:"by_monthday"` RollingUsers *[][]string `json:"rolling_users"` TimeZone *string `json:"time_zone"` StartRotationFromUserIndex *int `json:"start_rotation_from_user_index"` }
type OnCallShiftService ¶
type OnCallShiftService struct {
// contains filtered or unexported fields
}
OnCallShiftService handles requests to on-call shift endpoint
// https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/on_call_shifts/
func NewOnCallShiftService ¶
func NewOnCallShiftService(client *Client) *OnCallShiftService
NewOnCallShiftService creates OnCallShiftService with defined url
func (*OnCallShiftService) CreateOnCallShift ¶
func (service *OnCallShiftService) CreateOnCallShift(opt *CreateOnCallShiftOptions) (*OnCallShift, *http.Response, error)
CreateOnCallShift creates an on-call shift
func (*OnCallShiftService) DeleteOnCallShift ¶
func (service *OnCallShiftService) DeleteOnCallShift(id string, opt *DeleteOnCallShiftOptions) (*http.Response, error)
DeleteOnCallShift deletes on-call shift
func (*OnCallShiftService) GetOnCallShift ¶
func (service *OnCallShiftService) GetOnCallShift(id string, opt *GetOnCallShiftOptions) (*OnCallShift, *http.Response, error)
GetOnCallShift fetches shift by given id
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/on_call_shifts/#get-oncall-shifts
func (*OnCallShiftService) ListOnCallShifts ¶
func (service *OnCallShiftService) ListOnCallShifts(opt *ListOnCallShiftOptions) (*PaginatedOnCallShiftsResponse, *http.Response, error)
ListOnCallShifts fetches all on-call shifts for authorized organization
func (*OnCallShiftService) UpdateOnCallShift ¶
func (service *OnCallShiftService) UpdateOnCallShift(id string, opt *UpdateOnCallShiftOptions) (*OnCallShift, *http.Response, error)
UpdateOnCallShift updates on-call shift
type PaginatedAlertsResponse ¶ added in v0.0.5
type PaginatedAlertsResponse struct { PaginatedResponse Alerts []*Alert `json:"results"` }
PaginatedAlertsResponse represents a paginated response from the on-call alerts API.
type PaginatedEscalationChainsResponse ¶
type PaginatedEscalationChainsResponse struct { PaginatedResponse EscalationChains []*EscalationChain `json:"results"` }
type PaginatedEscalationsResponse ¶
type PaginatedEscalationsResponse struct { PaginatedResponse Escalations []*Escalation `json:"results"` }
type PaginatedIntegrationsResponse ¶
type PaginatedIntegrationsResponse struct { PaginatedResponse Integrations []*Integration `json:"results"` }
type PaginatedOnCallShiftsResponse ¶
type PaginatedOnCallShiftsResponse struct { PaginatedResponse OnCallShifts []*OnCallShift `json:"results"` }
type PaginatedResponse ¶
type PaginatedRoutesResponse ¶
type PaginatedRoutesResponse struct { PaginatedResponse Routes []*Route `json:"results"` }
type PaginatedSchedulesResponse ¶
type PaginatedSchedulesResponse struct { PaginatedResponse Schedules []*Schedule `json:"results"` }
type PaginatedSlackChannelsResponse ¶
type PaginatedSlackChannelsResponse struct { PaginatedResponse SlackChannels []*SlackChannel `json:"results"` }
type PaginatedTeamsResponse ¶
type PaginatedTeamsResponse struct { PaginatedResponse Teams []*Team `json:"results"` }
type PaginatedUserGroupsResponse ¶
type PaginatedUserGroupsResponse struct { PaginatedResponse UserGroups []*UserGroup `json:"results"` }
type PaginatedUserNotificationRulesResponse ¶ added in v0.0.12
type PaginatedUserNotificationRulesResponse struct { PaginatedResponse UserNotificationRules []*UserNotificationRule `json:"results"` }
type PaginatedUsersResponse ¶
type PaginatedUsersResponse struct { PaginatedResponse Users []*User `json:"results"` }
type PaginatedWebhooksResponse ¶ added in v0.0.11
type PaginatedWebhooksResponse struct { PaginatedResponse Webhooks []*Webhook `json:"results"` }
type Route ¶
type Route struct { ID string `json:"id"` IntegrationId string `json:"integration_id"` EscalationChainId string `json:"escalation_chain_id"` Position int `json:"position"` RoutingRegex string `json:"routing_regex"` RoutingType string `json:"routing_type"` IsTheLastRoute bool `json:"is_the_last_route"` SlackRoute *SlackRoute `json:"slack"` TelegramRoute *TelegramRoute `json:"telegram"` MSTeamsRoute *MSTeamsRoute `json:"msteams"` }
type RouteService ¶
type RouteService struct {
// contains filtered or unexported fields
}
RouteService handles requests to route endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/routes/
func NewRouteService ¶
func NewRouteService(client *Client) *RouteService
NewRouteService creates RouteService with defined url
func (*RouteService) CreateRoute ¶
func (service *RouteService) CreateRoute(opt *CreateRouteOptions) (*Route, *http.Response, error)
CreateRoute creates route with given name and type
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/routes/#create-a-route
func (*RouteService) DeleteRoute ¶
func (service *RouteService) DeleteRoute(id string, opt *DeleteRouteOptions) (*http.Response, error)
DeleteRoute deletes route
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/routes/#delete-a-route
func (*RouteService) GetRoute ¶
func (service *RouteService) GetRoute(id string, opt *GetRouteOptions) (*Route, *http.Response, error)
GetRoute fetches route by given id
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/routes/#get-a-route
func (*RouteService) ListRoutes ¶
func (service *RouteService) ListRoutes(opt *ListRouteOptions) (*PaginatedRoutesResponse, *http.Response, error)
ListRoutes fetches all routes for authorized organization
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/routes/#list-routes
func (*RouteService) UpdateRoute ¶
func (service *RouteService) UpdateRoute(id string, opt *UpdateRouteOptions) (*Route, *http.Response, error)
UpdateRoute updates route with new templates and/or name. At least one field in template is required
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/routes/#update-route
type Schedule ¶
type Schedule struct { ID string `json:"id"` TeamId string `json:"team_id"` Type string `json:"type"` OnCallNow []string `json:"on_call_now"` Name string `json:"name"` ICalUrlPrimary *string `json:"ical_url_primary"` ICalUrlOverrides *string `json:"ical_url_overrides"` EnableWebOverrides bool `json:"enable_web_overrides"` TimeZone string `json:"time_zone"` Slack *SlackSchedule `json:"slack"` Shifts *[]string `json:"shifts"` }
type ScheduleService ¶
type ScheduleService struct {
// contains filtered or unexported fields
}
ScheduleService handles requests to schedule endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/schedules/
func NewScheduleService ¶
func NewScheduleService(client *Client) *ScheduleService
NewScheduleService creates ScheduleService with defined url
func (*ScheduleService) CreateSchedule ¶
func (service *ScheduleService) CreateSchedule(opt *CreateScheduleOptions) (*Schedule, *http.Response, error)
CreateSchedule creates a schedule with given name, type and other parameters depending on type/
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/schedules/#create-a-schedule
func (*ScheduleService) DeleteSchedule ¶
func (service *ScheduleService) DeleteSchedule(id string, opt *DeleteScheduleOptions) (*http.Response, error)
DeleteSchedule deletes a schedule.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/schedules/#delete-a-schedule
func (*ScheduleService) GetSchedule ¶
func (service *ScheduleService) GetSchedule(id string, opt *GetScheduleOptions) (*Schedule, *http.Response, error)
GetSchedule fetches a schedule by given id
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/schedules/#get-a-schedule
func (*ScheduleService) ListSchedules ¶
func (service *ScheduleService) ListSchedules(opt *ListScheduleOptions) (*PaginatedSchedulesResponse, *http.Response, error)
ListSchedules fetches all schedules for authorized organization
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/schedules/#list-schedules
func (*ScheduleService) UpdateSchedule ¶
func (service *ScheduleService) UpdateSchedule(id string, opt *UpdateScheduleOptions) (*Schedule, *http.Response, error)
UpdateSchedule updates a schedule.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/schedules/#update-a-schedule
type SlackChannel ¶
type SlackChannelService ¶
type SlackChannelService struct {
// contains filtered or unexported fields
}
SlackChannelService handles requests to slack channel endpoint
// https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/slack_channels/
func NewSlackChannelService ¶
func NewSlackChannelService(client *Client) *SlackChannelService
NewSlackChannelsService creates SlackChannelService with defined url
func (*SlackChannelService) ListSlackChannels ¶
func (service *SlackChannelService) ListSlackChannels(opt *ListSlackChannelOptions) (*PaginatedSlackChannelsResponse, *http.Response, error)
ListSlackChannels gets all slackChannels for authorized organization
type SlackRoute ¶
type SlackSchedule ¶
type SlackUserGroup ¶
type TeamService ¶
type TeamService struct {
// contains filtered or unexported fields
}
TeamService handles requests to team endpoint
func NewTeamService ¶
func NewTeamService(client *Client) *TeamService
NewTeamService creates TeamService with defined url
func (*TeamService) GetTeam ¶
func (service *TeamService) GetTeam(id string, opt *GetTeamOptions) (*Team, *http.Response, error)
GetTeam fetches team by given id
func (*TeamService) ListTeams ¶
func (service *TeamService) ListTeams(opt *ListTeamOptions) (*PaginatedTeamsResponse, *http.Response, error)
ListTeams fetchs all Teams for authorized user
type TelegramRoute ¶ added in v0.0.5
type Templates ¶
type Templates struct { GroupingKey *string `json:"grouping_key"` ResolveSignal *string `json:"resolve_signal"` AcknowledgeSignal *string `json:"acknowledge_signal"` SourceLink *string `json:"source_link"` Slack *TitleMessageImageTemplate `json:"slack"` Web *TitleMessageImageTemplate `json:"web"` MSTeams *TitleMessageImageTemplate `json:"msteams"` Telegram *TitleMessageImageTemplate `json:"telegram"` PhoneCall *TitleTemplate `json:"phone_call"` SMS *TitleTemplate `json:"sms"` Email *TitleMessageTemplate `json:"email"` MobileApp *TitleMessageTemplate `json:"mobile_app"` }
type TitleMessageImageTemplate ¶ added in v0.0.7
type TitleMessageTemplate ¶ added in v0.0.7
type TitleTemplate ¶ added in v0.0.7
type TitleTemplate struct {
Title *string `json:"title"`
}
type UpdateEscalationOptions ¶
type UpdateEscalationOptions struct { Position *int `json:"position,omitempty"` Type *string `json:"type"` Duration int `json:"duration,omitempty"` PersonsToNotify *[]string `json:"persons_to_notify,omitempty"` PersonsToNotifyEachTime *[]string `json:"persons_to_notify_next_each_time,omitempty"` TeamToNotify string `json:"team_to_notify,omitempty"` NotifyOnCallFromSchedule string `json:"notify_on_call_from_schedule,omitempty"` ActionToTrigger string `json:"action_to_trigger,omitempty"` GroupToNotify string `json:"group_to_notify,omitempty"` ManualOrder bool `json:"manual_order,omitempty"` Important *bool `json:"important,omitempty"` NotifyIfTimeFrom string `json:"notify_if_time_from,omitempty"` NotifyIfTimeTo string `json:"notify_if_time_to,omitempty"` Severity string `json:"severity,omitempty"` }
type UpdateIntegrationOptions ¶
type UpdateIntegrationOptions struct { Name string `json:"name,omitempty"` TeamId string `json:"team_id"` Templates *Templates `json:"templates,omitempty"` DefaultRoute *DefaultRoute `json:"default_route,omitempty"` }
type UpdateOnCallShiftOptions ¶
type UpdateOnCallShiftOptions struct { Type string `json:"type"` Name string `json:"name"` TeamId string `json:"team_id"` Level *int `json:"level,omitempty"` Start string `json:"start"` Duration int `json:"duration"` Until *string `json:"until"` Frequency *string `json:"frequency"` Users *[]string `json:"users"` Interval *int `json:"interval"` WeekStart *string `json:"week_start,omitempty"` ByDay *[]string `json:"by_day"` ByMonth *[]int `json:"by_month"` ByMonthday *[]int `json:"by_monthday"` Source int `json:"source"` RollingUsers *[][]string `json:"rolling_users"` TimeZone *string `json:"time_zone"` StartRotationFromUserIndex *int `json:"start_rotation_from_user_index"` }
type UpdateRouteOptions ¶
type UpdateRouteOptions struct { EscalationChainId string `json:"escalation_chain_id,omitempty"` Position *int `json:"position,omitempty"` Slack *SlackRoute `json:"slack,omitempty"` Telegram *TelegramRoute `json:"telegram,omitempty"` MSTeams *MSTeamsRoute `json:"msteams,omitempty"` RoutingRegex string `json:"routing_regex,omitempty"` RoutingType string `json:"routing_type,omitempty"` ManualOrder bool `url:"manual_order,omitempty" json:"manual_order,omitempty"` }
type UpdateScheduleOptions ¶
type UpdateScheduleOptions struct { Name string `json:"name,omitempty"` TeamId string `json:"team_id"` ICalUrlPrimary *string `json:"ical_url_primary"` ICalUrlOverrides *string `json:"ical_url_overrides"` TimeZone string `json:"time_zone,omitempty"` EnableWebOverrides bool `json:"enable_web_overrides"` Slack *SlackSchedule `json:"slack,omitempty"` Shifts *[]string `json:"shifts"` }
type UpdateUserNotificationRuleOptions ¶ added in v0.0.12
type UpdateWebhookOptions ¶ added in v0.0.11
type UpdateWebhookOptions struct { Name string `json:"name"` Team string `json:"team"` Url string `json:"url"` TriggerType string `json:"trigger_type"` HttpMethod string `json:"http_method"` Data *string `json:"data"` Username *string `json:"username"` Password *string `json:"password"` AuthorizationHeader *string `json:"authorization_header"` TriggerTemplate *string `json:"trigger_template"` Headers *string `json:"headers"` ForwardAll bool `json:"forward_all"` IntegrationFilter *[]string `json:"integration_filter"` IsWebhookEnabled bool `json:"is_webhook_enabled"` }
type UserGroup ¶
type UserGroup struct { ID string `json:"id"` Type string `json:"type"` SlackUserGroup *SlackUserGroup `json:"slack"` }
type UserGroupService ¶
type UserGroupService struct {
// contains filtered or unexported fields
}
UserGroupService handles requests for user group endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/user_groups/
func NewUserGroupService ¶
func NewUserGroupService(client *Client) *UserGroupService
NewUserGroupService creates UserGroupService with defined url
func (*UserGroupService) ListUserGroups ¶
func (service *UserGroupService) ListUserGroups(opt *ListUserGroupOptions) (*PaginatedUserGroupsResponse, *http.Response, error)
ListUserGroups gets all UserGroups for authorized organization
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/user_groups/#list-user-groups
type UserNotificationRule ¶ added in v0.0.12
type UserNotificationRuleService ¶ added in v0.0.12
type UserNotificationRuleService struct {
// contains filtered or unexported fields
}
UserNotificationRuleService handles requests to user notification rule endpoints
https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/
func NewUserNotificationRuleService ¶ added in v0.0.12
func NewUserNotificationRuleService(client *Client) *UserNotificationRuleService
NewUserNotificationRuleService creates UserNotificationRuleService with defined url
func (*UserNotificationRuleService) CreateUserNotificationRule ¶ added in v0.0.12
func (service *UserNotificationRuleService) CreateUserNotificationRule(opt *CreateUserNotificationRuleOptions) (*UserNotificationRule, *http.Response, error)
CreateUserNotificationRule creates a user notification rule for the given user, type, and position
func (*UserNotificationRuleService) DeleteUserNotificationRule ¶ added in v0.0.12
func (service *UserNotificationRuleService) DeleteUserNotificationRule(id string, opt *DeleteUserNotificationRuleOptions) (*http.Response, error)
DeleteUserNotificationRule deletes user notification rule
func (*UserNotificationRuleService) GetUserNotificationRule ¶ added in v0.0.12
func (service *UserNotificationRuleService) GetUserNotificationRule(id string, opt *GetUserNotificationRuleOptions) (*UserNotificationRule, *http.Response, error)
GetUserNotificationRule fetches a user notification rule by given id
func (*UserNotificationRuleService) ListUserNotificationRules ¶ added in v0.0.12
func (service *UserNotificationRuleService) ListUserNotificationRules(opt *ListUserNotificationRuleOptions) (*PaginatedUserNotificationRulesResponse, *http.Response, error)
ListUserNotificationRules fetches all user notification rules for authorized organization
func (*UserNotificationRuleService) UpdateUserNotificationRule ¶ added in v0.0.12
func (service *UserNotificationRuleService) UpdateUserNotificationRule(id string, opt *UpdateUserNotificationRuleOptions) (*UserNotificationRule, *http.Response, error)
UpdateUserNotificationRule updates user notification rule with new position, duration, and type
NOTE: this endpoint is not currently publicly documented, but it does exist
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService handles requests to user endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/users/
func NewUserService ¶
func NewUserService(client *Client) *UserService
NewUserService creates UserService with defined url
func (*UserService) GetUser ¶
func (service *UserService) GetUser(id string, opt *GetUserOptions) (*User, *http.Response, error)
GetUser fetches a user by given id.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/users/#get-a-user
func (*UserService) ListUsers ¶
func (service *UserService) ListUsers(opt *ListUserOptions) (*PaginatedUsersResponse, *http.Response, error)
ListUsers fetches all users for authorized organization.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/users/
type Webhook ¶ added in v0.0.11
type Webhook struct { ID string `json:"id"` Name string `json:"name"` Team string `json:"team"` Url string `json:"url"` TriggerType string `json:"trigger_type"` HttpMethod string `json:"http_method"` Data *string `json:"data"` Username *string `json:"username"` Password *string `json:"password"` AuthorizationHeader *string `json:"authorization_header"` TriggerTemplate *string `json:"trigger_template"` Headers *string `json:"headers"` ForwardAll bool `json:"forward_all"` IntegrationFilter *[]string `json:"integration_filter"` IsWebhookEnabled bool `json:"is_webhook_enabled"` }
type WebhookService ¶ added in v0.0.11
type WebhookService struct {
// contains filtered or unexported fields
}
WebhookService handles requests to outgoing webhook endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func NewWebhookService ¶ added in v0.0.11
func NewWebhookService(client *Client) *WebhookService
NewWebhookService creates WebhookService with defined url
func (*WebhookService) CreateWebhook ¶ added in v0.0.11
func (service *WebhookService) CreateWebhook(opt *CreateWebhookOptions) (*Webhook, *http.Response, error)
CreateWebhook creates webhook
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func (*WebhookService) DeleteWebhook ¶ added in v0.0.11
func (service *WebhookService) DeleteWebhook(id string, opt *DeleteWebhookOptions) (*http.Response, error)
DeleteWebhook deletes webhook.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func (*WebhookService) GetWebhook ¶ added in v0.0.11
func (service *WebhookService) GetWebhook(id string, opt *GetWebhookOptions) (*Webhook, *http.Response, error)
GetWebhook fetches webhook by given id.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func (*WebhookService) ListWebhooks ¶ added in v0.0.11
func (service *WebhookService) ListWebhooks(opt *ListWebhookOptions) (*PaginatedWebhooksResponse, *http.Response, error)
ListWebhooks fetches all Webhooks for authorized organization
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/#list-actions
func (*WebhookService) UpdateWebhook ¶ added in v0.0.11
func (service *WebhookService) UpdateWebhook(id string, opt *UpdateWebhookOptions) (*Webhook, *http.Response, error)
UpdateWebhook updates webhook
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/