Documentation ¶
Index ¶
- Constants
- Variables
- type APIError
- type APIListObject
- type APIObject
- type APIReference
- type APIResourceType
- type APIResponse
- type Abilities
- type Ability
- type AbilityResponse
- type Acknowledgement
- type Addon
- type AddonResponse
- type Agent
- type Alert
- type AlertBody
- 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(e EscalationPolicy) (*EscalationPolicy, error)
- func (c *Client) CreateEscalationRule(escID string, e EscalationRule) (*EscalationRule, error)
- func (c *Client) CreateIncidentNote(id string, note IncidentNote) error
- func (c *Client) CreateIntegration(id string, i Integration) (*Integration, error)
- func (c *Client) CreateMaintenanceWindows(m MaintenanceWindow) (*MaintenanceWindow, error)
- func (c *Client) CreateOverride(id string, o Override) (*Override, error)
- func (c *Client) CreateResource(resource Resource) (Resource, error)
- func (c *Client) CreateSchedule(s Schedule) (*Schedule, error)
- func (c *Client) CreateService(s Service) (*Service, error)
- func (c *Client) CreateTeam(t *Team) (*Team, error)
- func (c *Client) CreateUser(u User) (*User, error)
- func (c *Client) DeleteEscalationPolicy(id string) error
- func (c *Client) DeleteEscalationRule(escID string, id string) error
- func (c *Client) DeleteIntegration(serviceID string, integrationID string) error
- func (c *Client) DeleteMaintenanceWindow(id string) error
- func (c *Client) DeleteOverride(scheduleID, overrideID string) error
- func (c *Client) DeleteResource(typ APIResourceType, id 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) GetAddon(id string) (*Addon, error)
- func (c *Client) GetEscalationPolicy(id string, opts ...ResourceRequestOptionFunc) (*EscalationPolicy, error)
- func (c *Client) GetEscalationRule(escID string, id string, o *GetEscalationRuleOptions) (*EscalationRule, error)
- func (c *Client) GetExtension(id string, opts ...ResourceRequestOptionFunc) (*Extension, error)
- func (c *Client) GetIncident(id string, opts ...ResourceRequestOptionFunc) (*Incident, error)
- func (c *Client) GetIntegration(serviceID, integrationID string, o GetIntegrationOptions) (*Integration, error)
- func (c *Client) GetLogEntry(id string) (*LogEntry, error)
- func (c *Client) GetMaintenanceWindow(id string, opts ...ResourceRequestOptionFunc) (*MaintenanceWindow, error)
- func (c *Client) GetResource(typ APIResourceType, id string, opts ...ResourceRequestOptionFunc) (Resource, error)
- func (c *Client) GetResponsePlay(id string, opts ...ResourceRequestOptionFunc) (*ResponsePlay, error)
- func (c *Client) GetSchedule(id string, opts ...ResourceRequestOptionFunc) (*Schedule, error)
- func (c *Client) GetService(id string, opts ...ResourceRequestOptionFunc) (*Service, error)
- func (c *Client) GetTeam(id string) (*Team, error)
- func (c *Client) GetUser(id string, opts ...ResourceRequestOptionFunc) (*User, error)
- func (c *Client) GetVendor(id string, opts ...ResourceRequestOptionFunc) (*Vendor, error)
- func (c *Client) InstallAddon(a Addon) (*Addon, error)
- func (c *Client) ListAbilities() (*ListAbilityResponse, error)
- func (c *Client) ListAddons(opts ...ResourceRequestOptionFunc) (*ListAddonResponse, error)
- func (c *Client) ListAlertsForIncident(id string, opts ...ResourceRequestOptionFunc) (*ListIncidentAlertsResponse, error)
- func (c *Client) ListEscalationPolicies(opts ...ResourceRequestOptionFunc) (*ListEscalationPoliciesResponse, error)
- func (c *Client) ListEscalationRules(escID string) (*ListEscalationRulesResponse, error)
- func (c *Client) ListIncidentLogEntries(id string, o ListIncidentLogEntriesOptions) (*ListIncidentLogEntriesResponse, error)
- func (c *Client) ListIncidentNotes(id string) ([]IncidentNote, error)
- func (c *Client) ListIncidents(opts ...ResourceRequestOptionFunc) (*ListIncidentsResponse, error)
- func (c *Client) ListLogEntries(opts ...ResourceRequestOptionFunc) (*ListLogEntryResponse, error)
- func (c *Client) ListMaintenanceWindows(opts ...ResourceRequestOptionFunc) (*ListMaintenanceWindowsResponse, error)
- func (c *Client) ListNotifications(opts ...ResourceRequestOptionFunc) (*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) ([]Override, error)
- func (c *Client) ListResources(typ APIResourceType, opts ...ResourceRequestOptionFunc) (*http.Response, error)
- func (c *Client) ListSchedules(opts ...ResourceRequestOptionFunc) (*ListSchedulesResponse, error)
- func (c *Client) ListServices(opts ...ResourceRequestOptionFunc) (*ListServiceResponse, error)
- func (c *Client) ListTeams(opts ...ResourceRequestOptionFunc) (*ListTeamResponse, error)
- func (c *Client) ListUsers(opts ...ResourceRequestOptionFunc) (*ListUsersResponse, error)
- func (c *Client) ListVendors(opts ...ResourceRequestOptionFunc) (*ListVendorResponse, error)
- func (c *Client) ManageIncidents(from string, incidents []Incident) error
- func (c *Client) PreviewSchedule(s Schedule, o PreviewScheduleOptions) 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) TestAbility(ability Ability) error
- func (c *Client) UpdateEscalationPolicy(id string, e *EscalationPolicy) (*EscalationPolicy, error)
- func (c *Client) UpdateEscalationRule(escID string, id string, e *EscalationRule) (*EscalationRule, error)
- func (c *Client) UpdateIntegration(serviceID string, i Integration) (*Integration, error)
- func (c *Client) UpdateMaintenanceWindow(m MaintenanceWindow) (*MaintenanceWindow, error)
- func (c *Client) UpdateResource(resource Resource) (Resource, error)
- func (c *Client) UpdateSchedule(id string, s Schedule) (*Schedule, error)
- func (c *Client) UpdateService(s Service) (*Service, error)
- func (c *Client) UpdateTeam(id string, t *Team) (*Team, error)
- func (c *Client) UpdateUser(u User) (*User, error)
- type ContactMethod
- type Context
- type ErrorObject
- type ErrorResponse
- type EscalationPolicy
- type EscalationPolicyResponse
- type EscalationRule
- type Event
- type EventResponse
- type Extension
- type ExtensionOptFunc
- type ExtensionSchema
- type GetEscalationPolicyOptions
- type GetEscalationRuleOptions
- type GetIntegrationOptions
- type GetMaintenanceWindowOptions
- type GetScheduleOptions
- type GetServiceOptions
- type GetUserOptions
- type HTTPClient
- type Incident
- type IncidentDetail
- type IncidentNote
- type IncidentResponse
- type IncidentUrgencyRule
- type IncidentUrgencyType
- type InlineModel
- type Integration
- type InvalidResourceTypeError
- type ListAbilityResponse
- type ListAddonOptions
- type ListAddonResponse
- type ListEscalationPoliciesOptions
- type ListEscalationPoliciesResponse
- type ListEscalationRulesResponse
- type ListIncidentAlertsResponse
- type ListIncidentLogEntriesOptions
- type ListIncidentLogEntriesResponse
- 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 ListResponsePlaysResponse
- type ListResponseTypeFunc
- type ListSchedulesOptions
- type ListSchedulesResponse
- type ListServiceOptions
- type ListServiceResponse
- type ListTeamOptions
- type ListTeamResponse
- type ListUsersOptions
- type ListUsersResponse
- type ListVendorOptions
- type ListVendorResponse
- type ListWebhooksResponse
- type LogEntry
- type LogEntryResponse
- type MaintenanceWindow
- type MaintenanceWindowResponse
- type NewClientOptionFunc
- type Notification
- type NotificationResponse
- type NotificationRule
- type OnCall
- type Override
- type PendingAction
- type PreviewScheduleOptions
- type RenderedScheduleEntry
- type Resource
- type ResourceList
- type ResourceRequestOptionFunc
- func WithDateRange(value string) ResourceRequestOptionFunc
- func WithEditable(value string) ResourceRequestOptionFunc
- func WithEscalationPolicyIDs(value string) ResourceRequestOptionFunc
- func WithFilter(value string) ResourceRequestOptionFunc
- func WithHeader(key, value string) ResourceRequestOptionFunc
- func WithHeaders(headers map[string]string) ResourceRequestOptionFunc
- func WithIncludes(value string) ResourceRequestOptionFunc
- func WithIsOverview(value string) ResourceRequestOptionFunc
- func WithOverflow(value string) ResourceRequestOptionFunc
- func WithParams(p map[string]string) ResourceRequestOptionFunc
- func WithQuery(value string) ResourceRequestOptionFunc
- func WithServiceIDs(value string) ResourceRequestOptionFunc
- func WithSince(value string) ResourceRequestOptionFunc
- func WithSortBy(value string) ResourceRequestOptionFunc
- func WithStatuses(value string) ResourceRequestOptionFunc
- func WithTeamIDs(value string) ResourceRequestOptionFunc
- func WithTimeZone(value string) ResourceRequestOptionFunc
- func WithUntil(value string) ResourceRequestOptionFunc
- func WithUserIDs(value string) ResourceRequestOptionFunc
- type Response
- type ResponsePlay
- type ResponsePlayResponse
- type ResponseTypeFunc
- type Restriction
- type Schedule
- type ScheduleLayer
- type ScheduleResponse
- type ScheduledAction
- type Service
- type ServiceResponse
- type SupportHours
- type Team
- type TeamResponse
- type UpdateScheduleOptions
- type User
- type UserReference
- type UserResponse
- type Vendor
- type VendorResponse
- type Webhook
- type WebhookPayload
- type WebhookResponse
Constants ¶
const ( // Resource Types AbilityResourceType APIResourceType = "ability" AddonResourceType APIResourceType = "addon" EscalationPolicyResourceType APIResourceType = "escalation_policy" EventResourceType APIResourceType = "event" ExtensionResourceType APIResourceType = "extension" IncidentResourceType APIResourceType = "incident" LogEntryResourceType APIResourceType = "log_entry" MaintenanceWindowResourceType APIResourceType = "maintenance_window" NotificationResourceType APIResourceType = "notification" OnCallResourceType APIResourceType = "on_call" ResponsePlayResourceType APIResourceType = "response_play" ScheduleResourceType APIResourceType = "schedule" ServiceResourceType APIResourceType = "service" TeamResourceType APIResourceType = "team" UserResourceType APIResourceType = "user" VendorResourceType APIResourceType = "vendor" WebhookResourceType APIResourceType = "webhook" // Abilities AbilitySSO Ability = "sso" AbilityAdvancedReports Ability = "advanced_reports" Abilityteams Ability = "teams" AbilityReadOnlyUsers Ability = "read_only_users" AbilityTeamResponders Ability = "team_responders" AbilityServiceSupportHours Ability = "service_support_hours" Abilityurgencies Ability = "urgencies" AbilityManageSchedules Ability = "manage_schedules" AbilityManageApiKeys Ability = "manage_api_keys" AbilityCoordinatedResponding Ability = "coordinated_responding" AbilityResponseAutomation Ability = "response_automation" AbilityUsingAlertsOnAnyService Ability = "using_alerts_on_any_service" AbilityEventRules Ability = "event_rules" AbilityDynamicNotifications Ability = "dynamic_notifications" AbilityBetaCustomActions Ability = "beta_custom_actions" AbilityCoordinatedRespondingPreview Ability = "coordinated_responding_preview" AbilityPreviewIncidentAlertSplit Ability = "preview_incident_alert_split" AbilityTimeBasedAlertGrouping Ability = "time_based_alert_grouping" AbilityMobileSchedules Ability = "mobile_schedules" AbilityResponseplaysMobileIosV1 Ability = "responseplays_mobile_ios_v1" AbilityResponseplaysMobileAndroidV1 Ability = "responseplays_mobile_android_v1" AbilityLivenessIosV1 Ability = "liveness_ios_v1" AbilityLivenessAndroidV1 Ability = "liveness_android_v1" AbilityPreviewIncidentPriority Ability = "preview_incident_priority" AbilityIncidentPriorityActivated Ability = "incident_priority_activated" AbilityFeaturesInUsePreventingDowngradeTo Ability = "features_in_use_preventing_downgrade_to" AbilityFeatureToPlanMap Ability = "feature_to_plan_map" // Integration constants AwsCloudwatchInboundIntegration = "aws_cloudwatch_inbound_integration" AwsCloudwatchInboundIntegrationReference = "aws_cloudwatch_inbound_integration_reference" CloudkickInboundIntegration = "cloudkick_inbound_integration" CloudkickInboundIntegrationReference = "cloudkick_inbound_integration_reference" EventTransformerApiInboundIntegration = "event_transformer_api_inbound_integration" EventTransformerApiInboundIntegrationReference = "event_transformer_api_inbound_integration_reference" GenericEmailInboundIntegration = "generic_email_inbound_integration" GenericEmailInboundIntegrationReference = "generic_email_inbound_integration_reference" GenericEventsApiInboundIntegration = "generic_events_api_inbound_integration" GenericEventsApiInboundIntegrationReference = "generic_events_api_inbound_integration_reference" KeynoteInboundIntegration = "keynote_inbound_integration" KeynoteInboundIntegrationReference = "keynote_inbound_integration_reference" NagiosInboundIntegration = "nagios_inbound_integration" NagiosInboundIntegrationReference = "nagios_inbound_integration_reference" PingdomInboundIntegration = "pingdom_inbound_integration" PingdomInboundIntegrationReference = "pingdom_inbound_integration_reference" SqlMonitorInboundIntegration = "sql_monitor_inbound_integration" SqlMonitorInboundIntegrationReference = "sql_monitor_inbound_integration_reference" // Timezones TZAmericaLos_Angeles = "America/Los_Angeles" TZEuropeCopenhagen = "Europe/Copenhagen" TZEtcUTC = "Etc/UTC" TZAsiaShanghai = "Asia/Shanghai" TZEuropeHelsinki = "Europe/Helsinki" TZEuropeAmsterdam = "Europe/Amsterdam" )
Variables ¶
var APIListResponses = apiListResourceTypes{ AbilityResourceType: func(response *http.Response) ResourceList { return new(ListAbilityResponse) }, AddonResourceType: func(response *http.Response) ResourceList { return new(ListAddonResponse) }, EscalationPolicyResourceType: func(response *http.Response) ResourceList { return new(ListEscalationPoliciesResponse) }, IncidentResourceType: func(response *http.Response) ResourceList { return new(ListIncidentsResponse) }, LogEntryResourceType: func(response *http.Response) ResourceList { return new(ListLogEntryResponse) }, MaintenanceWindowResourceType: func(response *http.Response) ResourceList { return new(ListMaintenanceWindowsResponse) }, NotificationResourceType: func(response *http.Response) ResourceList { return new(ListNotificationsResponse) }, ResponsePlayResourceType: func(response *http.Response) ResourceList { return new(ListResponsePlaysResponse) }, ScheduleResourceType: func(response *http.Response) ResourceList { return new(ListSchedulesResponse) }, ServiceResourceType: func(response *http.Response) ResourceList { return new(ListServiceResponse) }, TeamResourceType: func(response *http.Response) ResourceList { return new(ListTeamResponse) }, UserResourceType: func(response *http.Response) ResourceList { return new(ListUsersResponse) }, VendorResourceType: func(response *http.Response) ResourceList { return new(ListVendorResponse) }, WebhookResourceType: func(response *http.Response) ResourceList { return new(ListWebhooksResponse) }, }
var APIResponses = apiResourceTypes{ AbilityResourceType: func(response *http.Response) Response { return NewAbilityResponse(response) }, AddonResourceType: func(response *http.Response) Response { return NewAddonResponse(response) }, EscalationPolicyResourceType: func(response *http.Response) Response { return NewEscalationPolicyResponse(response) }, IncidentResourceType: func(response *http.Response) Response { return NewIncidentResponse(response) }, LogEntryResourceType: func(response *http.Response) Response { return NewLogEntryResponse(response) }, MaintenanceWindowResourceType: func(response *http.Response) Response { return NewMaintenanceWindowResponse(response) }, NotificationResourceType: func(response *http.Response) Response { return NewNotificationResponse(response) }, ResponsePlayResourceType: func(response *http.Response) Response { return NewResponsePlayResponse(response) }, ScheduleResourceType: func(response *http.Response) Response { return NewScheduleResponse(response) }, ServiceResourceType: func(response *http.Response) Response { return NewServiceResponse(response) }, TeamResourceType: func(response *http.Response) Response { return NewTeamResponse(response) }, UserResourceType: func(response *http.Response) Response { return NewUserResponse(response) }, VendorResourceType: func(response *http.Response) Response { return NewVendorResponse(response) }, WebhookResourceType: func(response *http.Response) Response { return NewWebhookResponse(response) }, }
var ErrorCode_Message = map[int]string{
1001: "Incident Already Resolved",
1002: "Incident Already Acknowledged",
1003: "Invalid Status Provided",
1004: "Invalid Id Provided",
1005: "Data Updated Since Last Request",
1006: "Cannot Escalate",
1007: "Assigned To User Not Found",
1008: "Requester User Not Found",
1009: "Error Parsing before_time Parameter",
1010: "Before Time or Before Incident Number Not Found",
1011: "Cannot process reassign action",
1012: "Incident Is Not Acknowledged",
1013: "Snooze Duration is Invalid",
1014: "Escalation Policy Not Found",
2000: "An internal error has occurred.PagerDuty administrators have been notified.",
2001: "Cannot Delete Only Rule For Escalation Policy, Cannot create more than 50 users at one time, Escalation Policy has already been taken, Incident could not be created, Invalid Input Provided, Users must be an array",
2002: "Arguments Caused Error",
2003: "Missing Arguments",
2004: "Invalid time values in 'since' and/or 'until' parameters",
2005: "Invalid Query Date Range",
2006: "Authentication failed",
2007: "Account Not Found",
2008: "Account Locked",
2009: "Only HTTPS Allowed For This Call",
2010: "Access Denied",
2011: "You must specify a requester_id to perform this action",
2012: "Your account is expired and cannot use the API.",
2013: "User not found",
2015: "Invalid operation",
2016: "The request took too long to process",
2100: "Not Found",
3001: "Invalid Schedule",
3004: "Schedule Not Found, Unknown Schedule",
4004: "Invalid Override, Override Not Found",
5001: "Affiliate Partner Not Found, Color Not Found, Escalation Policy Not Found, Escalation Rule Not Found, Incident Not Found, Log Entry Not Found, Maintenance Window Not Found, User Next On-call Not Found, Vendor Not Found, Webhook Not Found",
5002: "Service Not Found, Simple Log Entry Limit Reached",
5003: "Cannot cancel a maintenance window from the past",
6001: "Team Not Found",
6002: "Team has Incidents but Reassignment Team is not valid",
6003: "Team has Incidents but Reassignment Team is not found",
6004: "Team could not be deleted because there are too many incidents, please contact support.",
6006: "Team has existing associations",
6007: "The request failed to complete",
7001: "saml is not enabled",
7002: "SAMLResponse is not provided",
7003: "failed to parse SAMLResponse",
7004: "SAMLResponse is invalid",
7005: "unable to find user by name_id",
7006: "invalid name_id found in SAMLResponse",
7007: "unexpected validation error",
8001: "google auth is not enabled, pre_auth.authorizable? returned false",
8002: "redirect_uri is invalid",
8004: "unable to find account",
8005: "unable to find user by name_id",
8006: "user has denied google auth",
8007: "unable to log in using google auth",
8008: "user has tried to access an invalid host domain",
}
Functions ¶
This section is empty.
Types ¶
type APIListObject ¶
type APIListObject struct { Limit uint `url:"limit,omitempty" json:"limit"` Offset uint `url:"offset,omitempty" json:"offset"` More bool `url:"more,omitempty" json:"more"` Total uint `url:"total,omitempty" json:"total"` }
APIListObject are the fields used to control pagination when listing objects.
func (APIListObject) GetLimit ¶
func (list APIListObject) GetLimit() uint
func (APIListObject) GetOffset ¶
func (list APIListObject) GetOffset() uint
func (APIListObject) GetTotal ¶
func (list APIListObject) GetTotal() uint
func (APIListObject) HasMore ¶
func (list APIListObject) HasMore() bool
type APIObject ¶
type APIObject struct { ID string `json:"id,omitempty"` Type APIResourceType `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
func (APIObject) GetHTMLURL ¶
func (APIObject) GetSummary ¶
func (APIObject) GetType ¶
func (apiObj APIObject) GetType() APIResourceType
type APIReference ¶
APIReference are the fields required to reference another API object.
type APIResourceType ¶
type APIResourceType string
func (APIResourceType) Plural ¶
func (r APIResourceType) Plural() APIResourceType
IV. Nouns ending in "y" a. If the common noun ends with a consonant + "y" or "qu" + "y" , remove the "y" and add "ies". The vowels are the letters a, e, i, o, and u. All other letters are consonants. b. Common nouns with a vowel + "y", just add "s" Exception: To form the plural of proper nouns ending in "y" preceded by a consonant, just add an "s".
func (APIResourceType) String ¶
func (r APIResourceType) String() string
type APIResponse ¶
type APIResponse struct {
// contains filtered or unexported fields
}
type Ability ¶
type Ability string
func (Ability) GetHTMLURL ¶
func (Ability) GetSummary ¶
func (Ability) GetType ¶
func (a Ability) GetType() APIResourceType
type AbilityResponse ¶
type AbilityResponse struct {
APIResponse
}
func NewAbilityResponse ¶
func NewAbilityResponse(resp *http.Response) AbilityResponse
func (AbilityResponse) GetResource ¶
func (r AbilityResponse) GetResource() (Resource, error)
type Acknowledgement ¶
Acknowledgement is the data structure of an acknowledgement of an incident.
type Addon ¶
type Addon struct { APIObject Name string `json:"name,omitempty"` Src string `json:"src,omitempty"` Services []APIObject `json:"services,omitempty"` }
Addon is a third-party add-on to PagerDuty's UI.
type AddonResponse ¶
type AddonResponse struct {
APIResponse
}
func NewAddonResponse ¶
func NewAddonResponse(resp *http.Response) AddonResponse
func (AddonResponse) GetResource ¶
func (r AddonResponse) GetResource() (Resource, error)
type Alert ¶
type Alert struct { APIReference CreatedAt time.Time `json:"created_at"` Status string `json:"status"` AlertKey string `json:"alert_key"` Service APIReference `json:"service"` Body AlertBody `json:"body"` Incident APIReference `json:"incident"` Suppressed bool `json:"suppressed"` Severity string `json:"severity"` Integration APIReference `json:"integration"` }
type AlertBody ¶
type AlertBody struct { Type string `json:"type"` Contexts []APIReference `json:"contexts"` Details map[string]interface{} `json:"details"` }
type Assignment ¶
Assignment is the data structure for an assignment of an incident
type Channel ¶
type Channel struct {
Type string
}
Channel is the means by which the action was carried out.
type Client ¶
type Client struct { // HTTPClient is the HTTP client used for making requests against the // PagerDuty API. You can use either *http.Client here, or your own // implementation. HTTPClient HTTPClient // contains filtered or unexported fields }
Client wraps http client
func NewClient ¶
func NewClient(authToken string, opts ...NewClientOptionFunc) *Client
NewClient creates an API client
func (*Client) AddEscalationPolicyToTeam ¶
AddEscalationPolicyToTeam adds an escalation policy to a team.
func (*Client) AddUserToTeam ¶
AddUserToTeam adds a user to a team.
func (*Client) CreateEscalationPolicy ¶
func (c *Client) CreateEscalationPolicy(e EscalationPolicy) (*EscalationPolicy, error)
CreateEscalationPolicy creates a new escalation policy.
func (*Client) CreateEscalationRule ¶
func (c *Client) CreateEscalationRule(escID string, e EscalationRule) (*EscalationRule, error)
CreateEscalationRule creates a new escalation rule for an escalation policy and appends it to the end of the existing escalation rules.
func (*Client) CreateIncidentNote ¶
func (c *Client) CreateIncidentNote(id string, note IncidentNote) error
CreateIncidentNote creates a new note for the specified incident.
func (*Client) CreateIntegration ¶
func (c *Client) CreateIntegration(id string, i Integration) (*Integration, error)
CreateIntegration creates a new integration belonging to a service.
func (*Client) CreateMaintenanceWindows ¶
func (c *Client) CreateMaintenanceWindows(m MaintenanceWindow) (*MaintenanceWindow, error)
CreateMaintenanceWindows creates a new maintenance window for the specified services.
func (*Client) CreateOverride ¶
CreateOverride creates an override for a specific user covering the specified time range.
func (*Client) CreateResource ¶
func (*Client) CreateSchedule ¶
CreateSchedule creates a new on-call schedule.
func (*Client) CreateService ¶
CreateService creates a new service.
func (*Client) CreateTeam ¶
CreateTeam creates a new team.
func (*Client) CreateUser ¶
CreateUser creates a new user.
func (*Client) DeleteEscalationPolicy ¶
DeleteEscalationPolicy deletes an existing escalation policy and rules.
func (*Client) DeleteEscalationRule ¶
DeleteEscalationRule deletes an existing escalation rule.
func (*Client) DeleteIntegration ¶
DeleteIntegration deletes an existing integration.
func (*Client) DeleteMaintenanceWindow ¶
DeleteMaintenanceWindow deletes an existing maintenance window if it's in the future, or ends it if it's currently on-going.
func (*Client) DeleteOverride ¶
DeleteOverride removes an override.
func (*Client) DeleteResource ¶
func (c *Client) DeleteResource(typ APIResourceType, id string) error
DeleteResource deletes the given Resource. The given Resource should return a valid API URL from GetSelf()
func (*Client) DeleteSchedule ¶
DeleteSchedule deletes an on-call schedule.
func (*Client) DeleteService ¶
DeleteService deletes an existing service.
func (*Client) DeleteTeam ¶
DeleteTeam removes an existing team.
func (*Client) GetEscalationPolicy ¶
func (c *Client) GetEscalationPolicy(id string, opts ...ResourceRequestOptionFunc) (*EscalationPolicy, error)
GetEscalationPolicy gets information about an existing escalation policy and its rules.
func (*Client) GetEscalationRule ¶
func (c *Client) GetEscalationRule(escID string, id string, o *GetEscalationRuleOptions) (*EscalationRule, error)
GetEscalationRule gets information about an existing escalation rule.
func (*Client) GetExtension ¶
func (c *Client) GetExtension(id string, opts ...ResourceRequestOptionFunc) (*Extension, error)
func (*Client) GetIncident ¶
func (c *Client) GetIncident(id string, opts ...ResourceRequestOptionFunc) (*Incident, error)
GetIncident shows detailed information about an incident.
func (*Client) GetIntegration ¶
func (c *Client) GetIntegration(serviceID, integrationID string, o GetIntegrationOptions) (*Integration, error)
GetIntegration gets details about an integration belonging to a service.
func (*Client) GetMaintenanceWindow ¶
func (c *Client) GetMaintenanceWindow(id string, opts ...ResourceRequestOptionFunc) (*MaintenanceWindow, error)
GetMaintenanceWindow gets an existing maintenance window.
func (*Client) GetResource ¶
func (c *Client) GetResource(typ APIResourceType, id string, opts ...ResourceRequestOptionFunc) (Resource, error)
GetResource fetches a Resource for a given type and ID
func (*Client) GetResponsePlay ¶
func (c *Client) GetResponsePlay(id string, opts ...ResourceRequestOptionFunc) (*ResponsePlay, error)
func (*Client) GetSchedule ¶
func (c *Client) GetSchedule(id string, opts ...ResourceRequestOptionFunc) (*Schedule, error)
GetSchedule shows detailed information about a schedule, including entries for each layer and sub-schedule.
func (*Client) GetService ¶
func (c *Client) GetService(id string, opts ...ResourceRequestOptionFunc) (*Service, error)
GetService gets details about an existing service.
func (*Client) GetUser ¶
func (c *Client) GetUser(id string, opts ...ResourceRequestOptionFunc) (*User, error)
GetUser gets details about an existing user.
func (*Client) GetVendor ¶
func (c *Client) GetVendor(id string, opts ...ResourceRequestOptionFunc) (*Vendor, error)
GetVendor gets details about an existing vendor.
func (*Client) InstallAddon ¶
InstallAddon installs an add-on for your account.
func (*Client) ListAbilities ¶
func (c *Client) ListAbilities() (*ListAbilityResponse, error)
ListAbilities lists all abilities on your account.
func (*Client) ListAddons ¶
func (c *Client) ListAddons(opts ...ResourceRequestOptionFunc) (*ListAddonResponse, error)
ListAddons lists all of the add-ons installed on your account.
func (*Client) ListAlertsForIncident ¶
func (c *Client) ListAlertsForIncident(id string, opts ...ResourceRequestOptionFunc) (*ListIncidentAlertsResponse, error)
func (*Client) ListEscalationPolicies ¶
func (c *Client) ListEscalationPolicies(opts ...ResourceRequestOptionFunc) (*ListEscalationPoliciesResponse, error)
ListEscalationPolicies lists all of the existing escalation policies.
func (*Client) ListEscalationRules ¶
func (c *Client) ListEscalationRules(escID string) (*ListEscalationRulesResponse, error)
ListEscalationRules lists all of the escalation rules for an existing escalation policy.
func (*Client) ListIncidentLogEntries ¶
func (c *Client) ListIncidentLogEntries(id string, o ListIncidentLogEntriesOptions) (*ListIncidentLogEntriesResponse, error)
ListIncidentLogEntries lists existing log entries for the specified incident.
func (*Client) ListIncidentNotes ¶
func (c *Client) ListIncidentNotes(id string) ([]IncidentNote, error)
ListIncidentNotes lists existing notes for the specified incident.
func (*Client) ListIncidents ¶
func (c *Client) ListIncidents(opts ...ResourceRequestOptionFunc) (*ListIncidentsResponse, error)
ListIncidents lists existing incidents.
func (*Client) ListLogEntries ¶
func (c *Client) ListLogEntries(opts ...ResourceRequestOptionFunc) (*ListLogEntryResponse, error)
ListLogEntries lists all of the incident log entries across the entire account.
func (*Client) ListMaintenanceWindows ¶
func (c *Client) ListMaintenanceWindows(opts ...ResourceRequestOptionFunc) (*ListMaintenanceWindowsResponse, error)
ListMaintenanceWindows lists existing maintenance windows, optionally filtered by service and/or team, or whether they are from the past, present or future.
func (*Client) ListNotifications ¶
func (c *Client) ListNotifications(opts ...ResourceRequestOptionFunc) (*ListNotificationsResponse, error)
ListNotifications lists notifications for a given time range, optionally filtered by type (sms_notification, email_notification, phone_notification, or push_notification).
func (*Client) ListOnCallUsers ¶
func (c *Client) ListOnCallUsers(id string, o ListOnCallUsersOptions) ([]User, error)
ListOnCallUsers lists all of the users on call in a given schedule for a given time range.
func (*Client) ListOnCalls ¶
func (c *Client) ListOnCalls(o ListOnCallOptions) (*ListOnCallsResponse, error)
ListOnCalls list the on-call entries during a given time range.
func (*Client) ListOverrides ¶
func (c *Client) ListOverrides(id string, o ListOverridesOptions) ([]Override, error)
TODO: Figure out what the hell this is doing ListOverrides lists overrides for a given time range.
func (*Client) ListResources ¶
func (c *Client) ListResources(typ APIResourceType, opts ...ResourceRequestOptionFunc) (*http.Response, error)
func (*Client) ListSchedules ¶
func (c *Client) ListSchedules(opts ...ResourceRequestOptionFunc) (*ListSchedulesResponse, error)
ListSchedules lists the on-call schedules.
func (*Client) ListServices ¶
func (c *Client) ListServices(opts ...ResourceRequestOptionFunc) (*ListServiceResponse, error)
ListServices lists existing services.
func (*Client) ListTeams ¶
func (c *Client) ListTeams(opts ...ResourceRequestOptionFunc) (*ListTeamResponse, error)
ListTeams lists teams of your PagerDuty account, optionally filtered by a search query.
func (*Client) ListUsers ¶
func (c *Client) ListUsers(opts ...ResourceRequestOptionFunc) (*ListUsersResponse, error)
ListUsers lists users of your PagerDuty account, optionally filtered by a search query.
func (*Client) ListVendors ¶
func (c *Client) ListVendors(opts ...ResourceRequestOptionFunc) (*ListVendorResponse, error)
ListVendors lists existing vendors.
func (*Client) ManageIncidents ¶
TODO: Update for multiple resources ManageIncidents acknowledges, resolves, escalates, or reassigns one or more incidents.
func (*Client) PreviewSchedule ¶
func (c *Client) PreviewSchedule(s Schedule, o PreviewScheduleOptions) error
PreviewSchedule previews what an on-call schedule would look like without saving it.
func (*Client) RemoveEscalationPolicyFromTeam ¶
RemoveEscalationPolicyFromTeam removes an escalation policy from a team.
func (*Client) RemoveUserFromTeam ¶
RemoveUserFromTeam removes a user from a team.
func (*Client) SnoozeIncident ¶
SnoozeIncident sets an incident to not alert for a specified period of time.
func (*Client) TestAbility ¶
TestAbility Check if your account has the given ability.
func (*Client) UpdateEscalationPolicy ¶
func (c *Client) UpdateEscalationPolicy(id string, e *EscalationPolicy) (*EscalationPolicy, error)
UpdateEscalationPolicy updates an existing escalation policy and its rules.
func (*Client) UpdateEscalationRule ¶
func (c *Client) UpdateEscalationRule(escID string, id string, e *EscalationRule) (*EscalationRule, error)
UpdateEscalationRule updates an existing escalation rule.
func (*Client) UpdateIntegration ¶
func (c *Client) UpdateIntegration(serviceID string, i Integration) (*Integration, error)
UpdateIntegration updates an integration belonging to a service.
func (*Client) UpdateMaintenanceWindow ¶
func (c *Client) UpdateMaintenanceWindow(m MaintenanceWindow) (*MaintenanceWindow, error)
UpdateMaintenanceWindow updates an existing maintenance window.
func (*Client) UpdateResource ¶
func (*Client) UpdateSchedule ¶
UpdateSchedule updates an existing on-call schedule.
func (*Client) UpdateService ¶
UpdateService updates an existing service.
func (*Client) UpdateTeam ¶
UpdateTeam updates an existing team.
type ContactMethod ¶
type ContactMethod struct { ID string Label string Address string Type string SendShortEmail bool `json:"send_short_email"` }
ContactMethod is a way of contacting the user.
type ErrorObject ¶
type ErrorObject struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` Errors interface{} `json:"errors,omitempty"` }
func (ErrorObject) Error ¶
func (eo ErrorObject) Error() string
type ErrorResponse ¶
type ErrorResponse struct {
Error ErrorObject `json:"error,omitempty"`
}
type EscalationPolicy ¶
type EscalationPolicy struct { APIObject Name string `json:"name,omitempty"` EscalationRules []EscalationRule `json:"escalation_rules,omitempty"` Services []APIReference `json:"services,omitempty"` NumLoops uint `json:"num_loops,omitempty"` Teams []APIReference `json:"teams,omitempty"` Description string `json:"description,omitempty"` RepeatEnabled bool `json:"repeat_enabled,omitempty"` }
EscalationPolicy is a collection of escalation rules.
type EscalationPolicyResponse ¶
type EscalationPolicyResponse struct {
APIResponse
}
func NewEscalationPolicyResponse ¶
func NewEscalationPolicyResponse(resp *http.Response) EscalationPolicyResponse
func (EscalationPolicyResponse) GetResource ¶
func (r EscalationPolicyResponse) GetResource() (Resource, error)
type EscalationRule ¶
type EscalationRule struct { ID string `json:"id,omitempty"` Delay uint `json:"escalation_delay_in_minutes,omitempty"` Targets []APIObject `json:"targets"` }
EscalationRule is a rule for an escalation policy to trigger.
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"` }
Event stores data for problem reporting, acknowledgement, and resolution.
type EventResponse ¶
type EventResponse struct { Status string `json:"status"` Message string `json:"message"` IncidentKey string `json:"incident_key"` }
EventResponse is the data returned from the CreateEvent API endpoint.
func CreateEvent ¶
func CreateEvent(e Event) (*EventResponse, error)
CreateEvent sends PagerDuty an event to trigger, acknowledge, or resolve a problem. If you need to provide a custom HTTP client, please use CreateEventWithHTTPClient.
func CreateEventWithHTTPClient ¶
func CreateEventWithHTTPClient(e Event, client HTTPClient) (*EventResponse, error)
CreateEventWithHTTPClient sends PagerDuty an event to trigger, acknowledge, or resolve a problem. This function accepts a custom HTTP Client, if the default one used by this package doesn't fit your needs. If you don't need a custom HTTP client, please use CreateEvent instead.
type Extension ¶
type Extension struct { APIObject EndpointUrl string `json:"endpoint_url"` Name string `json:"name"` ExtensionSchema ExtensionSchema `json:"extension_schema"` ExtensionObjects []APIObject `json:"extension_objects"` }
func NewExtension ¶
func NewExtension(opts ...ExtensionOptFunc) *Extension
type ExtensionOptFunc ¶
type ExtensionOptFunc func(*Extension)
func ExtensionWithEndpoint ¶
func ExtensionWithEndpoint(endpoint string) ExtensionOptFunc
func ExtensionWithName ¶
func ExtensionWithName(name string) ExtensionOptFunc
func ExtensionWithObjects ¶
func ExtensionWithObjects(r ...APIObject) ExtensionOptFunc
func ExtensionWithSchema ¶
func ExtensionWithSchema(r ExtensionSchema) ExtensionOptFunc
func ExtensionWithService ¶
func ExtensionWithService(serviceId string) ExtensionOptFunc
type ExtensionSchema ¶
type ExtensionSchema struct {
APIObject
}
type GetEscalationPolicyOptions ¶
type GetEscalationPolicyOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
GetEscalationPolicyOptions is the data structure used when calling the GetEscalationPolicy API endpoint.
type GetEscalationRuleOptions ¶
type GetEscalationRuleOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
GetEscalationRuleOptions is the data structure used when calling the GetEscalationRule API endpoint.
type GetIntegrationOptions ¶
type GetIntegrationOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
GetIntegrationOptions is the data structure used when calling the GetIntegration API endpoint.
type GetMaintenanceWindowOptions ¶
type GetMaintenanceWindowOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
GetMaintenanceWindowOptions is the data structure used when calling the GetMaintenanceWindow API endpoint.
type GetScheduleOptions ¶
type GetScheduleOptions struct { APIListObject TimeZone string `url:"time_zone,omitempty"` Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` }
GetScheduleOptions is the data structure used when calling the GetSchedule API endpoint.
type GetServiceOptions ¶
type GetServiceOptions struct {
Includes []string `url:"include,brackets,omitempty"`
}
GetServiceOptions is the data structure used when calling the GetService API endpoint.
type GetUserOptions ¶
type GetUserOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}
GetUserOptions is the data structure used when calling the GetUser API endpoint.
type HTTPClient ¶
HTTPClient is an interface which declares the functionality we need from an HTTP client. This is to allow consumers to provide their own HTTP client as needed, without restricting them to only using *http.Client.
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:"first_trigger_log_entry,omitempty"` EscalationPolicy APIObject `json:"escalation_policy,omitempty"` Teams []APIObject `json:"teams,omitempty"` Urgency string `json:"urgency,omitempty"` Status string `json:"status,omitempty"` }
Incident is a normalized, de-duplicated event generated by a PagerDuty integration.
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_data"` TriggerDetailsHTMLUrl string `json:"trigger_details_html_url"` }
IncidentDetail contains a representation of the incident associated with the action that caused this webhook message.
type IncidentNote ¶
type IncidentNote struct { ID string `json:"id,omitempty"` User APIObject `json:"user,omitempty"` Content string `json:"content,omitempty"` CreatedAt string `json:"created_at,omitempty"` }
IncidentNote is a note for the specified incident.
type IncidentResponse ¶
type IncidentResponse struct {
APIResponse
}
func NewIncidentResponse ¶
func NewIncidentResponse(resp *http.Response) IncidentResponse
func (IncidentResponse) GetResource ¶
func (r IncidentResponse) GetResource() (Resource, error)
type IncidentUrgencyRule ¶
type IncidentUrgencyRule struct { Type string `json:"type,omitempty"` Urgency string `json:"urgency,omitempty"` DuringSupportHours *IncidentUrgencyType `json:"during_support_hours,omitempty"` OutsideSupportHours *IncidentUrgencyType `json:"outside_support_hours,omitempty"` }
IncidentUrgencyRule is the default urgency for new incidents.
type IncidentUrgencyType ¶
type IncidentUrgencyType struct { Type string `json:"type,omitempty"` Urgency string `json:"urgency,omitempty"` }
IncidentUrgencyType are the incidents urgency during or outside support hours.
type InlineModel ¶
InlineModel represents when a scheduled action will occur.
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"` Type string `json:"type,omitempty"` IntegrationKey string `json:"integration_key,omitempty"` IntegrationEmail string `json:"integration_email,omitempty"` }
Integration is an endpoint (like Nagios, email, or an API call) that generates events, which are normalized and de-duplicated by PagerDuty to create incidents.
type InvalidResourceTypeError ¶
type InvalidResourceTypeError struct {
Message string
}
InvalidResourceTypeError is a custom error type.
func NewInvalidResourceTypeError ¶
func NewInvalidResourceTypeError(typ APIResourceType) InvalidResourceTypeError
NewInvalidResourceTypeError creates a new `InvalidResourceTypeError`.
func (InvalidResourceTypeError) Error ¶
func (e InvalidResourceTypeError) Error() string
type ListAbilityResponse ¶
type ListAbilityResponse struct {
Abilities Abilities `json:"abilities"`
}
ListAbilityResponse is the response when calling the ListAbility API endpoint.
func (ListAbilityResponse) GetLimit ¶
func (list ListAbilityResponse) GetLimit() uint
func (ListAbilityResponse) GetOffset ¶
func (list ListAbilityResponse) GetOffset() uint
func (ListAbilityResponse) GetTotal ¶
func (list ListAbilityResponse) GetTotal() uint
func (ListAbilityResponse) HasMore ¶
func (list ListAbilityResponse) HasMore() bool
type ListAddonOptions ¶
type ListAddonOptions struct { APIListObject Includes []string `url:"include,omitempty,brackets"` ServiceIDs []string `url:"service_ids,omitempty,brackets"` Filter string `url:"filter,omitempty"` }
ListAddonOptions are the options available when calling the ListAddons API endpoint.
type ListAddonResponse ¶
type ListAddonResponse struct { APIListObject Addons []Addon `json:"addons"` }
ListAddonResponse is the response when calling the ListAddons API endpoint.
type ListEscalationPoliciesOptions ¶
type ListEscalationPoliciesOptions struct { APIListObject Query string `url:"query,omitempty"` UserIDs []string `url:"user_ids,omitempty,brackets"` TeamIDs []string `url:"team_ids,omitempty,brackets"` Includes []string `url:"include,omitempty,brackets"` SortBy string `url:"sort_by,omitempty"` }
ListEscalationPoliciesOptions is the data structure used when calling the ListEscalationPolicies API endpoint.
type ListEscalationPoliciesResponse ¶
type ListEscalationPoliciesResponse struct { APIListObject EscalationPolicies []EscalationPolicy `json:"escalation_policies"` }
ListEscalationPoliciesResponse is the data structure returned from calling the ListEscalationPolicies API endpoint.
type ListEscalationRulesResponse ¶
type ListEscalationRulesResponse struct { APIListObject EscalationRules []EscalationRule `json:"escalation_rules"` }
type ListIncidentLogEntriesOptions ¶
type ListIncidentLogEntriesOptions struct { APIListObject Includes []string `url:"include,omitempty,brackets"` IsOverview bool `url:"is_overview,omitempty"` TimeZone string `url:"time_zone,omitempty"` }
ListIncidentLogEntriesOptions is the structure used when passing parameters to the ListIncidentLogEntries API endpoint.
type ListIncidentLogEntriesResponse ¶
type ListIncidentLogEntriesResponse struct { APIListObject LogEntries []LogEntry `json:"log_entries,omitempty"` }
ListIncidentLogEntriesResponse is the response structure when calling the ListIncidentLogEntries API endpoint.
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"` }
ListIncidentsOptions is the structure used when passing parameters to the ListIncident API endpoint.
type ListIncidentsResponse ¶
type ListIncidentsResponse struct { APIListObject Incidents []Incident `json:"incidents,omitempty"` }
ListIncidentsResponse is the response structure when calling the ListIncident API endpoint.
type ListLogEntriesOptions ¶
type ListLogEntriesOptions struct { APIListObject TimeZone string `url:"time_zone"` Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` IsOverview bool `url:"is_overview,omitempty"` Includes []string `url:"include,omitempty,brackets"` }
ListLogEntriesOptions is the data structure used when calling the ListLogEntry API endpoint.
type ListLogEntryResponse ¶
type ListLogEntryResponse struct { APIListObject LogEntries []LogEntry `json:"log_entries"` }
ListLogEntryResponse is the response data when calling the ListLogEntry API endpoint.
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"` }
ListMaintenanceWindowsOptions is the data structure used when calling the ListMaintenanceWindows API endpoint.
type ListMaintenanceWindowsResponse ¶
type ListMaintenanceWindowsResponse struct { APIListObject MaintenanceWindows []MaintenanceWindow `json:"maintenance_windows"` }
ListMaintenanceWindowsResponse is the data structur returned from calling the ListMaintenanceWindows API endpoint.
type ListNotificationOptions ¶
type ListNotificationOptions struct { APIListObject TimeZone string `url:"time_zone,omitempty"` Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` Filter string `url:"filter,omitempty"` Includes []string `url:"include,omitempty"` }
ListNotificationOptions is the data structure used when calling the ListNotifications API endpoint.
type ListNotificationsResponse ¶
type ListNotificationsResponse struct { APIListObject Notifications []Notification }
ListNotificationsResponse is the data structure returned from the ListNotifications API endpoint.
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 `url:"since,omitempty"` Until string `url:"until,omitempty"` Earliest bool `url:"earliest,omitempty"` }
ListOnCallOptions is the data structure used when calling the ListOnCalls API endpoint.
type ListOnCallUsersOptions ¶
type ListOnCallUsersOptions struct { APIListObject Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` }
ListOnCallUsersOptions is the data structure used when calling the ListOnCallUsers API endpoint.
type ListOnCallsResponse ¶
type ListOnCallsResponse struct { APIListObject OnCalls []OnCall `json:"oncalls"` }
ListOnCallsResponse is the data structure returned from calling the ListOnCalls API endpoint.
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"` }
ListOverridesOptions is the data structure used when calling the ListOverrides API endpoint.
type ListResponsePlaysResponse ¶
type ListResponsePlaysResponse struct {
APIListObject
}
type ListResponseTypeFunc ¶
type ListResponseTypeFunc func(response *http.Response) ResourceList
type ListSchedulesOptions ¶
type ListSchedulesOptions struct { APIListObject Query string `url:"query,omitempty"` }
ListSchedulesOptions is the data structure used when calling the ListSchedules API endpoint.
type ListSchedulesResponse ¶
type ListSchedulesResponse struct { APIListObject Schedules []Schedule `json:"schedules"` }
ListSchedulesResponse is the data structure returned from calling the ListSchedules API endpoint.
type ListServiceOptions ¶
type ListServiceOptions struct { APIListObject TeamIDs []string `url:"team_ids,omitempty,brackets"` TimeZone string `url:"time_zone,omitempty"` SortBy string `url:"sort_by,omitempty"` Query string `url:"query,omitempty"` Includes []string `url:"include,omitempty,brackets"` }
ListServiceOptions is the data structure used when calling the ListServices API endpoint.
type ListServiceResponse ¶
type ListServiceResponse struct { APIListObject Services []Service }
ListServiceResponse is the data structure returned from calling the ListServices API endpoint.
type ListTeamOptions ¶
type ListTeamOptions struct { APIListObject Query string `url:"query,omitempty"` }
ListTeamOptions are the input parameters used when calling the ListTeams API endpoint.
type ListTeamResponse ¶
type ListTeamResponse struct { APIListObject Teams []Team }
ListTeamResponse is the structure used when calling the ListTeams API endpoint.
type ListUsersOptions ¶
type ListUsersOptions struct { APIListObject Query string `url:"query,omitempty"` TeamIDs []string `url:"team_ids,omitempty,brackets"` Includes []string `url:"include,omitempty,brackets"` }
ListUsersOptions is the data structure used when calling the ListUsers API endpoint.
type ListUsersResponse ¶
type ListUsersResponse struct { APIListObject Users []User }
ListUsersResponse is the data structure returned from calling the ListUsers API endpoint.
type ListVendorOptions ¶
type ListVendorOptions struct { APIListObject Query string `url:"query,omitempty"` }
ListVendorOptions is the data structure used when calling the ListVendors API endpoint.
type ListVendorResponse ¶
type ListVendorResponse struct { APIListObject Vendors []Vendor }
ListVendorResponse is the data structure returned from calling the ListVendors API endpoint.
type ListWebhooksResponse ¶
type ListWebhooksResponse struct {
APIListObject
}
type LogEntry ¶
type LogEntry struct { APIObject CreatedAt string `json:"created_at"` Agent Agent Channel Channel Incident Incident Teams []Team Contexts []Context AcknowledgementTimeout int `json:"acknowledgement_timeout"` EventDetails map[string]string }
LogEntry is a list of all of the events that happened to an incident.
type LogEntryResponse ¶
type LogEntryResponse struct {
APIResponse
}
func NewLogEntryResponse ¶
func NewLogEntryResponse(resp *http.Response) LogEntryResponse
func (LogEntryResponse) GetResource ¶
func (r LogEntryResponse) GetResource() (Resource, error)
type MaintenanceWindow ¶
type MaintenanceWindow struct { APIObject SequenceNumber uint `json:"sequence_number,omitempty"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` Description string `json:"description"` Services []APIObject `json:"services"` Teams []APIListObject `json:"teams"` CreatedBy APIListObject `json:"created_by"` }
MaintenanceWindow is used to temporarily disable one or more services for a set period of time.
type MaintenanceWindowResponse ¶
type MaintenanceWindowResponse struct {
APIResponse
}
func NewMaintenanceWindowResponse ¶
func NewMaintenanceWindowResponse(resp *http.Response) MaintenanceWindowResponse
func (MaintenanceWindowResponse) GetResource ¶
func (r MaintenanceWindowResponse) GetResource() (Resource, error)
type NewClientOptionFunc ¶
type NewClientOptionFunc func(*Client)
func WithCustomClient ¶
func WithCustomClient(c HTTPClient) NewClientOptionFunc
func WithCustomHost ¶
func WithCustomHost(host string) NewClientOptionFunc
type Notification ¶
type Notification struct { ID string `json:"id"` Type string StartedAt string `json:"started_at"` Address string User APIObject }
Notification is a message containing the details of the incident.
func (Notification) GetHTMLURL ¶
func (n Notification) GetHTMLURL() string
func (Notification) GetID ¶
func (n Notification) GetID() string
func (Notification) GetSelf ¶
func (n Notification) GetSelf() string
func (Notification) GetSummary ¶
func (n Notification) GetSummary() string
func (Notification) GetType ¶
func (n Notification) GetType() APIResourceType
type NotificationResponse ¶
type NotificationResponse struct {
APIResponse
}
func NewNotificationResponse ¶
func NewNotificationResponse(resp *http.Response) NotificationResponse
func (NotificationResponse) GetResource ¶
func (r NotificationResponse) GetResource() (Resource, error)
type NotificationRule ¶
type NotificationRule struct { ID string StartDelayInMinutes uint `json:"start_delay_in_minutes"` CreatedAt string `json:"created_at"` ContactMethod ContactMethod `json:"contact_method"` Urgency string Type string }
NotificationRule is a rule for notifying the user.
type OnCall ¶
type OnCall struct { User APIObject `json:"user,omitempty"` Schedule APIObject `json:"schedule,omitempty"` EscalationPolicy APIObject `json:"escalation_policy,omitempty"` EscalationLevel uint `json:"escalation_level,omitempty"` Start string `json:"start,omitempty"` End string `json:"end,omitempty"` }
OnCall represents a contiguous unit of time for which a user will be on call for a given escalation policy and escalation rule.
type Override ¶
type Override struct { ID string `json:"id,omitempty"` Start string `json:"start,omitempty"` End string `json:"end,omitempty"` User APIObject `json:"user,omitempty"` }
Overrides are any schedule layers from the override layer.
type PendingAction ¶
PendingAction is the data structure for any pending actions on an incident.
type PreviewScheduleOptions ¶
type PreviewScheduleOptions struct { APIListObject Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` Overflow bool `url:"overflow,omitempty"` }
PreviewScheduleOptions is the data structure used when calling the PreviewSchedule API endpoint.
type RenderedScheduleEntry ¶
type RenderedScheduleEntry struct { Start string `json:"start,omitempty"` End string `json:"end,omitempty"` User APIObject `json:"user,omitempty"` }
RenderedScheduleEntry represents the computed set of schedule layer entries that put users on call for a schedule, and cannot be modified directly.
type Resource ¶
type Resource interface { GetID() string GetType() APIResourceType GetSummary() string GetSelf() string GetHTMLURL() string }
type ResourceList ¶
type ResourceRequestOptionFunc ¶
func WithDateRange ¶
func WithDateRange(value string) ResourceRequestOptionFunc
func WithEditable ¶
func WithEditable(value string) ResourceRequestOptionFunc
func WithEscalationPolicyIDs ¶
func WithEscalationPolicyIDs(value string) ResourceRequestOptionFunc
func WithFilter ¶
func WithFilter(value string) ResourceRequestOptionFunc
func WithHeader ¶
func WithHeader(key, value string) ResourceRequestOptionFunc
func WithHeaders ¶
func WithHeaders(headers map[string]string) ResourceRequestOptionFunc
func WithIncludes ¶
func WithIncludes(value string) ResourceRequestOptionFunc
func WithIsOverview ¶
func WithIsOverview(value string) ResourceRequestOptionFunc
func WithOverflow ¶
func WithOverflow(value string) ResourceRequestOptionFunc
func WithParams ¶
func WithParams(p map[string]string) ResourceRequestOptionFunc
func WithQuery ¶
func WithQuery(value string) ResourceRequestOptionFunc
func WithServiceIDs ¶
func WithServiceIDs(value string) ResourceRequestOptionFunc
func WithSince ¶
func WithSince(value string) ResourceRequestOptionFunc
func WithSortBy ¶
func WithSortBy(value string) ResourceRequestOptionFunc
func WithStatuses ¶
func WithStatuses(value string) ResourceRequestOptionFunc
func WithTeamIDs ¶
func WithTeamIDs(value string) ResourceRequestOptionFunc
func WithTimeZone ¶
func WithTimeZone(value string) ResourceRequestOptionFunc
func WithUntil ¶
func WithUntil(value string) ResourceRequestOptionFunc
func WithUserIDs ¶
func WithUserIDs(value string) ResourceRequestOptionFunc
type ResponsePlay ¶
type ResponsePlay struct {
APIObject
}
type ResponsePlayResponse ¶
type ResponsePlayResponse struct {
APIResponse
}
func NewResponsePlayResponse ¶
func NewResponsePlayResponse(resp *http.Response) ResponsePlayResponse
func (ResponsePlayResponse) GetResource ¶
func (r ResponsePlayResponse) GetResource() (Resource, error)
type ResponseTypeFunc ¶
type Restriction ¶
type Restriction struct { Type string `json:"type,omitempty"` StartTimeOfDay string `json:"start_time_of_day,omitempty"` StartDayOfWeek uint `json:"start_day_of_week,omitempty"` DurationSeconds uint `json:"duration_seconds,omitempty"` }
Restriction limits on-call responsibility for a layer to certain times of the day or week.
type Schedule ¶
type Schedule struct { APIObject Name string `json:"name,omitempty"` TimeZone string `json:"time_zone,omitempty"` Description string `json:"description,omitempty"` EscalationPolicies []APIObject `json:"escalation_policies,omitempty"` Users []APIObject `json:"users,omitempty"` ScheduleLayers []ScheduleLayer `json:"schedule_layers,omitempty"` OverrideSubschedule ScheduleLayer `json:"override_subschedule,omitempty"` FinalSchedule ScheduleLayer `json:"final_schedule,omitempty"` }
Schedule determines the time periods that users are on call.
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_turn_length_seconds,omitempty"` Users []UserReference `json:"users,omitempty"` Restrictions []Restriction `json:"restrictions,omitempty"` RenderedScheduleEntries []RenderedScheduleEntry `json:"rendered_schedule_entries,omitempty"` RenderedCoveragePercentage float64 `json:"rendered_coverage_percentage,omitempty"` }
ScheduleLayer is an entry that puts users on call for a schedule.
type ScheduleResponse ¶
type ScheduleResponse struct {
APIResponse
}
func NewScheduleResponse ¶
func NewScheduleResponse(resp *http.Response) ScheduleResponse
func (ScheduleResponse) GetResource ¶
func (r ScheduleResponse) GetResource() (Resource, error)
type ScheduledAction ¶
type ScheduledAction struct { Type string `json:"type,omitempty"` At InlineModel `json:"at,omitempty"` ToUrgency string `json:"to_urgency"` }
ScheduledAction contains scheduled actions for the service.
type Service ¶
type Service struct { APIObject Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` AutoResolveTimeout *uint `json:"auto_resolve_timeout"` AcknowledgementTimeout *uint `json:"acknowledgement_timeout"` 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 *SupportHours `json:"support_hours,omitempty"` ScheduledActions []ScheduledAction `json:"scheduled_actions,omitempty"` AlertCreation string `json:"alert_creation,omitempty"` }
Service represents something you monitor (like a web service, email service, or database service).
type ServiceResponse ¶
type ServiceResponse struct {
APIResponse
}
func NewServiceResponse ¶
func NewServiceResponse(resp *http.Response) ServiceResponse
func (ServiceResponse) GetResource ¶
func (r ServiceResponse) GetResource() (Resource, error)
type SupportHours ¶
type SupportHours struct { Type string `json:"type,omitempty"` Timezone string `json:"time_zone,omitempty"` StartTime string `json:"start_time,omitempty"` EndTime string `json:"end_time,omitempty"` DaysOfWeek []uint `json:"days_of_week,omitempty"` }
SupportHours are the support hours for the service.
type Team ¶
type Team struct { APIObject Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` }
Team is a collection of users and escalation policies that represent a group of people within an organization.
type TeamResponse ¶
type TeamResponse struct {
APIResponse
}
func NewTeamResponse ¶
func NewTeamResponse(resp *http.Response) TeamResponse
func (TeamResponse) GetResource ¶
func (r TeamResponse) GetResource() (Resource, error)
type UpdateScheduleOptions ¶
type UpdateScheduleOptions struct {
Overflow bool `url:"overflow,omitempty"`
}
UpdateScheduleOptions is the data structure used when calling the UpdateSchedule API endpoint.
type User ¶
type User struct { APIObject Name string `json:"name"` Email string `json:"email"` Timezone string `json:"timezone,omitempty"` Color string `json:"color,omitempty"` Role string `json:"role,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` Description string `json:"description,omitempty"` InvitationSent bool ContactMethods []ContactMethod `json:"contact_methods"` NotificationRules []NotificationRule `json:"notification_rules"` JobTitle string `json:"job_title,omitempty"` Teams []Team }
User is a member of a PagerDuty account that has the ability to interact with incidents and other data on the account.
type UserReference ¶
type UserReference struct {
User APIObject `json:"user"`
}
UserReference is a reference to an authorized PagerDuty user.
type UserResponse ¶
type UserResponse struct {
APIResponse
}
func NewUserResponse ¶
func NewUserResponse(resp *http.Response) UserResponse
func (UserResponse) GetResource ¶
func (r UserResponse) GetResource() (Resource, error)
type Vendor ¶
type Vendor struct { APIObject Name string `json:"name,omitempty"` LogoURL string `json:"logo_url,omitempty"` LongName string `json:"long_name,omitempty"` WebsiteURL string `json:"website_url,omitempty"` Description string `json:"description,omitempty"` Connectable bool `json:"connectable,omitempty"` ThumbnailURL string `json:"thumbnail_url,omitempty"` GenericServiceType string `json:"generic_service_type,omitempty"` IntegrationGuideURL string `json:"integration_guide_url,omitempty"` }
Vendor represents a specific type of integration. AWS Cloudwatch, Splunk, Datadog, etc are all examples of vendors that can be integrated in PagerDuty by making an integration.
type VendorResponse ¶
type VendorResponse struct {
APIResponse
}
func NewVendorResponse ¶
func NewVendorResponse(resp *http.Response) VendorResponse
func (VendorResponse) GetResource ¶
func (r VendorResponse) GetResource() (Resource, error)
type WebhookPayload ¶
type WebhookPayload struct { ID string `json:"id"` Type string `json:"type"` CreatedOn string `json:"created_on"` Data *json.RawMessage `json:"data"` }
WebhookPayload is a single message array for a webhook.
func DecodeWebhook ¶
func DecodeWebhook(r io.Reader) (*WebhookPayload, error)
DecodeWebhook decodes a webhook from a response object.
type WebhookResponse ¶
type WebhookResponse struct {
APIResponse
}
func NewWebhookResponse ¶
func NewWebhookResponse(resp *http.Response) WebhookResponse
func (WebhookResponse) GetResource ¶
func (r WebhookResponse) GetResource() (Resource, error)