Documentation
¶
Index ¶
- func CheckResponse(r *http.Response) error
- type Client
- type CreateCustomActionOptions
- type CreateEscalationChainOptions
- type CreateEscalationOptions
- type CreateIntegrationOptions
- type CreateOnCallShiftOptions
- type CreateRouteOptions
- type CreateScheduleOptions
- type CustomAction
- type CustomActionService
- func (service *CustomActionService) CreateCustomAction(opt *CreateCustomActionOptions) (*CustomAction, *http.Response, error)
- func (service *CustomActionService) DeleteCustomAction(id string, opt *DeleteCustomActionOptions) (*http.Response, error)
- func (service *CustomActionService) GetCustomAction(id string, opt *GetCustomActionOptions) (*CustomAction, *http.Response, error)
- func (service *CustomActionService) ListCustomActions(opt *ListCustomActionOptions) (*PaginatedCustomActionsResponse, *http.Response, error)
- func (service *CustomActionService) UpdateCustomAction(id string, opt *UpdateCustomActionOptions) (*CustomAction, *http.Response, error)
- type DefaultRoute
- type DeleteCustomActionOptions
- type DeleteEscalationChainOptions
- type DeleteEscalationOptions
- type DeleteIntegrationOptions
- type DeleteOnCallShiftOptions
- type DeleteRouteOptions
- type DeleteScheduleOptions
- 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 GetCustomActionOptions
- type GetEscalationChainOptions
- type GetEscalationOptions
- type GetIntegrationOptions
- type GetOnCallShiftOptions
- type GetRouteOptions
- type GetScheduleOptions
- type GetTeamOptions
- type GetUserOptions
- 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 ListCustomActionOptions
- type ListEscalationChainOptions
- type ListEscalationOptions
- type ListIntegrationOptions
- type ListOnCallShiftOptions
- type ListOptions
- type ListRouteOptions
- type ListScheduleOptions
- type ListSlackChannelOptions
- type ListTeamOptions
- type ListUserGroupOptions
- type ListUserOptions
- 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 PaginatedCustomActionsResponse
- type PaginatedEscalationChainsResponse
- type PaginatedEscalationsResponse
- type PaginatedIntegrationsResponse
- type PaginatedOnCallShiftsResponse
- type PaginatedResponse
- type PaginatedRoutesResponse
- type PaginatedSchedulesResponse
- type PaginatedSlackChannelsResponse
- type PaginatedTeamsResponse
- type PaginatedUserGroupsResponse
- type PaginatedUsersResponse
- 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 SlackTemplate
- type SlackUserGroup
- type Team
- type TeamService
- type Templates
- type UpdateCustomActionOptions
- type UpdateEscalationChainOptions
- type UpdateEscalationOptions
- type UpdateIntegrationOptions
- type UpdateOnCallShiftOptions
- type UpdateRouteOptions
- type UpdateScheduleOptions
- type User
- type UserGroup
- type UserGroupService
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
Types ¶
type Client ¶
type Client struct {
// List of Services. Keep in sync with func newClient
Integrations *IntegrationService
EscalationChains *EscalationChainService
Escalations *EscalationService
Users *UserService
Schedules *ScheduleService
Routes *RouteService
SlackChannels *SlackChannelService
UserGroups *UserGroupService
CustomActions *CustomActionService
OnCallShifts *OnCallShiftService
Teams *TeamService
// contains filtered or unexported fields
}
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) NewRequest ¶
func (c *Client) NewRequest(method, path string, opt interface{}) (*retryablehttp.Request, error)
type CreateCustomActionOptions ¶ added in v0.0.2
type CreateCustomActionOptions struct {
Name string `json:"name,omitempty"`
TeamId string `json:"team_id"`
Url string `json:"url,omitempty"`
Data *string `json:"data"`
User *string `json:"user"`
Password *string `json:"password"`
AuthorizationHeader *string `json:"authorization_header"`
ForwardWholePayload bool `json:"forward_whole_payload"`
}
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"`
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"`
}
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"`
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"`
Slack *SlackRoute `json:"slack,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"`
TimeZone string `json:"time_zone,omitempty"`
Slack *SlackSchedule `json:"slack,omitempty"`
Shifts *[]string `json:"shifts"`
}
type CustomAction ¶
type CustomAction struct {
ID string `json:"id"`
Name string `json:"name"`
TeamId string `json:"team_id"`
Url string `json:"url"`
Data *string `json:"data"`
User *string `json:"user"`
Password *string `json:"password"`
AuthorizationHeader *string `json:"authorization_header"`
ForwardWholePayload bool `json:"forward_whole_payload"`
}
type CustomActionService ¶
type CustomActionService struct {
// contains filtered or unexported fields
}
CustomActionService handles requests to outgoing webhook endpoint
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func NewCustomActionService ¶
func NewCustomActionService(client *Client) *CustomActionService
NewCustomActionService creates CustomActionService with defined url
func (*CustomActionService) CreateCustomAction ¶ added in v0.0.2
func (service *CustomActionService) CreateCustomAction(opt *CreateCustomActionOptions) (*CustomAction, *http.Response, error)
CreateCustomAction creates custom action
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func (*CustomActionService) DeleteCustomAction ¶ added in v0.0.2
func (service *CustomActionService) DeleteCustomAction(id string, opt *DeleteCustomActionOptions) (*http.Response, error)
DeleteCustomAction deletes custom action.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func (*CustomActionService) GetCustomAction ¶ added in v0.0.2
func (service *CustomActionService) GetCustomAction(id string, opt *GetCustomActionOptions) (*CustomAction, *http.Response, error)
GetCustomAction fetches custom action by given id.
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
func (*CustomActionService) ListCustomActions ¶
func (service *CustomActionService) ListCustomActions(opt *ListCustomActionOptions) (*PaginatedCustomActionsResponse, *http.Response, error)
ListCustomActions fetches all customActions for authorized organization
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/#list-actions
func (*CustomActionService) UpdateCustomAction ¶ added in v0.0.2
func (service *CustomActionService) UpdateCustomAction(id string, opt *UpdateCustomActionOptions) (*CustomAction, *http.Response, error)
UpdateCustomAction updates custom action
https://grafana.com/docs/grafana-cloud/oncall/oncall-api-reference/outgoing_webhooks/
type DefaultRoute ¶
type DefaultRoute struct {
ID string `json:"id"`
EscalationChainId *string `json:"escalation_chain_id"`
SlackRoute *SlackRoute `json:"slack,omitempty"`
}
type DeleteCustomActionOptions ¶ added in v0.0.2
type DeleteCustomActionOptions struct {
}
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 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"`
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"`
}
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 GetCustomActionOptions ¶ added in v0.0.2
type GetCustomActionOptions struct {
}
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 GetUserOptions ¶
type GetUserOptions struct {
}
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 ListCustomActionOptions ¶
type ListCustomActionOptions struct {
ListOptions
Name string `url:"name,omitempty" json:"name,omitempty"`
}
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"`
}
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 ListUserOptions ¶
type ListUserOptions struct {
ListOptions
Username string `url:"username,omitempty" json:"username,omitempty"`
}
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"`
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 shoft 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 PaginatedCustomActionsResponse ¶
type PaginatedCustomActionsResponse struct {
PaginatedResponse
CustomActions []*CustomAction `json:"results"`
}
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 PaginatedUsersResponse ¶
type PaginatedUsersResponse struct {
PaginatedResponse
Users []*User `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"`
IsTheLastRoute bool `json:"is_the_last_route"`
SlackRoute *SlackRoute `json:"slack"`
}
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"`
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 SlackRoute struct {
ChannelId *string `json:"channel_id"`
}
type SlackSchedule ¶
type SlackTemplate ¶
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 Templates ¶
type Templates struct {
GroupingKey *string `json:"grouping_key"`
ResolveSignal *string `json:"resolve_signal"`
Slack *SlackTemplate `json:"slack"`
}
type UpdateCustomActionOptions ¶ added in v0.0.2
type UpdateCustomActionOptions struct {
Name string `json:"name,omitempty"`
Url string `json:"url"`
Data *string `json:"data"`
User *string `json:"user"`
Password *string `json:"password"`
AuthorizationHeader *string `json:"authorization_header"`
ForwardWholePayload bool `json:"forward_whole_payload"`
}
type UpdateEscalationChainOptions ¶
type UpdateEscalationChainOptions struct {
Name string `json:"name,omitempty"`
}
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"`
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"`
}
type UpdateIntegrationOptions ¶
type UpdateIntegrationOptions struct {
Name string `json:"name,omitempty"`
Templates *Templates `json:"templates,omitempty"`
DefaultRoute *DefaultRoute `json:"default_route,omitempty"`
}
type UpdateOnCallShiftOptions ¶
type UpdateOnCallShiftOptions struct {
Type string `json:"type"`
Name string `json:"name"`
Level *int `json:"level,omitempty"`
Start string `json:"start"`
Duration int `json:"duration"`
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"`
RoutingRegex string `json:"routing_regex,omitempty"`
ManualOrder bool `url:"manual_order,omitempty" json:"manual_order,omitempty"`
}
type UpdateScheduleOptions ¶
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 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/