Documentation ¶
Index ¶
- Constants
- type APIListObject
- type APIObject
- type Acknowledgement
- type Addon
- type Agent
- type Assignment
- type Channel
- type Client
- func (c *Client) AddEscalationPolicyToTeam(teamID, epID string) error
- func (c *Client) AddUserToTeam(teamID, userID string) error
- func (c *Client) CreateEscalationPolicy(ep EscalationPolicy) error
- func (c *Client) CreateIncidentNote(id string, note IncidentNote) error
- func (c *Client) CreateIntegration(id string, i Integration) error
- func (c *Client) CreateMaintaienanceWindows(m MaintenanceWindow) error
- func (c *Client) CreateOverride(id string, o Overrides) error
- func (c *Client) CreateSchedule(s Schedule) error
- func (c *Client) CreateService(s Service) error
- func (c *Client) CreateTeam(t *Team) error
- func (c *Client) CreateUser(u User) error
- func (c *Client) Delete(path string) (*http.Response, error)
- func (c *Client) DeleteAddon(id string) error
- func (c *Client) DeleteEscalationPolicy(id string) error
- func (c *Client) DeleteMaintenanceWindow(id string) error
- func (c *Client) DeleteOverride(scheduleID, overrideID string) error
- func (c *Client) DeleteSchedule(id string) error
- func (c *Client) DeleteService(id string) error
- func (c *Client) DeleteTeam(id string) error
- func (c *Client) DeleteUser(id string) error
- func (c *Client) Do(method, path string, body io.Reader) (*http.Response, error)
- func (c *Client) Get(path string) (*http.Response, error)
- func (c *Client) GetAddon(id string) (*Addon, error)
- func (c *Client) GetEscalationPolicy(id string, o *GetEscalationPolicyOptions) (*EscalationPolicy, error)
- func (c *Client) GetIncident(id string) (*Incident, error)
- func (c *Client) GetIntegration(serviceID, integrationID string, o GetIntegrationOptions) (*Integration, error)
- func (c *Client) GetLogEntry(id string, o GetLogEntryOptions) (*LogEntry, error)
- func (c *Client) GetMaintenanceWindow(id string, o GetMaintenanceWindowOptions) (*MaintenanceWindow, error)
- func (c *Client) GetSchedule(id string, o GetScheduleOptions) (*Schedule, error)
- func (c *Client) GetService(id string, o GetServiceOptions) (*Service, error)
- func (c *Client) GetTeam(id string) (*Team, error)
- func (c *Client) GetUser(id string, o GetUserOptions) (*User, error)
- func (c *Client) InstallAddon(a Addon) error
- func (c *Client) ListAddons(o ListAddonOptions) (*ListAddonResponse, error)
- func (c *Client) ListEscalationPolicies(o ListEscalationPoliciesOptions) (*ListEscalationPolicyResponse, error)
- func (c *Client) ListIncidentNotes(id string) ([]IncidentNote, error)
- func (c *Client) ListIncidents(o ListIncidentsOptions) (*ListIncidentsResponse, error)
- func (c *Client) ListLogEntries(o ListLogEntriesOptions) (*ListLogEntryResponse, error)
- func (c *Client) ListMaintenanceWindows(o ListMaintenanceWindowsOptions) (*ListMaintenanceWindowsResponse, error)
- func (c *Client) ListNotifications(o ListNotificationOptions) (*ListNotificationsResponse, error)
- func (c *Client) ListOnCallUsers(id string, o ListOnCallUsersOptions) ([]User, error)
- func (c *Client) ListOnCalls(o ListOnCallOptions) (*ListOnCallsResponse, error)
- func (c *Client) ListOverrides(id string, o ListOverridesOptions) ([]Overrides, error)
- func (c *Client) ListSchedules(o ListSchedulesOptions) (*ListSchedulesResponse, error)
- func (c *Client) ListServices(o ListServiceOptions) (*ListServiceResponse, error)
- func (c *Client) ListTeams(o ListTeamOptions) (*ListTeamResponse, error)
- func (c *Client) ListUsers(o ListUserOptions) (*ListUsersResponse, error)
- func (c *Client) ManageIncidents(incidents []Incident, o ManageIncidentsOptions) error
- func (c *Client) Post(path string, payload interface{}) (*http.Response, error)
- func (c *Client) PreviewSchedule(s Schedule, o PreviewScheduleOptions) error
- func (c *Client) Put(path string, payload interface{}) (*http.Response, error)
- func (c *Client) RemoveEscalationPolicyFromTeam(teamID, epID string) error
- func (c *Client) RemoveUserFromTeam(teamID, userID string) error
- func (c *Client) SnoozeIncident(id string, duration uint) error
- func (c *Client) UpdateAddon(id string, a Addon) error
- func (c *Client) UpdateEscalationPolicy(e *EscalationPolicy) error
- func (c *Client) UpdateIntegration(serviceID string, i Integration) error
- func (c *Client) UpdateMaintenanceWindow(m MaintenanceWindow) error
- func (c *Client) UpdateSchedule(id string, s Schedule) error
- func (c *Client) UpdateService(s Service) error
- func (c *Client) UpdateTeam(id string, t *Team) error
- func (c *Client) UpdateUser(u User) error
- type ContactMethod
- type EmailFilter
- type EscalationPolicy
- type EscalationRule
- type Event
- type EventResponse
- type GetEscalationPolicyOptions
- type GetIntegrationOptions
- type GetLogEntryOptions
- type GetMaintenanceWindowOptions
- type GetScheduleOptions
- type GetServiceOptions
- type GetUserOptions
- type Incident
- type IncidentDetail
- type IncidentNote
- type IncidentUrgencyRule
- type Integration
- type ListAddonOptions
- type ListAddonResponse
- type ListEscalationPoliciesOptions
- type ListEscalationPolicyResponse
- type ListIncidentsOptions
- type ListIncidentsResponse
- type ListLogEntriesOptions
- type ListLogEntryResponse
- type ListMaintenanceWindowsOptions
- type ListMaintenanceWindowsResponse
- type ListNotificationOptions
- type ListNotificationsResponse
- type ListOnCallOptions
- type ListOnCallUsersOptions
- type ListOnCallsResponse
- type ListOverridesOptions
- type ListSchedulesOptions
- type ListSchedulesResponse
- type ListServiceOptions
- type ListServiceResponse
- type ListTeamOptions
- type ListTeamResponse
- type ListUserOptions
- type ListUsersResponse
- type LogEntry
- type MaintenanceWindow
- type ManageIncidentsOptions
- type NamedTime
- type Notification
- type NotificationRule
- type OnCall
- type Overrides
- type PendingAction
- type PreviewScheduleOptions
- type RenderedScheduleEntry
- type Restriction
- type Schedule
- type ScheduleLayer
- type ScheduledAction
- type Service
- type SupportHours
- type SupportHoursDetails
- type Team
- type UpdateScheduleOptions
- type User
- type WebhookPayload
Constants ¶
View Source
const (
APIEndpoint = "https://api.pagerduty.com"
)
View Source
const EventEndPoint = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIListObject ¶
type APIObject ¶
type APIObject struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Summary string `json:"summary,omitempty"` Self string `json:"self,omitempty"` HtmlUrl string `json:"html_url,omitempty"` }
APIObject represents generic api json response that is shared by most domain object (like escalation
type Acknowledgement ¶
type Assignment ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps http client
func (*Client) AddEscalationPolicyToTeam ¶
func (*Client) AddUserToTeam ¶
func (*Client) CreateEscalationPolicy ¶
func (c *Client) CreateEscalationPolicy(ep EscalationPolicy) error
func (*Client) CreateIncidentNote ¶
func (c *Client) CreateIncidentNote(id string, note IncidentNote) error
func (*Client) CreateIntegration ¶
func (c *Client) CreateIntegration(id string, i Integration) error
func (*Client) CreateMaintaienanceWindows ¶
func (c *Client) CreateMaintaienanceWindows(m MaintenanceWindow) error
func (*Client) CreateSchedule ¶
func (*Client) CreateService ¶
func (*Client) CreateTeam ¶
func (*Client) CreateUser ¶
func (*Client) DeleteAddon ¶
func (*Client) DeleteEscalationPolicy ¶
func (*Client) DeleteMaintenanceWindow ¶
func (*Client) DeleteOverride ¶
func (*Client) DeleteSchedule ¶
func (*Client) DeleteService ¶
func (*Client) DeleteTeam ¶
func (*Client) DeleteUser ¶
func (*Client) GetEscalationPolicy ¶
func (c *Client) GetEscalationPolicy(id string, o *GetEscalationPolicyOptions) (*EscalationPolicy, error)
func (*Client) GetIntegration ¶
func (c *Client) GetIntegration(serviceID, integrationID string, o GetIntegrationOptions) (*Integration, error)
func (*Client) GetLogEntry ¶
func (c *Client) GetLogEntry(id string, o GetLogEntryOptions) (*LogEntry, error)
func (*Client) GetMaintenanceWindow ¶
func (c *Client) GetMaintenanceWindow(id string, o GetMaintenanceWindowOptions) (*MaintenanceWindow, error)
func (*Client) GetSchedule ¶
func (c *Client) GetSchedule(id string, o GetScheduleOptions) (*Schedule, error)
func (*Client) GetService ¶
func (c *Client) GetService(id string, o GetServiceOptions) (*Service, error)
func (*Client) InstallAddon ¶
func (*Client) ListAddons ¶
func (c *Client) ListAddons(o ListAddonOptions) (*ListAddonResponse, error)
func (*Client) ListEscalationPolicies ¶
func (c *Client) ListEscalationPolicies(o ListEscalationPoliciesOptions) (*ListEscalationPolicyResponse, error)
func (*Client) ListIncidentNotes ¶
func (c *Client) ListIncidentNotes(id string) ([]IncidentNote, error)
func (*Client) ListIncidents ¶
func (c *Client) ListIncidents(o ListIncidentsOptions) (*ListIncidentsResponse, error)
func (*Client) ListLogEntries ¶
func (c *Client) ListLogEntries(o ListLogEntriesOptions) (*ListLogEntryResponse, error)
func (*Client) ListMaintenanceWindows ¶
func (c *Client) ListMaintenanceWindows(o ListMaintenanceWindowsOptions) (*ListMaintenanceWindowsResponse, error)
func (*Client) ListNotifications ¶
func (c *Client) ListNotifications(o ListNotificationOptions) (*ListNotificationsResponse, error)
func (*Client) ListOnCallUsers ¶
func (c *Client) ListOnCallUsers(id string, o ListOnCallUsersOptions) ([]User, error)
func (*Client) ListOnCalls ¶
func (c *Client) ListOnCalls(o ListOnCallOptions) (*ListOnCallsResponse, error)
func (*Client) ListOverrides ¶
func (c *Client) ListOverrides(id string, o ListOverridesOptions) ([]Overrides, error)
func (*Client) ListSchedules ¶
func (c *Client) ListSchedules(o ListSchedulesOptions) (*ListSchedulesResponse, error)
func (*Client) ListServices ¶
func (c *Client) ListServices(o ListServiceOptions) (*ListServiceResponse, error)
func (*Client) ListTeams ¶
func (c *Client) ListTeams(o ListTeamOptions) (*ListTeamResponse, error)
func (*Client) ListUsers ¶
func (c *Client) ListUsers(o ListUserOptions) (*ListUsersResponse, error)
func (*Client) ManageIncidents ¶
func (c *Client) ManageIncidents(incidents []Incident, o ManageIncidentsOptions) error
func (*Client) PreviewSchedule ¶
func (c *Client) PreviewSchedule(s Schedule, o PreviewScheduleOptions) error
func (*Client) RemoveEscalationPolicyFromTeam ¶
func (*Client) RemoveUserFromTeam ¶
func (*Client) UpdateEscalationPolicy ¶
func (c *Client) UpdateEscalationPolicy(e *EscalationPolicy) error
func (*Client) UpdateIntegration ¶
func (c *Client) UpdateIntegration(serviceID string, i Integration) error
func (*Client) UpdateMaintenanceWindow ¶
func (c *Client) UpdateMaintenanceWindow(m MaintenanceWindow) error
func (*Client) UpdateService ¶
func (*Client) UpdateUser ¶
type ContactMethod ¶
type EmailFilter ¶
type EmailFilter struct { SubjectMode string `json:"subject_mode,omitempty"` SubjectRegex string `json:"subject_regex,omitempty"` BodyMode string `json:"body_mode,omitempty"` BodyRegex string `json:"body_regex,omitempty"` FromEmailMode string `json:"from_email_mode,omitempty"` FromEmailRegex string `json:"from_email_regex,omitempty"` }
type EscalationPolicy ¶
type EscalationPolicy struct { APIObject Name string `json:"name,omitempty"` EscalationRules []APIObject `json:"escalation_rules,omitempty"` Services []APIObject `json:"services,omitempty"` NumLoops uint `json:"num_loops,omitempty"` Teams []APIObject `json:"teams,omitempty"` Description string `json:"description,omitempty"` }
type EscalationRule ¶
type Event ¶
type Event struct { ServiceKey string `json:"service_key"` Type string `json:"event_type"` IncidentKey string `json:"incident_key,omitempty"` Description string `json:"description"` Client string `json:"client,omitempty"` ClientURL string `json:"client_url,omitempty"` Details interface{} `json:"details,omitempty"` Contexts []interface{} `json:"contexts,omitempty"` }
type EventResponse ¶
type EventResponse struct { Status string `json:"status"` Message string `json:"message"` IncidentKey string `json:"incident_key"` }
func CreateEvent ¶
func CreateEvent(e Event) (*EventResponse, error)
type GetEscalationPolicyOptions ¶
type GetEscalationPolicyOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
type GetIntegrationOptions ¶
type GetIntegrationOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
type GetLogEntryOptions ¶
type GetMaintenanceWindowOptions ¶
type GetMaintenanceWindowOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
type GetScheduleOptions ¶
type GetScheduleOptions struct { APIListObject TimeZone string `url:"time_zone,omitempty"` Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` }
type GetServiceOptions ¶
type GetServiceOptions struct {
Includes []string `url:"include,brackets,omitempty"`
}
type GetUserOptions ¶
type GetUserOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
type Incident ¶
type Incident struct { APIObject IncidentNumber uint `json:"incident_number,omitempty"` CreatedAt string `json:"created_at,omitempty"` PendingActions []PendingAction `json:"pending_actions,omitempty"` IncidentKey string `json:"incident_key,omitempty"` Service APIObject `json:"service,omitempty"` Assignments []Assignment `json:"assignments,omitempty"` Acknowledgements []Acknowledgement `json:"acknowledgements,omitempty"` LastStatusChangeAt string `json:"last_status_change_at,omitempty"` LastStatusChangeBy APIObject `json:"last_status_change_by,omitempty"` FirstTriggerLogEntry APIObject `json:"last_trigger_log_entry,omitempty"` EscalationPolicy APIObject `json:"escalation_policy,omitempty"` Teams []APIObject `json:"teams,omitempty"` Urgency string `json:"urgency,omitempty"` }
type IncidentDetail ¶
type IncidentDetail struct { ID string `json:"id"` IncidentNumber uint `json:"incident_number"` CreatedOn string `json:"created_on"` Status string `json:"status"` HTMLUrl string `json:"html_url"` Service string `json:"service"` AssignedToUser *json.RawMessage `json:"assigned_to_user"` AssignedTo []string `json:"assigned_to"` TriggerSummaryData *json.RawMessage `json:"trigger_summary_daya"` TriggerDeatilsHTMLUrl string `json:"trigger_details_html_url"` }
type IncidentNote ¶
type IncidentUrgencyRule ¶
type IncidentUrgencyRule struct { Type string `json:"type,omitempty"` Urgency string `json:"urgency,omitempty"` DuringSupportHours SupportHours `json:"during_support_hours,omitempty"` OutsideSupportHours SupportHours `json:"outside_support_hours,omitempty"` }
type Integration ¶
type Integration struct { APIObject Name string `json:"name,omitempty"` Service APIObject `json:"service,omitempty"` CreatedAt string `json:"created_at,omitempty"` Vendor APIObject `json:"vendor,omitempty"` IntegrationEmail string `json:"integration_email"` EmailIncidentCreation string `json:"email_incident_creation,omitempty"` EmailFilterMode string `json:"email_filter_mode"` EmailFilters []EmailFilter `json:"email_filters,omitempty"` }
type ListAddonOptions ¶
type ListAddonOptions struct { APIListObject Includes []string `url:"include,omitempty,brackets"` ServiceIDs []string `url:"service_ids,omitempty,brackets"` Filter string `url:"filter,omitempty"` }
type ListAddonResponse ¶
type ListAddonResponse struct { APIListObject Addons []Addon `json:"addons"` }
type ListEscalationPolicyResponse ¶
type ListEscalationPolicyResponse struct { APIListObject EscalationPolicies []EscalationPolicy `json:"escalation_policies"` }
type ListIncidentsOptions ¶
type ListIncidentsOptions struct { APIListObject Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` DateRange string `url:"date_range,omitempty"` Statuses []string `url:"statuses,omitempty,brackets"` IncidentKey string `url:"incident_key,omitempty"` ServiceIDs []string `url:"service_ids,omitempty,brackets"` TeamIDs []string `url:"team_ids,omitempty,brackets"` UserIDs []string `url:"user_ids,omitempty,brackets"` Urgencies []string `url:"urgencies,omitempty,brackets"` TimeZone string `url:"time_zone,omitempty"` SortBy string `url:"sort_by,omitempty"` Includes []string `url:"include,omitempty,brackets"` }
type ListIncidentsResponse ¶
type ListIncidentsResponse struct { APIListObject Incidents []Incident `json:"incidents,omitempty"` }
type ListLogEntriesOptions ¶
type ListLogEntryResponse ¶
type ListLogEntryResponse struct { APIListObject LogEntries []LogEntry `json:"log_entries"` }
type ListMaintenanceWindowsOptions ¶
type ListMaintenanceWindowsOptions struct { APIListObject Query string `url:"query,omitempty"` Includes []string `url:"include,omitempty,brackets"` TeamIDs []string `url:"team_ids,omitempty,brackets"` ServiceIDs []string `url:"service_ids,omitempty,brackets"` Filter string `url:"filter,omitempty,brackets"` }
type ListMaintenanceWindowsResponse ¶
type ListMaintenanceWindowsResponse struct { APIListObject MaintenanceWindows []MaintenanceWindow `json:"maintenance_windows"` }
type ListNotificationOptions ¶
type ListNotificationsResponse ¶
type ListNotificationsResponse struct { APIListObject Notifications []Notification }
type ListOnCallOptions ¶
type ListOnCallOptions struct { APIListObject TimeZone string `url:"time_zone,omitempty"` Includes []string `url:"include,omitempty,brackets"` UserIDs []string `url:"user_ids,omitempty,brackets"` EscalationPolicyIDs []string `url:"escalation_policy_ids,omitempty,brackets"` ScheduleIDs []string `url:"schedule_ids,omitempty,brackets"` Since string `json:"since,omitempty"` Until string `json:"until,omitempty"` Earliest bool `json:"earliest,omitempty"` }
type ListOnCallUsersOptions ¶
type ListOnCallUsersOptions struct { APIListObject Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` }
type ListOnCallsResponse ¶
type ListOnCallsResponse struct {
OnCalls []OnCall `json:"oncalls"`
}
type ListOverridesOptions ¶
type ListOverridesOptions struct { APIListObject Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` Editable bool `url:"editable,omitempty"` Overflow bool `url:"overflow,omitempty"` }
type ListSchedulesOptions ¶
type ListSchedulesOptions struct { APIListObject Query string `url:"query,omitempty"` }
type ListSchedulesResponse ¶
type ListSchedulesResponse struct { APIListObject Schedules []Schedule }
type ListServiceOptions ¶
type ListServiceResponse ¶
type ListServiceResponse struct { APIListObject Services []Service }
type ListTeamOptions ¶
type ListTeamOptions struct { APIListObject Query string `url:"query,omitempty"` }
type ListTeamResponse ¶
type ListTeamResponse struct { APIListObject Teams []Team }
type ListUserOptions ¶
type ListUserOptions struct { APIListObject Query string `url:"query,omitempty"` TeamIDs []string `url:"team_ids,omitempty,brackets"` Includes []string `url:"include,omitempty,brackets"` }
type ListUsersResponse ¶
type ListUsersResponse struct { APIListObject Users []User }
type MaintenanceWindow ¶
type MaintenanceWindow struct { APIObject SequenceNumber uint `json:"sequence_number,omitempty"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` Description string Services []APIObject Teams []APIListObject CreatedBy APIListObject `json:"created_by"` }
type ManageIncidentsOptions ¶
type ManageIncidentsOptions struct {
From string `url:"from,omitempty"`
}
type Notification ¶
type NotificationRule ¶
type PendingAction ¶
type PreviewScheduleOptions ¶
type PreviewScheduleOptions struct { APIListObject Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` Overflow bool `url:"overflow,omitempty"` }
type RenderedScheduleEntry ¶
type Restriction ¶
type Schedule ¶
type Schedule struct { APIObject Name string `json:"name,omitempty"` TimeZone string `json:"time_zone,omitempty"` Desciption string `json:"description,omitempty"` EscalationPolicies []APIObject `json:"escalation_policies,omitempty"` Users []APIObject `json:"users,omitempty"` ScheduleLayers []ScheduleLayer `json:"schedule_layers,omitempty"` OverridesSubschedule ScheduleLayer `json:"override_subschedule,omitempty"` FinalSchedule ScheduleLayer `json:"final_schedule,omitempty"` }
type ScheduleLayer ¶
type ScheduleLayer struct { APIObject Name string `json:"name,omitempty"` Start string `json:"start,omitempty"` End string `json:"end,omitempty"` RotationVirtualStart string `json:"rotation_virtual_start,omitempty"` RotationTurnLengthSeconds uint `json:"rotation_virtual_start,omitempty"` Users []APIObject `json:"users,omitempty"` Restrictions []Restriction `json:"restrictions,omitempty"` RenderedScheduleEntries []RenderedScheduleEntry `json:"rendered_schedule_entries,omitempty"` RenderedCoveragePercentage float64 `json:"rendered_coverage_percentage,omitempty"` }
type ScheduledAction ¶
type Service ¶
type Service struct { APIObject Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` AutoResolveTimeout uint `json:"auto_resolve_timeout,omitempty"` AcknowledgementTimeout uint `json:"acknowledgement_timeout,omitempty"` CreateAt string `json:"created_at,omitempty"` Status string `json:"status,omitempty"` LastIncidentTimestamp string `json:"last_incident_timestamp,omitempty"` Integrations []Integration `json:"integrations,omitempty"` EscalationPolicy EscalationPolicy `json:"escalation_policy,omitempty"` Teams []Team `json:"teams,omitempty"` IncidentUrgencyRule IncidentUrgencyRule `json:"incident_urgency_rule,omitempty"` SupportHours SupportHoursDetails `json:"support_hours,omitempty"` ScheduledActions []ScheduledAction `json:"scheduled_actions,omitempty"` }
type SupportHours ¶
type SupportHoursDetails ¶
type UpdateScheduleOptions ¶
type UpdateScheduleOptions struct {
Overflow bool `url:"overflow,omitempty"`
}
type User ¶
type User struct { APIObject Name string Email string Timezone string Color string Role string AvatarURL string `json:"avatar_url"` Description string InvitationSent bool ContactMethods []ContactMethod `json:"contact_methods"` NotificationRules []NotificationRule `json:"notification_rules"` JobTitle string `json:"jon_title"` Teams []Team }
type WebhookPayload ¶
type WebhookPayload struct { ID string `json:"id"` Type string `json:"type"` CreatedOn string `json:"created_on"` Data *json.RawMessage `json:"data"` }
func DecodeWebhook ¶
func DecodeWebhook(r io.Reader) (*WebhookPayload, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.