Documentation
¶
Overview ¶
Package flashduty is the official Go client for the Flashduty Open API (https://www.flashduty.com). It is a thin, typed wrapper: every method maps to exactly one HTTP call, returns (*T, *Response, error), and performs no hidden cross-endpoint enrichment.
Create a client with an app key:
client, err := flashduty.NewClient("APP_KEY")
if err != nil {
// handle error
}
Endpoints are grouped into services on the client, e.g. client.Incidents.List(ctx, &flashduty.ListIncidentsRequest{...}). Most are POST actions; a few read endpoints are GET with query parameters. Services are added by the code generator; see internal/cmd/gen.
Cross-cutting transport concerns (retry, caching, tracing, rate-limit handling) compose as http.RoundTripper middleware via WithTransport. The optional retry subpackage provides a safe-by-default retrying transport.
Index ¶
- func Bool(v bool) *bool
- func Float64(v float64) *float64
- func Int(v int) *int
- func Int64(v int64) *int64
- func IsAccessDenied(err error) bool
- func IsInvalidParameter(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func IsUnauthorized(err error) bool
- func NewExportScanner(r io.Reader) *bufio.Scanner
- func String(v string) *string
- func Uint64(v uint64) *uint64
- type A2aAgentCreateRequest
- type A2aAgentCreateResponse
- type A2aAgentIDRequest
- type A2aAgentItem
- type A2aAgentListRequest
- type A2aAgentListResponse
- type A2aAgentUpdateRequest
- type A2aAgentsService
- func (s *A2aAgentsService) ReadGet(ctx context.Context, req *A2aAgentIDRequest) (*A2aAgentItem, *Response, error)
- func (s *A2aAgentsService) ReadList(ctx context.Context, req *A2aAgentListRequest) (*A2aAgentListResponse, *Response, error)
- func (s *A2aAgentsService) WriteCreate(ctx context.Context, req *A2aAgentCreateRequest) (*A2aAgentCreateResponse, *Response, error)
- func (s *A2aAgentsService) WriteDelete(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)
- func (s *A2aAgentsService) WriteDisable(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)
- func (s *A2aAgentsService) WriteEnable(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)
- func (s *A2aAgentsService) WriteUpdate(ctx context.Context, req *A2aAgentUpdateRequest) (*any, *Response, error)
- type AccountInfo
- type AccountInfoRestrictions
- type AccountService
- type AckIncidentRequest
- type AddIncidentResponderRequest
- type AddIncidentResponderRequestNotify
- type AddWarRoomMemberRequest
- type AffectedStatusPageComponentItem
- type AlertEmailPreviewEmail
- type AlertEmailPreviewEvent
- type AlertEmailPreviewParsed
- type AlertEmailPreviewRequest
- type AlertEmailPreviewResponse
- type AlertEmailPreviewSettings
- type AlertEmailRule
- type AlertEnrichmentService
- func (s *AlertEnrichmentService) EnrichmentReadInfo(ctx context.Context, req *EnrichmentInfoRequest) (*EnrichmentItem, *Response, error)
- func (s *AlertEnrichmentService) EnrichmentReadList(ctx context.Context, req *EnrichmentListRequest) (*EnrichmentListResponse, *Response, error)
- func (s *AlertEnrichmentService) EnrichmentReadPreview(ctx context.Context, req *EnrichmentPreviewRequest) (*EnrichmentPreviewResponse, *Response, error)
- func (s *AlertEnrichmentService) EnrichmentSampleReadList(ctx context.Context, req *EnrichmentSampleListRequest) (*EnrichmentSampleListResponse, *Response, error)
- func (s *AlertEnrichmentService) EnrichmentWriteUpsert(ctx context.Context, req *EnrichmentUpsertRequest) (*Response, error)
- func (s *AlertEnrichmentService) FieldReadInfo(ctx context.Context, req *FieldInfoRequest) (*FieldItem, *Response, error)
- func (s *AlertEnrichmentService) FieldReadList(ctx context.Context, req *FieldListRequest) (*FieldListResponse, *Response, error)
- func (s *AlertEnrichmentService) FieldWriteCreate(ctx context.Context, req *CreateFieldRequest) (*CreateFieldResponse, *Response, error)
- func (s *AlertEnrichmentService) FieldWriteDelete(ctx context.Context, req *DeleteFieldRequest) (*Response, error)
- func (s *AlertEnrichmentService) FieldWriteUpdate(ctx context.Context, req *UpdateFieldRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingAPIReadInfo(ctx context.Context, req *MappingApiidRequest) (*MappingAPIItem, *Response, error)
- func (s *AlertEnrichmentService) MappingAPIReadList(ctx context.Context) (*MappingAPIListResponse, *Response, error)
- func (s *AlertEnrichmentService) MappingAPIWriteCreate(ctx context.Context, req *MappingAPICreateRequest) (*MappingAPICreateResponse, *Response, error)
- func (s *AlertEnrichmentService) MappingAPIWriteDelete(ctx context.Context, req *MappingApiidRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingAPIWriteUpdate(ctx context.Context, req *MappingAPIUpdateRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingDataReadDownload(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingDataReadList(ctx context.Context, req *MappingDataListRequest) (*MappingDataListResponse, *Response, error)
- func (s *AlertEnrichmentService) MappingDataWriteDelete(ctx context.Context, req *MappingDataDeleteRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingDataWriteTruncate(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingDataWriteUpload(ctx context.Context, req *MappingDataUploadRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingDataWriteUpsert(ctx context.Context, req *MappingDataUpsertRequest) (*MappingDataUpsertResponse, *Response, error)
- func (s *AlertEnrichmentService) MappingSchemaReadInfo(ctx context.Context, req *MappingSchemaIDRequest) (*MappingSchemaItem, *Response, error)
- func (s *AlertEnrichmentService) MappingSchemaReadList(ctx context.Context) (*MappingSchemaListResponse, *Response, error)
- func (s *AlertEnrichmentService) MappingSchemaWriteCreate(ctx context.Context, req *MappingSchemaCreateRequest) (*MappingSchemaCreateResponse, *Response, error)
- func (s *AlertEnrichmentService) MappingSchemaWriteDelete(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)
- func (s *AlertEnrichmentService) MappingSchemaWriteUpdate(ctx context.Context, req *MappingSchemaUpdateRequest) (*Response, error)
- type AlertEvent
- type AlertEventGlobalListRequest
- type AlertEventGlobalListResponse
- type AlertEventItem
- type AlertEventListRequest
- type AlertEventListResponse
- type AlertFeedRequest
- type AlertFeedResponse
- type AlertFeedType
- type AlertImage
- type AlertInfo
- type AlertInfoRequest
- type AlertItem
- type AlertListByIDsRequest
- type AlertListRequest
- type AlertListResponse
- type AlertMergeRequest
- type AlertPipeline
- type AlertPipelineInfoRequest
- type AlertPipelineItem
- type AlertPipelineListRequest
- type AlertPipelineListResponse
- type AlertPipelinePreviewEvent
- type AlertPipelinePreviewRequest
- type AlertPipelinePreviewResponse
- type AlertPipelineUpsertRequest
- type AlertRule
- type AlertRuleAnyDataV2
- type AlertRuleAudit
- type AlertRuleBasic
- type AlertRuleConfigsV2
- type AlertRuleConfigsV2QueriesItem
- type AlertRuleConfigsV2RelateQueriesItem
- type AlertRuleCounter
- type AlertRuleEnabledTimesItem
- type AlertRuleExport
- type AlertRuleExportListResponse
- type AlertRuleNoDataV2
- type AlertRuleRecoveryQueryV2
- type AlertRuleThresholdV2
- type AlertRuleV2
- type AlertRuleV2EnabledTimesItem
- type AlertRulesService
- func (s *AlertRulesService) ReadAuditDetail(ctx context.Context, req *AuditRecordIDRequest) (*AlertRuleAudit, *Response, error)
- func (s *AlertRulesService) ReadAudits(ctx context.Context, req *RuleIDRequest) (*RuleAuditListResponse, *Response, error)
- func (s *AlertRulesService) ReadCounterChannel(ctx context.Context) (*RuleCounterChannelResponse, *Response, error)
- func (s *AlertRulesService) ReadCounterTotal(ctx context.Context) (*RuleCounterTotalResponse, *Response, error)
- func (s *AlertRulesService) ReadInfoV2(ctx context.Context, req *RuleIDRequest) (*AlertRuleV2, *Response, error)
- func (s *AlertRulesService) ReadList(ctx context.Context, req *RuleListRequest) (*RuleBasicListResponse, *Response, error)
- func (s *AlertRulesService) WriteCreateV2(ctx context.Context, req *AlertRuleV2) (*AlertRuleV2, *Response, error)
- func (s *AlertRulesService) WriteDelete(ctx context.Context, req *RuleIDRequest) (*Response, error)
- func (s *AlertRulesService) WriteDeleteBatch(ctx context.Context, req *RuleIDsRequest) (*Response, error)
- func (s *AlertRulesService) WriteFieldsUpdate(ctx context.Context, req *RuleFieldsUpdateRequest) (*RuleNameMessageListResponse, *Response, error)
- func (s *AlertRulesService) WriteMove(ctx context.Context, req *RuleMoveRequest) (*RuleNameMessageListResponse, *Response, error)
- func (s *AlertRulesService) WriteUpdateV2(ctx context.Context, req *AlertRuleV2) (*AlertRuleV2, *Response, error)
- type AlertShort
- type AlertsService
- func (s *AlertsService) EventReadList(ctx context.Context, req *AlertEventGlobalListRequest) (*AlertEventGlobalListResponse, *Response, error)
- func (s *AlertsService) ReadEventList(ctx context.Context, req *AlertEventListRequest) (*AlertEventListResponse, *Response, error)
- func (s *AlertsService) ReadFeed(ctx context.Context, req *AlertFeedRequest) (*AlertFeedResponse, *Response, error)
- func (s *AlertsService) ReadInfo(ctx context.Context, req *AlertInfoRequest) (*AlertItem, *Response, error)
- func (s *AlertsService) ReadList(ctx context.Context, req *AlertListRequest) (*AlertListResponse, *Response, error)
- func (s *AlertsService) ReadListByIDs(ctx context.Context, req *AlertListByIDsRequest) (*AlertListResponse, *Response, error)
- func (s *AlertsService) ReadPipelineInfo(ctx context.Context, req *AlertPipelineInfoRequest) (*AlertPipelineItem, *Response, error)
- func (s *AlertsService) ReadPipelineList(ctx context.Context, req *AlertPipelineListRequest) (*AlertPipelineListResponse, *Response, error)
- func (s *AlertsService) ReadPipelinePreview(ctx context.Context, req *AlertPipelinePreviewRequest) (*AlertPipelinePreviewResponse, *Response, error)
- func (s *AlertsService) WriteMerge(ctx context.Context, req *AlertMergeRequest) (*Response, error)
- func (s *AlertsService) WritePipelineUpsert(ctx context.Context, req *AlertPipelineUpsertRequest) (*Response, error)
- type AnalyticsService
- func (s *AnalyticsService) ByAccount(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error)
- func (s *AnalyticsService) ByChannel(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error)
- func (s *AnalyticsService) ByResponder(ctx context.Context, req *InsightQueryRequest) (*ResponderInsightResponse, *Response, error)
- func (s *AnalyticsService) ByTeam(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error)
- func (s *AnalyticsService) ChannelExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)
- func (s *AnalyticsService) IncidentExport(ctx context.Context, req *InsightIncidentExportRequest) (*Response, error)
- func (s *AnalyticsService) IncidentList(ctx context.Context, req *InsightIncidentListRequest) (*InsightIncidentListResponse, *Response, error)
- func (s *AnalyticsService) ResponderExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)
- func (s *AnalyticsService) TeamExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)
- func (s *AnalyticsService) TopkAlertsByLabel(ctx context.Context, req *InsightTopkAlertByLabelRequest) (*InsightAlertByLabelResponse, *Response, error)
- type ApAlertDrop
- type ApAlertInhibit
- type ApDescriptionReset
- type ApSeverityReset
- type ApTitleReset
- type ApplicationsService
- func (s *ApplicationsService) ReadInfo(ctx context.Context, req *RUMApplicationIDRequest) (*RUMApplicationItem, *Response, error)
- func (s *ApplicationsService) ReadInfos(ctx context.Context, req *RUMApplicationInfosRequest) (*RUMApplicationInfosResponse, *Response, error)
- func (s *ApplicationsService) ReadList(ctx context.Context, req *RUMApplicationListRequest) (*RUMApplicationListResponse, *Response, error)
- func (s *ApplicationsService) RemoteConfigReadGet(ctx context.Context, req *GetRemoteConfigRequest) (*GetRemoteConfigResponse, *Response, error)
- func (s *ApplicationsService) RemoteConfigReadHistoryList(ctx context.Context, req *ListRemoteConfigHistoryRequest) (*ListRemoteConfigHistoryResponse, *Response, error)
- func (s *ApplicationsService) RemoteConfigReadPreview(ctx context.Context, req *PreviewRemoteConfigRequest) (*PreviewRemoteConfigResponse, *Response, error)
- func (s *ApplicationsService) RemoteConfigWriteHistoryRevert(ctx context.Context, req *RevertRemoteConfigRequest) (*RevertRemoteConfigResponse, *Response, error)
- func (s *ApplicationsService) RemoteConfigWriteUpdate(ctx context.Context, req *UpdateRemoteConfigRequest) (*UpdateRemoteConfigResponse, *Response, error)
- func (s *ApplicationsService) WebhookTest(ctx context.Context, req *RUMWebhookTestRequest) (*RUMWebhookTestResponse, *Response, error)
- func (s *ApplicationsService) WriteCreate(ctx context.Context, req *RUMApplicationCreateRequest) (*RUMApplicationCreateResponse, *Response, error)
- func (s *ApplicationsService) WriteDelete(ctx context.Context, req *RUMApplicationIDRequest) (*Response, error)
- func (s *ApplicationsService) WriteUpdate(ctx context.Context, req *RUMApplicationUpdateRequest) (*Response, error)
- type ArtifactFileStateItem
- type ArtifactFileStateRequest
- type ArtifactFileStateResponse
- type ArtifactIDRequest
- type ArtifactListRequest
- type ArtifactListResponse
- type ArtifactPublishFromFileRequest
- type ArtifactPublishResponse
- type ArtifactShareState
- type ArtifactSignRequest
- type ArtifactUpdateRequest
- type ArtifactsReadStreamRequest
- type ArtifactsService
- func (s *ArtifactsService) ReadGet(ctx context.Context, req *ArtifactIDRequest) (*PublishedArtifactItem, *Response, error)
- func (s *ArtifactsService) ReadGetFileState(ctx context.Context, req *ArtifactFileStateRequest) (*ArtifactFileStateResponse, *Response, error)
- func (s *ArtifactsService) ReadList(ctx context.Context, req *ArtifactListRequest) (*ArtifactListResponse, *Response, error)
- func (s *ArtifactsService) ReadSign(ctx context.Context, req *ArtifactSignRequest) (*SignedUrLs, *Response, error)
- func (s *ArtifactsService) ReadStream(ctx context.Context, req *ArtifactsReadStreamRequest) (*Response, error)
- func (s *ArtifactsService) WriteDelete(ctx context.Context, req *ArtifactIDRequest) (*any, *Response, error)
- func (s *ArtifactsService) WritePublish(ctx context.Context, req *ArtifactPublishFromFileRequest) (*ArtifactPublishResponse, *Response, error)
- func (s *ArtifactsService) WriteShareEnable(ctx context.Context, req *ArtifactIDRequest) (*ArtifactShareState, *Response, error)
- func (s *ArtifactsService) WriteShareRevoke(ctx context.Context, req *ArtifactIDRequest) (*any, *Response, error)
- func (s *ArtifactsService) WriteShareSync(ctx context.Context, req *ArtifactIDRequest) (*ArtifactShareState, *Response, error)
- func (s *ArtifactsService) WriteUpdate(ctx context.Context, req *ArtifactUpdateRequest) (*PublishedArtifactItem, *Response, error)
- type AssignIncidentRequest
- type AssignedTo
- type AssignedToNotify
- type AuditLog
- type AuditLogParamsItem
- type AuditLogsService
- type AuditOperationListRequest
- type AuditOperationListResponse
- type AuditOperationTypeItem
- type AuditRecordIDRequest
- type AuditSearchRequest
- type AuditSearchResponse
- type AutomationFireAPITriggerRequest
- type AutomationFireAPITriggerResponse
- type AutomationRuleCreateRequest
- type AutomationRuleIDRequest
- type AutomationRuleItem
- type AutomationRuleItemExecutionLocation
- type AutomationRuleItemLastRun
- type AutomationRuleListRequest
- type AutomationRuleListResponse
- type AutomationRuleUpdateRequest
- type AutomationRunItem
- type AutomationRunListRequest
- type AutomationRunListResponse
- type AutomationRunView
- type AutomationTemplateItem
- type AutomationTemplateListRequest
- type AutomationTemplateListResponse
- type AutomationsService
- func (s *AutomationsService) RuleReadGet(ctx context.Context, req *AutomationRuleIDRequest) (*AutomationRuleItem, *Response, error)
- func (s *AutomationsService) RuleReadList(ctx context.Context, req *AutomationRuleListRequest) (*AutomationRuleListResponse, *Response, error)
- func (s *AutomationsService) RuleWriteCreate(ctx context.Context, req *AutomationRuleCreateRequest) (*AutomationRuleItem, *Response, error)
- func (s *AutomationsService) RuleWriteDelete(ctx context.Context, req *AutomationRuleIDRequest) (*any, *Response, error)
- func (s *AutomationsService) RuleWriteRun(ctx context.Context, req *AutomationRuleIDRequest) (*ManualRunRuleResult, *Response, error)
- func (s *AutomationsService) RuleWriteUpdate(ctx context.Context, req *AutomationRuleUpdateRequest) (*AutomationRuleItem, *Response, error)
- func (s *AutomationsService) RunReadList(ctx context.Context, req *AutomationRunListRequest) (*AutomationRunListResponse, *Response, error)
- func (s *AutomationsService) TemplateReadList(ctx context.Context, req *AutomationTemplateListRequest) (*AutomationTemplateListResponse, *Response, error)
- func (s *AutomationsService) TriggerWriteFire(ctx context.Context, triggerID, token string, ...) (*AutomationFireAPITriggerResponse, *Response, error)
- type BindWorkItemPostMortemRequest
- type CalDay
- type CalEventIDRequest
- type CalEventItem
- type CalEventListRequest
- type CalEventListResponse
- type CalEventUpsertRequest
- type CalEventUpsertResponse
- type CalendarCreateRequest
- type CalendarCreateResponse
- type CalendarEmptyObject
- type CalendarIDRequest
- type CalendarItem
- type CalendarListRequest
- type CalendarListResponse
- type CalendarUpdateRequest
- type CalendarsService
- func (s *CalendarsService) CalEventDelete(ctx context.Context, req *CalEventIDRequest) (*Response, error)
- func (s *CalendarsService) CalEventList(ctx context.Context, req *CalEventListRequest) (*CalEventListResponse, *Response, error)
- func (s *CalendarsService) CalEventUpsert(ctx context.Context, req *CalEventUpsertRequest) (*CalEventUpsertResponse, *Response, error)
- func (s *CalendarsService) CalendarCreate(ctx context.Context, req *CalendarCreateRequest) (*CalendarCreateResponse, *Response, error)
- func (s *CalendarsService) CalendarDelete(ctx context.Context, req *CalendarIDRequest) (*Response, error)
- func (s *CalendarsService) CalendarInfo(ctx context.Context, req *CalendarIDRequest) (*CalendarItem, *Response, error)
- func (s *CalendarsService) CalendarList(ctx context.Context, req *CalendarListRequest) (*CalendarListResponse, *Response, error)
- func (s *CalendarsService) CalendarUpdate(ctx context.Context, req *CalendarUpdateRequest) (*Response, error)
- type CancelStatusPageMigrationRequest
- type ChangeEventItem
- type ChangeItem
- type ChangesService
- type ChannelCreateResponse
- type ChannelIDRequest
- type ChannelInfoRequest
- type ChannelInfosRequest
- type ChannelInfosResponse
- type ChannelIntegrationCreateRequest
- type ChannelIntegrationCreateResponse
- type ChannelIntegrationIDRequest
- type ChannelIntegrationItem
- type ChannelIntegrationListRequest
- type ChannelIntegrationListResponse
- type ChannelIntegrationUpdateRequest
- type ChannelItem
- type ChannelRuleIDRequest
- type ChannelScopedListRequest
- type ChannelShort
- type ChannelsService
- func (s *ChannelsService) ChannelCreate(ctx context.Context, req *CreateChannelRequest) (*ChannelCreateResponse, *Response, error)
- func (s *ChannelsService) ChannelDelete(ctx context.Context, req *ChannelIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelDisable(ctx context.Context, req *ChannelIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelEnable(ctx context.Context, req *ChannelIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelEscalateRuleCreate(ctx context.Context, req *CreateEscalationRuleRequest) (*RuleCreateResponse, *Response, error)
- func (s *ChannelsService) ChannelEscalateRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelEscalateRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelEscalateRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelEscalateRuleInfo(ctx context.Context, req *ChannelRuleIDRequest) (*EscalateRuleItem, *Response, error)
- func (s *ChannelsService) ChannelEscalateRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListEscalationRulesResponse, *Response, error)
- func (s *ChannelsService) ChannelEscalateRuleReorder(ctx context.Context, req *ReorderEscalationRulesRequest) (*Response, error)
- func (s *ChannelsService) ChannelEscalateRuleUpdate(ctx context.Context, req *UpdateEscalationRuleRequest) (*Response, error)
- func (s *ChannelsService) ChannelInfo(ctx context.Context, req *ChannelInfoRequest) (*ChannelItem, *Response, error)
- func (s *ChannelsService) ChannelInfos(ctx context.Context, req *ChannelInfosRequest) (*ChannelInfosResponse, *Response, error)
- func (s *ChannelsService) ChannelInhibitRuleCreate(ctx context.Context, req *CreateInhibitRuleRequest) (*RuleCreateResponse, *Response, error)
- func (s *ChannelsService) ChannelInhibitRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelInhibitRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelInhibitRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelInhibitRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListInhibitRulesResponse, *Response, error)
- func (s *ChannelsService) ChannelInhibitRuleUpdate(ctx context.Context, req *UpdateInhibitRuleRequest) (*Response, error)
- func (s *ChannelsService) ChannelList(ctx context.Context, req *ListChannelsRequest) (*ListChannelsResponse, *Response, error)
- func (s *ChannelsService) ChannelSilenceRuleCreate(ctx context.Context, req *CreateSilenceRuleRequest) (*RuleCreateResponse, *Response, error)
- func (s *ChannelsService) ChannelSilenceRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelSilenceRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelSilenceRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelSilenceRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListSilenceRulesResponse, *Response, error)
- func (s *ChannelsService) ChannelSilenceRuleUpdate(ctx context.Context, req *UpdateSilenceRuleRequest) (*Response, error)
- func (s *ChannelsService) ChannelUnsubscribeRuleCreate(ctx context.Context, req *CreateDropRuleRequest) (*RuleCreateResponse, *Response, error)
- func (s *ChannelsService) ChannelUnsubscribeRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelUnsubscribeRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelUnsubscribeRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
- func (s *ChannelsService) ChannelUnsubscribeRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListDropRulesResponse, *Response, error)
- func (s *ChannelsService) ChannelUnsubscribeRuleUpdate(ctx context.Context, req *UpdateDropRuleRequest) (*Response, error)
- func (s *ChannelsService) ChannelUpdate(ctx context.Context, req *UpdateChannelRequest) (*UpdateChannelResponse, *Response, error)
- func (s *ChannelsService) RouteInfo(ctx context.Context, req *RouteInfoRequest) (*RouteItem, *Response, error)
- func (s *ChannelsService) RouteList(ctx context.Context, req *ListRoutesRequest) (*ListRoutesResponse, *Response, error)
- func (s *ChannelsService) RouteUpsert(ctx context.Context, req *UpsertRouteRequest) (*Response, error)
- type ClickHouseQueryParams
- type Client
- type CommentIncidentRequest
- type CompleteWorkItemRequest
- type ContextResolvedItem
- type ConvertWorkItemRequest
- type CreateChannelRequest
- type CreateChannelRequestEscalateRule
- type CreateDropRuleRequest
- type CreateEscalationRuleRequest
- type CreateFieldRequest
- type CreateFieldResponse
- type CreateIncidentCommentTypeRequest
- type CreateIncidentCommentTypeResponse
- type CreateIncidentRequest
- type CreateIncidentRequestAssignedTo
- type CreateIncidentRequestAssignedToNotify
- type CreateIncidentResponse
- type CreateInhibitRuleRequest
- type CreateIntegrationRequest
- type CreateIntegrationResponse
- type CreateIntegrationResponseTest
- type CreateSilenceRuleRequest
- type CreateStatusPageChangeRequest
- type CreateStatusPageChangeRequestUpdatesItem
- type CreateStatusPageChangeRequestUpdatesItemComponentChangesItem
- type CreateStatusPageChangeTimelineRequest
- type CreateStatusPageChangeTimelineRequestComponentChangesItem
- type CreateStatusPageDraftRequest
- type CreateStatusPageDraftRequestDraft
- type CreateStatusPageDraftRequestDraftAffectedComponentsItem
- type CreateStatusPageRequest
- type CreateStatusPageResponse
- type CreateWarRoomRequest
- type CreateWorkItemRequest
- type CustomFieldValues
- type DashboardAbsoluteTimeRange
- type DashboardActor
- type DashboardBarViz
- type DashboardCandidate
- type DashboardColumnOption
- type DashboardCreateRequest
- type DashboardCustomVariable
- type DashboardDataLink
- type DashboardDatasourceRef
- type DashboardDatasourceVariable
- type DashboardDefinition
- type DashboardDeleteOutput
- type DashboardDeleteRequest
- type DashboardDraftContext
- type DashboardFieldSort
- type DashboardGaugeViz
- type DashboardGridPosition
- type DashboardIDRequest
- type DashboardInvestigationTarget
- type DashboardLabelFilter
- type DashboardLinkMapping
- type DashboardListItem
- type DashboardListOutput
- type DashboardListRequest
- type DashboardLogsVariableQuery
- type DashboardLogsViz
- type DashboardMoveRequest
- type DashboardOutline
- type DashboardOutlineFolder
- type DashboardOutlineInfo
- type DashboardOutlinePanel
- type DashboardOutlineRequest
- type DashboardOutlineSection
- type DashboardOutlineTab
- type DashboardOutlineVariable
- type DashboardOutlineVizConfig
- type DashboardPanel
- type DashboardPanelPreviewRequest
- type DashboardPanelPreviewResponse
- type DashboardPanelQuery
- type DashboardPanelRunBudget
- type DashboardPanelRunRef
- type DashboardPanelRunRequest
- type DashboardPanelRunResponse
- type DashboardPrometheusVariableQuery
- type DashboardQueriesResolveRequest
- type DashboardQueriesResolveResponse
- type DashboardQuery
- type DashboardQueryVariable
- type DashboardRelativeTimeRange
- type DashboardResolvedPanelQueries
- type DashboardResolvedQuery
- type DashboardResolvedVariable
- type DashboardResource
- type DashboardRestoreRequest
- type DashboardRevisionGetRequest
- type DashboardRevisionItem
- type DashboardRevisionListOutput
- type DashboardRevisionResource
- type DashboardRuntimeDatasource
- type DashboardRuntimeError
- type DashboardSearchRequest
- type DashboardSection
- type DashboardSelection
- type DashboardSelectionConfig
- type DashboardSort
- type DashboardSqlVariableQuery
- type DashboardStatViz
- type DashboardTab
- type DashboardTableViz
- type DashboardTextViz
- type DashboardThreshold
- type DashboardTimeSeriesViz
- type DashboardTrashItem
- type DashboardTrashListOutput
- type DashboardTrashListRequest
- type DashboardUpdateOutput
- type DashboardUpdateRequest
- type DashboardVariable
- type DashboardVariableQuery
- type DashboardVariablesPreviewRequest
- type DashboardVariablesPreviewResponse
- type DashboardVariablesResolveRequest
- type DashboardVariablesResolveResponse
- type DashboardVizConfig
- type DashboardsService
- func (s *DashboardsService) PanelReadPreview(ctx context.Context, req *DashboardPanelPreviewRequest) (*DashboardPanelPreviewResponse, *Response, error)
- func (s *DashboardsService) PanelReadRun(ctx context.Context, req *DashboardPanelRunRequest) (*DashboardPanelRunResponse, *Response, error)
- func (s *DashboardsService) QueryReadResolve(ctx context.Context, req *DashboardQueriesResolveRequest) (*DashboardQueriesResolveResponse, *Response, error)
- func (s *DashboardsService) ReadGet(ctx context.Context, req *DashboardIDRequest) (*DashboardResource, *Response, error)
- func (s *DashboardsService) ReadList(ctx context.Context, req *DashboardListRequest) (*DashboardListOutput, *Response, error)
- func (s *DashboardsService) ReadOutline(ctx context.Context, req *DashboardOutlineRequest) (*DashboardOutline, *Response, error)
- func (s *DashboardsService) ReadSearch(ctx context.Context, req *DashboardSearchRequest) (*DashboardListOutput, *Response, error)
- func (s *DashboardsService) RevisionReadGet(ctx context.Context, req *DashboardRevisionGetRequest) (*DashboardRevisionResource, *Response, error)
- func (s *DashboardsService) RevisionReadList(ctx context.Context, req *DashboardIDRequest) (*DashboardRevisionListOutput, *Response, error)
- func (s *DashboardsService) TrashReadList(ctx context.Context, req *DashboardTrashListRequest) (*DashboardTrashListOutput, *Response, error)
- func (s *DashboardsService) VariableReadPreview(ctx context.Context, req *DashboardVariablesPreviewRequest) (*DashboardVariablesPreviewResponse, *Response, error)
- func (s *DashboardsService) VariableReadResolve(ctx context.Context, req *DashboardVariablesResolveRequest) (*DashboardVariablesResolveResponse, *Response, error)
- func (s *DashboardsService) WriteCreate(ctx context.Context, req *DashboardCreateRequest) (*DashboardResource, *Response, error)
- func (s *DashboardsService) WriteDelete(ctx context.Context, req *DashboardDeleteRequest) (*DashboardDeleteOutput, *Response, error)
- func (s *DashboardsService) WriteMove(ctx context.Context, req *DashboardMoveRequest) (*DashboardUpdateOutput, *Response, error)
- func (s *DashboardsService) WriteRestore(ctx context.Context, req *DashboardRestoreRequest) (*DashboardResource, *Response, error)
- func (s *DashboardsService) WriteUpdate(ctx context.Context, req *DashboardUpdateRequest) (*DashboardUpdateOutput, *Response, error)
- type DataQueryService
- type DataSourceItem
- type DataSourceListRequest
- type DataSourceListResponse
- type DataSourceUpsertRequest
- type DataSourcesService
- func (s *DataSourcesService) ReadInfo(ctx context.Context, req *IDRequest) (*DataSourceItem, *Response, error)
- func (s *DataSourcesService) ReadList(ctx context.Context, req *DataSourceListRequest) (*DataSourceListResponse, *Response, error)
- func (s *DataSourcesService) ReadPrometheusLabelValues(ctx context.Context, dataSourceID uint64, labelName string) (*PrometheusLabelValuesResponse, *Response, error)
- func (s *DataSourcesService) ReadSLSLogstores(ctx context.Context, req *SLSLogstoresRequest) (*SLSLogstoresResponse, *Response, error)
- func (s *DataSourcesService) ReadSLSProjects(ctx context.Context, req *SLSProjectsRequest) (*SLSProjectsResponse, *Response, error)
- func (s *DataSourcesService) ToolsInvoke(ctx context.Context, req *DatasourceToolInvokeRequest) (*DatasourceToolResult, *Response, error)
- func (s *DataSourcesService) WriteCreate(ctx context.Context, req *DataSourceUpsertRequest) (*DataSourceItem, *Response, error)
- func (s *DataSourcesService) WriteDelete(ctx context.Context, req *IDRequest) (*Response, error)
- func (s *DataSourcesService) WriteUpdate(ctx context.Context, req *DataSourceUpsertRequest) (*DataSourceItem, *Response, error)
- type DatasourceQueryExecution
- type DatasourceToolInvokeRequest
- type DatasourceToolResult
- type DatasourceToolTruncation
- type DedicatedIntegrationsService
- func (s *DedicatedIntegrationsService) ReadInfo(ctx context.Context, req *ChannelIntegrationIDRequest) (*ChannelIntegrationItem, *Response, error)
- func (s *DedicatedIntegrationsService) ReadList(ctx context.Context, req *ChannelIntegrationListRequest) (*ChannelIntegrationListResponse, *Response, error)
- func (s *DedicatedIntegrationsService) WriteCreate(ctx context.Context, req *ChannelIntegrationCreateRequest) (*ChannelIntegrationCreateResponse, *Response, error)
- func (s *DedicatedIntegrationsService) WriteDelete(ctx context.Context, req *ChannelIntegrationIDRequest) (*Response, error)
- func (s *DedicatedIntegrationsService) WriteDisable(ctx context.Context, req *ChannelIntegrationIDRequest) (*Response, error)
- func (s *DedicatedIntegrationsService) WriteEnable(ctx context.Context, req *ChannelIntegrationIDRequest) (*Response, error)
- func (s *DedicatedIntegrationsService) WriteRotateKey(ctx context.Context, req *ChannelIntegrationIDRequest) (*RotateIntegrationKeyResponse, *Response, error)
- func (s *DedicatedIntegrationsService) WriteUpdate(ctx context.Context, req *ChannelIntegrationUpdateRequest) (*ChannelIntegrationItem, *Response, error)
- type DeleteFieldRequest
- type DeleteIncidentCommentTypeRequest
- type DeletePostMortemRequest
- type DeletePostMortemTemplateRequest
- type DeleteStatusPageChangeRequest
- type DeleteStatusPageChangeTimelineRequest
- type DeleteStatusPageComponentRequest
- type DeleteStatusPageRequest
- type DeleteStatusPageSectionRequest
- type DeleteStatusPageTemplateRequest
- type DeleteWarRoomRequest
- type DeleteWorkItemRequest
- type DiagnosticsService
- type DimensionInsightItem
- type DimensionInsightResponse
- type DisableIncidentMergeRequest
- type DoIncidentCustomActionRequest
- type DoIncidentCustomActionResponse
- type DsClickHouseConfig
- type DsElasticSearchConfig
- type DsKafkaConfig
- type DsLokiConfig
- type DsMongoDBConfig
- type DsMySqlConfig
- type DsOracleConfig
- type DsPayload
- type DsPostgresConfig
- type DsPrometheusConfig
- type DsRedisNodeConfig
- type DsRedisSentinelConfig
- type DsTencentClsConfig
- type DsVictoriaLogsConfig
- type DsslsConfig
- type DutyError
- type ElasticsearchQueryParams
- type EmptyObject
- type EmptyRequest
- type EmptyResponse
- type EnabledTime
- type EnrichFilter
- type EnrichRule
- type EnrichStep
- type EnrichmentInfoRequest
- type EnrichmentItem
- type EnrichmentListRequest
- type EnrichmentListResponse
- type EnrichmentPreviewEvent
- type EnrichmentPreviewRequest
- type EnrichmentPreviewResponse
- type EnrichmentSample
- type EnrichmentSampleListRequest
- type EnrichmentSampleListResponse
- type EnrichmentUpsertRequest
- type EnvironmentBinding
- type ErrorCode
- type ErrorIngestionRulesService
- func (s *ErrorIngestionRulesService) Create(ctx context.Context, req *RUMErrorIngestionCreateRequest) (*RUMErrorIngestionCreateResponse, *Response, error)
- func (s *ErrorIngestionRulesService) Delete(ctx context.Context, req *RUMErrorIngestionRuleIDRequest) (*Response, error)
- func (s *ErrorIngestionRulesService) Disable(ctx context.Context, req *RUMErrorIngestionRuleIDRequest) (*Response, error)
- func (s *ErrorIngestionRulesService) Enable(ctx context.Context, req *RUMErrorIngestionRuleIDRequest) (*Response, error)
- func (s *ErrorIngestionRulesService) HistoryList(ctx context.Context, req *RUMErrorIngestionHistoryListRequest) (*RUMErrorIngestionHistoryListResponse, *Response, error)
- func (s *ErrorIngestionRulesService) HistoryRevert(ctx context.Context, req *RUMErrorIngestionRevertRequest) (*Response, error)
- func (s *ErrorIngestionRulesService) List(ctx context.Context, req *RUMErrorIngestionListRequest) (*RUMErrorIngestionListResponse, *Response, error)
- func (s *ErrorIngestionRulesService) Update(ctx context.Context, req *RUMErrorIngestionUpdateRequest) (*Response, error)
- type ErrorResponse
- type ErsComposition
- type ErsDrop
- type ErsExtraction
- type ErsMapping
- type EscalateLayer
- type EscalateRuleItem
- type EscalateTarget
- type EscalateTargetBy
- type EscalateTargetWebhooksItem
- type EventGroup
- type EventItem
- type ExploreData
- type ExploreField
- type ExploreFrame
- type ExploreLogEntry
- type ExploreResponseExecution
- type ExploreResult
- type ExploreSample
- type ExportLine
- type ExportStatusPageSubscribersRequest
- type ExportUsage
- type ExportedStatusPageSubscriberItem
- type FacetCountItem
- type FacetsService
- type FeedDetailAlertAck
- type FeedDetailAlertClose
- type FeedDetailAlertComment
- type FeedDetailAlertMerge
- type FeedDetailAlertMuteByFlapping
- type FeedDetailAlertMuteByInhibit
- type FeedDetailAlertMuteBySilence
- type FeedDetailAlertTrigger
- type FeedDetailAlertUnack
- type FeedDetailAlertUpdate
- type FeedDetailIncidentAck
- type FeedDetailIncidentAddRspd
- type FeedDetailIncidentAssign
- type FeedDetailIncidentAssignNotify
- type FeedDetailIncidentAutoRefreshCard
- type FeedDetailIncidentComment
- type FeedDetailIncidentCustomAction
- type FeedDetailIncidentMerge
- type FeedDetailIncidentMuteByFlapping
- type FeedDetailIncidentMuteReply
- type FeedDetailIncidentNew
- type FeedDetailIncidentNotify
- type FeedDetailIncidentReopen
- type FeedDetailIncidentResetDescription
- type FeedDetailIncidentResetField
- type FeedDetailIncidentResetImpact
- type FeedDetailIncidentResetResolution
- type FeedDetailIncidentResetRootCause
- type FeedDetailIncidentResetSeverity
- type FeedDetailIncidentResetTitle
- type FeedDetailIncidentResolve
- type FeedDetailIncidentSnooze
- type FeedDetailIncidentStorm
- type FeedDetailIncidentUnack
- type FeedDetailIncidentWake
- type FeedDetailIncidentWarRoomCreate
- type FeedDetailIncidentWarRoomDelete
- type FeedDetailWorkItemAssigneesChanged
- type FeedDetailWorkItemAutoConverted
- type FeedDetailWorkItemBound
- type FeedDetailWorkItemCompleted
- type FeedDetailWorkItemConverted
- type FeedDetailWorkItemCreated
- type FeedDetailWorkItemDeleted
- type FeedDetailWorkItemUpdated
- type FeedItem
- type FeedSeverity
- type FieldDeleteReference
- type FieldDeleteReferenceError
- type FieldDeleteReferenceErrorData
- type FieldInfoRequest
- type FieldItem
- type FieldListRequest
- type FieldListResponse
- type FilterCondition
- type FilterGroup
- type Flapping
- type FolderCreateRequest
- type FolderDeleteRequest
- type FolderHealthItem
- type FolderHealthOutput
- type FolderItem
- type FolderMoveRequest
- type FolderUpdateRequest
- type GetIntegrationRequest
- type GetRemoteConfigRequest
- type GetRemoteConfigResponse
- type GetWarRoomDefaultObserversRequest
- type GetWarRoomDefaultObserversResponse
- type GetWarRoomDetailRequest
- type GetWebhookHistoryDetailRequest
- type Group
- type GroupCasesItem
- type IDRequest
- type ImIntegrationsService
- type Image
- type ImportStatusPageSubscriberItem
- type ImportStatusPageSubscribersRequest
- type IncProgressCnts
- type IncidentActionImage
- type IncidentCardHiddenFields
- type IncidentCommentTypeDisplay
- type IncidentCommentTypeItem
- type IncidentFeedItem
- type IncidentFeedType
- type IncidentInfo
- type IncidentInfoRequest
- type IncidentListResponse
- type IncidentRawItem
- type IncidentRawItemAssignedTo
- type IncidentRawItemRespondersItem
- type IncidentShort
- type IncidentsPostMortemInfoRequest
- type IncidentsPostmortemReadTemplateInfoRequest
- type IncidentsService
- func (s *IncidentsService) Ack(ctx context.Context, req *AckIncidentRequest) (*Response, error)
- func (s *IncidentsService) AlertList(ctx context.Context, req *ListIncidentAlertsRequest) (*ListIncidentAlertsResponse, *Response, error)
- func (s *IncidentsService) Assign(ctx context.Context, req *AssignIncidentRequest) (*Response, error)
- func (s *IncidentsService) Comment(ctx context.Context, req *CommentIncidentRequest) (*Response, error)
- func (s *IncidentsService) CommentTypeCreate(ctx context.Context, req *CreateIncidentCommentTypeRequest) (*CreateIncidentCommentTypeResponse, *Response, error)
- func (s *IncidentsService) CommentTypeDelete(ctx context.Context, req *DeleteIncidentCommentTypeRequest) (*Response, error)
- func (s *IncidentsService) CommentTypeList(ctx context.Context) (*ListIncidentCommentTypesResponse, *Response, error)
- func (s *IncidentsService) CommentTypeReorder(ctx context.Context, req *ReorderIncidentCommentTypesRequest) (*Response, error)
- func (s *IncidentsService) CommentTypeUpdate(ctx context.Context, req *UpdateIncidentCommentTypeRequest) (*Response, error)
- func (s *IncidentsService) Create(ctx context.Context, req *CreateIncidentRequest) (*CreateIncidentResponse, *Response, error)
- func (s *IncidentsService) CustomActionDo(ctx context.Context, req *DoIncidentCustomActionRequest) (*DoIncidentCustomActionResponse, *Response, error)
- func (s *IncidentsService) DisableMerge(ctx context.Context, req *DisableIncidentMergeRequest) (*Response, error)
- func (s *IncidentsService) Feed(ctx context.Context, req *ListIncidentFeedRequest) (*ListIncidentFeedResponse, *Response, error)
- func (s *IncidentsService) FieldReset(ctx context.Context, req *ResetIncidentFieldRequest) (*Response, error)
- func (s *IncidentsService) Info(ctx context.Context, req *IncidentInfoRequest) (*IncidentInfo, *Response, error)
- func (s *IncidentsService) List(ctx context.Context, req *ListIncidentsRequest) (*IncidentListResponse, *Response, error)
- func (s *IncidentsService) ListByIDs(ctx context.Context, req *ListIncidentsByIDsRequest) (*IncidentListResponse, *Response, error)
- func (s *IncidentsService) Merge(ctx context.Context, req *MergeIncidentsRequest) (*Response, error)
- func (s *IncidentsService) PastList(ctx context.Context, req *ListPastIncidentsRequest) (*ListPastIncidentsResponse, *Response, error)
- func (s *IncidentsService) PostMortemDelete(ctx context.Context, req *DeletePostMortemRequest) (*Response, error)
- func (s *IncidentsService) PostMortemInfo(ctx context.Context, req *IncidentsPostMortemInfoRequest) (*PostMortemItem, *Response, error)
- func (s *IncidentsService) PostMortemList(ctx context.Context, req *ListPostMortemsRequest) (*ListPostMortemsResponse, *Response, error)
- func (s *IncidentsService) PostMortemWriteResetContent(ctx context.Context, req *ResetPostMortemContentRequest) (*PostMortemContentResetResponse, *Response, error)
- func (s *IncidentsService) PostmortemReadListTemplates(ctx context.Context, req *ListPostMortemTemplatesRequest) (*ListPostMortemTemplatesResponse, *Response, error)
- func (s *IncidentsService) PostmortemReadTemplateInfo(ctx context.Context, req *IncidentsPostmortemReadTemplateInfoRequest) (*PostMortemTemplate, *Response, error)
- func (s *IncidentsService) PostmortemWriteDeleteTemplate(ctx context.Context, req *DeletePostMortemTemplateRequest) (*Response, error)
- func (s *IncidentsService) PostmortemWriteInit(ctx context.Context, req *InitPostMortemRequest) (*PostMortemItem, *Response, error)
- func (s *IncidentsService) PostmortemWriteResetBasics(ctx context.Context, req *ResetPostMortemBasicsRequest) (*Response, error)
- func (s *IncidentsService) PostmortemWriteResetFollowUps(ctx context.Context, req *ResetPostMortemFollowUpsRequest) (*Response, error)
- func (s *IncidentsService) PostmortemWriteResetStatus(ctx context.Context, req *ResetPostMortemStatusRequest) (*Response, error)
- func (s *IncidentsService) PostmortemWriteResetTitle(ctx context.Context, req *ResetPostMortemTitleRequest) (*Response, error)
- func (s *IncidentsService) PostmortemWriteUpsertTemplate(ctx context.Context, req *UpsertPostMortemTemplateRequest) (*PostMortemTemplate, *Response, error)
- func (s *IncidentsService) ReadGetWarRoomDefaultObservers(ctx context.Context, req *GetWarRoomDefaultObserversRequest) (*GetWarRoomDefaultObserversResponse, *Response, error)
- func (s *IncidentsService) Remove(ctx context.Context, req *RemoveIncidentRequest) (*Response, error)
- func (s *IncidentsService) Reopen(ctx context.Context, req *ReopenIncidentRequest) (*Response, error)
- func (s *IncidentsService) Reset(ctx context.Context, req *UpdateIncidentFieldsRequest) (*Response, error)
- func (s *IncidentsService) Resolve(ctx context.Context, req *ResolveIncidentRequest) (*Response, error)
- func (s *IncidentsService) ResponderAdd(ctx context.Context, req *AddIncidentResponderRequest) (*Response, error)
- func (s *IncidentsService) ServiceDeskPlusRequestReadList(ctx context.Context, req *ServiceDeskPlusRequestListRequest) (*ServiceDeskPlusRequestListResponse, *Response, error)
- func (s *IncidentsService) Snooze(ctx context.Context, req *SnoozeIncidentRequest) (*Response, error)
- func (s *IncidentsService) Unack(ctx context.Context, req *UnackIncidentRequest) (*Response, error)
- func (s *IncidentsService) Wake(ctx context.Context, req *WakeIncidentRequest) (*Response, error)
- func (s *IncidentsService) WarRoomCreate(ctx context.Context, req *CreateWarRoomRequest) (*WarRoom, *Response, error)
- func (s *IncidentsService) WarRoomDelete(ctx context.Context, req *DeleteWarRoomRequest) (*Response, error)
- func (s *IncidentsService) WarRoomDetail(ctx context.Context, req *GetWarRoomDetailRequest) (*WarRoom, *Response, error)
- func (s *IncidentsService) WarRoomList(ctx context.Context, req *ListWarRoomsRequest) (*ListWarRoomsResponse, *Response, error)
- func (s *IncidentsService) WorkItemBindPostMortem(ctx context.Context, req *BindWorkItemPostMortemRequest) (*WorkItemListResult, *Response, error)
- func (s *IncidentsService) WorkItemComplete(ctx context.Context, req *CompleteWorkItemRequest) (*WorkItemMutationResult, *Response, error)
- func (s *IncidentsService) WorkItemConvert(ctx context.Context, req *ConvertWorkItemRequest) (*WorkItemMutationResult, *Response, error)
- func (s *IncidentsService) WorkItemCreate(ctx context.Context, req *CreateWorkItemRequest) (*WorkItemCreateResult, *Response, error)
- func (s *IncidentsService) WorkItemDelete(ctx context.Context, req *DeleteWorkItemRequest) (*WorkItemMutationResult, *Response, error)
- func (s *IncidentsService) WorkItemList(ctx context.Context, req *ListWorkItemRequest) (*WorkItemListResult, *Response, error)
- func (s *IncidentsService) WorkItemResetAssignees(ctx context.Context, req *ResetWorkItemAssigneesRequest) (*WorkItemMutationResult, *Response, error)
- func (s *IncidentsService) WorkItemUpdate(ctx context.Context, req *UpdateWorkItemRequest) (*WorkItemMutationResult, *Response, error)
- func (s *IncidentsService) WriteAddWarRoomMember(ctx context.Context, req *AddWarRoomMemberRequest) (*string, *Response, error)
- type InhibitRuleItem
- type InitPostMortemRequest
- type InsightAlertByLabelItem
- type InsightAlertByLabelResponse
- type InsightFilter
- type InsightIncidentExportRequest
- type InsightIncidentListRequest
- type InsightIncidentListResponse
- type InsightQueryRequest
- type InsightTopkAlertByLabelRequest
- type IntegrationDetail
- type IntegrationDetailTest
- type IntegrationItem
- type IntegrationLifecycleRequest
- type IntegrationTypeItem
- type IntegrationTypeListRequest
- type IntegrationsService
- func (s *IntegrationsService) AlertReadEmailPreview(ctx context.Context, req *AlertEmailPreviewRequest) (*AlertEmailPreviewResponse, *Response, error)
- func (s *IntegrationsService) DatasourceImPersonTryLink(ctx context.Context, req *TryLinkPersonRequest) (*TryLinkPersonResponse, *Response, error)
- func (s *IntegrationsService) Detail(ctx context.Context, req *GetWebhookHistoryDetailRequest) (*WebhookHistoryDetail, *Response, error)
- func (s *IntegrationsService) IntegrationAPIReadInfo(ctx context.Context, req *GetIntegrationRequest) (*IntegrationDetail, *Response, error)
- func (s *IntegrationsService) IntegrationAPIReadList(ctx context.Context, req *ListIntegrationsRequest) (*ListIntegrationsResponse, *Response, error)
- func (s *IntegrationsService) IntegrationAPIReadTypeList(ctx context.Context, req *IntegrationTypeListRequest) (*ListIntegrationTypesResponse, *Response, error)
- func (s *IntegrationsService) IntegrationAPIWriteCreate(ctx context.Context, req *CreateIntegrationRequest) (*CreateIntegrationResponse, *Response, error)
- func (s *IntegrationsService) IntegrationAPIWriteDelete(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error)
- func (s *IntegrationsService) IntegrationAPIWriteDisable(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error)
- func (s *IntegrationsService) IntegrationAPIWriteEnable(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error)
- func (s *IntegrationsService) IntegrationAPIWriteRotateKey(ctx context.Context, req *IntegrationLifecycleRequest) (*RotateIntegrationKeyResponse, *Response, error)
- func (s *IntegrationsService) IntegrationAPIWriteUpdate(ctx context.Context, req *UpdateIntegrationRequest) (*IntegrationDetail, *Response, error)
- func (s *IntegrationsService) List(ctx context.Context, req *ListWebhookHistoryRequest) (*ListWebhookHistoryResponse, *Response, error)
- type InvestigationTarget
- type InvestigationTimeRange
- type InviteMemberItem
- type IssuePresetSeverityRulesService
- func (s *IssuePresetSeverityRulesService) Create(ctx context.Context, req *RUMPresetSeverityRuleCreateRequest) (*RUMPresetSeverityRuleCreateResponse, *Response, error)
- func (s *IssuePresetSeverityRulesService) Delete(ctx context.Context, req *RUMPresetSeverityRuleIDRequest) (*Response, error)
- func (s *IssuePresetSeverityRulesService) Disable(ctx context.Context, req *RUMPresetSeverityRuleIDRequest) (*Response, error)
- func (s *IssuePresetSeverityRulesService) Enable(ctx context.Context, req *RUMPresetSeverityRuleIDRequest) (*Response, error)
- func (s *IssuePresetSeverityRulesService) HistoryList(ctx context.Context, req *RUMPresetSeverityRuleHistoryListRequest) (*RUMPresetSeverityRuleHistoryListResponse, *Response, error)
- func (s *IssuePresetSeverityRulesService) HistoryRevert(ctx context.Context, req *RUMPresetSeverityRuleHistoryRevertRequest) (*Response, error)
- func (s *IssuePresetSeverityRulesService) List(ctx context.Context, req *RUMPresetSeverityRuleListRequest) (*RUMPresetSeverityRuleListResponse, *Response, error)
- func (s *IssuePresetSeverityRulesService) Reorder(ctx context.Context, req *RUMPresetSeverityRuleReorderRequest) (*Response, error)
- func (s *IssuePresetSeverityRulesService) Update(ctx context.Context, req *RUMPresetSeverityRuleUpdateRequest) (*Response, error)
- type IssuesService
- func (s *IssuesService) ReadExport(ctx context.Context, req *RUMIssueExportRequest) (*Response, error)
- func (s *IssuesService) ReadInfo(ctx context.Context, req *RUMIssueIDRequest) (*RUMIssueItem, *Response, error)
- func (s *IssuesService) ReadList(ctx context.Context, req *RUMIssueListRequest) (*RUMIssueListResponse, *Response, error)
- func (s *IssuesService) WriteUpdate(ctx context.Context, req *RUMIssueUpdateRequest) (*Response, error)
- type KnowledgeFileDeleteRequest
- type KnowledgeFileDeleteResponse
- type KnowledgeFileGetRequest
- type KnowledgeFileGetResponse
- type KnowledgeFileItem
- type KnowledgeFileListRequest
- type KnowledgeFileListResponse
- type KnowledgeFilePutRequest
- type KnowledgeFilePutResponse
- type KnowledgeGetRequest
- type KnowledgeGetResponse
- type KnowledgePackDeleteRequest
- type KnowledgePackDeleteResponse
- type KnowledgePackEnsureRequest
- type KnowledgePackItem
- type KnowledgePackListRequest
- type KnowledgePackListResponse
- type KnowledgePackUpdateRequest
- type KnowledgeService
- func (s *KnowledgeService) FileReadGet(ctx context.Context, req *KnowledgeFileGetRequest) (*KnowledgeFileGetResponse, *Response, error)
- func (s *KnowledgeService) FileReadList(ctx context.Context, req *KnowledgeFileListRequest) (*KnowledgeFileListResponse, *Response, error)
- func (s *KnowledgeService) FileWriteDelete(ctx context.Context, req *KnowledgeFileDeleteRequest) (*KnowledgeFileDeleteResponse, *Response, error)
- func (s *KnowledgeService) FileWritePut(ctx context.Context, req *KnowledgeFilePutRequest) (*KnowledgeFilePutResponse, *Response, error)
- func (s *KnowledgeService) PackReadGet(ctx context.Context) (*KnowledgeGetResponse, *Response, error)
- func (s *KnowledgeService) PackReadList(ctx context.Context, req *KnowledgePackListRequest) (*KnowledgePackListResponse, *Response, error)
- func (s *KnowledgeService) PackWriteDelete(ctx context.Context, req *KnowledgePackDeleteRequest) (*KnowledgePackDeleteResponse, *Response, error)
- func (s *KnowledgeService) PackWriteEnsure(ctx context.Context, req *KnowledgePackEnsureRequest) (*KnowledgePackItem, *Response, error)
- func (s *KnowledgeService) PackWriteUpdate(ctx context.Context, req *KnowledgePackUpdateRequest) (*KnowledgePackItem, *Response, error)
- type KnowledgeWarning
- type LicenseListResponse
- type LicensePersonItem
- type LicensesService
- type LinkItem
- type ListChangeRequest
- type ListChangeResponse
- type ListChannelsRequest
- type ListChannelsResponse
- type ListDropRulesResponse
- type ListEscalationRulesResponse
- type ListIncidentAlertsRequest
- type ListIncidentAlertsResponse
- type ListIncidentCommentTypesRequest
- type ListIncidentCommentTypesResponse
- type ListIncidentFeedRequest
- type ListIncidentFeedResponse
- type ListIncidentsByIDsRequest
- type ListIncidentsRequest
- type ListInhibitRulesResponse
- type ListIntegrationTypesResponse
- type ListIntegrationsRequest
- type ListIntegrationsResponse
- type ListOptions
- type ListPastIncidentsRequest
- type ListPastIncidentsResponse
- type ListPostMortemTemplatesRequest
- type ListPostMortemTemplatesResponse
- type ListPostMortemsRequest
- type ListPostMortemsResponse
- type ListRemoteConfigHistoryRequest
- type ListRemoteConfigHistoryResponse
- type ListRoutesRequest
- type ListRoutesResponse
- type ListSilenceRulesResponse
- type ListStatusPageResponse
- type ListStatusPageTemplatesResponse
- type ListWarRoomEnabledResponse
- type ListWarRoomsRequest
- type ListWarRoomsResponse
- type ListWebhookHistoryRequest
- type ListWebhookHistoryResponse
- type ListWorkItemRequest
- type Logger
- type LokiQueryParams
- type ManualRunRuleResult
- type MappingAPICreateRequest
- type MappingAPICreateResponse
- type MappingAPIItem
- type MappingAPIListResponse
- type MappingAPIUpdateRequest
- type MappingApiidRequest
- type MappingDataDeleteRequest
- type MappingDataItem
- type MappingDataListRequest
- type MappingDataListResponse
- type MappingDataUploadRequest
- type MappingDataUpsertRequest
- type MappingDataUpsertResponse
- type MappingSchemaCreateRequest
- type MappingSchemaCreateResponse
- type MappingSchemaIDRequest
- type MappingSchemaItem
- type MappingSchemaListResponse
- type MappingSchemaUpdateRequest
- type McpServerCreateRequest
- type McpServerDeleteRequest
- type McpServerGetRequest
- type McpServerItem
- type McpServerListRequest
- type McpServerListResponse
- type McpServerStatusRequest
- type McpServerUpdateRequest
- type McpServersService
- func (s *McpServersService) ReadServerGet(ctx context.Context, req *McpServerGetRequest) (*McpServerItem, *Response, error)
- func (s *McpServersService) ReadServerList(ctx context.Context, req *McpServerListRequest) (*McpServerListResponse, *Response, error)
- func (s *McpServersService) WriteServerCreate(ctx context.Context, req *McpServerCreateRequest) (*McpServerItem, *Response, error)
- func (s *McpServersService) WriteServerDelete(ctx context.Context, req *McpServerDeleteRequest) (*any, *Response, error)
- func (s *McpServersService) WriteServerDisable(ctx context.Context, req *McpServerStatusRequest) (*any, *Response, error)
- func (s *McpServersService) WriteServerEnable(ctx context.Context, req *McpServerStatusRequest) (*any, *Response, error)
- func (s *McpServersService) WriteServerUpdate(ctx context.Context, req *McpServerUpdateRequest) (*McpServerItem, *Response, error)
- type MemberDeleteRequest
- type MemberEmptyObject
- type MemberInfoRequest
- type MemberInfoResponse
- type MemberInviteRequest
- type MemberInviteResponse
- type MemberItem
- type MemberListRequest
- type MemberListResponse
- type MemberNotifyRequest
- type MemberNotifyResponse
- type MemberNotifyResultItem
- type MemberOncallInterval
- type MemberResetInfoRequest
- type MemberResetInfoUpdates
- type MemberRoleGrantRequest
- type MemberRoleRevokeRequest
- type MemberRoleUpdateRequest
- type MemberScheduleItem
- type MembersService
- func (s *MembersService) MemberDelete(ctx context.Context, req *MemberDeleteRequest) (*Response, error)
- func (s *MembersService) MemberGrantRole(ctx context.Context, req *MemberRoleGrantRequest) (*Response, error)
- func (s *MembersService) MemberInfo(ctx context.Context) (*MemberInfoResponse, *Response, error)
- func (s *MembersService) MemberInvite(ctx context.Context, req *MemberInviteRequest) (*MemberInviteResponse, *Response, error)
- func (s *MembersService) MemberList(ctx context.Context, req *MemberListRequest) (*MemberListResponse, *Response, error)
- func (s *MembersService) MemberNotify(ctx context.Context, req *MemberNotifyRequest) (*MemberNotifyResponse, *Response, error)
- func (s *MembersService) MemberResetInfo(ctx context.Context, req *MemberResetInfoRequest) (*Response, error)
- func (s *MembersService) MemberRevokeRole(ctx context.Context, req *MemberRoleRevokeRequest) (*Response, error)
- func (s *MembersService) MemberUpdateRole(ctx context.Context, req *MemberRoleUpdateRequest) (*Response, error)
- func (s *MembersService) PersonInfos(ctx context.Context, req *PersonInfosRequest) (*PersonInfosResponse, *Response, error)
- type MergeIncidentsRequest
- type MetricsBase
- type MigrateStatusPageEmailSubscribersRequest
- type MigrateStatusPageStructureRequest
- type MySQLQueryParams
- type NameMessage
- type NewMemberItem
- type NotificationTemplatesService
- func (s *NotificationTemplatesService) ReadInfo(ctx context.Context, req *TemplateIDRequest) (*TemplateItem, *Response, error)
- func (s *NotificationTemplatesService) ReadList(ctx context.Context, req *TemplateListRequest) (*TemplateListResponse, *Response, error)
- func (s *NotificationTemplatesService) ReadPreview(ctx context.Context, req *PreviewTemplateRequest) (*PreviewTemplateResponse, *Response, error)
- func (s *NotificationTemplatesService) WriteCreate(ctx context.Context, req *TemplateCreateRequest) (*TemplateCreateResponse, *Response, error)
- func (s *NotificationTemplatesService) WriteDelete(ctx context.Context, req *TemplateIDRequest) (*Response, error)
- func (s *NotificationTemplatesService) WriteUpdate(ctx context.Context, req *TemplateUpdateRequest) (*Response, error)
- type NotifyChat
- type NotifyPerson
- type NotifyRobot
- type OnceTimeFilter
- type Option
- func WithBaseURL(raw string) Option
- func WithHTTPClient(hc *http.Client) Option
- func WithLogger(l Logger) Option
- func WithRequestHeaders(h http.Header) Option
- func WithRequestHook(hook func(*http.Request)) Option
- func WithTimeout(d time.Duration) Option
- func WithTransport(rt http.RoundTripper) Option
- func WithUserAgent(ua string) Option
- type OrFilterGroup
- type OracleQueryParams
- type PastIncidentItem
- type PendingUserMessage
- type PermissionFactorItem
- type PermissionFactorListRequest
- type PermissionFactorListResponse
- type PermissionItem
- type PersonInfosRequest
- type PersonInfosResponse
- type PersonItem
- type PersonShort
- type PipelineStep
- type PlatformEmptyObject
- type PostMortemContentResetResponse
- type PostMortemItem
- type PostMortemItemBasics
- type PostMortemItemContent
- type PostMortemMeta
- type PostMortemTemplate
- type PostgresQueryParams
- type PreflightResult
- type PreviewRemoteConfigRequest
- type PreviewRemoteConfigResponse
- type PreviewTemplateRequest
- type PreviewTemplateResponse
- type PreviewTemplateResponseBlocksItem
- type PreviewTemplateResponseCard
- type PreviewTemplateResponseCardElementsItem
- type PreviewTemplateResponseCardElementsItemActionsItem
- type PreviewTemplateResponseNoticesItem
- type PrometheusLabelValuesResponse
- type PrometheusQueryParams
- type PublishedArtifactItem
- type QueryDataRequest
- type QueryDataResponse
- type QueryExploreExecution
- type QueryExploreRequest
- type QueryField
- type QueryFrame
- type QueryFramesResult
- type QueryInvestigationTarget
- type QueryRecordsResult
- type QueryResult
- type QueryRowsRequest
- type QuerySample
- type QuerySamplesResult
- type RUMApplicationAlerting
- type RUMApplicationCreateRequest
- type RUMApplicationCreateResponse
- type RUMApplicationIDRequest
- type RUMApplicationInfosRequest
- type RUMApplicationInfosResponse
- type RUMApplicationItem
- type RUMApplicationLink
- type RUMApplicationLinks
- type RUMApplicationListRequest
- type RUMApplicationListResponse
- type RUMApplicationRepository
- type RUMApplicationTracing
- type RUMApplicationUpdateRequest
- type RUMDashboardActor
- type RUMDashboardBarViz
- type RUMDashboardCandidate
- type RUMDashboardColumnOption
- type RUMDashboardCreateRequest
- type RUMDashboardCustomVariable
- type RUMDashboardDataLink
- type RUMDashboardDatasourceRef
- type RUMDashboardDefinition
- type RUMDashboardDeleteResponse
- type RUMDashboardFieldSort
- type RUMDashboardGridPosition
- type RUMDashboardIDRequest
- type RUMDashboardLinkMapping
- type RUMDashboardListItem
- type RUMDashboardListRequest
- type RUMDashboardListResponse
- type RUMDashboardListSort
- type RUMDashboardMutationRequest
- type RUMDashboardPanel
- type RUMDashboardPanelQuery
- type RUMDashboardQuery
- type RUMDashboardQueryArgs
- type RUMDashboardQueryVariable
- type RUMDashboardRelativeTimeRange
- type RUMDashboardResource
- type RUMDashboardRevisionGetRequest
- type RUMDashboardRevisionItem
- type RUMDashboardRevisionListResponse
- type RUMDashboardRevisionResource
- type RUMDashboardSection
- type RUMDashboardSelection
- type RUMDashboardSelectionConfig
- type RUMDashboardStatViz
- type RUMDashboardTab
- type RUMDashboardTableViz
- type RUMDashboardTextViz
- type RUMDashboardThreshold
- type RUMDashboardTimeSeriesViz
- type RUMDashboardTopListViz
- type RUMDashboardTrashItem
- type RUMDashboardTrashListRequest
- type RUMDashboardTrashListResponse
- type RUMDashboardTrashListSort
- type RUMDashboardUnitFields
- type RUMDashboardUpdateRequest
- type RUMDashboardUpdateResponse
- type RUMDashboardVariable
- type RUMDashboardVariableQuery
- type RUMDashboardVizConfig
- type RUMDataFieldMeta
- type RUMDataQueryDefinition
- type RUMDataQueryOutput
- type RUMDataQueryRequest
- type RUMDataQueryResponse
- type RUMDataQueryResult
- type RUMDataSamplingDecision
- type RUMErrorIngestionCreateRequest
- type RUMErrorIngestionCreateResponse
- type RUMErrorIngestionEmptyResponse
- type RUMErrorIngestionFilterCondition
- type RUMErrorIngestionHistoryItem
- type RUMErrorIngestionHistoryListRequest
- type RUMErrorIngestionHistoryListResponse
- type RUMErrorIngestionListRequest
- type RUMErrorIngestionListResponse
- type RUMErrorIngestionOrFilters
- type RUMErrorIngestionRevertRequest
- type RUMErrorIngestionRule
- type RUMErrorIngestionRuleIDRequest
- type RUMErrorIngestionRuleSnapshotItem
- type RUMErrorIngestionUpdateRequest
- type RUMFacetCountRequest
- type RUMFacetCountResponse
- type RUMFieldItem
- type RUMFieldListRequest
- type RUMFieldListResponse
- type RUMIssueExportRequest
- type RUMIssueIDRequest
- type RUMIssueItem
- type RUMIssueItemError
- type RUMIssueItemFirstSeen
- type RUMIssueItemLastSeen
- type RUMIssueItemRegression
- type RUMIssueItemSuspectedCause
- type RUMIssueListRequest
- type RUMIssueListResponse
- type RUMIssueUpdateRequest
- type RUMPresetSeverityRuleCreateRequest
- type RUMPresetSeverityRuleCreateResponse
- type RUMPresetSeverityRuleFilterCondition
- type RUMPresetSeverityRuleHistoryItem
- type RUMPresetSeverityRuleHistoryListRequest
- type RUMPresetSeverityRuleHistoryListResponse
- type RUMPresetSeverityRuleHistoryRevertRequest
- type RUMPresetSeverityRuleHistorySnapshotRule
- type RUMPresetSeverityRuleIDRequest
- type RUMPresetSeverityRuleItem
- type RUMPresetSeverityRuleListRequest
- type RUMPresetSeverityRuleListResponse
- type RUMPresetSeverityRuleReorderRequest
- type RUMPresetSeverityRuleUpdateRequest
- type RUMReplayApplication
- type RUMReplayDevice
- type RUMReplayForegroundPeriod
- type RUMReplaySession
- type RUMReplayView
- type RUMResourceInfoRequest
- type RUMResourceItem
- type RUMSessionReplayMetaItem
- type RUMSessionReplayMetaRequest
- type RUMSessionReplaySegmentsRequest
- type RUMSessionReplaySegmentsResult
- type RUMWebhookTestRequest
- type RUMWebhookTestResponse
- type RateLimit
- type RateLimitError
- type RemoteConfig
- type RemoteConfigHistoryItem
- type RemoteConfigRule
- type RemoteConfigValues
- type RemoveIncidentRequest
- type ReopenIncidentRequest
- type ReorderEscalationRulesRequest
- type ReorderIncidentCommentTypesRequest
- type ResetIncidentFieldRequest
- type ResetPostMortemBasicsRequest
- type ResetPostMortemContentRequest
- type ResetPostMortemFollowUpsRequest
- type ResetPostMortemStatusRequest
- type ResetPostMortemTitleRequest
- type ResetWorkItemAssigneesRequest
- type ResolveIncidentRequest
- type ResourcesService
- type Responder
- type ResponderInsightItem
- type ResponderInsightResponse
- type Response
- type ResponseEnvelope
- type RevertRemoteConfigRequest
- type RevertRemoteConfigResponse
- type RoleDeleteRequest
- type RoleGrantRequest
- type RoleIDRequest
- type RoleInfoRequest
- type RoleItem
- type RoleListRequest
- type RoleListResponse
- type RolePermissionListRequest
- type RolePermissionListResponse
- type RoleUpsertRequest
- type RoleUpsertResponse
- type RolesPermissionsService
- func (s *RolesPermissionsService) ReadInfo(ctx context.Context, req *RoleInfoRequest) (*RoleItem, *Response, error)
- func (s *RolesPermissionsService) ReadList(ctx context.Context, req *RoleListRequest) (*RoleListResponse, *Response, error)
- func (s *RolesPermissionsService) ReadListPermission(ctx context.Context, req *RolePermissionListRequest) (*RolePermissionListResponse, *Response, error)
- func (s *RolesPermissionsService) ReadListPermissionFactor(ctx context.Context, req *PermissionFactorListRequest) (*PermissionFactorListResponse, *Response, error)
- func (s *RolesPermissionsService) WriteDelete(ctx context.Context, req *RoleDeleteRequest) (*Response, error)
- func (s *RolesPermissionsService) WriteDisable(ctx context.Context, req *RoleIDRequest) (*Response, error)
- func (s *RolesPermissionsService) WriteEnable(ctx context.Context, req *RoleIDRequest) (*Response, error)
- func (s *RolesPermissionsService) WriteGrantRole(ctx context.Context, req *RoleGrantRequest) (*Response, error)
- func (s *RolesPermissionsService) WriteRevokeRole(ctx context.Context, req *RoleGrantRequest) (*Response, error)
- func (s *RolesPermissionsService) WriteUpsert(ctx context.Context, req *RoleUpsertRequest) (*RoleUpsertResponse, *Response, error)
- type RotateIntegrationKeyResponse
- type RouteCase
- type RouteDefault
- type RouteInfoRequest
- type RouteItem
- type RouteMatchCondition
- type RouteSection
- type RuleAuditListResponse
- type RuleBasicListResponse
- type RuleConfigs
- type RuleConfigsCheckAnydata
- type RuleConfigsCheckAnydataRecovery
- type RuleConfigsCheckNodata
- type RuleConfigsCheckThreshold
- type RuleConfigsCheckThresholdRecovery
- type RuleConfigsQueriesItem
- type RuleConfigsRelateQueriesItem
- type RuleCounterChannelResponse
- type RuleCounterTotalResponse
- type RuleCreateResponse
- type RuleEmptyRequest
- type RuleEmptyResponse
- type RuleFieldsUpdateRequest
- type RuleFoldersService
- func (s *RuleFoldersService) List(ctx context.Context) (*[]FolderItem, *Response, error)
- func (s *RuleFoldersService) ReadHealth(ctx context.Context) (*FolderHealthOutput, *Response, error)
- func (s *RuleFoldersService) ReadList(ctx context.Context) (*[]FolderItem, *Response, error)
- func (s *RuleFoldersService) WriteCreate(ctx context.Context, req *FolderCreateRequest) (*FolderItem, *Response, error)
- func (s *RuleFoldersService) WriteDelete(ctx context.Context, req *FolderDeleteRequest) (*Response, error)
- func (s *RuleFoldersService) WriteMove(ctx context.Context, req *FolderMoveRequest) (*Response, error)
- func (s *RuleFoldersService) WriteUpdate(ctx context.Context, req *FolderUpdateRequest) (*FolderItem, *Response, error)
- type RuleIDRequest
- type RuleIDsRequest
- type RuleImportRequest
- type RuleImportResponse
- type RuleListRequest
- type RuleMoveRequest
- type RuleNameMessageListResponse
- type RumDashboardsService
- func (s *RumDashboardsService) ReadGet(ctx context.Context, req *RUMDashboardIDRequest) (*RUMDashboardResource, *Response, error)
- func (s *RumDashboardsService) ReadList(ctx context.Context, req *RUMDashboardListRequest) (*RUMDashboardListResponse, *Response, error)
- func (s *RumDashboardsService) ReadRevisionGet(ctx context.Context, req *RUMDashboardRevisionGetRequest) (*RUMDashboardRevisionResource, *Response, error)
- func (s *RumDashboardsService) ReadRevisionList(ctx context.Context, req *RUMDashboardIDRequest) (*RUMDashboardRevisionListResponse, *Response, error)
- func (s *RumDashboardsService) ReadTrashList(ctx context.Context, req *RUMDashboardTrashListRequest) (*RUMDashboardTrashListResponse, *Response, error)
- func (s *RumDashboardsService) WriteCreate(ctx context.Context, req *RUMDashboardCreateRequest) (*RUMDashboardResource, *Response, error)
- func (s *RumDashboardsService) WriteDelete(ctx context.Context, req *RUMDashboardMutationRequest) (*RUMDashboardDeleteResponse, *Response, error)
- func (s *RumDashboardsService) WriteRestore(ctx context.Context, req *RUMDashboardMutationRequest) (*RUMDashboardResource, *Response, error)
- func (s *RumDashboardsService) WriteUpdate(ctx context.Context, req *RUMDashboardUpdateRequest) (*RUMDashboardUpdateResponse, *Response, error)
- type SLSLogstoresRequest
- type SLSLogstoresResponse
- type SLSProject
- type SLSProjectsRequest
- type SLSProjectsResponse
- type SLSQueryParams
- type ScheduleByPersonRequest
- type ScheduleByPersonResponse
- type ScheduleCalculatedLayer
- type ScheduleCalculatedSchedule
- type ScheduleDayMask
- type ScheduleEmptyObject
- type ScheduleFixedTimeNotifyInfo
- type ScheduleGroup
- type ScheduleIDResponse
- type ScheduleIDsBodyRequest
- type ScheduleIDsRequest
- type ScheduleImNotify
- type ScheduleImNotifySettings
- type ScheduleInfoRequest
- type ScheduleItem
- type ScheduleLayer
- type ScheduleLayerEndsAt
- type ScheduleLayerHandoff
- type ScheduleLayerRestrictsWallItem
- type ScheduleLayerStartsAt
- type ScheduleListRequest
- type ScheduleListResponse
- type ScheduleMember
- type ScheduleNotify
- type ScheduleNotifyBy
- type ScheduleOncallGroup
- type ScheduleRestrictPeriod
- type ScheduleSelfRequest
- type ScheduleSelfResponse
- type ScheduleUpsertRequest
- type SchedulesService
- func (s *SchedulesService) ByPerson(ctx context.Context, req *ScheduleByPersonRequest) (*ScheduleByPersonResponse, *Response, error)
- func (s *SchedulesService) Create(ctx context.Context, req *ScheduleUpsertRequest) (*ScheduleIDResponse, *Response, error)
- func (s *SchedulesService) Delete(ctx context.Context, req *ScheduleIDsBodyRequest) (*Response, error)
- func (s *SchedulesService) Info(ctx context.Context, req *ScheduleInfoRequest) (*ScheduleItem, *Response, error)
- func (s *SchedulesService) Infos(ctx context.Context, req *ScheduleIDsRequest) (*ScheduleSelfResponse, *Response, error)
- func (s *SchedulesService) List(ctx context.Context, req *ScheduleListRequest) (*ScheduleListResponse, *Response, error)
- func (s *SchedulesService) Preview(ctx context.Context, req *ScheduleUpsertRequest) (*ScheduleItem, *Response, error)
- func (s *SchedulesService) Self(ctx context.Context, req *ScheduleSelfRequest) (*ScheduleSelfResponse, *Response, error)
- func (s *SchedulesService) Update(ctx context.Context, req *ScheduleUpsertRequest) (*Response, error)
- type ServiceDeskPlusRequestListRequest
- type ServiceDeskPlusRequestListResponse
- type ServiceDeskPlusRequestMappingItem
- type SessionAttachment
- type SessionAttachmentUploadRequest
- type SessionCreateRequest
- type SessionCreateResponse
- type SessionDeleteRequest
- type SessionEventFrame
- type SessionExportRequest
- type SessionFilePart
- type SessionFrameReader
- type SessionGetRequest
- type SessionGetResponse
- type SessionItem
- type SessionItemAutomation
- type SessionListRequest
- type SessionListResponse
- type SessionMessageAck
- type SessionMessagePart
- type SessionMessageRequest
- type SessionReplayService
- type SessionStreamError
- type SessionSubscribeRequest
- type SessionTokenUsage
- type SessionsService
- func (s *SessionsService) Export(ctx context.Context, req *SessionExportRequest) (io.ReadCloser, *Response, error)
- func (s *SessionsService) ReadInfo(ctx context.Context, req *SessionGetRequest) (*SessionGetResponse, *Response, error)
- func (s *SessionsService) ReadList(ctx context.Context, req *SessionListRequest) (*SessionListResponse, *Response, error)
- func (s *SessionsService) Subscribe(ctx context.Context, req *SessionSubscribeRequest) (io.ReadCloser, *Response, error)
- func (s *SessionsService) UploadAttachment(ctx context.Context, req *SessionAttachmentUploadRequest) (*SessionAttachment, *Response, error)
- func (s *SessionsService) WriteCreate(ctx context.Context, req *SessionCreateRequest) (*SessionCreateResponse, *Response, error)
- func (s *SessionsService) WriteDelete(ctx context.Context, req *SessionDeleteRequest) (*any, *Response, error)
- func (s *SessionsService) WriteMessage(ctx context.Context, req *SessionMessageRequest) (*SessionMessageAck, *Response, error)
- type SignedUrLs
- type SilenceRuleItem
- type SkillDeleteRequest
- type SkillGetRequest
- type SkillItem
- type SkillItemExamplesItem
- type SkillListRequest
- type SkillListResponse
- type SkillStatusRequest
- type SkillUpdateRequest
- type SkillUploadRequest
- type SkillsService
- func (s *SkillsService) ReadEnable(ctx context.Context, req *SkillStatusRequest) (*any, *Response, error)
- func (s *SkillsService) ReadGet(ctx context.Context, req *SkillGetRequest) (*SkillItem, *Response, error)
- func (s *SkillsService) ReadList(ctx context.Context, req *SkillListRequest) (*SkillListResponse, *Response, error)
- func (s *SkillsService) WriteDelete(ctx context.Context, req *SkillDeleteRequest) (*any, *Response, error)
- func (s *SkillsService) WriteDisable(ctx context.Context, req *SkillStatusRequest) (*any, *Response, error)
- func (s *SkillsService) WriteUpdate(ctx context.Context, req *SkillUpdateRequest) (*SkillItem, *Response, error)
- func (s *SkillsService) WriteUpload(ctx context.Context, req *SkillUploadRequest) (*SkillItem, *Response, error)
- type SnoozeIncidentRequest
- type SourcemapBinaryImage
- type SourcemapCodeSnippet
- type SourcemapEnrichedFrame
- type SourcemapItem
- type SourcemapListRequest
- type SourcemapListResponse
- type SourcemapStackEnrichRequest
- type SourcemapStackEnrichResponse
- type SourcemapStackFrame
- type SourcemapsService
- type StatusPageChangeCreateResponse
- type StatusPageChangeItem
- type StatusPageChangeListResponse
- type StatusPageChangeTimelineCreateResponse
- type StatusPageChangeUpdateItem
- type StatusPageComponentChangeItem
- type StatusPageComponentItem
- type StatusPageDraftCreateResponse
- type StatusPageInfoResponse
- type StatusPageItem
- type StatusPageMessageTemplate
- type StatusPageMigrationJob
- type StatusPageMigrationProgress
- type StatusPageMigrationStartResponse
- type StatusPagePreDefinedTemplate
- type StatusPageSectionItem
- type StatusPageSubscriberExportResponse
- type StatusPageSubscriberListResponse
- type StatusPageSubscriptionItem
- type StatusPagesChangeActiveListRequest
- type StatusPagesChangeInfoRequest
- type StatusPagesChangeListRequest
- type StatusPagesInfoRequest
- type StatusPagesMigrationStatusRequest
- type StatusPagesService
- func (s *StatusPagesService) ChangeActiveList(ctx context.Context, req *StatusPagesChangeActiveListRequest) (*StatusPageChangeListResponse, *Response, error)
- func (s *StatusPagesService) ChangeCreate(ctx context.Context, req *CreateStatusPageChangeRequest) (*StatusPageChangeCreateResponse, *Response, error)
- func (s *StatusPagesService) ChangeDelete(ctx context.Context, req *DeleteStatusPageChangeRequest) (*Response, error)
- func (s *StatusPagesService) ChangeInfo(ctx context.Context, req *StatusPagesChangeInfoRequest) (*StatusPageChangeItem, *Response, error)
- func (s *StatusPagesService) ChangeList(ctx context.Context, req *StatusPagesChangeListRequest) (*StatusPageChangeListResponse, *Response, error)
- func (s *StatusPagesService) ChangeTimelineCreate(ctx context.Context, req *CreateStatusPageChangeTimelineRequest) (*StatusPageChangeTimelineCreateResponse, *Response, error)
- func (s *StatusPagesService) ChangeTimelineDelete(ctx context.Context, req *DeleteStatusPageChangeTimelineRequest) (*Response, error)
- func (s *StatusPagesService) ChangeTimelineUpdate(ctx context.Context, req *UpdateStatusPageChangeTimelineRequest) (*Response, error)
- func (s *StatusPagesService) ChangeUpdate(ctx context.Context, req *UpdateStatusPageChangeRequest) (*Response, error)
- func (s *StatusPagesService) ComponentDelete(ctx context.Context, req *DeleteStatusPageComponentRequest) (*Response, error)
- func (s *StatusPagesService) ComponentUpsert(ctx context.Context, req *UpsertStatusPageComponentRequest) (*UpsertStatusPageComponentResponse, *Response, error)
- func (s *StatusPagesService) Create(ctx context.Context, req *CreateStatusPageRequest) (*CreateStatusPageResponse, *Response, error)
- func (s *StatusPagesService) Delete(ctx context.Context, req *DeleteStatusPageRequest) (*Response, error)
- func (s *StatusPagesService) DraftCreate(ctx context.Context, req *CreateStatusPageDraftRequest) (*StatusPageDraftCreateResponse, *Response, error)
- func (s *StatusPagesService) Info(ctx context.Context, req *StatusPagesInfoRequest) (*StatusPageInfoResponse, *Response, error)
- func (s *StatusPagesService) MigrateEmailSubscribers(ctx context.Context, req *MigrateStatusPageEmailSubscribersRequest) (*StatusPageMigrationStartResponse, *Response, error)
- func (s *StatusPagesService) MigrateStructure(ctx context.Context, req *MigrateStatusPageStructureRequest) (*StatusPageMigrationStartResponse, *Response, error)
- func (s *StatusPagesService) MigrationCancel(ctx context.Context, req *CancelStatusPageMigrationRequest) (*Response, error)
- func (s *StatusPagesService) MigrationStatus(ctx context.Context, req *StatusPagesMigrationStatusRequest) (*StatusPageMigrationJob, *Response, error)
- func (s *StatusPagesService) ReadPageList(ctx context.Context) (*ListStatusPageResponse, *Response, error)
- func (s *StatusPagesService) SectionDelete(ctx context.Context, req *DeleteStatusPageSectionRequest) (*Response, error)
- func (s *StatusPagesService) SectionUpsert(ctx context.Context, req *UpsertStatusPageSectionRequest) (*UpsertStatusPageSectionResponse, *Response, error)
- func (s *StatusPagesService) SubscriberExport(ctx context.Context, req *ExportStatusPageSubscribersRequest) (*Response, error)
- func (s *StatusPagesService) SubscriberImport(ctx context.Context, req *ImportStatusPageSubscribersRequest) (*Response, error)
- func (s *StatusPagesService) SubscriberList(ctx context.Context, req *StatusPagesSubscriberListRequest) (*StatusPageSubscriberListResponse, *Response, error)
- func (s *StatusPagesService) TemplateDelete(ctx context.Context, req *DeleteStatusPageTemplateRequest) (*Response, error)
- func (s *StatusPagesService) TemplateList(ctx context.Context, req *StatusPagesTemplateListRequest) (*ListStatusPageTemplatesResponse, *Response, error)
- func (s *StatusPagesService) TemplateUpsert(ctx context.Context, req *UpsertStatusPageTemplateRequest) (*UpsertStatusPageTemplateResponse, *Response, error)
- func (s *StatusPagesService) Update(ctx context.Context, req *UpdateStatusPageRequest) (*Response, error)
- type StatusPagesSubscriberListRequest
- type StatusPagesTemplateListRequest
- type StringMapPatch
- type TeamBriefItem
- type TeamDeleteRequest
- type TeamInfoRequest
- type TeamInfosRequest
- type TeamInfosResponse
- type TeamItem
- type TeamListRequest
- type TeamListResponse
- type TeamUpsertRequest
- type TeamUpsertResponse
- type TeamsService
- func (s *TeamsService) ReadInfo(ctx context.Context, req *TeamInfoRequest) (*TeamItem, *Response, error)
- func (s *TeamsService) ReadInfos(ctx context.Context, req *TeamInfosRequest) (*TeamInfosResponse, *Response, error)
- func (s *TeamsService) ReadList(ctx context.Context, req *TeamListRequest) (*TeamListResponse, *Response, error)
- func (s *TeamsService) WriteDelete(ctx context.Context, req *TeamDeleteRequest) (*Response, error)
- func (s *TeamsService) WriteUpsert(ctx context.Context, req *TeamUpsertRequest) (*TeamUpsertResponse, *Response, error)
- type TemplateCreateRequest
- type TemplateCreateResponse
- type TemplateIDRequest
- type TemplateItem
- type TemplateListRequest
- type TemplateListResponse
- type TemplateUpdateRequest
- type TencentCLSQueryParams
- type TimeFilter
- type Timestamp
- type TimestampMilli
- type TryLinkPersonRequest
- type TryLinkPersonResponse
- type UnackIncidentRequest
- type UnsubscribeRuleItem
- type UpdateChannelRequest
- type UpdateChannelResponse
- type UpdateDropRuleRequest
- type UpdateEscalationRuleRequest
- type UpdateFieldRequest
- type UpdateIncidentCommentTypeRequest
- type UpdateIncidentFieldsRequest
- type UpdateInhibitRuleRequest
- type UpdateIntegrationRequest
- type UpdateRemoteConfigRequest
- type UpdateRemoteConfigResponse
- type UpdateSilenceRuleRequest
- type UpdateStatusPageChangeRequest
- type UpdateStatusPageChangeTimelineRequest
- type UpdateStatusPageRequest
- type UpdateWorkItemRequest
- type UpsertPostMortemTemplateRequest
- type UpsertRouteRequest
- type UpsertStatusPageComponentRequest
- type UpsertStatusPageComponentRequestComponentsItem
- type UpsertStatusPageComponentResponse
- type UpsertStatusPageSectionRequest
- type UpsertStatusPageSectionRequestSectionsItem
- type UpsertStatusPageSectionResponse
- type UpsertStatusPageTemplateRequest
- type UpsertStatusPageTemplateResponse
- type VictoriaLogsQueryParams
- type WakeIncidentRequest
- type WarRoom
- type WarRoomDataSourceItem
- type WarRoomItem
- type WarRoomPersonItem
- type WebhookHistoryDetail
- type WebhookHistoryItem
- type WorkItemAssignee
- type WorkItemCreateResult
- type WorkItemItem
- type WorkItemListResult
- type WorkItemMutationResult
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAccessDenied ¶
IsAccessDenied reports whether err carries the AccessDenied API error code.
func IsInvalidParameter ¶
IsInvalidParameter reports whether err carries the InvalidParameter API error code.
func IsNotFound ¶
IsNotFound reports whether err carries the ResourceNotFound API error code.
func IsRateLimited ¶
IsRateLimited reports whether err represents a rate-limit condition.
It returns true when the error chain contains a *RateLimitError (regardless of the code it carries) or when the resolved code is RequestTooFrequently.
func IsUnauthorized ¶
IsUnauthorized reports whether err carries the Unauthorized API error code.
func NewExportScanner ¶ added in v0.5.4
NewExportScanner wraps an export stream in a bufio.Scanner configured to read one NDJSON line per Scan, with a buffer large enough for the wide event lines (tool output, llm calls) that the transcript can contain. Each token is one raw JSON line; decode it with DecodeExportLine or json.Unmarshal into ExportLine.
rc, _, err := client.Sessions.Export(ctx, req)
if err != nil { return err }
defer rc.Close()
sc := flashduty.NewExportScanner(rc)
for sc.Scan() {
line, err := flashduty.DecodeExportLine(sc.Bytes())
// ... handle line, or write sc.Bytes() straight to a file ...
}
return sc.Err()
Types ¶
type A2aAgentCreateRequest ¶ added in v0.4.0
type A2aAgentCreateRequest struct {
// Agent display name, used to address the agent in sessions. Must not contain `@`, must not be `general` or `explore`, and must be unique within its scope (account-wide or one team).
AgentName string `json:"agent_name" toon:"agent_name"`
// Allow non-loopback HTTP OAuth discovery/metadata endpoints for this agent instead of requiring HTTPS. Defaults to false.
AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
// Skip TLS certificate verification when connecting to this agent's endpoint (self-signed/private certs). Defaults to false.
AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
// Shared credential key-values: `header` and `api_key` for `auth_type=api_key`, `token` for `auth_type=bearer`. Values of `api_key`, `token`, and `client_secret` are encrypted at rest and masked in responses.
AuthConfig map[string]string `json:"auth_config,omitempty" toon:"auth_config,omitempty"`
// Who supplies the credential:
// - `shared` (default; an empty value behaves the same): one credential stored on the agent (`auth_type` + `auth_config`) is used for every caller.
// - `per_user_secret`: each user stores their own secret, sent in the header named by `secret_schema.header_name`.
// - `per_user_oauth`: each user completes their own OAuth authorization; discovery and client registration run on first use.
//
// `per_user_secret` requires `secret_schema` with a non-empty `header_name`; any other value returns `InvalidParameter`.
AuthMode string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
// Authentication used to reach the remote agent with a shared credential:
// - `none`: no credential header.
// - `api_key`: sends `auth_config.api_key` in the header named by `auth_config.header`.
// - `bearer`: sends `Authorization: Bearer <auth_config.token>`.
//
// When omitted the value is stored as an empty string, which behaves like `none`.
AuthType string `json:"auth_type,omitempty" toon:"auth_type,omitempty"`
// URL of the remote agent card. Must be an absolute `http` or `https` URL with a non-empty host; a URL with no path is resolved to `/.well-known/agent-card.json`. If an execution environment is online, the card is fetched and must declare an A2A 1.x `JSONRPC` or `HTTP+JSON` interface.
CardURL string `json:"card_url" toon:"card_url"`
// Execution environments this agent is callable from: `cloud` and/or BYOC runner environment IDs. Omitted or empty means all environments.
Environments []string `json:"environments,omitempty" toon:"environments,omitempty"`
// Natural-language instructions for the remote agent: a Markdown document with optional `summary` frontmatter and a non-empty body, at most 50 KiB (51200 bytes). Required — a deprecated `description` field is still accepted for legacy clients and, if both are sent, must exactly match `instructions`.
Instructions string `json:"instructions" toon:"instructions"`
// JSON-encoded OAuth metadata; populated by the OAuth discovery flow for `per_user_oauth` mode.
OauthMetadata string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
// JSON-encoded secret schema, e.g. `{"header_name":"X-Api-Key"}`; required when `auth_mode=per_user_secret`.
SecretSchema string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
// Whether the remote agent supports streaming.
Streaming bool `json:"streaming,omitempty" toon:"streaming,omitempty"`
// Team scope: 0 = account-wide; >0 = team. Creating at account scope requires the owner/admin role; creating into a team requires actual membership in that team.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
A2aAgentCreateRequest is generated from the Flashduty OpenAPI schema.
type A2aAgentCreateResponse ¶ added in v0.4.0
type A2aAgentCreateResponse struct {
// ID of the newly created agent.
AgentID string `json:"agent_id" toon:"agent_id"`
}
A2aAgentCreateResponse is generated from the Flashduty OpenAPI schema.
type A2aAgentIDRequest ¶ added in v0.4.0
type A2aAgentIDRequest struct {
// Target agent ID, from the list returned by `POST /safari/a2a-agent/list`.
AgentID string `json:"agent_id" toon:"agent_id"`
}
A2aAgentIDRequest is generated from the Flashduty OpenAPI schema.
type A2aAgentItem ¶ added in v0.4.0
type A2aAgentItem struct {
// Owning account ID.
AccountID int64 `json:"account_id" toon:"account_id"`
// Agent name read from the remote card on older records. The server no longer fills this in, so it is omitted for new agents.
AgentCardName string `json:"agent_card_name" toon:"agent_card_name"`
// Skill names read from the remote card on older records. The server no longer fills this in, so it is omitted for new agents.
AgentCardSkills []string `json:"agent_card_skills" toon:"agent_card_skills"`
// Unique A2A agent ID (prefix `a2a_`).
AgentID string `json:"agent_id" toon:"agent_id"`
// Agent display name.
AgentName string `json:"agent_name" toon:"agent_name"`
// Allow non-loopback HTTP OAuth discovery/metadata endpoints for this agent instead of requiring HTTPS.
AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http" toon:"allow_insecure_oauth_http"`
// Skip TLS certificate verification when connecting to this agent's endpoint.
AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify" toon:"allow_insecure_tls_skip_verify"`
// Shared credential key-values (`header`, `api_key`, `token`, …). Values of `api_key`, `token`, `client_secret`, and any other value stored encrypted are masked as `****`. Omitted when empty.
AuthConfig map[string]string `json:"auth_config" toon:"auth_config"`
// Who supplies the credential; omitted when empty, which behaves like `shared`:
// - `shared`: one credential stored on the agent (`auth_type` + `auth_config`) is used for every caller.
// - `per_user_secret`: each user stores their own secret, sent in the header named by `secret_schema.header_name`.
// - `per_user_oauth`: each user completes their own OAuth authorization; discovery and client registration run on first use.
AuthMode string `json:"auth_mode" toon:"auth_mode"`
// Authentication used to reach the remote agent with a shared credential:
// - `none`: no credential header.
// - `api_key`: sends `auth_config.api_key` in the header named by `auth_config.header`.
// - `bearer`: sends `Authorization: Bearer <auth_config.token>`.
//
// An empty string means `auth_type` was omitted at creation and behaves like `none`.
AuthType string `json:"auth_type" toon:"auth_type"`
// Whether the caller may update, enable, disable, or delete this agent: `true` for an account-scoped agent only for the account owner or an admin, for a team agent only for members of that team.
CanEdit bool `json:"can_edit" toon:"can_edit"`
// Card-resolution timeout in seconds. Always 0 today — the API does not yet expose a way to set it.
CardResolveTimeout int64 `json:"card_resolve_timeout" toon:"card_resolve_timeout"`
// URL of the remote agent card. When `can_edit` is `false`, credentials in the URL are removed and every query value is replaced with `****`.
CardURL string `json:"card_url" toon:"card_url"`
// Creation time. Unix timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Member ID that created the agent.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// Execution environments this agent is callable from (`cloud` and/or BYOC runner environment IDs). Always present; `[]` means all environments (also the value on legacy rows created before this field).
Environments []string `json:"environments" toon:"environments"`
// Natural-language instructions for the remote agent (formerly named `description`).
Instructions string `json:"instructions" toon:"instructions"`
// JSON-encoded OAuth metadata (per_user_oauth mode).
OauthMetadata string `json:"oauth_metadata" toon:"oauth_metadata"`
// JSON-encoded secret schema (per_user_secret mode).
SecretSchema string `json:"secret_schema" toon:"secret_schema"`
// Whether the agent is offered to AI SRE sessions:
// - `enabled`: available for dispatch (the state after create).
// - `disabled`: kept but not offered; re-enable with `POST /safari/a2a-agent/enable`.
Status string `json:"status" toon:"status"`
// Whether the remote agent supports streaming responses.
Streaming bool `json:"streaming" toon:"streaming"`
// Single-task execution timeout in seconds. Always 0 today — the API does not yet expose a way to set it.
TaskTimeout int64 `json:"task_timeout" toon:"task_timeout"`
// Team scope: 0 = account-wide; >0 = the owning team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Last update time. Unix timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}
A2aAgentItem is generated from the Flashduty OpenAPI schema.
type A2aAgentListRequest ¶ added in v0.4.0
type A2aAgentListRequest struct {
// Include account-scoped (`team_id=0`) rows. Defaults to `true`; ignored when `scope` is `account` (always included) or `team` (never included).
IncludeAccount *bool `json:"include_account,omitempty" toon:"include_account,omitempty"`
// Page size; 0 or less falls back to 20. No upper bound is enforced.
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Pagination offset — number of rows to skip, starting from 0.
Offset int64 `json:"offset,omitempty" toon:"offset,omitempty"`
// Case-insensitive substring search across agent name, instructions, card URL, agent ID, and the resolved card name.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Visibility scope: `all` (account-scope plus the caller's visible teams), `account` (account-scope only), or `team` (team-scoped rows across the caller's visible teams).
Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
// Restrict to these team IDs. IDs of teams the caller does not belong to are ignored; empty means all of the caller's teams.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
A2aAgentListRequest is generated from the Flashduty OpenAPI schema.
type A2aAgentListResponse ¶ added in v0.4.0
type A2aAgentListResponse struct {
// A2A agents on this page.
Items []A2aAgentItem `json:"items" toon:"items"`
// Total number of matching agents.
Total int64 `json:"total" toon:"total"`
}
A2aAgentListResponse is generated from the Flashduty OpenAPI schema.
type A2aAgentUpdateRequest ¶ added in v0.4.0
type A2aAgentUpdateRequest struct {
// Target agent ID, from the list returned by `POST /safari/a2a-agent/list`.
AgentID string `json:"agent_id" toon:"agent_id"`
// New display name; omit to leave unchanged. Same rules as create: no `@`, not `general` / `explore`, unique within the scope.
AgentName *string `json:"agent_name,omitempty" toon:"agent_name,omitempty"`
// Toggle non-loopback HTTP OAuth discovery for this agent. Omit to leave unchanged.
AllowInsecureOauthHTTP *bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
// Toggle TLS certificate verification skipping for this agent. Omit to leave unchanged.
AllowInsecureTlsSkipVerify *bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
// Replace the whole auth config; omit to leave unchanged. Keys missing from the map are dropped. For a sensitive key, sending back the masked value keeps the stored secret, while sending an empty string clears it.
AuthConfig map[string]string `json:"auth_config,omitempty" toon:"auth_config,omitempty"`
// New auth mode; omit to leave unchanged. Values (who supplies the credential):
// - `shared` (default; an empty value behaves the same): one credential stored on the agent (`auth_type` + `auth_config`) is used for every caller.
// - `per_user_secret`: each user stores their own secret, sent in the header named by `secret_schema.header_name`.
// - `per_user_oauth`: each user completes their own OAuth authorization; discovery and client registration run on first use.
//
// When sent, `secret_schema` is overwritten with the value in the same request.
AuthMode *string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
// New auth type; omit to leave unchanged.
// - `none`: no credential header.
// - `api_key`: sends `auth_config.api_key` in the header named by `auth_config.header`.
// - `bearer`: sends `Authorization: Bearer <auth_config.token>`.
AuthType *string `json:"auth_type,omitempty" toon:"auth_type,omitempty"`
// New card URL; omit to leave unchanged. Validated and compatibility-checked the same way as on create; a real change also clears `oauth_metadata` unless a new one is sent.
CardURL *string `json:"card_url,omitempty" toon:"card_url,omitempty"`
// Execution environments this agent is callable from: `cloud` and/or BYOC runner environment IDs. Omit (null) to leave unchanged; send a list to set it — an empty list clears the restriction back to all environments.
Environments []string `json:"environments,omitempty" toon:"environments,omitempty"`
// New instructions document (same contract as create: optional `summary` frontmatter, non-empty body, at most 50 KiB). Omit to leave unchanged. A deprecated `description` field is also accepted; if both are sent they must match.
Instructions *string `json:"instructions,omitempty" toon:"instructions,omitempty"`
// New JSON OAuth metadata. A non-empty value is stored as sent. When omitted or empty, the stored value is kept unless `auth_mode` or `card_url` changes, in which case it is cleared.
OauthMetadata *string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
// New JSON secret schema, e.g. `{"header_name":"X-Api-Key"}`. Applied only together with `auth_mode`; sent alone it is ignored.
SecretSchema *string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
// Toggle streaming support. Omit to leave unchanged.
Streaming *bool `json:"streaming,omitempty" toon:"streaming,omitempty"`
// Reassign team scope; omit to leave unchanged. Moving to a team requires membership in it; moving to account scope (`0`) requires the account owner or an admin. If the team changes without `environments` in the same request, the current runner entries must stay selectable by the caller or the update is rejected.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
A2aAgentUpdateRequest is generated from the Flashduty OpenAPI schema.
type A2aAgentsService ¶ added in v0.4.0
type A2aAgentsService service
A2aAgentsService handles the "AI SRE/A2A agents" API resource.
func (*A2aAgentsService) ReadGet ¶ added in v0.4.0
func (s *A2aAgentsService) ReadGet(ctx context.Context, req *A2aAgentIDRequest) (*A2aAgentItem, *Response, error)
Get A2A agent detail.
Return one A2A agent's configuration by ID, with auth secrets masked.
API: POST /safari/a2a-agent/get (remote-agent-read-get).
func (*A2aAgentsService) ReadList ¶ added in v0.4.0
func (s *A2aAgentsService) ReadList(ctx context.Context, req *A2aAgentListRequest) (*A2aAgentListResponse, *Response, error)
List A2A agents.
List A2A agents visible to the caller across account and team scopes, with pagination.
API: POST /safari/a2a-agent/list (remote-agent-read-list).
func (*A2aAgentsService) WriteCreate ¶ added in v0.4.0
func (s *A2aAgentsService) WriteCreate(ctx context.Context, req *A2aAgentCreateRequest) (*A2aAgentCreateResponse, *Response, error)
Create A2A agent.
Register a new A2A remote agent from its agent-card URL.
API: POST /safari/a2a-agent/create (remote-agent-write-create).
func (*A2aAgentsService) WriteDelete ¶ added in v0.4.0
func (s *A2aAgentsService) WriteDelete(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)
Delete A2A agent.
Soft-delete an A2A agent by ID.
API: POST /safari/a2a-agent/delete (remote-agent-write-delete).
func (*A2aAgentsService) WriteDisable ¶ added in v0.4.0
func (s *A2aAgentsService) WriteDisable(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)
Disable A2A agent.
Disable an enabled A2A agent.
API: POST /safari/a2a-agent/disable (remote-agent-write-disable).
func (*A2aAgentsService) WriteEnable ¶ added in v0.4.0
func (s *A2aAgentsService) WriteEnable(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)
Enable A2A agent.
Enable a disabled A2A agent.
API: POST /safari/a2a-agent/enable (remote-agent-write-enable).
func (*A2aAgentsService) WriteUpdate ¶ added in v0.4.0
func (s *A2aAgentsService) WriteUpdate(ctx context.Context, req *A2aAgentUpdateRequest) (*any, *Response, error)
Update A2A agent.
Apply a partial update to an A2A agent. Omit a field to leave it unchanged.
API: POST /safari/a2a-agent/update (remote-agent-write-update).
type AccountInfo ¶ added in v0.4.0
type AccountInfo struct {
// Account identifier.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Account (organization) name shown in the console.
AccountName string `json:"account_name" toon:"account_name"`
// Account avatar URL.
Avatar string `json:"avatar" toon:"avatar"`
// ISO 3166-1 alpha-2 region code of the contact phone (e.g. "CN", "US", "HK").
CountryCode string `json:"country_code" toon:"country_code"`
// Account creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Primary account domain (login subdomain).
Domain string `json:"domain" toon:"domain"`
// Account contact email.
Email string `json:"email" toon:"email"`
// Additional account domains.
ExtraDomains []string `json:"extra_domains" toon:"extra_domains"`
// Account language preference (`zh-CN` or `en-US`); empty string when not set.
Locale string `json:"locale" toon:"locale"`
// Account identifier on the marketplace platform. Omitted together with `mp_plat`.
MpAccountID string `json:"mp_account_id" toon:"mp_account_id"`
// Cloud marketplace the account was provisioned from: `aws` — AWS Marketplace. Omitted when the account did not come from a marketplace.
MpPlat string `json:"mp_plat" toon:"mp_plat"`
// Account contact phone, masked for privacy.
Phone string `json:"phone" toon:"phone"`
// Account access restrictions. Omitted when none are configured.
Restrictions AccountInfoRestrictions `json:"restrictions" toon:"restrictions"`
// Account default time zone (IANA name, e.g. `Asia/Shanghai`); members without their own setting follow it. Empty string when not set.
TimeZone string `json:"time_zone" toon:"time_zone"`
}
AccountInfo is generated from the Flashduty OpenAPI schema.
type AccountInfoRestrictions ¶ added in v0.4.0
type AccountInfoRestrictions struct {
// Whether subdomains of the allowed email domains are also accepted.
AllowSubdomain bool `json:"allow_subdomain" toon:"allow_subdomain"`
// Email domains allowed for new members; invitations to other domains are rejected. `null` or empty when unrestricted.
EmailDomains []string `json:"email_domains" toon:"email_domains"`
// Source IP addresses or CIDR ranges allowed to call the console and API for this account; `null` or empty when unrestricted.
Ips []string `json:"ips" toon:"ips"`
}
AccountInfoRestrictions is generated from the Flashduty OpenAPI schema.
type AccountService ¶ added in v0.4.0
type AccountService service
AccountService handles the "Platform/Account" API resource.
func (*AccountService) Info ¶ added in v0.4.0
func (s *AccountService) Info(ctx context.Context) (*AccountInfo, *Response, error)
Get account detail.
Return the current account's profile and settings.
API: POST /account/info (account-read-info).
type AckIncidentRequest ¶
type AckIncidentRequest struct {
// Custom field values for the acknowledgement form. Allowed keys and values depend on the incident's visible form.
CustomFields CustomFieldValues `json:"custom_fields,omitempty" toon:"custom_fields,omitempty"`
// Images attached to the acknowledgement timeline entry.
Images []IncidentActionImage `json:"images,omitempty" toon:"images,omitempty"`
// Incident IDs to acknowledge. At most 100 per call.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
// Form summary recorded as a timeline comment. Accepted only when the acknowledgement form contains a summary element.
Summary string `json:"summary,omitempty" toon:"summary,omitempty"`
}
AckIncidentRequest is generated from the Flashduty OpenAPI schema.
type AddIncidentResponderRequest ¶
type AddIncidentResponderRequest struct {
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Notification settings for the newly added responders. Defaults to `{"follow_preference": true}`.
Notify AddIncidentResponderRequestNotify `json:"notify,omitzero" toon:"notify,omitempty"`
// Member IDs to add as responders. IDs that are already responders, or that do not exist in the account, are skipped.
PersonIDs []int64 `json:"person_ids" toon:"person_ids"`
}
AddIncidentResponderRequest is generated from the Flashduty OpenAPI schema.
type AddIncidentResponderRequestNotify ¶
type AddIncidentResponderRequestNotify struct {
// `true`: notify each person through their personal notification preference. `false`: use `personal_channels`, which must then be non-empty. When omitted, `personal_channels` must be set.
FollowPreference *bool `json:"follow_preference,omitempty" toon:"follow_preference,omitempty"`
// Channels used when `follow_preference` is `false`: `sms`, `voice`, `email`, `push` (mobile app push), or an IM app channel written as `feishu_app:<integration_id>`, `dingtalk_app:<integration_id>`, `wecom_app:<integration_id>`, `slack_app:<integration_id>`, or `teams_app:<integration_id>`. Ignored when `follow_preference` is `true`.
PersonalChannels []string `json:"personal_channels,omitempty" toon:"personal_channels,omitempty"`
// Notification template ID, as returned by the notification template endpoints. Must exist in the account; otherwise the call fails with `InvalidParameter`.
TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
}
AddIncidentResponderRequestNotify is generated from the Flashduty OpenAPI schema.
type AddWarRoomMemberRequest ¶ added in v0.4.0
type AddWarRoomMemberRequest struct {
// Chat ID of the war-room group on the IM platform, as returned for the war room by `POST /incident/war-room/list`.
ChatID string `json:"chat_id" toon:"chat_id"`
// ID of the IM integration hosting the war room; obtain it from `POST /datasource/im/war-room-enabled/list`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Person IDs (member IDs, or the account ID for the owner) to add. Must not be empty.
MemberIDs []int64 `json:"member_ids" toon:"member_ids"`
}
AddWarRoomMemberRequest is generated from the Flashduty OpenAPI schema.
type AffectedStatusPageComponentItem ¶
type AffectedStatusPageComponentItem struct {
// Time the component became available, as a Unix timestamp in seconds. Omitted when 0.
AvailableSinceSeconds Timestamp `json:"available_since_seconds" toon:"available_since_seconds"`
// Component ID. Omitted when empty.
ComponentID string `json:"component_id" toon:"component_id"`
// Component description. Omitted when empty.
Description string `json:"description" toon:"description"`
// When true, the component is hidden entirely from summary endpoints. Omitted when false.
HideAll bool `json:"hide_all" toon:"hide_all"`
// When true, uptime data is hidden from summary responses. Omitted when false.
HideUptime bool `json:"hide_uptime" toon:"hide_uptime"`
// Component display name.
Name string `json:"name" toon:"name"`
// Display order within its section. Omitted when 0.
OrderID int64 `json:"order_id" toon:"order_id"`
// Parent section ID. Omitted when the component sits at the top level.
SectionID string `json:"section_id" toon:"section_id"`
// Current status of the component affected by the change. Severity increases: `operational` < `degraded` = `under_maintenance` < `partial_outage` < `full_outage`; incident-type changes may use the first four, maintenance-type changes only `operational` and `under_maintenance`.
// | Value | Meaning |
// |---|---|
// | `operational` | Operating normally. |
// | `degraded` | Degraded performance. |
// | `partial_outage` | Partial outage. |
// | `full_outage` | Full outage. |
// | `under_maintenance` | Under maintenance. |
Status string `json:"status" toon:"status"`
}
AffectedStatusPageComponentItem is generated from the Flashduty OpenAPI schema.
type AlertEmailPreviewEmail ¶ added in v0.16.0
type AlertEmailPreviewEmail struct {
// Email body: HTML when it starts with `<`, otherwise plain text.
Body string `json:"body,omitempty" toon:"body,omitempty"`
// A whole email file (`.eml`) as base64. When set it stands in for `subject`, `body` and `from` and is parsed the way the SMTP server parses mail.
Eml string `json:"eml,omitempty" toon:"eml,omitempty"`
// Sender address.
From string `json:"from,omitempty" toon:"from,omitempty"`
// Email subject.
Subject string `json:"subject,omitempty" toon:"subject,omitempty"`
}
AlertEmailPreviewEmail is generated from the Flashduty OpenAPI schema.
type AlertEmailPreviewEvent ¶ added in v0.16.0
type AlertEmailPreviewEvent struct {
// Event description.
Description string `json:"description" toon:"description"`
// Severity of a firing event; empty for a recovery.
EventSeverity string `json:"event_severity" toon:"event_severity"`
// Status of the event this email produces.
EventStatus string `json:"event_status" toon:"event_status"`
// Labels taken from the email: the body, sender, recipients and subject are exposed as labels.
Labels map[string]string `json:"labels" toon:"labels"`
// Event title.
Title string `json:"title" toon:"title"`
}
AlertEmailPreviewEvent is generated from the Flashduty OpenAPI schema.
type AlertEmailPreviewParsed ¶ added in v0.16.0
type AlertEmailPreviewParsed struct {
// Body the conversion used: the HTML part when there is one, otherwise the text part.
Body string `json:"body" toon:"body"`
// Body as plain text; a key extracted from the description is looked for here first.
BodyText string `json:"body_text" toon:"body_text"`
// Sender address taken from the email.
From string `json:"from" toon:"from"`
// Subject as the parser decoded it.
Subject string `json:"subject" toon:"subject"`
}
AlertEmailPreviewParsed is generated from the Flashduty OpenAPI schema.
type AlertEmailPreviewRequest ¶ added in v0.16.0
type AlertEmailPreviewRequest struct {
// The email to convert.
Email AlertEmailPreviewEmail `json:"email" toon:"email"`
// Email integration whose saved settings seed the preview. `0` or omitted is what the console sends on the create page, before the integration exists.
IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
// Settings to preview. They are validated the way the save endpoint validates them.
Settings AlertEmailPreviewSettings `json:"settings" toon:"settings"`
}
AlertEmailPreviewRequest is generated from the Flashduty OpenAPI schema.
type AlertEmailPreviewResponse ¶ added in v0.16.0
type AlertEmailPreviewResponse struct {
// Hash of `key_source`. Empty in `alwaysTrigger` mode, where each email gets a random key.
AlertKey string `json:"alert_key" toon:"alert_key"`
// What the conversion read from the email.
Email AlertEmailPreviewParsed `json:"email" toon:"email"`
// The event the email produces. `null` when the email is discarded.
Event *AlertEmailPreviewEvent `json:"event" toon:"event"`
// `true` when the rule's pattern captured nothing and the subject was used as the key source.
KeyFallback bool `json:"key_fallback" toon:"key_fallback"`
// What the alert key was hashed from. Empty when every email is its own alert (`alwaysTrigger`) or the email is discarded.
KeySource string `json:"key_source" toon:"key_source"`
// Zero-based index of the rule that matched. `null` when no rule matched, and always `null` in `alwaysTrigger` and `triggerByTitle` modes.
MatchedRule int64 `json:"matched_rule" toon:"matched_rule"`
// What the settings make of this email: `trigger` (a firing event), `close` (a recovery event) or `discard` (dropped).
Result string `json:"result" toon:"result"`
}
AlertEmailPreviewResponse is generated from the Flashduty OpenAPI schema.
type AlertEmailPreviewSettings ¶ added in v0.16.0
type AlertEmailPreviewSettings struct {
// What happens to an email that matches no rule when `mode` is `triggerOrCloseByRule`: `trigger` turns it into a firing event, `discard` drops it.
Default string `json:"default,omitempty" toon:"default,omitempty"`
// How the integration decides what an email becomes. Omitted defaults to `alwaysTrigger`.
// - `alwaysTrigger`: every email becomes its own alert, keyed randomly.
// - `triggerByTitle`: every email becomes a firing event whose alert key is hashed from the subject.
// - `triggerOrCloseByRule`: `rules` decide whether an email triggers, closes or is discarded, and `default` handles the rest.
Mode string `json:"mode,omitempty" toon:"mode,omitempty"`
// Rules tried in order when `mode` is `triggerOrCloseByRule`; each entry must be a non-empty object. At most 50.
Rules []AlertEmailRule `json:"rules,omitempty" toon:"rules,omitempty"`
}
AlertEmailPreviewSettings is generated from the Flashduty OpenAPI schema.
type AlertEmailRule ¶ added in v0.16.0
type AlertEmailRule struct {
// Which part of the email the alert key is extracted from: `title` or `description`. For `description` the body text is searched first, then the body text with tables, then the description.
ExtractFrom string `json:"extract_from" toon:"extract_from"`
// Regular expression the key is extracted with; the captured groups are joined by `,` to form the key source. A pattern that captures nothing falls back to the subject.
ExtractPattern string `json:"extract_pattern" toon:"extract_pattern"`
// AND conditions the email must match for the rule to apply. Send `[]` to match every email.
Filters []FilterCondition `json:"filters" toon:"filters"`
// `trigger` turns a matching email into a firing event, `close` into a recovery event.
Type string `json:"type" toon:"type"`
}
AlertEmailRule is generated from the Flashduty OpenAPI schema.
type AlertEnrichmentService ¶
type AlertEnrichmentService service
AlertEnrichmentService handles the "On-call/Alert enrichment" API resource.
func (*AlertEnrichmentService) EnrichmentReadInfo ¶
func (s *AlertEnrichmentService) EnrichmentReadInfo(ctx context.Context, req *EnrichmentInfoRequest) (*EnrichmentItem, *Response, error)
Get enrichment rules.
Return the enrichment rule set configured for a specific integration.
API: POST /enrichment/info (enrichment-read-info).
func (*AlertEnrichmentService) EnrichmentReadList ¶
func (s *AlertEnrichmentService) EnrichmentReadList(ctx context.Context, req *EnrichmentListRequest) (*EnrichmentListResponse, *Response, error)
List enrichment rules.
Return the enrichment rule sets for a list of integration IDs.
API: POST /enrichment/list (enrichment-read-list).
func (*AlertEnrichmentService) EnrichmentReadPreview ¶ added in v0.16.0
func (s *AlertEnrichmentService) EnrichmentReadPreview(ctx context.Context, req *EnrichmentPreviewRequest) (*EnrichmentPreviewResponse, *Response, error)
Preview enrichment rule results.
Run unsaved enrichment rules over one event, the way ingestion would.
API: POST /enrichment/preview (enrichment-read-preview).
func (*AlertEnrichmentService) EnrichmentSampleReadList ¶ added in v0.16.0
func (s *AlertEnrichmentService) EnrichmentSampleReadList(ctx context.Context, req *EnrichmentSampleListRequest) (*EnrichmentSampleListResponse, *Response, error)
List recent event samples.
List the raw events an integration received most recently, newest first.
API: POST /enrichment/sample/list (enrichment-sample-read-list).
func (*AlertEnrichmentService) EnrichmentWriteUpsert ¶
func (s *AlertEnrichmentService) EnrichmentWriteUpsert(ctx context.Context, req *EnrichmentUpsertRequest) (*Response, error)
Upsert enrichment rules.
Create or replace the whole enrichment rule set of an integration.
API: POST /enrichment/upsert (enrichment-write-upsert).
func (*AlertEnrichmentService) FieldReadInfo ¶
func (s *AlertEnrichmentService) FieldReadInfo(ctx context.Context, req *FieldInfoRequest) (*FieldItem, *Response, error)
Get field detail.
Return the configuration of a single incident custom field by ID.
API: POST /field/info (field-read-info).
func (*AlertEnrichmentService) FieldReadList ¶
func (s *AlertEnrichmentService) FieldReadList(ctx context.Context, req *FieldListRequest) (*FieldListResponse, *Response, error)
List fields.
Return all incident custom fields configured for the account.
API: POST /field/list (field-read-list).
func (*AlertEnrichmentService) FieldWriteCreate ¶
func (s *AlertEnrichmentService) FieldWriteCreate(ctx context.Context, req *CreateFieldRequest) (*CreateFieldResponse, *Response, error)
Create field.
Create a new incident custom field on the account.
API: POST /field/create (field-write-create).
func (*AlertEnrichmentService) FieldWriteDelete ¶
func (s *AlertEnrichmentService) FieldWriteDelete(ctx context.Context, req *DeleteFieldRequest) (*Response, error)
Delete field.
Delete an incident custom field and asynchronously strip it from existing incidents.
API: POST /field/delete (field-write-delete).
func (*AlertEnrichmentService) FieldWriteUpdate ¶
func (s *AlertEnrichmentService) FieldWriteUpdate(ctx context.Context, req *UpdateFieldRequest) (*Response, error)
Update field.
Update mutable attributes of an existing incident custom field.
API: POST /field/update (field-write-update).
func (*AlertEnrichmentService) MappingAPIReadInfo ¶
func (s *AlertEnrichmentService) MappingAPIReadInfo(ctx context.Context, req *MappingApiidRequest) (*MappingAPIItem, *Response, error)
Get mapping API detail.
Return detail of a single mapping API by its ID.
API: POST /enrichment/mapping/api/info (mapping-api-read-info).
func (*AlertEnrichmentService) MappingAPIReadList ¶
func (s *AlertEnrichmentService) MappingAPIReadList(ctx context.Context) (*MappingAPIListResponse, *Response, error)
List mapping APIs.
Return all mapping APIs of the account, newest first.
API: POST /enrichment/mapping/api/list (mapping-api-read-list).
func (*AlertEnrichmentService) MappingAPIWriteCreate ¶
func (s *AlertEnrichmentService) MappingAPIWriteCreate(ctx context.Context, req *MappingAPICreateRequest) (*MappingAPICreateResponse, *Response, error)
Create mapping API.
Register an external HTTP API that enrichment rules call to look up alert labels.
API: POST /enrichment/mapping/api/create (mapping-api-write-create).
func (*AlertEnrichmentService) MappingAPIWriteDelete ¶
func (s *AlertEnrichmentService) MappingAPIWriteDelete(ctx context.Context, req *MappingApiidRequest) (*Response, error)
Delete mapping API.
Soft-delete a mapping API; refused while an enrichment rule uses it.
API: POST /enrichment/mapping/api/delete (mapping-api-write-delete).
func (*AlertEnrichmentService) MappingAPIWriteUpdate ¶
func (s *AlertEnrichmentService) MappingAPIWriteUpdate(ctx context.Context, req *MappingAPIUpdateRequest) (*Response, error)
Update mapping API.
Update configuration of an existing mapping API.
API: POST /enrichment/mapping/api/update (mapping-api-write-update).
func (*AlertEnrichmentService) MappingDataReadDownload ¶
func (s *AlertEnrichmentService) MappingDataReadDownload(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)
Download mapping data as CSV.
Export all data rows of a mapping schema as a CSV file download.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: POST /enrichment/mapping/data/download (mapping-data-read-download).
func (*AlertEnrichmentService) MappingDataReadList ¶
func (s *AlertEnrichmentService) MappingDataReadList(ctx context.Context, req *MappingDataListRequest) (*MappingDataListResponse, *Response, error)
List mapping data.
Return paginated mapping data rows for a schema, with optional exact-match filtering on source label values.
API: POST /enrichment/mapping/data/list (mapping-data-read-list).
func (*AlertEnrichmentService) MappingDataWriteDelete ¶
func (s *AlertEnrichmentService) MappingDataWriteDelete(ctx context.Context, req *MappingDataDeleteRequest) (*Response, error)
Delete mapping data rows.
Delete up to 100 mapping data rows by their keys.
API: POST /enrichment/mapping/data/delete (mapping-data-write-delete).
func (*AlertEnrichmentService) MappingDataWriteTruncate ¶
func (s *AlertEnrichmentService) MappingDataWriteTruncate(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)
Truncate mapping data.
Delete all data rows in a mapping schema.
API: POST /enrichment/mapping/data/truncate (mapping-data-write-truncate).
func (*AlertEnrichmentService) MappingDataWriteUpload ¶
func (s *AlertEnrichmentService) MappingDataWriteUpload(ctx context.Context, req *MappingDataUploadRequest) (*Response, error)
MappingDataWriteUpload bulk-loads mapping data rows from a CSV file. By default the existing data is truncated before the new rows load; set DoNotTruncateFirst to append instead.
API: POST /enrichment/mapping/data/upload (mapping-data-write-upload).
func (*AlertEnrichmentService) MappingDataWriteUpsert ¶
func (s *AlertEnrichmentService) MappingDataWriteUpsert(ctx context.Context, req *MappingDataUpsertRequest) (*MappingDataUpsertResponse, *Response, error)
Upsert mapping data rows.
Insert or update up to 1000 data rows in a mapping schema. Each row must contain all source and result labels.
API: POST /enrichment/mapping/data/upsert (mapping-data-write-upsert).
func (*AlertEnrichmentService) MappingSchemaReadInfo ¶
func (s *AlertEnrichmentService) MappingSchemaReadInfo(ctx context.Context, req *MappingSchemaIDRequest) (*MappingSchemaItem, *Response, error)
Get mapping schema detail.
Return detail of a single mapping schema by its ID.
API: POST /enrichment/mapping/schema/info (mapping-schema-read-info).
func (*AlertEnrichmentService) MappingSchemaReadList ¶
func (s *AlertEnrichmentService) MappingSchemaReadList(ctx context.Context) (*MappingSchemaListResponse, *Response, error)
List mapping schemas.
Return all mapping schemas of the account, newest first.
API: POST /enrichment/mapping/schema/list (mapping-schema-read-list).
func (*AlertEnrichmentService) MappingSchemaWriteCreate ¶
func (s *AlertEnrichmentService) MappingSchemaWriteCreate(ctx context.Context, req *MappingSchemaCreateRequest) (*MappingSchemaCreateResponse, *Response, error)
Create mapping schema.
Create a mapping schema that defines the lookup labels and the result labels to fill.
API: POST /enrichment/mapping/schema/create (mapping-schema-write-create).
func (*AlertEnrichmentService) MappingSchemaWriteDelete ¶
func (s *AlertEnrichmentService) MappingSchemaWriteDelete(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)
Delete mapping schema.
Delete a mapping schema and all of its data rows; refused while an enrichment rule or robot webhook uses it.
API: POST /enrichment/mapping/schema/delete (mapping-schema-write-delete).
func (*AlertEnrichmentService) MappingSchemaWriteUpdate ¶
func (s *AlertEnrichmentService) MappingSchemaWriteUpdate(ctx context.Context, req *MappingSchemaUpdateRequest) (*Response, error)
Update mapping schema.
Update the name, description, or owning team of a mapping schema. Source and result labels cannot be changed after creation.
API: POST /enrichment/mapping/schema/update (mapping-schema-write-update).
type AlertEvent ¶ added in v0.16.0
type AlertEvent struct {
// Account the event belongs to. Set by the platform on stored samples.
AccountID int64 `json:"account_id,omitempty" toon:"account_id,omitempty"`
// Deduplication key that merges events into one alert. Empty is allowed: the preview mints a random key, so nothing is merged.
AlertKey string `json:"alert_key,omitempty" toon:"alert_key,omitempty"`
// Integration the sample was received by. Set by the platform on stored samples.
DataSourceID int64 `json:"data_source_id,omitempty" toon:"data_source_id,omitempty"`
// Integration type of the event. Set by the platform on stored samples.
DataSourceType string `json:"data_source_type,omitempty" toon:"data_source_type,omitempty"`
// Event description, truncated to 2048 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Severity carried by a firing event. The preview overwrites it with `event_status` for firing events.
EventSeverity string `json:"event_severity,omitempty" toon:"event_severity,omitempty"`
// Event status. `Critical`, `Warning` and `Info` are firing events; `Ok` is a recovery.
EventStatus string `json:"event_status" toon:"event_status"`
// Unix timestamp in seconds. The preview stamps the current time, so the value sent is ignored.
EventTime int64 `json:"event_time,omitempty" toon:"event_time,omitempty"`
// Images attached to the event. Images whose `src` is empty, longer than 512 characters, or does not start with `img_` or `http` are dropped; at most the first 5 are kept, and `alt` and `href` are cut to 128 and 512 characters.
Images []AlertImage `json:"images,omitempty" toon:"images,omitempty"`
// Event labels. Up to 50 entries; keys are label names, values strings.
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Event title. Required unless `title_rule` is set; the two are the source of the alert title.
Title string `json:"title,omitempty" toon:"title,omitempty"`
// Title template such as `$service::$alertname`, built from `labels` when `title` is empty.
TitleRule string `json:"title_rule,omitempty" toon:"title_rule,omitempty"`
}
AlertEvent is generated from the Flashduty OpenAPI schema.
type AlertEventGlobalListRequest ¶
type AlertEventGlobalListRequest struct {
ListOptions
// Sort ascending when `true`.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by channel IDs. At most 100 entries. Channels the caller cannot access are dropped; if none remain, the result is empty.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// End of the search window, Unix epoch seconds. Must be greater than `start_time`; the span must not exceed 31 days.
EndTime int64 `json:"end_time" toon:"end_time"`
// Filter by integration IDs.
IntegrationIDs []int64 `json:"integration_ids,omitempty" toon:"integration_ids,omitempty"`
// Filter by integration types (plugin keys).
IntegrationTypes []string `json:"integration_types,omitempty" toon:"integration_types,omitempty"`
// Sort field; only `event_time` is supported.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Comma-separated filter on `event_severity`, e.g. `Critical,Warning`. Meaningful values: `Critical`, `Warning`, `Info`. Values are not validated; an unknown value (or `Ok`) matches nothing.
Severities string `json:"severities,omitempty" toon:"severities,omitempty"`
// Start of the search window, Unix epoch seconds. Must be greater than 0.
StartTime int64 `json:"start_time" toon:"start_time"`
}
AlertEventGlobalListRequest is generated from the Flashduty OpenAPI schema.
type AlertEventGlobalListResponse ¶
type AlertEventGlobalListResponse struct {
// Whether a next page exists (probed by fetching limit+1 rows).
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Raw alert events on the current page.
Items []AlertEventItem `json:"items" toon:"items"`
// Cursor for the next page — the ObjectID of the last event on this page; pass it back as `search_after_ctx`. Omitted when the page is empty; in cursor mode also omitted when there is no next page.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Total number of matching events, capped at 1000.
Total int64 `json:"total" toon:"total"`
}
AlertEventGlobalListResponse is generated from the Flashduty OpenAPI schema.
type AlertEventItem ¶
type AlertEventItem struct {
// ID of the account that owns this record; the same for every record returned to one `app_key`.
AccountID int64 `json:"account_id" toon:"account_id"`
// Parent alert ID (MongoDB ObjectID).
AlertID string `json:"alert_id" toon:"alert_id"`
// Deduplication key used to merge events into an alert.
AlertKey string `json:"alert_key" toon:"alert_key"`
// Channel ID the event is routed to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Record creation time, Unix epoch seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Deprecated. Use `integration_id` instead.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Soft-delete time, Unix epoch seconds. Omitted when the event is not deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Event description.
Description string `json:"description" toon:"description"`
// Event ID (MongoDB ObjectID).
EventID string `json:"event_id" toon:"event_id"`
// Severity of this event: `Critical`, `Warning`, or `Info`. An event never carries `Ok` as severity — `Ok` appears only as `event_status`.
EventSeverity string `json:"event_severity" toon:"event_severity"`
// Status carried by this event: `Critical`/`Warning`/`Info` for a firing event, `Ok` for a recovery event.
EventStatus string `json:"event_status" toon:"event_status"`
// Event timestamp, Unix epoch seconds.
EventTime Timestamp `json:"event_time" toon:"event_time"`
// Images attached to the event.
Images []AlertImage `json:"images" toon:"images"`
// Integration that produced this event.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Plugin type of the integration, such as `prometheus.alert`, `grafana.alert`, `zabbix.alert`, `monit.alert`, or `email.alert`. The set is open and grows with new integrations; `POST /integration/type/list` returns the full list.
IntegrationType string `json:"integration_type" toon:"integration_type"`
// Label key-value pairs.
Labels map[string]string `json:"labels" toon:"labels"`
// Event title.
Title string `json:"title" toon:"title"`
// Title template used to derive `title` from labels.
TitleRule string `json:"title_rule" toon:"title_rule"`
// Record update time, Unix epoch seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
AlertEventItem is generated from the Flashduty OpenAPI schema.
type AlertEventListRequest ¶
type AlertEventListRequest struct {
ListOptions
// Alert ID (MongoDB ObjectID).
AlertID string `json:"alert_id" toon:"alert_id"`
// When true, return events oldest-first. Defaults to newest-first.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
}
AlertEventListRequest is generated from the Flashduty OpenAPI schema.
type AlertEventListResponse ¶
type AlertEventListResponse struct {
// Whether another page is available.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Raw alert events in the requested order.
Items []AlertEventItem `json:"items" toon:"items"`
// Cursor to pass as `search_after_ctx` for the next page. Omitted when the page is empty; in cursor mode also omitted when there is no next page.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Total matching event count, capped at 1000.
Total int64 `json:"total" toon:"total"`
}
AlertEventListResponse is generated from the Flashduty OpenAPI schema.
type AlertFeedRequest ¶
type AlertFeedRequest struct {
ListOptions
// Alert ID (ObjectID hex string); obtain it from `POST /alert/list`.
AlertID string `json:"alert_id" toon:"alert_id"`
// Sort ascending.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by feed type codes — see the `type` field of the response items for the full list (e.g. `a_new`, `a_comm`, `a_merge`).
Types []string `json:"types,omitempty" toon:"types,omitempty"`
}
AlertFeedRequest is generated from the Flashduty OpenAPI schema.
type AlertFeedResponse ¶
type AlertFeedResponse struct {
// Whether a next page exists.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Alert feed records on the current page.
Items []FeedItem `json:"items" toon:"items"`
}
AlertFeedResponse is generated from the Flashduty OpenAPI schema.
type AlertFeedType ¶
type AlertFeedType string
AlertFeedType Alert activity feed entry type. Each value identifies one alert lifecycle event; the matching `detail` payload shape is determined by this field.
const ( AlertFeedTypeANew AlertFeedType = "a_new" AlertFeedTypeAUpdate AlertFeedType = "a_update" AlertFeedTypeAComm AlertFeedType = "a_comm" AlertFeedTypeAMerge AlertFeedType = "a_merge" AlertFeedTypeAMSilence AlertFeedType = "a_m_silence" AlertFeedTypeAMInhibit AlertFeedType = "a_m_inhibit" AlertFeedTypeAMFlapping AlertFeedType = "a_m_flapping" AlertFeedTypeAAck AlertFeedType = "a_ack" AlertFeedTypeAUnack AlertFeedType = "a_unack" AlertFeedTypeAClose AlertFeedType = "a_close" )
func (AlertFeedType) String ¶ added in v0.5.2
func (e AlertFeedType) String() string
String returns the underlying string value, implementing fmt.Stringer.
type AlertImage ¶
type AlertImage struct {
// Alternative text shown when the image cannot be displayed; empty when not set.
Alt string `json:"alt,omitempty" toon:"alt,omitempty"`
// Optional link URL when the image is clicked.
Href string `json:"href,omitempty" toon:"href,omitempty"`
// Image source URL or internal image reference (starts with `img_` or `http`).
Src string `json:"src" toon:"src"`
}
AlertImage is generated from the Flashduty OpenAPI schema.
type AlertInfo ¶
type AlertInfo struct {
// ID of the account that owns this record; the same for every record returned to one `app_key`.
AccountID int64 `json:"account_id" toon:"account_id"`
// Alert ID (MongoDB ObjectID).
AlertID string `json:"alert_id" toon:"alert_id"`
// Deduplication key used to merge events into the alert.
AlertKey string `json:"alert_key" toon:"alert_key"`
// Current severity.
AlertSeverity string `json:"alert_severity" toon:"alert_severity"`
// Current status.
AlertStatus string `json:"alert_status" toon:"alert_status"`
// ID of the channel the alert was routed to; its name is in `channel_name`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel display name.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Status of the channel: `enabled`, `disabled`, or `deleted`. Empty string when the record has no channel or the channel no longer exists.
ChannelStatus string `json:"channel_status" toon:"channel_status"`
// Creation timestamp (seconds).
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Deprecated. Use `integration_id` instead.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Deprecated. Use `integration_name`.
DataSourceName string `json:"data_source_name" toon:"data_source_name"`
// Deprecated. Use `integration_ref_id`.
DataSourceRefID string `json:"data_source_ref_id" toon:"data_source_ref_id"`
// Deprecated; same value as `integration_type`.
DataSourceType string `json:"data_source_type" toon:"data_source_type"`
// Soft-delete timestamp (seconds). Zero if not deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Alert description.
Description string `json:"description" toon:"description"`
// Console URL of this alert (`{console}/alert/detail/{alert_id}`). Empty when the deployment has no console base configured.
DetailURL string `json:"detail_url" toon:"detail_url"`
// Unix timestamp (seconds) when the alert recovered. 0 if still active.
EndTime Timestamp `json:"end_time" toon:"end_time"`
// Total number of raw events merged into this alert.
EventCnt int64 `json:"event_cnt" toon:"event_cnt"`
// Raw alert event preview, populated only when requested. Capped at the 20 newest events per alert.
Events []AlertEventItem `json:"events" toon:"events"`
// Whether this alert has ever been silenced.
EverMuted bool `json:"ever_muted" toon:"ever_muted"`
// Images attached to the alert; `null` when there are none.
Images []Image `json:"images" toon:"images"`
// Parent incident reference, if the alert has been merged into one.
Incident IncidentShort `json:"incident" toon:"incident"`
// Integration ID that produced the alert.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Integration display name.
IntegrationName string `json:"integration_name" toon:"integration_name"`
// Integration reference ID.
IntegrationRefID string `json:"integration_ref_id" toon:"integration_ref_id"`
// Plugin type of the integration, such as `prometheus.alert`, `grafana.alert`, `zabbix.alert`, `monit.alert`, or `email.alert`. The set is open and grows with new integrations; `POST /integration/type/list` returns the full list.
IntegrationType string `json:"integration_type" toon:"integration_type"`
// Alert labels.
Labels map[string]string `json:"labels" toon:"labels"`
// Unix timestamp (seconds) of the most recent event.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Always an empty string in API responses; filled only when the alert is rendered for notifications.
ResponderEmail string `json:"responder_email" toon:"responder_email"`
// Always an empty string in API responses; filled only when the alert is rendered for notifications.
ResponderName string `json:"responder_name" toon:"responder_name"`
// Unix timestamp (seconds) when the alert first fired.
StartTime Timestamp `json:"start_time" toon:"start_time"`
// Alert title.
Title string `json:"title" toon:"title"`
// Title rendering rule.
TitleRule string `json:"title_rule" toon:"title_rule"`
// Last update timestamp (seconds).
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
AlertInfo is generated from the Flashduty OpenAPI schema.
type AlertInfoRequest ¶
type AlertInfoRequest struct {
// Alert ID (ObjectID hex string).
AlertID string `json:"alert_id" toon:"alert_id"`
}
AlertInfoRequest is generated from the Flashduty OpenAPI schema.
type AlertItem ¶
type AlertItem struct {
// ID of the account that owns the alert.
AccountID int64 `json:"account_id" toon:"account_id"`
// Unique alert ID (ObjectID hex string).
AlertID string `json:"alert_id" toon:"alert_id"`
// Deduplication key.
AlertKey string `json:"alert_key" toon:"alert_key"`
// Current severity — the highest severity ever seen on this alert: `Critical`, `Warning`, or `Info`.
AlertSeverity string `json:"alert_severity" toon:"alert_severity"`
// Current status: `Critical`/`Warning`/`Info` while firing, `Ok` once recovered.
AlertStatus string `json:"alert_status" toon:"alert_status"`
// ID of the channel the alert belongs to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Display name of the channel.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Status of the channel: `enabled` or `disabled`.
ChannelStatus string `json:"channel_status" toon:"channel_status"`
// Creation timestamp, Unix epoch seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Deprecated: use `integration_id` instead.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Deprecated: use `integration_name` instead.
DataSourceName string `json:"data_source_name" toon:"data_source_name"`
// Deprecated: use `integration_ref_id` instead.
DataSourceRefID string `json:"data_source_ref_id" toon:"data_source_ref_id"`
// Deprecated: use `integration_type` instead (same value, e.g. `prometheus.alert`). Omitted when empty.
DataSourceType string `json:"data_source_type" toon:"data_source_type"`
// Soft-delete time, Unix epoch seconds. Omitted when the alert is not deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Alert description.
Description string `json:"description" toon:"description"`
// Console URL of this alert (`{console}/alert/detail/{alert_id}`). Empty when the deployment has no console base configured.
DetailURL string `json:"detail_url" toon:"detail_url"`
// Resolution time, Unix epoch seconds. 0 if still active.
EndTime Timestamp `json:"end_time" toon:"end_time"`
// Total number of raw events received by this alert.
EventCnt int64 `json:"event_cnt" toon:"event_cnt"`
// Raw events of this alert. Omitted here; populated only by `POST /incident/alert/list`.
Events []AlertEventItem `json:"events" toon:"events"`
// True if this alert has ever been silenced.
EverMuted bool `json:"ever_muted" toon:"ever_muted"`
// Images attached to the alert; `null` when there are none.
Images []AlertImage `json:"images" toon:"images"`
// Associated incident, if any.
Incident IncidentShort `json:"incident" toon:"incident"`
// ID of the integration that produced this alert.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Display name of the integration.
IntegrationName string `json:"integration_name" toon:"integration_name"`
// Owner reference of the integration: `a_<account_id>` for an account-level integration, `c_<channel_id>` for a channel-owned one.
IntegrationRefID string `json:"integration_ref_id" toon:"integration_ref_id"`
// Type key of the integration that produced the alert, e.g. `prometheus.alert` or `zabbix.alert`; same values as `plugin_type` from `POST /integration/type/list`.
IntegrationType string `json:"integration_type" toon:"integration_type"`
// Label key-value pairs; `null` when the alert has no labels.
Labels map[string]string `json:"labels" toon:"labels"`
// Last-event time, Unix epoch seconds.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Responder email. Always empty in this response — responder tracking lives on the associated incident.
ResponderEmail string `json:"responder_email" toon:"responder_email"`
// Responder display name. Always empty in this response — responder tracking lives on the associated incident.
ResponderName string `json:"responder_name" toon:"responder_name"`
// First-seen time, Unix epoch seconds.
StartTime Timestamp `json:"start_time" toon:"start_time"`
// Alert title.
Title string `json:"title" toon:"title"`
// Title template used to derive `title` from the event labels (e.g. `$service::$cluster`).
TitleRule string `json:"title_rule" toon:"title_rule"`
// Last update timestamp, Unix epoch seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
AlertItem is generated from the Flashduty OpenAPI schema.
type AlertListByIDsRequest ¶
type AlertListByIDsRequest struct {
// Alert IDs (ObjectID hex strings) to fetch. A malformed ID fails the request; IDs not found in the account are left out of the result.
AlertIDs []string `json:"alert_ids" toon:"alert_ids"`
}
AlertListByIDsRequest is generated from the Flashduty OpenAPI schema.
type AlertListRequest ¶
type AlertListRequest struct {
ListOptions
// Filter to specific alert IDs (ObjectID hex strings). Invalid IDs are ignored; if none are valid, the result is empty.
AlertIDs []string `json:"alert_ids,omitempty" toon:"alert_ids,omitempty"`
// Filter by alert deduplication keys.
AlertKeys []string `json:"alert_keys,omitempty" toon:"alert_keys,omitempty"`
// Comma-separated filter on `alert_severity`, e.g. `Critical,Warning`. Allowed values: `Critical`, `Warning`, `Info`, `Ok`; other values return `InvalidParameter`. `Ok` matches nothing because `alert_severity` is never `Ok`.
AlertSeverity string `json:"alert_severity,omitempty" toon:"alert_severity,omitempty"`
// Sort ascending by `start_time` when `true`; default is descending.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// When `true`, also require the alert's `updated_at` to fall within [`start_time`, `end_time`], in addition to the `start_time` filter; the span must then not exceed 7 days.
ByUpdatedAt bool `json:"by_updated_at,omitempty" toon:"by_updated_at,omitempty"`
// Filter by channel IDs.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// End of the search window, Unix epoch seconds. Must be greater than `start_time`; the span must not exceed 31 days (7 days with `by_updated_at`). A value before the start of the data retention period returns `InvalidParameter`.
EndTime int64 `json:"end_time" toon:"end_time"`
// Filter by whether the alert has ever been silenced.
EverMuted *bool `json:"ever_muted,omitempty" toon:"ever_muted,omitempty"`
// Filter by integration IDs.
IntegrationIDs []int64 `json:"integration_ids,omitempty" toon:"integration_ids,omitempty"`
// Filter by lifecycle: `true` returns only firing alerts (status `Critical`/`Warning`/`Info`), `false` returns only recovered alerts (status `Ok`). Omit or pass `null` to return both.
IsActive *bool `json:"is_active,omitempty" toon:"is_active,omitempty"`
// Start of the search window, Unix epoch seconds, applied to the alert's `start_time`. A value earlier than the account's data retention period is moved up to the retention start.
StartTime int64 `json:"start_time" toon:"start_time"`
}
AlertListRequest is generated from the Flashduty OpenAPI schema.
type AlertListResponse ¶
type AlertListResponse struct {
// `true` when another page exists. Exact in both cursor mode (`search_after_ctx` sent) and page-number mode, including past the 1,000 cap of `total`.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Alerts on the current page.
Items []AlertItem `json:"items" toon:"items"`
// Cursor for the next page — the ObjectID hex of the last alert on this page; pass it back as `search_after_ctx`. Omitted when the page is empty; in cursor mode also omitted when there is no next page.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Number of matching alerts, capped at 1,000.
Total int64 `json:"total" toon:"total"`
}
AlertListResponse is generated from the Flashduty OpenAPI schema.
type AlertMergeRequest ¶
type AlertMergeRequest struct {
// Alert IDs to merge (ObjectID hex strings); obtain them from `POST /alert/list`. Every ID must belong to the caller's account.
AlertIDs []string `json:"alert_ids" toon:"alert_ids"`
// Optional comment recorded on the merge feed entry. At most 1024 characters.
Comment string `json:"comment,omitempty" toon:"comment,omitempty"`
// Target incident ID (ObjectID hex string); obtain it from `POST /incident/list`.
IncidentID string `json:"incident_id" toon:"incident_id"`
// Member ID of the new owner for the target incident; obtain it from `POST /member/list`.
OwnerID int64 `json:"owner_id,omitempty" toon:"owner_id,omitempty"`
// Optional new title for the target incident. At most 512 characters.
Title string `json:"title,omitempty" toon:"title,omitempty"`
}
AlertMergeRequest is generated from the Flashduty OpenAPI schema.
type AlertPipeline ¶
type AlertPipeline struct {
// AND-filter list — the rule applies only when every condition matches the incoming event. Keys: `severity` (aliases `alert_severity`, `event_severity`), `status`, `title`, `title_rule`, `description`, `alert_key`, `integration_id` (alias `data_source_id`), and `labels.<name>`; other keys return `InvalidParameter`. `null` or omitted means the rule applies to all events.
If []FilterCondition `json:"if,omitempty" toon:"if,omitempty"`
// Rule type. Rules run in array order; when the `if` condition matches, the event is processed according to `kind`.
// | Value | Meaning |
// |---|---|
// | `title_reset` | Rewrites the event title from the `settings.title` template. |
// | `description_reset` | Rewrites the event description from the `settings.description` template. |
// | `severity_reset` | Resets the event severity and status to `settings.severity` (`Critical`/`Warning`/`Info`). |
// | `alert_drop` | Discards the matching event outright; no alert is created. |
// | `alert_inhibit` | Discards the event (inhibition) when an active source alert matching `settings.source_filters` and correlated via `settings.equals` exists. |
Kind string `json:"kind" toon:"kind"`
// Kind-specific settings. Shape depends on `kind`:
// - `title_reset`: `{ "title": "<string>" }`
// - `description_reset`: `{ "description": "<string>" }`
// - `severity_reset`: `{ "severity": "Critical"|"Warning"|"Info" }`
// - `alert_drop`: `{}` (empty object)
// - `alert_inhibit`: `{ "equals": ["<label_key>", ...], "source_filters": <OrFilterGroup> }`
Settings any `json:"settings,omitempty" toon:"settings,omitempty"`
}
AlertPipeline is generated from the Flashduty OpenAPI schema.
type AlertPipelineInfoRequest ¶
type AlertPipelineInfoRequest struct {
// Integration ID. Must be greater than 0.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
AlertPipelineInfoRequest is generated from the Flashduty OpenAPI schema.
type AlertPipelineItem ¶
type AlertPipelineItem struct {
// Creation timestamp, Unix epoch seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Member ID who created the pipeline.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Soft-delete time, Unix epoch seconds. Omitted when not deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Integration ID this pipeline applies to.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Ordered list of processing rules.
Rules []AlertPipeline `json:"rules" toon:"rules"`
// Pipeline status. Always `enabled` in these responses — deleted pipelines are filtered out.
Status string `json:"status" toon:"status"`
// Last update timestamp, Unix epoch seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Member ID who last updated the pipeline.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
AlertPipelineItem is generated from the Flashduty OpenAPI schema.
type AlertPipelineListRequest ¶
type AlertPipelineListRequest struct {
// Integration IDs. At least one entry is required.
IntegrationIDs []int64 `json:"integration_ids" toon:"integration_ids"`
}
AlertPipelineListRequest is generated from the Flashduty OpenAPI schema.
type AlertPipelineListResponse ¶
type AlertPipelineListResponse struct {
// Alert pipeline configuration of each requested integration, one item per configured integration.
Items []AlertPipelineItem `json:"items" toon:"items"`
}
AlertPipelineListResponse is generated from the Flashduty OpenAPI schema.
type AlertPipelinePreviewEvent ¶ added in v0.16.0
type AlertPipelinePreviewEvent struct {
// Event description.
Description string `json:"description" toon:"description"`
// Label set.
Labels map[string]string `json:"labels" toon:"labels"`
// Severity the event carried at this point. Empty for a recovery event sent without `event_severity`.
Severity string `json:"severity" toon:"severity"`
// Event title.
Title string `json:"title" toon:"title"`
}
AlertPipelinePreviewEvent is generated from the Flashduty OpenAPI schema.
type AlertPipelinePreviewRequest ¶ added in v0.16.0
type AlertPipelinePreviewRequest struct {
// The event to run the rules over.
Event AlertEvent `json:"event" toon:"event"`
// Integration whose saved enrichment runs first and whose pipeline context the preview uses.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Alert processing rules to try, in order. At most 50. The integration's stored pipeline is not used.
Rules []AlertPipeline `json:"rules,omitempty" toon:"rules,omitempty"`
}
AlertPipelinePreviewRequest is generated from the Flashduty OpenAPI schema.
type AlertPipelinePreviewResponse ¶ added in v0.16.0
type AlertPipelinePreviewResponse struct {
// The event as notification templates would render it once the rules ran.
After AlertPipelinePreviewEvent `json:"after" toon:"after"`
// The event as it arrived.
Before AlertPipelinePreviewEvent `json:"before" toon:"before"`
// `true` when a rule dropped the event, so no alert would be created.
Dropped bool `json:"dropped" toon:"dropped"`
// `true` when a rule inhibited the event because a matching source alert is active.
Inhibited bool `json:"inhibited" toon:"inhibited"`
// `true` when the event is a recovery event: ingestion closes the alert without running the pipeline.
IsRecovery bool `json:"is_recovery" toon:"is_recovery"`
// One entry per rule, in the order they ran.
Steps []PipelineStep `json:"steps" toon:"steps"`
}
AlertPipelinePreviewResponse is generated from the Flashduty OpenAPI schema.
type AlertPipelineUpsertRequest ¶
type AlertPipelineUpsertRequest struct {
// ID of the integration to configure; account-level and channel-owned integrations are both accepted.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Rules to apply, evaluated in array order. At most 50 entries; an empty array removes all rules.
Rules []AlertPipeline `json:"rules" toon:"rules"`
}
AlertPipelineUpsertRequest is generated from the Flashduty OpenAPI schema.
type AlertRule ¶
type AlertRule struct {
// Account ID. Filled by the server from the authenticated identity; do not provide.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Annotation key-value pairs delivered with alert events; keys must not start with `$` (reserved for query fields).
Annotations map[string]string `json:"annotations" toon:"annotations"`
// Channel IDs to send alerts to.
ChannelIDs []uint64 `json:"channel_ids" toon:"channel_ids"`
// Creation time as a Unix timestamp in seconds. Generated by the server; do not provide.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator user ID. Filled by the server from the current user; do not provide.
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Creator name. Filled by the server; do not provide.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Schedule expression: a 6-field cron (with seconds) or an `@every 30s` interval descriptor. Must not start with `CRON_TZ=` or `TZ=`; use the `timezone` field instead.
CronPattern string `json:"cron_pattern" toon:"cron_pattern"`
// Whether to enable debug logging; the edge emits detailed evaluation logs, useful for troubleshooting rules that do not trigger as expected.
DebugLogEnabled bool `json:"debug_log_enabled" toon:"debug_log_enabled"`
// Seconds to shift the evaluation query window backward, compensating for data ingestion latency.
DelaySeconds int64 `json:"delay_seconds" toon:"delay_seconds"`
// Rule description, in Markdown.
Description string `json:"description" toon:"description"`
// Format for the description. Defaults to `text` when omitted or empty. `text` = plain text; `markdown` = Markdown, rendered as Markdown in alert details.
DescriptionType string `json:"description_type" toon:"description_type"`
// Datasource IDs, merged with `ds_list` to decide which datasources the rule monitors; IDs survive datasource renames. At least one of `ds_list` and `ds_ids` must be provided.
DsIDs []uint64 `json:"ds_ids" toon:"ds_ids"`
// Data source name patterns (supports wildcards). At least one of `ds_list` / `ds_ids` must be non-empty; the two are merged to decide which datasources the rule monitors.
DsList []string `json:"ds_list" toon:"ds_list"`
// Datasource type identifier (e.g. `prometheus`, `elasticsearch`).
DsType string `json:"ds_type" toon:"ds_type"`
// Whether the rule is enabled. Updating to `false` makes the server clean up the rule's active alerts.
Enabled bool `json:"enabled" toon:"enabled"`
// Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.
EnabledTimes []AlertRuleEnabledTimesItem `json:"enabled_times" toon:"enabled_times"`
// ID of the folder the rule belongs to. Obtainable via `POST /monit/folder/list`.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Rule ID. Required for update; omit for create (assigned by the server).
ID uint64 `json:"id" toon:"id"`
// Custom labels.
Labels map[string]string `json:"labels" toon:"labels"`
// Rule name. Must be unique within the same folder.
Name string `json:"name" toon:"name"`
// Notification repeat interval in seconds.
RepeatInterval int64 `json:"repeat_interval" toon:"repeat_interval"`
// Max number of repeat notifications.
RepeatTotal int64 `json:"repeat_total" toon:"repeat_total"`
// Check configuration: query list plus trigger/recovery conditions. Structure see `RuleConfigs`.
RuleConfigs RuleConfigs `json:"rule_configs" toon:"rule_configs"`
// Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. `Asia/Shanghai`, `UTC`, `Europe/London`); shortcuts and offsets such as `Local`, `UTC+8`, or `CST` are rejected. Treated as `Asia/Shanghai` if empty.
Timezone string `json:"timezone" toon:"timezone"`
// Last update time as a Unix timestamp in seconds. Generated by the server; do not provide.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Last updater user ID. Filled by the server; do not provide.
UpdaterID uint64 `json:"updater_id" toon:"updater_id"`
// Last updater name. Filled by the server; do not provide.
UpdaterName string `json:"updater_name" toon:"updater_name"`
}
AlertRule is generated from the Flashduty OpenAPI schema.
type AlertRuleAnyDataV2 ¶ added in v0.15.2
type AlertRuleAnyDataV2 struct {
// Fire after the alert condition is met this many times; when enabled, minimum 1 and maximum 10000. Combined with `alerting_window_size` it means at least N hits within the last M evaluations.
AlertingCheckTimes int64 `json:"alerting_check_times,omitempty" toon:"alerting_check_times,omitempty"`
// Optional sliding window size M: fire only when the condition is met at least `alerting_check_times` times within the last M evaluations. Omit for consecutive mode. Must satisfy `alerting_check_times` <= M <= 10000.
AlertingWindowSize int64 `json:"alerting_window_size,omitempty" toon:"alerting_window_size,omitempty"`
// Whether the any-data check is enabled: any returned data row triggers an alert.
Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// Recovery evaluation config. Required (with non-empty `recovery.expr`) only when `recovery_mode` is `recovery_query_match`; must be omitted for the other modes.
Recovery AlertRuleRecoveryQueryV2 `json:"recovery,omitzero" toon:"recovery,omitempty"`
// Recover after the recovery condition is met this many times; minimum 1 when enabled.
RecoveryCheckTimes int64 `json:"recovery_check_times,omitempty" toon:"recovery_check_times,omitempty"`
// How recovery is decided (lifecycle v2); required when enabled. `data_absent` = recover when the query returns no data; `recovery` is not allowed. `recovery_query_match` = recover when the `recovery.expr` query expression evaluates true; only a single query (`name=A`) is allowed. `manual` = never recover automatically; alerts need manual handling, no recovery event is pushed, and `recovery` is not allowed.
RecoveryMode string `json:"recovery_mode,omitempty" toon:"recovery_mode,omitempty"`
// Severity of any-data alerts, case-sensitive; required when enabled.
Severity string `json:"severity,omitempty" toon:"severity,omitempty"`
}
AlertRuleAnyDataV2 is generated from the Flashduty OpenAPI schema.
type AlertRuleAudit ¶
type AlertRuleAudit struct {
// ID of the account that owns the rule.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Action performed: `create` = rule created; `update` = rule updated (covers full updates, field-batch updates, imports and moves).
Action string `json:"action" toon:"action"`
// ID of the alert rule this record belongs to.
AlertRuleID uint64 `json:"alert_rule_id" toon:"alert_rule_id"`
// JSON string of the full rule right after the change. Populated on `/monit/rule/audit/detail`, omitted on list responses. Records written by `/monit/rule/v2/create` and `/monit/rule/v2/update` use the `AlertRuleV2` shape; records written by `/monit/rule/update/fields` and `/monit/rule/move` use the stored rule shape, whose checker configs carry legacy recovery settings instead of `recovery_mode` / `end_mode`.
Content string `json:"content" toon:"content"`
// When this audit record was produced, as a Unix timestamp in seconds; equals the rule's `updated_at` at change time.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the user who made this change (taken from the rule's `updater_id` at change time).
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Name of the user who made this change (taken from the rule's `updater_name` at change time).
CreatorName string `json:"creator_name" toon:"creator_name"`
// Audit record ID.
ID uint64 `json:"id" toon:"id"`
}
AlertRuleAudit is generated from the Flashduty OpenAPI schema.
type AlertRuleBasic ¶
type AlertRuleBasic struct {
// ID of the account that owns the rule; `0` in `include_descendants: true` listings.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Number of currently active (unrecovered) alerts fired by this rule. `triggered` equals `active_alert_count > 0`.
ActiveAlertCount int64 `json:"active_alert_count" toon:"active_alert_count"`
// Creation time, as a Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the user who created the rule.
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Name of the user who created the rule.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Schedule expression: a 6-field cron with seconds, e.g. `0 * * * * *`, or an `@every 30s` interval descriptor. Must not start with `CRON_TZ=` or `TZ=`; use the `timezone` field instead.
CronPattern string `json:"cron_pattern" toon:"cron_pattern"`
// Whether debug logging is on; when `true` the edge writes detailed evaluation logs for this rule.
DebugLogEnabled bool `json:"debug_log_enabled" toon:"debug_log_enabled"`
// Seconds the evaluation query window is shifted back to allow for data ingestion latency.
DelaySeconds int64 `json:"delay_seconds" toon:"delay_seconds"`
// Datasource type the rule queries. Types that support alerting: `prometheus`, `elasticsearch`, `loki`, `clickhouse`, `mysql`, `oracle`, `postgres`, `sls`, `tencent_cls`, `victorialogs`. Only enabled rules are checked against this list, so a disabled rule may carry another value; empty in `include_descendants: true` listings.
DsType string `json:"ds_type" toon:"ds_type"`
// Whether the rule is enabled.
Enabled bool `json:"enabled" toon:"enabled"`
// ID of the folder that directly contains the rule; in `include_descendants: true` listings it can be a descendant of the requested folder.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Unique rule ID.
ID uint64 `json:"id" toon:"id"`
// Custom labels the rule adds to its alert events; `null` in `include_descendants: true` listings.
Labels map[string]string `json:"labels" toon:"labels"`
// Rule name, unique within its folder (at most 128 characters).
Name string `json:"name" toon:"name"`
// Runtime evaluation state, derived from edge heartbeats and the edge-reported rule status. Omitted when the state is unavailable.
//
// | Value | Meaning |
// |---|---|
// | `disabled` | The rule is disabled. |
// | `offline` | The edge instance or cluster owning this rule is offline. |
// | `abnormal` | The edge reports evaluation errors. |
// | `stale` | The edge's runtime status report is outdated. |
// | `no_datasource` | No datasource currently matches the rule's `ds_list` / `ds_ids`. |
// | `config_pending` | The latest rule config has not been delivered to the edge yet. |
// | `outside_enabled_time` | Enabled, but the current time is outside the rule's `enabled_times`. |
// | `waiting` | Enabled, but the edge has not reported runtime status yet. |
// | `normal` | Evaluating normally. |
RuntimeState string `json:"runtime_state" toon:"runtime_state"`
// Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. `Asia/Shanghai`, `UTC`, `Europe/London`); shortcuts and offsets such as `Local`, `UTC+8`, or `CST` are rejected. Treated as `Asia/Shanghai` if empty.
Timezone string `json:"timezone" toon:"timezone"`
// True if the rule currently has active alerts.
Triggered bool `json:"triggered" toon:"triggered"`
// Last modification time, as a Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the user who last modified the rule.
UpdaterID uint64 `json:"updater_id" toon:"updater_id"`
// Name of the user who last modified the rule.
UpdaterName string `json:"updater_name" toon:"updater_name"`
}
AlertRuleBasic is generated from the Flashduty OpenAPI schema.
type AlertRuleConfigsV2 ¶ added in v0.15.2
type AlertRuleConfigsV2 struct {
// Any-data check configuration: fires when a query returns any data row. See `AlertRuleAnyDataV2`.
CheckAnydata AlertRuleAnyDataV2 `json:"check_anydata,omitzero" toon:"check_anydata,omitempty"`
// No-data check configuration. See `AlertRuleNoDataV2`.
CheckNodata AlertRuleNoDataV2 `json:"check_nodata,omitzero" toon:"check_nodata,omitempty"`
// Threshold check configuration. See `AlertRuleThresholdV2`.
CheckThreshold AlertRuleThresholdV2 `json:"check_threshold,omitzero" toon:"check_threshold,omitempty"`
// Query list with at least one entry; each needs a unique `name` (`R` and `__all__` are reserved) and a non-empty, non-duplicated `expr`.
Queries []AlertRuleConfigsV2QueriesItem `json:"queries" toon:"queries"`
// Optional auxiliary queries whose results attach to alert events as context. Each entry needs a unique `name` (not colliding with any query name) and a non-empty `expr`. Always returned, as `[]` when there are none.
RelateQueries []AlertRuleConfigsV2RelateQueriesItem `json:"relate_queries,omitempty" toon:"relate_queries,omitempty"`
}
AlertRuleConfigsV2 is generated from the Flashduty OpenAPI schema.
type AlertRuleConfigsV2QueriesItem ¶ added in v0.15.2
type AlertRuleConfigsV2QueriesItem struct {
// Datasource-specific query parameters; keys follow the `<datasource>.<param>` convention (e.g. `es.type`, `tencent_cls.limit`). Most datasources need none.
Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
// Query expression.
Expr string `json:"expr,omitempty" toon:"expr,omitempty"`
// Result fields used as alert event labels; rows with the same label set form one alert. Must not overlap `value_fields`; applies to tabular results (SQL/ES-like datasources).
LabelFields []string `json:"label_fields,omitempty" toon:"label_fields,omitempty"`
// Query identifier (e.g. `A`), must match `[A-Za-z][A-Za-z0-9_]*`; `R` and `__all__` are reserved and cannot be used.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Numeric result fields evaluated by threshold expressions (referenced as `$A.<field>`); required for threshold checks when the datasource is not `prometheus`/`loki`/`victorialogs`. Field names must not contain `.`.
ValueFields []string `json:"value_fields,omitempty" toon:"value_fields,omitempty"`
}
AlertRuleConfigsV2QueriesItem is generated from the Flashduty OpenAPI schema.
type AlertRuleConfigsV2RelateQueriesItem ¶ added in v0.15.2
type AlertRuleConfigsV2RelateQueriesItem struct {
// Datasource-specific parameters for the auxiliary query; same convention as `queries[].args`.
Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
// Query expression.
Expr string `json:"expr,omitempty" toon:"expr,omitempty"`
// Auxiliary query identifier.
Name string `json:"name,omitempty" toon:"name,omitempty"`
}
AlertRuleConfigsV2RelateQueriesItem is generated from the Flashduty OpenAPI schema.
type AlertRuleCounter ¶
type AlertRuleCounter struct {
// ID of the account this snapshot belongs to.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Sample timestamp, Unix epoch seconds.
Clock Timestamp `json:"clock" toon:"clock"`
// ID of this snapshot record.
ID uint64 `json:"id" toon:"id"`
// Rule count at the sample time.
Num int64 `json:"num" toon:"num"`
}
AlertRuleCounter is generated from the Flashduty OpenAPI schema.
type AlertRuleEnabledTimesItem ¶
type AlertRuleEnabledTimesItem struct {
// Days of week (0=Sunday).
Days []int64 `json:"days" toon:"days"`
// End time, e.g. `18:00`.
Etime string `json:"etime" toon:"etime"`
// Start time, e.g. `09:00`.
Stime string `json:"stime" toon:"stime"`
}
AlertRuleEnabledTimesItem is generated from the Flashduty OpenAPI schema.
type AlertRuleExport ¶
type AlertRuleExport struct {
// Custom annotation key-value pairs attached to alert events; keys must not start with `$` (reserved for query field references).
Annotations map[string]string `json:"annotations" toon:"annotations"`
// Evaluation schedule as a 6-field cron expression (seconds included) or `@every <duration>` (an integral number of seconds, at least 1s); `CRON_TZ=`/`TZ=` prefixes are rejected — set the timezone in `timezone` instead.
CronPattern string `json:"cron_pattern" toon:"cron_pattern"`
// Whether to emit debug logs for this rule's evaluations; enable when troubleshooting.
DebugLogEnabled bool `json:"debug_log_enabled" toon:"debug_log_enabled"`
// Query time offset in seconds: each evaluation reads data as of `schedule time − delay_seconds` to tolerate ingestion lag; `0` means no offset.
DelaySeconds int64 `json:"delay_seconds" toon:"delay_seconds"`
// Rule description in the format given by `description_type`, shown with alert events.
Description string `json:"description" toon:"description"`
// Format of `description`, `text` or `markdown`; treated as `text` when omitted.
DescriptionType string `json:"description_type" toon:"description_type"`
// Datasource ID list, merged with `ds_list`; references by ID and is therefore immune to datasource renames.
DsIDs []uint64 `json:"ds_ids" toon:"ds_ids"`
// Datasource name list with wildcard support; merged with `ds_ids` to decide which datasources the rule monitors — must be maintained by hand if a datasource is renamed.
DsList []string `json:"ds_list" toon:"ds_list"`
// Datasource type ident, e.g. `prometheus`; must be a datasource type (`ident`) that exists in the import target environment.
DsType string `json:"ds_type" toon:"ds_type"`
// Whether the rule is enabled; rules imported as disabled are not evaluated.
Enabled bool `json:"enabled" toon:"enabled"`
// Effective time windows; each entry has `days` (0–6, 0 = Sunday) and `stime`/`etime` (`HH:MM`), interpreted in the rule's `timezone`; an empty list disables the rule.
EnabledTimes []EnabledTime `json:"enabled_times" toon:"enabled_times"`
// Custom label key-value pairs attached to alert events produced by this rule.
Labels map[string]string `json:"labels" toon:"labels"`
// Rule name, up to 128 characters when imported.
Name string `json:"name" toon:"name"`
// Interval in seconds between repeated notifications for a firing alert; values below 1 fall back to the default of 3600.
RepeatInterval int64 `json:"repeat_interval" toon:"repeat_interval"`
// Maximum number of repeated notifications for the same alert; values below 1 fall back to the default of 3.
RepeatTotal int64 `json:"repeat_total" toon:"repeat_total"`
RuleConfigs RuleConfigs `json:"rule_configs" toon:"rule_configs"`
// Timezone in which the rule executes. IANA timezone name; defaults to `Asia/Shanghai`.
Timezone string `json:"timezone" toon:"timezone"`
}
AlertRuleExport is generated from the Flashduty OpenAPI schema.
type AlertRuleExportListResponse ¶
type AlertRuleExportListResponse []AlertRuleExport
AlertRuleExportListResponse is a list response payload.
type AlertRuleNoDataV2 ¶ added in v0.15.2
type AlertRuleNoDataV2 struct {
// Whether to alert when all queries return empty results (global empty-result check).
AlertOnEmptyResult bool `json:"alert_on_empty_result,omitempty" toon:"alert_on_empty_result,omitempty"`
// Severity of empty-result alerts, case-sensitive; only takes effect and is required when `alert_on_empty_result` is on.
AlertOnEmptyResultSeverity string `json:"alert_on_empty_result_severity,omitempty" toon:"alert_on_empty_result_severity,omitempty"`
// Fire after the alert condition is met this many times; when enabled, minimum 1 and maximum 10000. Combined with `alerting_window_size` it means at least N hits within the last M evaluations.
AlertingCheckTimes int64 `json:"alerting_check_times,omitempty" toon:"alerting_check_times,omitempty"`
// Optional sliding window size M: fire only when the condition is met at least `alerting_check_times` times within the last M evaluations. Omit for consecutive mode. Must satisfy `alerting_check_times` <= M <= 10000.
AlertingWindowSize int64 `json:"alerting_window_size,omitempty" toon:"alerting_window_size,omitempty"`
// Seconds to wait before auto-closing. Allowed and required to be positive only when `end_mode` is `data_reappears_or_timeout`; must be 0 for the other modes.
AutoCloseAfterSeconds int64 `json:"auto_close_after_seconds,omitempty" toon:"auto_close_after_seconds,omitempty"`
// Whether the per-series no-data check is enabled: series that previously reported data trigger an alert when data disappears.
Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// How a no-data alert ends (lifecycle v2); required when enabled. `data_reappears` = recover when data reappears. `data_reappears_or_timeout` = end when data reappears or after `auto_close_after_seconds` seconds, whichever comes first; requires the per-series no-data check and a positive `auto_close_after_seconds`. `manual` = never end automatically; alerts need manual handling and no recovery event is pushed. For `data_reappears` and `manual`, `auto_close_after_seconds` must be 0.
EndMode string `json:"end_mode,omitempty" toon:"end_mode,omitempty"`
// Recover after the recovery condition is met this many times; minimum 1 when enabled.
RecoveryCheckTimes int64 `json:"recovery_check_times,omitempty" toon:"recovery_check_times,omitempty"`
// Severity of no-data alerts, case-sensitive; required when the per-series check is enabled.
Severity string `json:"severity,omitempty" toon:"severity,omitempty"`
}
AlertRuleNoDataV2 is generated from the Flashduty OpenAPI schema.
type AlertRuleRecoveryQueryV2 ¶ added in v0.15.2
type AlertRuleRecoveryQueryV2 struct {
// Datasource-specific parameters for the recovery query; keys follow the same `<datasource>.<param>` convention as a query's `args`. Not returned when empty.
Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
// Recovery condition expression: a threshold expression (e.g. `$A < 90`) in `expression_match` mode, a query expression in `recovery_query_match` mode. Required and non-empty when the corresponding mode is enabled.
Expr string `json:"expr,omitempty" toon:"expr,omitempty"`
// Numeric result fields the recovery expression references as `$A.<field>`; same semantics as a query's `value_fields`. Not returned when empty.
ValueFields []string `json:"value_fields,omitempty" toon:"value_fields,omitempty"`
}
AlertRuleRecoveryQueryV2 is generated from the Flashduty OpenAPI schema.
type AlertRuleThresholdV2 ¶ added in v0.15.2
type AlertRuleThresholdV2 struct {
// Fire after the alert condition is met this many times; when enabled, minimum 1 and maximum 10000. Combined with `alerting_window_size` it means at least N hits within the last M evaluations.
AlertingCheckTimes int64 `json:"alerting_check_times,omitempty" toon:"alerting_check_times,omitempty"`
// Optional sliding window size M: fire only when the condition is met at least `alerting_check_times` times within the last M evaluations. Omit for consecutive mode (N consecutive hits). Must satisfy `alerting_check_times` <= M <= 10000.
AlertingWindowSize int64 `json:"alerting_window_size,omitempty" toon:"alerting_window_size,omitempty"`
// Critical threshold expression referencing query results as `$<query>` or `$<query>.<value_field>`, e.g. `$A > 90`; when enabled at least one of the three severities must be set.
Critical string `json:"critical,omitempty" toon:"critical,omitempty"`
// Whether the threshold check is enabled.
Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// Info threshold expression; same syntax as `critical`.
Info string `json:"info,omitempty" toon:"info,omitempty"`
// Recovery evaluation config. Required (with non-empty `recovery.expr`) only when `recovery_mode` is `expression_match` or `recovery_query_match`; must be omitted for the other modes.
Recovery AlertRuleRecoveryQueryV2 `json:"recovery,omitzero" toon:"recovery,omitempty"`
// Recover after the recovery condition is met this many times; minimum 1 when enabled.
RecoveryCheckTimes int64 `json:"recovery_check_times,omitempty" toon:"recovery_check_times,omitempty"`
// How recovery is decided (lifecycle v2); required when enabled. `condition_clear` = recover once the alert expression no longer holds; `recovery` is not allowed. `expression_match` = recover when the `recovery.expr` threshold expression holds. `recovery_query_match` = recover when the `recovery.expr` query expression evaluates true. `manual` = never recover automatically; alerts need manual handling, no recovery event is pushed, and `recovery` is not allowed.
RecoveryMode string `json:"recovery_mode,omitempty" toon:"recovery_mode,omitempty"`
// Warning threshold expression; same syntax as `critical`.
Warning string `json:"warning,omitempty" toon:"warning,omitempty"`
}
AlertRuleThresholdV2 is generated from the Flashduty OpenAPI schema.
type AlertRuleV2 ¶ added in v0.15.2
type AlertRuleV2 struct {
// Account ID, filled by the server from the authentication context; any client-supplied value is ignored.
AccountID uint64 `json:"account_id,omitempty" toon:"account_id,omitempty"`
// Extra annotation key-value pairs delivered with alert events; keys must not start with `$` (reserved for query fields). The serialized JSON may not exceed 512 characters.
Annotations map[string]string `json:"annotations,omitempty" toon:"annotations,omitempty"`
// Collaboration space IDs alerts are sent to. May be empty; alerts then route through the global integration. The serialized JSON may not exceed 255 characters.
ChannelIDs []uint64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Creation time as a Unix timestamp in seconds, generated by the server; any client-supplied value is ignored.
CreatedAt int64 `json:"created_at,omitempty" toon:"created_at,omitempty"`
// Creator member ID, filled by the server from the current user; any client-supplied value is ignored.
CreatorID uint64 `json:"creator_id,omitempty" toon:"creator_id,omitempty"`
// Creator name, filled by the server; any client-supplied value is ignored.
CreatorName string `json:"creator_name,omitempty" toon:"creator_name,omitempty"`
// Schedule expression: a 6-field cron with seconds (e.g. `0 * * * * *`), a descriptor such as `@hourly`, or `@every <duration>` with a whole number of seconds of at least `1s` (e.g. `@every 30s`). Must not start with `CRON_TZ=` or `TZ=`; set the timezone in the `timezone` field instead.
CronPattern string `json:"cron_pattern" toon:"cron_pattern"`
// Enable debug logging; the edge then emits detailed evaluation logs for this rule, useful when the rule does not trigger as expected.
DebugLogEnabled bool `json:"debug_log_enabled,omitempty" toon:"debug_log_enabled,omitempty"`
// Seconds the evaluation query window is shifted back, compensating for data ingestion latency.
DelaySeconds int64 `json:"delay_seconds,omitempty" toon:"delay_seconds,omitempty"`
// Rule description; rendered as plain text or Markdown according to `description_type`.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Format of the description content. Empty or omitted defaults to `text`. `text` = plain text; `markdown` = Markdown, rendered as such in alert details.
DescriptionType string `json:"description_type,omitempty" toon:"description_type,omitempty"`
// Datasource ID list, merged with `ds_list` to decide the monitored datasources; IDs survive datasource renames. At least one of `ds_list` / `ds_ids` must be provided. The serialized JSON may not exceed 512 characters.
DsIDs []uint64 `json:"ds_ids,omitempty" toon:"ds_ids,omitempty"`
// Datasource name match patterns (wildcards supported). At least one of `ds_list` / `ds_ids` must be non-empty; both are merged to decide which datasources the rule monitors. The serialized JSON may not exceed 512 characters.
DsList []string `json:"ds_list,omitempty" toon:"ds_list,omitempty"`
// Datasource type the rule queries. When the rule is enabled it must be a type that supports alerting: `prometheus`, `elasticsearch`, `loki`, `clickhouse`, `mysql`, `oracle`, `postgres`, `sls`, `tencent_cls`, `victorialogs`.
DsType string `json:"ds_type" toon:"ds_type"`
// Whether the rule is enabled. Required — the server enforces an explicit value (including `false`) while decoding. Setting it to `false` on update clears the rule's active alerts.
Enabled bool `json:"enabled" toon:"enabled"`
// Time windows during which the rule is in effect. When omitted or empty, the rule is active 00:00–23:59 every day. The serialized JSON may not exceed 512 characters.
EnabledTimes []AlertRuleV2EnabledTimesItem `json:"enabled_times,omitempty" toon:"enabled_times,omitempty"`
// ID of the folder the rule belongs to; list folders via `POST /monit/folder/list`. Cannot be changed through the update API — use `/monit/rule/move` instead.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Rule ID. Required on update; omit on create (assigned by the server).
ID uint64 `json:"id,omitempty" toon:"id,omitempty"`
// Drill-down entries linked from the alert event detail page; at most 20 items, duplicates rejected, and at most 32 KiB once serialized. On update the field is presence-based: omit it to keep the current value, pass `[]` to clear; `null` is rejected.
InvestigationTargets []InvestigationTarget `json:"investigation_targets,omitzero" toon:"investigation_targets,omitempty"`
// Custom labels added to every alert event of the rule. Keys are trimmed, must not be empty and must not start with `__alert_rule_` (reserved); values containing `{{` are rendered as templates when events are delivered; `job` and `instance` values are limited to 255 characters. The serialized object may not exceed 1024 characters.
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Rule name. Must be unique within the folder and at most 128 characters.
Name string `json:"name" toon:"name"`
// Notification repeat interval in seconds. Values below 1 fall back to the default 3600; maximum 2147483647.
RepeatInterval int64 `json:"repeat_interval,omitempty" toon:"repeat_interval,omitempty"`
// Maximum number of repeat notifications. Values below 1 fall back to the default 3; maximum 2147483647.
RepeatTotal int64 `json:"repeat_total,omitempty" toon:"repeat_total,omitempty"`
// Detection configuration: query list plus trigger/recovery conditions. See `AlertRuleConfigsV2`. The serialized JSON may not exceed 65,535 bytes.
RuleConfigs AlertRuleConfigsV2 `json:"rule_configs" toon:"rule_configs"`
// Timezone the rule runs in; it decides how the cron schedule and enabled time windows are interpreted. Only IANA names are accepted (e.g. `Asia/Shanghai`, `UTC`, `Europe/London`); abbreviations or offsets like `Local`, `UTC+8`, `CST` are rejected. Empty falls back to `Asia/Shanghai`.
Timezone string `json:"timezone,omitempty" toon:"timezone,omitempty"`
// Last update time as a Unix timestamp in seconds, generated by the server; any client-supplied value is ignored.
UpdatedAt int64 `json:"updated_at,omitempty" toon:"updated_at,omitempty"`
// ID of the member who last updated the rule, filled by the server; any client-supplied value is ignored.
UpdaterID uint64 `json:"updater_id,omitempty" toon:"updater_id,omitempty"`
// Name of the member who last updated the rule, filled by the server; any client-supplied value is ignored.
UpdaterName string `json:"updater_name,omitempty" toon:"updater_name,omitempty"`
}
AlertRuleV2 is generated from the Flashduty OpenAPI schema.
type AlertRuleV2EnabledTimesItem ¶ added in v0.15.2
type AlertRuleV2EnabledTimesItem struct {
// Days of week the window applies to, `0` = Sunday through `6` = Saturday; non-empty, no duplicates.
Days []int64 `json:"days,omitempty" toon:"days,omitempty"`
// End time in 24-hour `HH:MM` format, e.g. `18:00`.
Etime string `json:"etime,omitempty" toon:"etime,omitempty"`
// Start time in 24-hour `HH:MM` format, e.g. `09:00`.
Stime string `json:"stime,omitempty" toon:"stime,omitempty"`
}
AlertRuleV2EnabledTimesItem is generated from the Flashduty OpenAPI schema.
type AlertRulesService ¶
type AlertRulesService service
AlertRulesService handles the "Monitors/Alert rules" API resource.
func (*AlertRulesService) ReadAuditDetail ¶
func (s *AlertRulesService) ReadAuditDetail(ctx context.Context, req *AuditRecordIDRequest) (*AlertRuleAudit, *Response, error)
Get rule audit snapshot.
Return one audit record of an alert rule, including the rule snapshot stored in `content`.
API: POST /monit/rule/audit/detail (monit-rule-read-audit-detail).
func (*AlertRulesService) ReadAudits ¶
func (s *AlertRulesService) ReadAudits(ctx context.Context, req *RuleIDRequest) (*RuleAuditListResponse, *Response, error)
List rule change history.
Return the change history (audit records) for an alert rule.
API: POST /monit/rule/audits (monit-rule-read-audits).
func (*AlertRulesService) ReadCounterChannel ¶
func (s *AlertRulesService) ReadCounterChannel(ctx context.Context) (*RuleCounterChannelResponse, *Response, error)
Get rule counts by channel.
Return how many alert rules route alerts to each collaboration space, keyed by space name.
API: POST /monit/rule/counter/channel (monit-rule-read-counter-channel).
func (*AlertRulesService) ReadCounterTotal ¶
func (s *AlertRulesService) ReadCounterTotal(ctx context.Context) (*RuleCounterTotalResponse, *Response, error)
Get rule counter time series.
Return the stored time series of the total rule count across the account — one sample per `clock` timestamp.
API: POST /monit/rule/counter/total (monit-rule-read-counter-total).
func (*AlertRulesService) ReadInfoV2 ¶ added in v0.15.2
func (s *AlertRulesService) ReadInfoV2(ctx context.Context, req *RuleIDRequest) (*AlertRuleV2, *Response, error)
Get alert rule detail (V2).
Return the full V2 configuration of an alert rule by ID, including lifecycle v2 recovery and ending modes.
API: POST /monit/rule/v2/info (monit-rule-read-info-v2).
func (*AlertRulesService) ReadList ¶
func (s *AlertRulesService) ReadList(ctx context.Context, req *RuleListRequest) (*RuleBasicListResponse, *Response, error)
List alert rules.
Return basic information for the alert rules in a folder; call `POST /monit/rule/v2/info` for full details.
API: POST /monit/rule/list/basic (monit-rule-read-list).
func (*AlertRulesService) WriteCreateV2 ¶ added in v0.15.2
func (s *AlertRulesService) WriteCreateV2(ctx context.Context, req *AlertRuleV2) (*AlertRuleV2, *Response, error)
Create alert rule (V2).
Create a new V2 alert rule. Returns the created rule with its assigned ID.
API: POST /monit/rule/v2/create (monit-rule-write-create-v2).
func (*AlertRulesService) WriteDelete ¶
func (s *AlertRulesService) WriteDelete(ctx context.Context, req *RuleIDRequest) (*Response, error)
Delete alert rule.
Delete a single alert rule by its ID.
API: POST /monit/rule/delete (monit-rule-write-delete).
func (*AlertRulesService) WriteDeleteBatch ¶
func (s *AlertRulesService) WriteDeleteBatch(ctx context.Context, req *RuleIDsRequest) (*Response, error)
Batch delete alert rules.
Delete multiple alert rules in a single request.
API: POST /monit/rule/delete/batch (monit-rule-write-delete-batch).
func (*AlertRulesService) WriteFieldsUpdate ¶
func (s *AlertRulesService) WriteFieldsUpdate(ctx context.Context, req *RuleFieldsUpdateRequest) (*RuleNameMessageListResponse, *Response, error)
Batch update rule fields.
Update the fields listed in `fields` on multiple alert rules in one call.
API: POST /monit/rule/update/fields (monit-rule-write-fields-update).
func (*AlertRulesService) WriteMove ¶
func (s *AlertRulesService) WriteMove(ctx context.Context, req *RuleMoveRequest) (*RuleNameMessageListResponse, *Response, error)
Move alert rules to folder.
Move one or more alert rules to a different folder.
API: POST /monit/rule/move (monit-rule-write-move).
func (*AlertRulesService) WriteUpdateV2 ¶ added in v0.15.2
func (s *AlertRulesService) WriteUpdateV2(ctx context.Context, req *AlertRuleV2) (*AlertRuleV2, *Response, error)
Update alert rule (V2).
Replace an alert rule's V2 configuration in full by ID. Returns the updated rule.
API: POST /monit/rule/v2/update (monit-rule-write-update-v2).
type AlertShort ¶ added in v0.14.3
type AlertShort struct {
// Alert ID (ObjectID hex string).
AlertID string `json:"alert_id" toon:"alert_id"`
// Alert title, resolved at read time. Omitted when empty.
Title string `json:"title" toon:"title"`
}
AlertShort is generated from the Flashduty OpenAPI schema.
type AlertsService ¶
type AlertsService service
AlertsService handles the "On-call/Alerts" API resource.
func (*AlertsService) EventReadList ¶
func (s *AlertsService) EventReadList(ctx context.Context, req *AlertEventGlobalListRequest) (*AlertEventGlobalListResponse, *Response, error)
List raw alert events.
Return a cursor-paginated list of raw alert events across all alerts, with filtering by integration, channel, time range, and severity.
API: POST /alert-event/list (alert-event-read-list).
func (*AlertsService) ReadEventList ¶
func (s *AlertsService) ReadEventList(ctx context.Context, req *AlertEventListRequest) (*AlertEventListResponse, *Response, error)
List events for an alert.
Return raw events for an alert with cursor or page-number pagination.
API: POST /alert/event/list (alert-read-event-list).
func (*AlertsService) ReadFeed ¶
func (s *AlertsService) ReadFeed(ctx context.Context, req *AlertFeedRequest) (*AlertFeedResponse, *Response, error)
List alert activity feed.
Return the activity feed (comments, state changes, merges, silence events) for a single alert, with page-based pagination.
API: POST /alert/feed (alert-read-feed).
func (*AlertsService) ReadInfo ¶
func (s *AlertsService) ReadInfo(ctx context.Context, req *AlertInfoRequest) (*AlertItem, *Response, error)
Get alert detail.
Return the full details of a single alert by its ID, including its associated incident and event count.
API: POST /alert/info (alert-read-info).
func (*AlertsService) ReadList ¶
func (s *AlertsService) ReadList(ctx context.Context, req *AlertListRequest) (*AlertListResponse, *Response, error)
List alerts.
Return a cursor-paginated list of alerts matching the given filters.
API: POST /alert/list (alert-read-list).
func (*AlertsService) ReadListByIDs ¶
func (s *AlertsService) ReadListByIDs(ctx context.Context, req *AlertListByIDsRequest) (*AlertListResponse, *Response, error)
List alerts by IDs.
Return the details of several alerts by ID in one request, without pagination.
API: POST /alert/list-by-ids (alert-read-list-by-ids).
func (*AlertsService) ReadPipelineInfo ¶
func (s *AlertsService) ReadPipelineInfo(ctx context.Context, req *AlertPipelineInfoRequest) (*AlertPipelineItem, *Response, error)
Get alert pipeline.
Return the alert processing pipeline configured for a specific integration.
API: POST /alert/pipeline/info (alert-read-pipeline-info).
func (*AlertsService) ReadPipelineList ¶
func (s *AlertsService) ReadPipelineList(ctx context.Context, req *AlertPipelineListRequest) (*AlertPipelineListResponse, *Response, error)
List alert pipelines.
Return the alert processing pipelines configured for multiple integrations.
API: POST /alert/pipeline/list (alert-read-pipeline-list).
func (*AlertsService) ReadPipelinePreview ¶ added in v0.16.0
func (s *AlertsService) ReadPipelinePreview(ctx context.Context, req *AlertPipelinePreviewRequest) (*AlertPipelinePreviewResponse, *Response, error)
Preview alert pipeline processing.
Run unsaved alert processing rules over one event, the way ingestion would.
API: POST /alert/pipeline/preview (alert-read-pipeline-preview).
func (*AlertsService) WriteMerge ¶
func (s *AlertsService) WriteMerge(ctx context.Context, req *AlertMergeRequest) (*Response, error)
Merge alerts into an incident.
Move one or more alerts into an existing incident and close source incidents left empty.
API: POST /alert/merge (alert-write-merge).
func (*AlertsService) WritePipelineUpsert ¶
func (s *AlertsService) WritePipelineUpsert(ctx context.Context, req *AlertPipelineUpsertRequest) (*Response, error)
Create or update alert pipeline.
Set the alert processing pipeline for an integration. Replaces the existing configuration entirely.
API: POST /alert/pipeline/upsert (alert-write-pipeline-upsert).
type AnalyticsService ¶
type AnalyticsService service
AnalyticsService handles the "On-call/Analytics" API resource.
func (*AnalyticsService) ByAccount ¶
func (s *AnalyticsService) ByAccount(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error)
Get account-level insight.
Return incident and alert metrics for the whole account, one row per time bucket.
API: POST /insight/account (insightByAccount).
func (*AnalyticsService) ByChannel ¶
func (s *AnalyticsService) ByChannel(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error)
Get channel insight.
Return incident and alert metrics grouped by channel, one row per channel per time bucket.
API: POST /insight/channel (insightByChannel).
func (*AnalyticsService) ByResponder ¶
func (s *AnalyticsService) ByResponder(ctx context.Context, req *InsightQueryRequest) (*ResponderInsightResponse, *Response, error)
Get responder insight.
Return per-responder incident handling metrics, one row per responder per time bucket.
API: POST /insight/responder (insightByResponder).
func (*AnalyticsService) ByTeam ¶
func (s *AnalyticsService) ByTeam(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error)
Get team insight.
Return incident and alert metrics grouped by team, one row per team per time bucket.
API: POST /insight/team (insightByTeam).
func (*AnalyticsService) ChannelExport ¶
func (s *AnalyticsService) ChannelExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)
Export channel insight.
Export channel insight metrics as a CSV file with the same rows as `/insight/channel`.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: POST /insight/channel/export (insightChannelExport).
func (*AnalyticsService) IncidentExport ¶
func (s *AnalyticsService) IncidentExport(ctx context.Context, req *InsightIncidentExportRequest) (*Response, error)
Export insight incidents.
Export the incidents matched by the analytics filters as a CSV file, one row per incident.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: POST /insight/incident/export (insightIncidentExport).
func (*AnalyticsService) IncidentList ¶
func (s *AnalyticsService) IncidentList(ctx context.Context, req *InsightIncidentListRequest) (*InsightIncidentListResponse, *Response, error)
List insight incidents.
Return a paged list of incidents with per-incident handling metrics used by the analytics dashboard.
API: POST /insight/incident/list (insightIncidentList).
func (*AnalyticsService) ResponderExport ¶
func (s *AnalyticsService) ResponderExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)
Export responder insight.
Export responder insight metrics as a CSV file with the same rows as `/insight/responder`.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: POST /insight/responder/export (insightResponderExport).
func (*AnalyticsService) TeamExport ¶
func (s *AnalyticsService) TeamExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)
Export team insight.
Export team insight metrics as a CSV file with the same rows as `/insight/team`.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: POST /insight/team/export (insightTeamExport).
func (*AnalyticsService) TopkAlertsByLabel ¶
func (s *AnalyticsService) TopkAlertsByLabel(ctx context.Context, req *InsightTopkAlertByLabelRequest) (*InsightAlertByLabelResponse, *Response, error)
Get top-K alerts grouped by check or resource.
Return the top-K alert groups aggregated either by `check` or by `resource` label over the specified time range.
API: POST /insight/alert/topk-by-label (insightTopkAlertsByLabel).
type ApAlertDrop ¶
type ApAlertDrop struct{}
ApAlertDrop is generated from the Flashduty OpenAPI schema.
type ApAlertInhibit ¶
type ApAlertInhibit struct {
// Keys whose values must be equal on the source alert and the current event: `title`, `severity`, or `labels.<name>`. Must not be empty (`InvalidParameter`). Any other key, or a label missing on the event, means the rule never inhibits.
Equals []string `json:"equals" toon:"equals"`
// AND-conditions a source alert must meet. Allowed keys: `severity`, `title`, and `labels.<name>`; other keys return `InvalidParameter`.
SourceFilters []FilterCondition `json:"source_filters" toon:"source_filters"`
}
ApAlertInhibit is generated from the Flashduty OpenAPI schema.
type ApDescriptionReset ¶
type ApDescriptionReset struct {
// Description template. Only a value starting with `[TPL]` takes effect: the rest is rendered as a Go template against the event and replaces the description. A value without the prefix leaves the description unchanged.
Description string `json:"description" toon:"description"`
}
ApDescriptionReset is generated from the Flashduty OpenAPI schema.
type ApSeverityReset ¶
type ApSeverityReset struct {
// Severity to set: `Critical`, `Warning` or `Info`. The event status is set to the same value.
Severity string `json:"severity" toon:"severity"`
}
ApSeverityReset is generated from the Flashduty OpenAPI schema.
type ApTitleReset ¶
type ApTitleReset struct {
// Title rule. A value starting with `[TPL]` is a Go template rendered against the event, e.g. `[TPL]{{.Labels.service}}`. Otherwise it is a `::`-separated list in which each `$name` part is replaced by the value of label `name` and other parts are kept as written.
Title string `json:"title" toon:"title"`
}
ApTitleReset is generated from the Flashduty OpenAPI schema.
type ApplicationsService ¶
type ApplicationsService service
ApplicationsService handles the "RUM/Applications" API resource.
func (*ApplicationsService) ReadInfo ¶
func (s *ApplicationsService) ReadInfo(ctx context.Context, req *RUMApplicationIDRequest) (*RUMApplicationItem, *Response, error)
Get application detail.
Retrieve full details of a single RUM application by `application_id`.
API: POST /rum/application/info (rum-application-read-info).
func (*ApplicationsService) ReadInfos ¶
func (s *ApplicationsService) ReadInfos(ctx context.Context, req *RUMApplicationInfosRequest) (*RUMApplicationInfosResponse, *Response, error)
Batch get applications.
Retrieve details for multiple RUM applications by their IDs in one request.
API: POST /rum/application/infos (rum-application-read-infos).
func (*ApplicationsService) ReadList ¶
func (s *ApplicationsService) ReadList(ctx context.Context, req *RUMApplicationListRequest) (*RUMApplicationListResponse, *Response, error)
List applications.
Return a paginated list of RUM applications accessible to the current user.
API: POST /rum/application/list (rum-application-read-list).
func (*ApplicationsService) RemoteConfigReadGet ¶ added in v0.15.2
func (s *ApplicationsService) RemoteConfigReadGet(ctx context.Context, req *GetRemoteConfigRequest) (*GetRemoteConfigResponse, *Response, error)
Get remote config detail.
Retrieve the live remote configuration of a RUM application and the version it is stored under.
API: POST /rum/application/remote-config/get (rum-application-remote-config-read-get).
func (*ApplicationsService) RemoteConfigReadHistoryList ¶ added in v0.15.2
func (s *ApplicationsService) RemoteConfigReadHistoryList(ctx context.Context, req *ListRemoteConfigHistoryRequest) (*ListRemoteConfigHistoryResponse, *Response, error)
List remote config history.
List published remote configuration versions of a RUM application.
API: POST /rum/application/remote-config/history/list (rum-application-remote-config-read-history-list).
func (*ApplicationsService) RemoteConfigReadPreview ¶ added in v0.15.2
func (s *ApplicationsService) RemoteConfigReadPreview(ctx context.Context, req *PreviewRemoteConfigRequest) (*PreviewRemoteConfigResponse, *Response, error)
Preview remote config.
Evaluate a draft remote configuration against a client context without publishing it.
API: POST /rum/application/remote-config/preview (rum-application-remote-config-read-preview).
func (*ApplicationsService) RemoteConfigWriteHistoryRevert ¶ added in v0.15.2
func (s *ApplicationsService) RemoteConfigWriteHistoryRevert(ctx context.Context, req *RevertRemoteConfigRequest) (*RevertRemoteConfigResponse, *Response, error)
Revert remote config.
Republish an earlier remote configuration version's content as a new version.
API: POST /rum/application/remote-config/history/revert (rum-application-remote-config-write-history-revert).
func (*ApplicationsService) RemoteConfigWriteUpdate ¶ added in v0.15.2
func (s *ApplicationsService) RemoteConfigWriteUpdate(ctx context.Context, req *UpdateRemoteConfigRequest) (*UpdateRemoteConfigResponse, *Response, error)
Update remote config.
Publish a complete new remote configuration version for a RUM application.
API: POST /rum/application/remote-config/update (rum-application-remote-config-write-update).
func (*ApplicationsService) WebhookTest ¶ added in v0.5.4
func (s *ApplicationsService) WebhookTest(ctx context.Context, req *RUMWebhookTestRequest) (*RUMWebhookTestResponse, *Response, error)
Test application webhook.
Send a sample RUM alert event to verify an application's webhook URL.
API: POST /rum/application/webhook/test (rum-application-webhook-test).
func (*ApplicationsService) WriteCreate ¶
func (s *ApplicationsService) WriteCreate(ctx context.Context, req *RUMApplicationCreateRequest) (*RUMApplicationCreateResponse, *Response, error)
Create application.
Create a new RUM application. Returns the generated `application_id` and `client_token`.
API: POST /rum/application/create (rum-application-write-create).
func (*ApplicationsService) WriteDelete ¶
func (s *ApplicationsService) WriteDelete(ctx context.Context, req *RUMApplicationIDRequest) (*Response, error)
Delete application.
Delete a RUM application by `application_id`.
API: POST /rum/application/delete (rum-application-write-delete).
func (*ApplicationsService) WriteUpdate ¶
func (s *ApplicationsService) WriteUpdate(ctx context.Context, req *RUMApplicationUpdateRequest) (*Response, error)
Update application.
Update selected fields of a RUM application; fields left out of the request keep their current values.
API: POST /rum/application/update (rum-application-write-update).
type ArtifactFileStateItem ¶ added in v0.14.5
type ArtifactFileStateItem struct {
// Artifact ID (`art_` prefix). Also the key of the public-share link.
ArtifactID string `json:"artifact_id" toon:"artifact_id"`
// The requested presented-file ID this entry answers for.
FileID string `json:"file_id" toon:"file_id"`
// Console-relative path of the artifact page: `/ai-sre/artifacts/<artifact_id>`.
GalleryPath string `json:"gallery_path" toon:"gallery_path"`
// Gallery display title of the published artifact.
Title string `json:"title" toon:"title"`
}
ArtifactFileStateItem is generated from the Flashduty OpenAPI schema.
type ArtifactFileStateRequest ¶ added in v0.14.5
type ArtifactFileStateRequest struct {
// Presented-file IDs (`pf_` prefix) to check. At most 50 entries per call, counted before duplicates and empty strings are removed; more fails with `InvalidParameter`.
FileIDs []string `json:"file_ids" toon:"file_ids"`
}
ArtifactFileStateRequest is generated from the Flashduty OpenAPI schema.
type ArtifactFileStateResponse ¶ added in v0.14.5
type ArtifactFileStateResponse struct {
// One entry per requested file whose session file path currently has a live gallery artifact; files without one, and unknown IDs, are omitted. An empty array when none match.
Items []ArtifactFileStateItem `json:"items" toon:"items"`
}
ArtifactFileStateResponse is generated from the Flashduty OpenAPI schema.
type ArtifactIDRequest ¶ added in v0.14.5
type ArtifactIDRequest struct {
// Artifact ID (`art_` prefix). Also the key of the public-share link.
ArtifactID string `json:"artifact_id" toon:"artifact_id"`
}
ArtifactIDRequest is generated from the Flashduty OpenAPI schema.
type ArtifactListRequest ¶ added in v0.14.5
type ArtifactListRequest struct {
// Sort ascending when true, descending when false. Applies only when `orderby` is set.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Number of artifacts per page. Values below 1 fall back to 20; values above 100 are capped at 100 (not rejected).
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Sort field: `created_at` (publish time) or `updated_at` (last change). Empty sorts by `updated_at` descending. In every case the caller's pinned artifacts come first, and `artifact_id` breaks ties.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Page number, 1-based. Values below 1 are treated as 1.
Page int64 `json:"page,omitempty" toon:"page,omitempty"`
// Case-insensitive substring match on the artifact title.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Visibility scope. `all` (default) lists the caller's own personal artifacts plus artifacts of every team the caller belongs to; `personal` lists only the caller's own; `team` lists only team-owned artifacts of the caller's teams.
Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
// Restrict to artifacts owned by these team IDs, intersected with the `scope` filter. Non-positive IDs are ignored; teams the caller does not belong to return nothing, and personal artifacts are excluded whenever this is set.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
ArtifactListRequest is generated from the Flashduty OpenAPI schema.
type ArtifactListResponse ¶ added in v0.14.5
type ArtifactListResponse struct {
// Artifacts on this page; the caller's pinned artifacts come first. An empty array when nothing matches.
Items []PublishedArtifactItem `json:"items" toon:"items"`
// Total number of artifacts matching the filter across all pages.
Total int64 `json:"total" toon:"total"`
}
ArtifactListResponse is generated from the Flashduty OpenAPI schema.
type ArtifactPublishFromFileRequest ¶ added in v0.14.5
type ArtifactPublishFromFileRequest struct {
// Presented-file ID (`pf_` prefix) of a file produced in a session, as shown on the file card in chat.
FileID string `json:"file_id" toon:"file_id"`
// Gallery display title. Trimmed; must be non-empty.
Title string `json:"title" toon:"title"`
}
ArtifactPublishFromFileRequest is generated from the Flashduty OpenAPI schema.
type ArtifactPublishResponse ¶ added in v0.14.5
type ArtifactPublishResponse struct {
// Artifact ID (`art_` prefix). Also the key of the public-share link.
ArtifactID string `json:"artifact_id" toon:"artifact_id"`
// Console-relative path of the artifact page: `/ai-sre/artifacts/<artifact_id>`.
GalleryPath string `json:"gallery_path" toon:"gallery_path"`
// Gallery display title.
Title string `json:"title" toon:"title"`
}
ArtifactPublishResponse is generated from the Flashduty OpenAPI schema.
type ArtifactShareState ¶ added in v0.14.5
type ArtifactShareState struct {
ArtifactID string `json:"artifact_id" toon:"artifact_id"`
PublicURL string `json:"public_url" toon:"public_url"`
ShareEnabled bool `json:"share_enabled" toon:"share_enabled"`
SharedAt TimestampMilli `json:"shared_at" toon:"shared_at"`
SharedBy int64 `json:"shared_by" toon:"shared_by"`
}
ArtifactShareState is generated from the Flashduty OpenAPI schema.
type ArtifactSignRequest ¶ added in v0.14.5
type ArtifactSignRequest struct {
// Presented-file ID (`pf_` prefix) to sign.
FileID string `json:"file_id" toon:"file_id"`
ShareToken string `json:"share_token,omitempty" toon:"share_token,omitempty"`
}
ArtifactSignRequest is generated from the Flashduty OpenAPI schema.
type ArtifactUpdateRequest ¶ added in v0.14.5
type ArtifactUpdateRequest struct {
// Artifact ID (`art_` prefix). Also the key of the public-share link.
ArtifactID string `json:"artifact_id" toon:"artifact_id"`
// Transfer target. `0` moves the artifact to personal scope and only its creator may do that; a positive value moves it to that team, and the caller must be a member of the team; a negative value fails with `InvalidParameter`. Omit or send `null` to keep the current scope. The creator (`person_id`) never changes.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// New title. Leading and trailing spaces are trimmed; a blank value fails with `InvalidParameter`. Omit or send `null` to keep the current title.
Title *string `json:"title,omitempty" toon:"title,omitempty"`
}
ArtifactUpdateRequest is generated from the Flashduty OpenAPI schema.
type ArtifactsReadStreamRequest ¶ added in v0.14.5
type ArtifactsReadStreamRequest struct {
// Signed token issued by `POST /safari/artifact/sign`. Bound to the calling account and person; valid for 5 minutes.
T string `url:"t"`
// `download` (default) serves the file as an attachment; `preview` serves it inline for browser display. Any other value falls back to `download`.
Mode string `url:"mode,omitempty"`
}
ArtifactsReadStreamRequest holds the query parameters for Download or preview a file.
type ArtifactsService ¶ added in v0.14.5
type ArtifactsService service
ArtifactsService handles the "AI SRE/Artifacts" API resource.
func (*ArtifactsService) ReadGet ¶ added in v0.14.5
func (s *ArtifactsService) ReadGet(ctx context.Context, req *ArtifactIDRequest) (*PublishedArtifactItem, *Response, error)
Get artifact detail.
Get one published artifact by ID, including its source file, owner and public-share state.
API: POST /safari/artifact/gallery/get (artifact-read-get).
func (*ArtifactsService) ReadGetFileState ¶ added in v0.14.5
func (s *ArtifactsService) ReadGetFileState(ctx context.Context, req *ArtifactFileStateRequest) (*ArtifactFileStateResponse, *Response, error)
Get file publish state.
Check which presented files already have a live published artifact.
API: POST /safari/artifact/gallery/file-state (artifact-read-get-file-state).
func (*ArtifactsService) ReadList ¶ added in v0.14.5
func (s *ArtifactsService) ReadList(ctx context.Context, req *ArtifactListRequest) (*ArtifactListResponse, *Response, error)
List artifacts.
List published artifacts visible to the caller, with pagination and title search.
API: POST /safari/artifact/gallery/list (artifact-read-list).
func (*ArtifactsService) ReadSign ¶ added in v0.14.5
func (s *ArtifactsService) ReadSign(ctx context.Context, req *ArtifactSignRequest) (*SignedUrLs, *Response, error)
Create signed file URLs.
Create short-lived signed URLs to download or preview a presented file.
API: POST /safari/artifact/sign (artifact-read-sign).
func (*ArtifactsService) ReadStream ¶ added in v0.14.5
func (s *ArtifactsService) ReadStream(ctx context.Context, req *ArtifactsReadStreamRequest) (*Response, error)
Download or preview a file.
Download or preview a file's bytes using a signed token.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: GET /safari/artifact/stream (artifact-read-stream).
func (*ArtifactsService) WriteDelete ¶ added in v0.14.5
func (s *ArtifactsService) WriteDelete(ctx context.Context, req *ArtifactIDRequest) (*any, *Response, error)
Remove artifact from gallery.
Detach an artifact from the gallery; the source file stays with its session.
API: POST /safari/artifact/gallery/delete (artifact-write-delete).
func (*ArtifactsService) WritePublish ¶ added in v0.14.5
func (s *ArtifactsService) WritePublish(ctx context.Context, req *ArtifactPublishFromFileRequest) (*ArtifactPublishResponse, *Response, error)
Publish file as artifact.
Publish a session-produced file to the artifact gallery.
API: POST /safari/artifact/gallery/publish-from-file (artifact-write-publish).
func (*ArtifactsService) WriteShareEnable ¶ added in v0.14.5
func (s *ArtifactsService) WriteShareEnable(ctx context.Context, req *ArtifactIDRequest) (*ArtifactShareState, *Response, error)
Enable public sharing.
Turn on anonymous public sharing for an artifact and return its public link.
API: POST /safari/artifact/gallery/share/enable (artifact-write-share-enable).
func (*ArtifactsService) WriteShareRevoke ¶ added in v0.14.5
func (s *ArtifactsService) WriteShareRevoke(ctx context.Context, req *ArtifactIDRequest) (*any, *Response, error)
Revoke public sharing.
Turn off public sharing; the link stops resolving immediately.
API: POST /safari/artifact/gallery/share/revoke (artifact-write-share-revoke).
func (*ArtifactsService) WriteShareSync ¶ added in v0.14.5
func (s *ArtifactsService) WriteShareSync(ctx context.Context, req *ArtifactIDRequest) (*ArtifactShareState, *Response, error)
Update shared snapshot.
Refresh the public snapshot of a shared artifact with its latest content.
API: POST /safari/artifact/gallery/share/sync (artifact-write-share-sync).
func (*ArtifactsService) WriteUpdate ¶ added in v0.14.5
func (s *ArtifactsService) WriteUpdate(ctx context.Context, req *ArtifactUpdateRequest) (*PublishedArtifactItem, *Response, error)
Update artifact.
Rename an artifact or transfer it between personal and team scope.
API: POST /safari/artifact/gallery/update (artifact-write-update).
type AssignIncidentRequest ¶
type AssignIncidentRequest struct {
// Assignment target. Set `person_ids`, `escalate_rule_id`, or `emails`; when none is set, the server re-runs the channel's escalation rule matching.
AssignedTo AssignedTo `json:"assigned_to" toon:"assigned_to"`
// Single incident ID. Ignored when `incident_ids` is also provided.
IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
// Incident IDs to assign in bulk; obtain them from `POST /incident/list`.
IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
}
AssignIncidentRequest is generated from the Flashduty OpenAPI schema.
type AssignedTo ¶
type AssignedTo struct {
// Unix timestamp (seconds) when the assignment was made; set by the server.
AssignedAt int64 `json:"assigned_at,omitempty" toon:"assigned_at,omitempty"`
// Member IDs that actually received the assignment: `person_ids` plus the members of the selected escalation level, deduplicated and sorted. Set by the server; omitted when empty.
EffectivePersonIDs []int64 `json:"effective_person_ids,omitempty" toon:"effective_person_ids,omitempty"`
// Member emails; each is resolved to a member ID and merged into `person_ids`. Emails without a matching member are ignored.
Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
// Escalation rule ID (MongoDB ObjectID) to drive assignment.
EscalateRuleID string `json:"escalate_rule_id,omitempty" toon:"escalate_rule_id,omitempty"`
// Escalation rule name, filled by the server in responses; ignored in requests.
EscalateRuleName string `json:"escalate_rule_name,omitempty" toon:"escalate_rule_name,omitempty"`
// Assignment ID generated by the server for each assignment; set by the server.
ID string `json:"id,omitempty" toon:"id,omitempty"`
// Zero-based escalation level within `escalate_rule_id` (`0` = first level). Responders are taken from this level.
LayerIdx int64 `json:"layer_idx,omitempty" toon:"layer_idx,omitempty"`
// Override the notification channels used for this assignment.
Notify AssignedToNotify `json:"notify,omitzero" toon:"notify,omitempty"`
// Member IDs to assign directly.
PersonIDs []int64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
// How the assignment happened: `assign` first assignment; `reassign` reassignment of an already assigned incident; `escalate` moved by the escalation flow; `reopen` reassignment after the incident was reopened; empty string in responses when the incident was never assigned. Omit it in requests and the server derives it.
Type string `json:"type,omitempty" toon:"type,omitempty"`
}
AssignedTo is generated from the Flashduty OpenAPI schema.
type AssignedToNotify ¶ added in v0.12.1
type AssignedToNotify struct {
// `true`: notify each person through their personal notification preference. `false`: use `personal_channels`, which must then be non-empty. When omitted, `personal_channels` must be set.
FollowPreference *bool `json:"follow_preference,omitempty" toon:"follow_preference,omitempty"`
// Channels used when `follow_preference` is `false`: `sms`, `voice`, `email`, `push` (mobile app push), or an IM app channel written as `feishu_app:<integration_id>`, `dingtalk_app:<integration_id>`, `wecom_app:<integration_id>`, `slack_app:<integration_id>`, or `teams_app:<integration_id>`. Ignored when `follow_preference` is `true`.
PersonalChannels []string `json:"personal_channels,omitempty" toon:"personal_channels,omitempty"`
// Notification template ID (MongoDB ObjectID).
TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
}
AssignedToNotify is generated from the Flashduty OpenAPI schema.
type AuditLog ¶
type AuditLog struct {
// ID of the account the entry belongs to.
AccountID uint64 `json:"account_id" toon:"account_id"`
// JSON-encoded request body. Bodies containing sensitive fields are base64url-encoded instead; bodies over 10 KB are replaced by a truncation placeholder.
Body string `json:"body" toon:"body"`
// Timestamp of the operation in Unix epoch milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// ID of the credential (the app key ID) when `credential_type` is `app_key`; 0 otherwise.
CredentialID uint64 `json:"credential_id" toon:"credential_id"`
// Credential type used for the call. `app_key` for a long-lived console app key, `ephemeral_app_key` for a short-lived key issued to AI SRE, and an empty string for member sessions.
CredentialType string `json:"credential_type" toon:"credential_type"`
// Client IP address of the caller.
IP string `json:"ip" toon:"ip"`
// True if this is flagged as a high-risk operation.
IsDangerous bool `json:"is_dangerous" toon:"is_dangerous"`
// True for mutating operations; false for read-only ones.
IsWrite bool `json:"is_write" toon:"is_write"`
// ID of the member who performed the action. 0 when the action was performed by the account principal itself.
MemberID uint64 `json:"member_id" toon:"member_id"`
// Display name of the member. Empty when `member_id` is 0.
MemberName string `json:"member_name" toon:"member_name"`
// Stable machine-readable operation name, e.g. `template:write:create`.
Operation string `json:"operation" toon:"operation"`
// Human-readable Chinese label of the operation (e.g. `创建模板`).
OperationName string `json:"operation_name" toon:"operation_name"`
// URL path parameters as an array of `Key`/`Value` pairs (an empty array when none). Some deployments return the same array as a JSON-encoded string.
Params []AuditLogParamsItem `json:"params" toon:"params"`
// Kind of the caller. `member` — a member or account-owner session; `service` — an app key or a short-lived key issued to AI SRE.
PrincipalKind string `json:"principal_kind" toon:"principal_kind"`
// Unique request ID for correlation.
RequestID string `json:"request_id" toon:"request_id"`
}
AuditLog is generated from the Flashduty OpenAPI schema.
type AuditLogParamsItem ¶
type AuditLogParamsItem struct {
// Name of a URL path parameter (the `:xxx` placeholder in the route).
Key string `json:"Key" toon:"Key"`
// The actual value of that path parameter in this request.
Value string `json:"Value" toon:"Value"`
}
AuditLogParamsItem is generated from the Flashduty OpenAPI schema.
type AuditLogsService ¶
type AuditLogsService service
AuditLogsService handles the "Platform/Audit logs" API resource.
func (*AuditLogsService) OperationList ¶
func (s *AuditLogsService) OperationList(ctx context.Context) (*AuditOperationListResponse, *Response, error)
List auditable operation types.
Return all operation names that are recorded in the audit log, for use as `operations` filter values.
API: POST /audit/operation/list (audit-read-operation-list).
func (*AuditLogsService) Search ¶
func (s *AuditLogsService) Search(ctx context.Context, req *AuditSearchRequest) (*AuditSearchResponse, *Response, error)
Search audit logs.
Return a cursor-paginated list of audit log entries within a time range.
API: POST /audit/search (audit-read-search).
type AuditOperationListRequest ¶
type AuditOperationListRequest struct{}
AuditOperationListRequest is generated from the Flashduty OpenAPI schema.
type AuditOperationListResponse ¶
type AuditOperationListResponse struct {
// Array of all auditable operation types (only APIs flagged for audit); always an array, possibly empty.
Items []AuditOperationTypeItem `json:"items" toon:"items"`
}
AuditOperationListResponse is generated from the Flashduty OpenAPI schema.
type AuditOperationTypeItem ¶
type AuditOperationTypeItem struct {
// Stable machine-readable operation name for use as a filter.
Name string `json:"name" toon:"name"`
// Human-readable Chinese label shown in the console.
NameCn string `json:"name_cn" toon:"name_cn"`
}
AuditOperationTypeItem is generated from the Flashduty OpenAPI schema.
type AuditRecordIDRequest ¶ added in v0.5.3
type AuditRecordIDRequest struct {
// Audit record ID — the `id` of a row returned by `POST /monit/rule/audits`, not the rule ID. A rule ID is looked up as an audit record ID, which usually returns `InvalidParameter` (`alert rule audit not found`) or an unrelated record.
ID uint64 `json:"id" toon:"id"`
}
AuditRecordIDRequest is generated from the Flashduty OpenAPI schema.
type AuditSearchRequest ¶
type AuditSearchRequest struct {
// End of the search window, Unix epoch seconds. Inclusive. Must be after `start_time`; maximum span 90 days.
EndTime int64 `json:"end_time" toon:"end_time"`
// When true, return only high-risk (dangerous) operations.
IsDangerous *bool `json:"is_dangerous,omitempty" toon:"is_dangerous,omitempty"`
// When true, return only write operations; when false, return only read operations.
IsWrite *bool `json:"is_write,omitempty" toon:"is_write,omitempty"`
// Page size, 0–99. Omit or set to 0 to let the server choose the page size (it may return every matching entry).
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Filter to specific operation names. Use `POST /audit/operation/list` to get the valid set.
Operations []string `json:"operations,omitempty" toon:"operations,omitempty"`
// Filter by the operator's member ID (get IDs from `POST /member/list`). Pass the account ID to match actions performed by the account principal itself.
PersonID uint64 `json:"person_id,omitempty" toon:"person_id,omitempty"`
// Filter to a single request by its unique request ID.
RequestID string `json:"request_id,omitempty" toon:"request_id,omitempty"`
// Opaque pagination cursor returned by the previous response. Leave empty for the first page.
SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
// Start of the search window, Unix epoch seconds. Exclusive — entries at exactly this second are not included.
StartTime int64 `json:"start_time" toon:"start_time"`
}
AuditSearchRequest is generated from the Flashduty OpenAPI schema.
type AuditSearchResponse ¶
type AuditSearchResponse struct {
// Audit log entries for this page, newest first. Omitted when the page is empty.
Docs []AuditLog `json:"docs" toon:"docs"`
// Opaque cursor for the next page. Empty string when there are no more results.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Total matching entries in the search window.
Total int64 `json:"total" toon:"total"`
}
AuditSearchResponse is generated from the Flashduty OpenAPI schema.
type AutomationFireAPITriggerRequest ¶ added in v0.5.4
type AutomationFireAPITriggerRequest struct {
// Context text passed to this Automation run.
Text string `json:"text,omitempty" toon:"text,omitempty"`
}
AutomationFireAPITriggerRequest is the payload accepted by an Automation HTTP POST trigger.
type AutomationFireAPITriggerResponse ¶ added in v0.5.4
type AutomationFireAPITriggerResponse struct {
// Result type. The API-trigger success path returns routine_fire.
Type string `json:"type" toon:"type"`
// Started session ID returned by the API-trigger success path.
SessionID string `json:"session_id" toon:"session_id"`
// Console URL for the started session.
SessionURL string `json:"session_url" toon:"session_url"`
}
AutomationFireAPITriggerResponse is the result returned by an Automation HTTP POST trigger.
type AutomationRuleCreateRequest ¶ added in v0.5.4
type AutomationRuleCreateRequest struct {
// Schedule in local time of `timezone`. Accepts 4 fields (`hour day month weekday`, minute defaults to 0) or 5 fields (`minute hour day month weekday`). The minute must be one fixed integer; seconds (6 fields) are not supported; setting both day-of-month and day-of-week is rejected. Required even for rules that use only other triggers: send a valid expression with `schedule_trigger_enabled=false`.
CronExpr string `json:"cron_expr" toon:"cron_expr"`
// Whether the rule's automatic triggers (schedule, HTTP POST, On-call incident, war room) are armed after creation. Defaults to `false`. Manual runs work either way.
Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// BYOC runner ID. Required when `environment_kind=byoc` and rejected for other kinds. A personal rule can only use account-scope runners; a team rule can use account-scope runners or runners of its own team.
EnvironmentID string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
// Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (a self-hosted BYOC runner in the account, used with `environment_id`); automatic selection prefers an online BYOC runner and falls back to the cloud sandbox.
EnvironmentKind string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
// Whether to create an enabled HTTP POST trigger. When `true`, the response carries `http_post_trigger_url` and the one-time `http_post_token`.
HTTPPostTriggerEnabled bool `json:"http_post_trigger_enabled,omitempty" toon:"http_post_trigger_enabled,omitempty"`
// Display name of the rule, 1–255 characters; leading and trailing spaces are trimmed.
Name string `json:"name" toon:"name"`
// Channel IDs to watch; incidents in these channels can start a run. Each ID must be positive.
OncallIncidentChannelIDs []int64 `json:"oncall_incident_channel_ids,omitempty" toon:"oncall_incident_channel_ids,omitempty"`
// Whether to merge similar incidents into one analysis. When `true` (default), an incident that closely resembles one already being analyzed by this rule (a run in progress or finished within the last 10 minutes) joins that run's session instead of starting a new one; its own run is recorded as `skipped` with `joined_session_id` set. When `false`, every matching incident starts its own run.
OncallIncidentMergeSimilar *bool `json:"oncall_incident_merge_similar,omitempty" toon:"oncall_incident_merge_similar,omitempty"`
// Incident severities to watch: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels.
OncallIncidentSeverities []string `json:"oncall_incident_severities,omitempty" toon:"oncall_incident_severities,omitempty"`
// Whether the On-call incident trigger is enabled. When the trigger is created (this is `true`, or channel IDs or severities are sent), both `oncall_incident_channel_ids` and `oncall_incident_severities` must be non-empty.
OncallIncidentTriggerEnabled bool `json:"oncall_incident_trigger_enabled,omitempty" toon:"oncall_incident_trigger_enabled,omitempty"`
// Task instruction sent to the AI SRE agent on every run. Must not be empty after trimming spaces.
Prompt string `json:"prompt" toon:"prompt"`
// Where the rule's runs execute. `web` (default): in a web console session. `current-chat`: in the IM chat the rule is created from; accepted only from a live IM conversation with the AI SRE agent, so API calls that send it get `400`.
RunIn *string `json:"run_in,omitempty" toon:"run_in,omitempty"`
// Whether the schedule trigger is enabled. Defaults to `true` when omitted; send `false` for rules that should fire only from other triggers.
ScheduleTriggerEnabled *bool `json:"schedule_trigger_enabled,omitempty" toon:"schedule_trigger_enabled,omitempty"`
// Scope of the rule. `0`: a personal rule owned by the caller. `>0`: a team rule; the caller must be a member of that team. Omitted: a personal rule for an app key; a rule created by the AI SRE agent inherits its session's scope. The scope cannot be changed after creation.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// IANA time zone name used to evaluate `cron_expr`, e.g. `Asia/Shanghai`. Ambiguous names such as `Local`, `CST`, `UTC+8`, and `GMT+8` are rejected. When omitted: the caller's member time zone, then the account time zone, then `Asia/Shanghai`.
Timezone string `json:"timezone,omitempty" toon:"timezone,omitempty"`
// Channel IDs whose war rooms start a run. Each ID must be positive.
WarRoomChannelIDs []int64 `json:"war_room_channel_ids,omitempty" toon:"war_room_channel_ids,omitempty"`
// Incident severities that start a run when their war room is created: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels.
WarRoomSeverities []string `json:"war_room_severities,omitempty" toon:"war_room_severities,omitempty"`
// Whether the war room trigger is enabled. It fires when a war room (IM group chat) is created for an incident in one of `war_room_channel_ids` with a severity in `war_room_severities`; the agent then runs inside that group chat. When the trigger is created (this is `true`, or `war_room_channel_ids` is sent), both lists must be non-empty.
WarRoomTriggerEnabled bool `json:"war_room_trigger_enabled,omitempty" toon:"war_room_trigger_enabled,omitempty"`
}
AutomationRuleCreateRequest is generated from the Flashduty OpenAPI schema.
type AutomationRuleIDRequest ¶ added in v0.5.4
type AutomationRuleIDRequest struct {
// Rule ID, from the list returned by `POST /safari/automation/rule/list`.
RuleID string `json:"rule_id" toon:"rule_id"`
}
AutomationRuleIDRequest is generated from the Flashduty OpenAPI schema.
type AutomationRuleItem ¶ added in v0.5.4
type AutomationRuleItem struct {
// ID of the account that owns the rule.
AccountID int64 `json:"account_id" toon:"account_id"`
// `true` when the caller can manage (get, update, delete, run) this rule: the owner of a personal rule, or a member of a team rule's team. Account owners and admins get no exemption.
CanEdit bool `json:"can_edit" toon:"can_edit"`
// Creation time, Unix milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Normalized 5-field cron expression (`minute hour day month weekday`), evaluated in `timezone`.
CronExpr string `json:"cron_expr" toon:"cron_expr"`
// Whether the rule's automatic triggers are armed. A disabled rule can still be run manually. A personal rule is disabled automatically when its owner leaves the account.
Enabled bool `json:"enabled" toon:"enabled"`
// BYOC runner ID when `environment_kind=byoc`; empty string otherwise.
EnvironmentID string `json:"environment_id" toon:"environment_id"`
// Runtime environment kind. Omit or send an empty value for automatic selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc` (self-hosted BYOC runner in the account); an empty value means automatic selection (prefers an online BYOC runner, falls back to the cloud sandbox).
EnvironmentKind string `json:"environment_kind" toon:"environment_kind"`
// Read-only description of where the rule runs.
ExecutionLocation AutomationRuleItemExecutionLocation `json:"execution_location" toon:"execution_location"`
// Where runs started by the schedule, HTTP POST, On-call incident, and manual triggers execute: `web_console` (a web console session) or `im` (the IM chat the rule was created from). War room runs always execute in the war room's group chat. Fixed at creation.
ExecutionPlace string `json:"execution_place" toon:"execution_place"`
// HTTP POST trigger token. Returned only in the response that issues it: create with `http_post_trigger_enabled=true`, an update that creates the trigger, or an update with `rotate_http_post_trigger_token=true`. Save it; it cannot be read again.
HTTPPostToken string `json:"http_post_token" toon:"http_post_token"`
// Whether the HTTP POST trigger is enabled.
HTTPPostTriggerEnabled bool `json:"http_post_trigger_enabled" toon:"http_post_trigger_enabled"`
// HTTP POST trigger ID. Omitted when the rule has no HTTP POST trigger.
HTTPPostTriggerID string `json:"http_post_trigger_id" toon:"http_post_trigger_id"`
// Path to fire the HTTP POST trigger, `/safari/automation/triggers/{trigger_id}/fire`, relative to the API base URL. Send `POST` with `Authorization: Bearer <http_post_token>`. Omitted when the rule has no HTTP POST trigger.
HTTPPostTriggerURL string `json:"http_post_trigger_url" toon:"http_post_trigger_url"`
// The rule's most recent run. Returned only by List Automation rules, and only when the rule has run at least once.
LastRun AutomationRuleItemLastRun `json:"last_run" toon:"last_run"`
// Display name of the rule.
Name string `json:"name" toon:"name"`
// Channel IDs the On-call incident trigger watches. Omitted when the rule has no such trigger.
OncallIncidentChannelIDs []int64 `json:"oncall_incident_channel_ids" toon:"oncall_incident_channel_ids"`
// Whether similar incidents are merged into one analysis (see the create request). `true` when the rule has no On-call incident trigger.
OncallIncidentMergeSimilar bool `json:"oncall_incident_merge_similar" toon:"oncall_incident_merge_similar"`
// Incident severities the On-call incident trigger watches: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels. Omitted when the rule has no such trigger.
OncallIncidentSeverities []string `json:"oncall_incident_severities" toon:"oncall_incident_severities"`
// Whether the On-call incident trigger is enabled.
OncallIncidentTriggerEnabled bool `json:"oncall_incident_trigger_enabled" toon:"oncall_incident_trigger_enabled"`
// On-call incident trigger ID. Omitted when the rule has no On-call incident trigger.
OncallIncidentTriggerID string `json:"oncall_incident_trigger_id" toon:"oncall_incident_trigger_id"`
// Person ID of the member who created the rule. For a personal rule, the only person who can manage it.
OwnerID int64 `json:"owner_id" toon:"owner_id"`
// Task instruction sent to the AI SRE agent on every run.
Prompt string `json:"prompt" toon:"prompt"`
// Rule ID (prefix `arule_`). Pass it as `rule_id` to get, update, delete, run, and list-runs calls.
RuleID string `json:"rule_id" toon:"rule_id"`
// Hidden session run scope. One of: `person` (personal rule, team_id=0, runs as the creator; disabled when the creator leaves the account), `team` (team rule, team_id>0, owned by the team and shared with its members; survives the creator leaving). Derived from the rule's team_id.
RunScope string `json:"run_scope" toon:"run_scope"`
// Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available.
ScheduleNextFireAtMs TimestampMilli `json:"schedule_next_fire_at_ms" toon:"schedule_next_fire_at_ms"`
// Whether the schedule trigger is enabled.
ScheduleTriggerEnabled bool `json:"schedule_trigger_enabled" toon:"schedule_trigger_enabled"`
// Schedule trigger ID. Omitted if the rule has no schedule trigger.
ScheduleTriggerID string `json:"schedule_trigger_id" toon:"schedule_trigger_id"`
// Scope team ID; `0` means a personal rule. Fixed at creation.
TeamID int64 `json:"team_id" toon:"team_id"`
// IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.
Timezone string `json:"timezone" toon:"timezone"`
// Last update time, Unix milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Channel IDs whose war rooms start a run. Omitted when the rule has no war room trigger.
WarRoomChannelIDs []int64 `json:"war_room_channel_ids" toon:"war_room_channel_ids"`
// Incident severities whose war rooms start a run: `Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels. Omitted when the rule has no war room trigger.
WarRoomSeverities []string `json:"war_room_severities" toon:"war_room_severities"`
// Whether the war room trigger is enabled.
WarRoomTriggerEnabled bool `json:"war_room_trigger_enabled" toon:"war_room_trigger_enabled"`
// War room trigger ID. Omitted when the rule has no war room trigger.
WarRoomTriggerID string `json:"war_room_trigger_id" toon:"war_room_trigger_id"`
}
AutomationRuleItem is generated from the Flashduty OpenAPI schema.
type AutomationRuleItemExecutionLocation ¶ added in v0.16.0
type AutomationRuleItemExecutionLocation struct {
// Name of the bound chat. Present only when `place=im` and the name is known.
ChatName string `json:"chat_name" toon:"chat_name"`
// Conversation type of the bound chat: `direct` (one-to-one chat with the bot), `group_chat` (a group chat), `group_thread` (a thread in a group chat), `war_room_chat` (an incident war room). Present only when `place=im`.
ConversationMode string `json:"conversation_mode" toon:"conversation_mode"`
// Human-readable destination label: `Web console` for web console rules, otherwise the chat name or platform and conversation type.
Description string `json:"description" toon:"description"`
// Same as the rule's `execution_place`: `web_console` runs in a web console session, `im` runs in the bound IM chat.
Place string `json:"place" toon:"place"`
// IM platform of the bound chat: `feishu` (Feishu/Lark), `dingtalk` (DingTalk), `wecom` (WeCom), `slack` (Slack), `teams` (Microsoft Teams). Present only when `place=im`.
Platform string `json:"platform" toon:"platform"`
// `person`: runs as the owner; `team`: runs under the team in `team_id`.
RunScope string `json:"run_scope" toon:"run_scope"`
// Team the runs belong to; `0` for a personal rule.
TeamID int64 `json:"team_id" toon:"team_id"`
}
AutomationRuleItemExecutionLocation is generated from the Flashduty OpenAPI schema.
type AutomationRuleItemLastRun ¶ added in v0.16.0
type AutomationRuleItemLastRun struct {
// Run ID, as in List Automation runs.
RunID string `json:"run_id" toon:"run_id"`
// Start time, Unix milliseconds.
StartedAt TimestampMilli `json:"started_at" toon:"started_at"`
// Run status, same meanings as `status` in List Automation runs: `queued`, `running`, `retrying` (in progress); `succeeded`, `partial`, `failed`, `skipped` (did not execute or merged into another run), `abandoned` (never completed), `blocked` (ended waiting on a connector authorization).
Status string `json:"status" toon:"status"`
}
AutomationRuleItemLastRun is generated from the Flashduty OpenAPI schema.
type AutomationRuleListRequest ¶ added in v0.5.4
type AutomationRuleListRequest struct {
ListOptions
// Filter by enabled state: `true` returns only enabled rules, `false` only disabled; omit or pass null for no filter.
Enabled *bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// Legacy switch. Only read when `scope` is empty: `false` behaves like `scope=team`; otherwise ignored.
IncludePerson *bool `json:"include_person,omitempty" toon:"include_person,omitempty"`
// Returns rules whose name contains this text. At most 64 characters.
Keyword string `json:"keyword,omitempty" toon:"keyword,omitempty"`
// Scope filter: `all` (default) your personal rules plus rules of your teams; `personal` only your personal rules; `team` only rules of your teams.
Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
// Filter to these team IDs; this narrows results and does not expand access.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
AutomationRuleListRequest is generated from the Flashduty OpenAPI schema.
type AutomationRuleListResponse ¶ added in v0.5.4
type AutomationRuleListResponse struct {
// Array of automation rules for the current page, used with `total` for pagination.
Rules []AutomationRuleItem `json:"rules" toon:"rules"`
// Number of rules matching the filters across all pages.
Total int64 `json:"total" toon:"total"`
}
AutomationRuleListResponse is generated from the Flashduty OpenAPI schema.
type AutomationRuleUpdateRequest ¶ added in v0.5.4
type AutomationRuleUpdateRequest struct {
// Target rule ID.
RuleID string `json:"rule_id,omitempty" toon:"rule_id,omitempty"`
// New rule name.
Name *string `json:"name,omitempty" toon:"name,omitempty"`
// Whether the rule is enabled.
Enabled *bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// Run cadence. Supports 4 fields (`hour day month weekday`, minute defaults to 0) and 5 fields (`minute hour day month weekday`).
CronExpr *string `json:"cron_expr,omitempty" toon:"cron_expr,omitempty"`
// IANA timezone `cron_expr` is evaluated in. The server must be able to load
// the name; an invalid value is rejected. Nil leaves the stored timezone
// unchanged, including a legacy empty string. An explicit empty string is
// stored as UTC, not reset to the account default.
Timezone *string `json:"timezone,omitempty" toon:"timezone,omitempty"`
// Whether the schedule trigger is enabled.
ScheduleTriggerEnabled *bool `json:"schedule_trigger_enabled,omitempty" toon:"schedule_trigger_enabled,omitempty"`
// New task prompt.
Prompt *string `json:"prompt,omitempty" toon:"prompt,omitempty"`
// Runtime environment kind. Omit or send an empty value for automatic selection.
EnvironmentKind *string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
// BYOC Runner ID.
EnvironmentID *string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
// Whether the HTTP POST trigger is enabled. Sending true creates one when missing.
HTTPPostTriggerEnabled *bool `json:"http_post_trigger_enabled,omitempty" toon:"http_post_trigger_enabled,omitempty"`
// Whether to rotate the HTTP POST trigger token. The new token is returned only in this response.
RotateHTTPPostTriggerToken bool `json:"rotate_http_post_trigger_token,omitempty" toon:"rotate_http_post_trigger_token,omitempty"`
// Whether the on-call incident trigger is enabled. Sending true creates it when missing and channel/severity filters are provided.
OncallIncidentTriggerEnabled *bool `json:"oncall_incident_trigger_enabled,omitempty" toon:"oncall_incident_trigger_enabled,omitempty"`
// On-call channel IDs whose new incidents can trigger this rule.
OncallIncidentChannelIDs *[]int64 `json:"oncall_incident_channel_ids,omitempty" toon:"oncall_incident_channel_ids,omitempty"`
// Incident severities that can trigger this rule.
OncallIncidentSeverities *[]string `json:"oncall_incident_severities,omitempty" toon:"oncall_incident_severities,omitempty"`
// Whether the AI SRE war room trigger is enabled. Sending true creates it when missing and channel/severity filters are provided.
WarRoomTriggerEnabled *bool `json:"war_room_trigger_enabled,omitempty" toon:"war_room_trigger_enabled,omitempty"`
// Channel (collaboration space) IDs whose new AI SRE war rooms can trigger this rule.
WarRoomChannelIDs *[]int64 `json:"war_room_channel_ids,omitempty" toon:"war_room_channel_ids,omitempty"`
// War room severities that can trigger this rule.
WarRoomSeverities *[]string `json:"war_room_severities,omitempty" toon:"war_room_severities,omitempty"`
}
AutomationRuleUpdateRequest updates mutable fields on an Automation rule. Pointer fields preserve partial-update semantics: nil means leave unchanged, while a non-nil zero value is sent to the API.
type AutomationRunItem ¶ added in v0.5.4
type AutomationRunItem struct {
// ID of the account that owns the run.
AccountID int64 `json:"account_id" toon:"account_id"`
// Number of execution attempts made for this run.
Attempts int64 `json:"attempts" toon:"attempts"`
// Completion time, Unix milliseconds. 0 means not completed.
CompletedAt TimestampMilli `json:"completed_at" toon:"completed_at"`
// Creation time, Unix milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Duration in milliseconds.
DurationMs int64 `json:"duration_ms" toon:"duration_ms"`
// Error code; empty when the run did not fail.
ErrorCode string `json:"error_code" toon:"error_code"`
// Error message; empty when the run did not fail.
ErrorMessage string `json:"error_message" toon:"error_message"`
// Where this run executed: `web_console` (a web console session; `session_id` links to it) or `im` (an IM chat; session details are withheld). `war_room_created` runs are always `im`.
ExecutionPlace string `json:"execution_place" toon:"execution_place"`
// For an On-call incident run merged into a similar incident's analysis (`status=skipped`): the session it joined. Omitted otherwise.
JoinedSessionID string `json:"joined_session_id" toon:"joined_session_id"`
// Display name of `joined_session_id`. Omitted when empty or when the name lookup fails.
JoinedSessionName string `json:"joined_session_name" toon:"joined_session_name"`
// Run kind; runs listed for a rule are always `automation_rule`.
Kind string `json:"kind" toon:"kind"`
// Idempotency key of this occurrence: `manual:<run_id>` for manual runs, `<trigger_id>:<scheduled fire time in Unix ms>` for schedule runs, `oncall_incident:<trigger_id>:<incident_id>` for On-call incident runs.
OccurrenceKey string `json:"occurrence_key" toon:"occurrence_key"`
// Raw run result JSON (carries `session_id` once a session started). `null` when empty or when the run executed in an IM chat.
ResultJSON map[string]any `json:"result_json" toon:"result_json"`
// ID of the rule this run belongs to.
RuleID string `json:"rule_id" toon:"rule_id"`
// Run ID (prefix `trun_`).
RunID string `json:"run_id" toon:"run_id"`
// AI SRE session the run executed in. Omitted when the run has not started a session, when it joined another run (see `joined_session_id`), or when it executed in an IM chat.
SessionID string `json:"session_id" toon:"session_id"`
// Display name of the run's session, stamped via a batch lookup. Omitted when empty or when the lookup fails.
SessionName string `json:"session_name" toon:"session_name"`
// Start time, Unix milliseconds.
StartedAt TimestampMilli `json:"started_at" toon:"started_at"`
// Raw run statistics JSON; null when empty.
StatsJSON map[string]any `json:"stats_json" toon:"stats_json"`
// Run status. One of (the first three are in-flight, the rest terminal):
// | Value | Meaning |
// | --- | --- |
// | `queued` | Enqueued, waiting for a worker |
// | `running` | Executing |
// | `retrying` | An attempt failed and a retry is scheduled |
// | `succeeded` | Completed successfully |
// | `partial` | Partially succeeded (currently only produced by memory-consolidation runs; rule runs never reach it) |
// | `failed` | Terminal failure, no further retries |
// | `skipped` | Not executed (e.g. grace period expired, trigger or rule invalid); the reason is kept on the run record. Also used for an On-call incident run merged into a similar incident's analysis (see `joined_session_id`) |
// | `abandoned` | Still in-flight past the stale threshold and swept as never-completed (e.g. worker died) |
// | `blocked` | Terminal: the run produced output but ended with a connector waiting on a human to complete authorization (distinct from `failed`) |
Status string `json:"status" toon:"status"`
// Trigger kind. One of:
// | Value | Meaning |
// | --- | --- |
// | `schedule` | Fired by the rule's schedule trigger |
// | `debug` | Debug run (reserved; current rule runs never carry this kind) |
// | `manual` | Started with Run Automation rule |
// | `http_post` | Fired via the rule's HTTP POST trigger |
// | `oncall_incident` | Fired by a matching On-call incident |
// | `war_room_created` | Fired when a war room was created for a matching incident; runs in that group chat |
TriggerKind string `json:"trigger_kind" toon:"trigger_kind"`
// Last update time, Unix milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}
AutomationRunItem is generated from the Flashduty OpenAPI schema.
type AutomationRunListRequest ¶ added in v0.5.4
type AutomationRunListRequest struct {
ListOptions
// Target rule ID, from the list returned by `POST /safari/automation/rule/list`.
RuleID string `json:"rule_id" toon:"rule_id"`
// Start-time lower bound, Unix milliseconds. Values below the 180-day run-history retention floor are clamped to it (that floor is also the default when omitted).
StartedAfterMs int64 `json:"started_after_ms,omitempty" toon:"started_after_ms,omitempty"`
// Start-time upper bound, Unix milliseconds. Must be greater than or equal to the effective `started_after_ms`; a value below the retention floor yields an empty result.
StartedBeforeMs int64 `json:"started_before_ms,omitempty" toon:"started_before_ms,omitempty"`
// Run status filter: `queued`, `running`, `retrying`, `succeeded`, `partial` (partially succeeded), `failed`, `skipped` (e.g. rule or trigger no longer valid), `abandoned` (stale run terminated by the system), `blocked` (terminal; produced output but a connector is waiting on a human authorization); omit for no filter.
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Trigger filter: `schedule` schedule trigger, `debug` debug run, `manual` manual run, `http_post` HTTP POST trigger, `oncall_incident` On-call incident trigger, `war_room_created` war room trigger; omit for no filter.
TriggerKind string `json:"trigger_kind,omitempty" toon:"trigger_kind,omitempty"`
}
AutomationRunListRequest is generated from the Flashduty OpenAPI schema.
type AutomationRunListResponse ¶ added in v0.5.4
type AutomationRunListResponse struct {
// Array of run records for the given `rule_id`, filtered by the request's status/trigger-kind/time-range and paginated.
Runs []AutomationRunItem `json:"runs" toon:"runs"`
// Number of runs matching the filters across all pages.
Total int64 `json:"total" toon:"total"`
}
AutomationRunListResponse is generated from the Flashduty OpenAPI schema.
type AutomationRunView ¶ added in v0.5.7
type AutomationRunView struct {
// Run ID, always populated once a run is created.
RunID string `json:"run_id" toon:"run_id"`
// AI SRE session started for this run. Omitted when the rule executes in an IM chat (`execution_place=im`).
SessionID string `json:"session_id" toon:"session_id"`
}
AutomationRunView is generated from the Flashduty OpenAPI schema.
type AutomationTemplateItem ¶ added in v0.5.4
type AutomationTemplateItem struct {
// Free-text, localized name of the group the template is shown under in the console, e.g. `Incident Response`. Groups appear in the order of their first template.
Category string `json:"category" toon:"category"`
// Prefill for `cron_expr`. Omitted when the template does not use the schedule trigger; the create request still needs a valid `cron_expr`.
CronExpr string `json:"cron_expr" toon:"cron_expr"`
// Localized explanation of what a rule created from this template does.
Description string `json:"description" toon:"description"`
// Prefill for the create request's `enabled`.
Enabled bool `json:"enabled" toon:"enabled"`
// Prefill for `http_post_trigger_enabled`.
HTTPPostTriggerEnabled bool `json:"http_post_trigger_enabled" toon:"http_post_trigger_enabled"`
// Icon identifier the console displays for the template, e.g. `siren`.
Icon string `json:"icon" toon:"icon"`
// Stable, locale-independent template ID (lowercase letters, digits, underscores). Present only on templates that other console pages link to directly; omitted otherwise.
Key string `json:"key" toon:"key"`
// Localized template name; use it as the rule `name`.
Name string `json:"name" toon:"name"`
// Prefill for `oncall_incident_severities` (`Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels). Omitted when the template does not use the On-call incident trigger.
OncallIncidentSeverities []string `json:"oncall_incident_severities" toon:"oncall_incident_severities"`
// Prefill for `oncall_incident_trigger_enabled`; when `true`, add `oncall_incident_channel_ids` before creating.
OncallIncidentTriggerEnabled bool `json:"oncall_incident_trigger_enabled" toon:"oncall_incident_trigger_enabled"`
// Prefill for the create request's `prompt`.
Prompt string `json:"prompt" toon:"prompt"`
// Prefill for `schedule_trigger_enabled`; `true` exactly when `cron_expr` is present.
ScheduleTriggerEnabled bool `json:"schedule_trigger_enabled" toon:"schedule_trigger_enabled"`
// Prefill for `war_room_severities` (`Critical` (most severe), `Warning`, or `Info` (least severe) — the On-call incident severity levels). Omitted when the template does not use the war room trigger.
WarRoomSeverities []string `json:"war_room_severities" toon:"war_room_severities"`
// Prefill for `war_room_trigger_enabled`; when `true`, add `war_room_channel_ids` before creating.
WarRoomTriggerEnabled bool `json:"war_room_trigger_enabled" toon:"war_room_trigger_enabled"`
}
AutomationTemplateItem is generated from the Flashduty OpenAPI schema.
type AutomationTemplateListRequest ¶ added in v0.5.4
type AutomationTemplateListRequest struct {
// Template language. A value containing `zh` returns Chinese, one containing `en` returns English, any other non-empty value returns Chinese. When omitted, the `locale`/`lang` query parameter or the `Accept-Language` header decides, defaulting to Chinese.
Locale string `json:"locale,omitempty" toon:"locale,omitempty"`
}
AutomationTemplateListRequest is generated from the Flashduty OpenAPI schema.
type AutomationTemplateListResponse ¶ added in v0.5.4
type AutomationTemplateListResponse struct {
// Built-in templates in the resolved language, in display order.
Templates []AutomationTemplateItem `json:"templates" toon:"templates"`
}
AutomationTemplateListResponse is generated from the Flashduty OpenAPI schema.
type AutomationsService ¶ added in v0.5.4
type AutomationsService service
AutomationsService handles the "AI SRE/Automations" API resource.
func (*AutomationsService) RuleReadGet ¶ added in v0.5.4
func (s *AutomationsService) RuleReadGet(ctx context.Context, req *AutomationRuleIDRequest) (*AutomationRuleItem, *Response, error)
Get Automation rule.
Get one Automation rule by ID, including its trigger settings and execution destination.
API: POST /safari/automation/rule/get (automation-rule-read-get).
func (*AutomationsService) RuleReadList ¶ added in v0.5.4
func (s *AutomationsService) RuleReadList(ctx context.Context, req *AutomationRuleListRequest) (*AutomationRuleListResponse, *Response, error)
List Automation rules.
List Automation rules visible to the caller, newest update first, with pagination and filters.
API: POST /safari/automation/rule/list (automation-rule-read-list).
func (*AutomationsService) RuleWriteCreate ¶ added in v0.5.4
func (s *AutomationsService) RuleWriteCreate(ctx context.Context, req *AutomationRuleCreateRequest) (*AutomationRuleItem, *Response, error)
Create Automation rule.
Create an Automation rule with schedule, HTTP POST, On-call incident, and war room triggers.
API: POST /safari/automation/rule/create (automation-rule-write-create).
func (*AutomationsService) RuleWriteDelete ¶ added in v0.5.4
func (s *AutomationsService) RuleWriteDelete(ctx context.Context, req *AutomationRuleIDRequest) (*any, *Response, error)
Delete Automation rule.
Delete an Automation rule together with all of its triggers and their subscriptions.
API: POST /safari/automation/rule/delete (automation-rule-write-delete).
func (*AutomationsService) RuleWriteRun ¶ added in v0.5.7
func (s *AutomationsService) RuleWriteRun(ctx context.Context, req *AutomationRuleIDRequest) (*ManualRunRuleResult, *Response, error)
Run Automation rule.
Run an Automation rule once right now, regardless of its triggers or enabled state.
API: POST /safari/automation/rule/run (automation-rule-write-run).
func (*AutomationsService) RuleWriteUpdate ¶ added in v0.5.4
func (s *AutomationsService) RuleWriteUpdate(ctx context.Context, req *AutomationRuleUpdateRequest) (*AutomationRuleItem, *Response, error)
Update Automation rule.
Update an Automation rule's fields and trigger settings; omitted fields keep their current values.
API: POST /safari/automation/rule/update (automation-rule-write-update).
func (*AutomationsService) RunReadList ¶ added in v0.5.4
func (s *AutomationsService) RunReadList(ctx context.Context, req *AutomationRunListRequest) (*AutomationRunListResponse, *Response, error)
List Automation runs.
List the run history of one Automation rule, newest first, with status, trigger, and time filters.
API: POST /safari/automation/run/list (automation-run-read-list).
func (*AutomationsService) TemplateReadList ¶ added in v0.5.4
func (s *AutomationsService) TemplateReadList(ctx context.Context, req *AutomationTemplateListRequest) (*AutomationTemplateListResponse, *Response, error)
List Automation templates.
List built-in Automation templates that prefill the create-rule form, in Chinese or English.
API: POST /safari/automation/template/list (automation-template-read-list).
func (*AutomationsService) TriggerWriteFire ¶ added in v0.5.4
func (s *AutomationsService) TriggerWriteFire(ctx context.Context, triggerID, token string, req *AutomationFireAPITriggerRequest) (*AutomationFireAPITriggerResponse, *Response, error)
TriggerWriteFire triggers an Automation run through its HTTP POST trigger URL.
This endpoint authenticates with the trigger's one-time bearer token rather than the account app_key used by the generated API methods.
API: POST /safari/automation/triggers/{trigger_id}/fire (automation-trigger-write-fire).
type BindWorkItemPostMortemRequest ¶ added in v0.8.0
type BindWorkItemPostMortemRequest struct {
// Client-generated idempotency key (max 128 characters; letters, digits, `_`, `-`, `.`, `:` only).
IdempotencyKey string `json:"idempotency_key" toon:"idempotency_key"`
// Incident ID (MongoDB ObjectID) whose converted, unbound items are bound. It must be linked to `post_mortem_id`.
IncidentID string `json:"incident_id" toon:"incident_id"`
// Post-mortem ID (32-character hex string) to bind the follow-ups to.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
}
BindWorkItemPostMortemRequest is generated from the Flashduty OpenAPI schema.
type CalDay ¶ added in v0.15.17
type CalDay struct {
// ID of the event that decided the day. Absent when no event covers the day.
EventID string `json:"event_id" toon:"event_id"`
// Whether the day is a day off.
IsOff bool `json:"is_off" toon:"is_off"`
// Layer that decided the day: custom = the calendar's own events, holiday = a linked holiday calendar, weekly = the weekly workdays. Absent when no event covers the day.
Layer string `json:"layer" toon:"layer"`
}
CalDay is generated from the Flashduty OpenAPI schema.
type CalEventIDRequest ¶
type CalEventIDRequest struct {
// Calendar ID; obtain it from `POST /calendar/list`.
CalID string `json:"cal_id" toon:"cal_id"`
// End date of the range to clear, in YYYY-MM-DD (exclusive). Must be later than start_at.
EndAt string `json:"end_at,omitempty" toon:"end_at,omitempty"`
// ID of the event to delete. Omit when clearing a date range.
EventID string `json:"event_id,omitempty" toon:"event_id,omitempty"`
// Start date of the range to clear, in YYYY-MM-DD. Pass together with end_at instead of event_id.
StartAt string `json:"start_at,omitempty" toon:"start_at,omitempty"`
}
CalEventIDRequest is generated from the Flashduty OpenAPI schema.
type CalEventItem ¶
type CalEventItem struct {
// Account ID. Only present for private events.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Calendar ID. For public events this is a locale key such as zh-cn.china.official.
CalID string `json:"cal_id" toon:"cal_id"`
// Creation timestamp (Unix seconds); `0` for generated `non_work.*` entries.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator person ID. Only present for private events.
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Event description.
Description string `json:"description" toon:"description"`
// Event end date (YYYY-MM-DD, exclusive).
EndAt string `json:"end_at" toon:"end_at"`
// Event ID. `cale.<id>` for the calendar's own events, `non_work.YYYYMMDD` for generated non-working weekdays, and `<holiday cal_id>.<id>` for events inherited from a holiday calendar.
EventID string `json:"event_id" toon:"event_id"`
// Whether the event marks a non-working day.
IsOff bool `json:"is_off" toon:"is_off"`
// Event start date (YYYY-MM-DD).
StartAt string `json:"start_at" toon:"start_at"`
// Event summary.
Summary string `json:"summary" toon:"summary"`
// Last update timestamp (Unix seconds); `0` for generated `non_work.*` entries.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
CalEventItem is generated from the Flashduty OpenAPI schema.
type CalEventListRequest ¶
type CalEventListRequest struct {
// Calendar ID; obtain it from `POST /calendar/list`.
CalID string `json:"cal_id" toon:"cal_id"`
// Day (1-31). 0 means no day filter.
Day int64 `json:"day,omitempty" toon:"day,omitempty"`
// Month (1-12). 0 means no month filter.
Month int64 `json:"month,omitempty" toon:"month,omitempty"`
// Year. Defaults to the current year when omitted.
Year int64 `json:"year,omitempty" toon:"year,omitempty"`
}
CalEventListRequest is generated from the Flashduty OpenAPI schema.
type CalEventListResponse ¶
type CalEventListResponse struct {
// Resolved state of every day in the requested scope, keyed by date (YYYY-MM-DD). The highest layer holding any event decides a day: the calendar's own events (custom), then the linked holiday calendars (holiday), then the weekly workdays (weekly). Inside one layer a working-day event beats a day off, so a make-up workday from a holiday calendar wins over holiday rest days. A day no event covers is a working day.
Days map[string]CalDay `json:"days" toon:"days"`
// Calendar events sorted by start_at.
Items []CalEventItem `json:"items" toon:"items"`
// Total number of events returned.
Total int64 `json:"total" toon:"total"`
}
CalEventListResponse is generated from the Flashduty OpenAPI schema.
type CalEventUpsertRequest ¶
type CalEventUpsertRequest struct {
// Calendar ID; obtain it from `POST /calendar/list`.
CalID string `json:"cal_id" toon:"cal_id"`
// Event description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Event end date in YYYY-MM-DD (exclusive).
EndAt string `json:"end_at" toon:"end_at"`
// Event ID. Omit when creating.
EventID string `json:"event_id,omitempty" toon:"event_id,omitempty"`
// Whether the event marks a non-working day. true = day off, false = working day override.
IsOff bool `json:"is_off" toon:"is_off"`
// Event start date in YYYY-MM-DD.
StartAt string `json:"start_at" toon:"start_at"`
// Event summary. Optional.
Summary string `json:"summary,omitempty" toon:"summary,omitempty"`
}
CalEventUpsertRequest is generated from the Flashduty OpenAPI schema.
type CalEventUpsertResponse ¶
type CalEventUpsertResponse struct {
// Calendar ID.
CalID string `json:"cal_id" toon:"cal_id"`
// Event ID (existing or newly generated).
EventID string `json:"event_id" toon:"event_id"`
// Event summary.
Summary string `json:"summary" toon:"summary"`
}
CalEventUpsertResponse is generated from the Flashduty OpenAPI schema.
type CalendarCreateRequest ¶
type CalendarCreateRequest struct {
// Calendar display name; must be unique within the account.
CalName string `json:"cal_name" toon:"cal_name"`
// Calendar description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Additional public-holiday calendar IDs to inherit events from (for example zh-cn.china.official).
ExtraCalIDs []string `json:"extra_cal_ids,omitempty" toon:"extra_cal_ids,omitempty"`
// Owning team ID; `0` or omitted means no team. A nonzero ID must be a team of the account.
TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// IANA timezone, e.g. `America/New_York`. Defaults to `Asia/Shanghai` when empty; an invalid name returns `InvalidParameter`.
Timezone string `json:"timezone,omitempty" toon:"timezone,omitempty"`
// Weekly working days, `0` = Sunday … `6` = Saturday. Days not listed are non-working days. When empty, no weekday is treated as non-working.
Workdays []int64 `json:"workdays,omitempty" toon:"workdays,omitempty"`
}
CalendarCreateRequest is generated from the Flashduty OpenAPI schema.
type CalendarCreateResponse ¶
type CalendarCreateResponse struct {
// ID of the newly created calendar (format cal.<uuid>).
CalID string `json:"cal_id" toon:"cal_id"`
// Calendar display name.
CalName string `json:"cal_name" toon:"cal_name"`
}
CalendarCreateResponse is generated from the Flashduty OpenAPI schema.
type CalendarEmptyObject ¶
type CalendarEmptyObject struct{}
CalendarEmptyObject is generated from the Flashduty OpenAPI schema.
type CalendarIDRequest ¶
type CalendarIDRequest struct {
// Calendar ID; obtain it from `POST /calendar/list`.
CalID string `json:"cal_id" toon:"cal_id"`
}
CalendarIDRequest is generated from the Flashduty OpenAPI schema.
type CalendarItem ¶
type CalendarItem struct {
// ID of the account that owns the calendar.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Calendar ID.
CalID string `json:"cal_id" toon:"cal_id"`
// Calendar display name.
CalName string `json:"cal_name" toon:"cal_name"`
// Creation timestamp (Unix seconds).
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator person ID.
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Calendar description.
Description string `json:"description" toon:"description"`
// Inherited public-holiday calendar IDs. Omitted when empty.
ExtraCalIDs []string `json:"extra_cal_ids" toon:"extra_cal_ids"`
// Calendar kind. `region.official.holiday` is a public regional holiday calendar (served by the central holiday service), `religion.holiday` is a public religious holiday calendar (reserved, currently no data), and `personal` is an account-created personal/team calendar.
Kind string `json:"kind" toon:"kind"`
// Calendar status. `enabled` means usable; `deleted` means removed and never returned by list endpoints.
Status string `json:"status" toon:"status"`
// Owning team ID (0 when not assigned).
TeamID uint64 `json:"team_id" toon:"team_id"`
// IANA timezone.
Timezone string `json:"timezone" toon:"timezone"`
// Last update timestamp (Unix seconds).
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Last updater person ID.
UpdatedBy uint64 `json:"updated_by" toon:"updated_by"`
// Weekly working days, `0` = Sunday … `6` = Saturday. Days not listed are non-working days. When empty, no weekday is treated as non-working. Omitted when empty.
Workdays []int64 `json:"workdays" toon:"workdays"`
}
CalendarItem is generated from the Flashduty OpenAPI schema.
type CalendarListRequest ¶
type CalendarListRequest struct {
// Calendar kind filter; defaults to personal when empty. `region.official.holiday` queries public regional holiday calendars (filtered by the caller's locale); `personal` queries account-created calendars.
Kind string `json:"kind,omitempty" toon:"kind,omitempty"`
// Disable locale filtering when listing public-holiday calendars.
NoLocale bool `json:"no_locale,omitempty" toon:"no_locale,omitempty"`
}
CalendarListRequest is generated from the Flashduty OpenAPI schema.
type CalendarListResponse ¶
type CalendarListResponse struct {
// Calendar items.
Items []CalendarItem `json:"items" toon:"items"`
// Total number of calendars returned.
Total int64 `json:"total" toon:"total"`
}
CalendarListResponse is generated from the Flashduty OpenAPI schema.
type CalendarUpdateRequest ¶
type CalendarUpdateRequest struct {
// Calendar ID; obtain it from `POST /calendar/list`.
CalID string `json:"cal_id" toon:"cal_id"`
// New calendar name; must be unique within the account.
CalName *string `json:"cal_name,omitempty" toon:"cal_name,omitempty"`
// New description.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Public holiday calendar IDs to inherit events from (see `POST /calendar/list` with `kind` = `region.official.holiday`). When sent, replaces the stored list; an empty array removes them all; omit to keep it.
ExtraCalIDs []string `json:"extra_cal_ids,omitempty" toon:"extra_cal_ids,omitempty"`
// New owning team ID; obtain it from `POST /team/list`. `0` removes the team; a nonzero ID must be a team of the account.
TeamID *uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// New IANA timezone, e.g. `Asia/Shanghai`; an invalid name returns `InvalidParameter`.
Timezone *string `json:"timezone,omitempty" toon:"timezone,omitempty"`
// Weekly working days, `0` = Sunday … `6` = Saturday. Days not listed are non-working days. When empty, no weekday is treated as non-working. When sent, replaces the stored list; omit to keep it.
Workdays []int64 `json:"workdays,omitempty" toon:"workdays,omitempty"`
}
CalendarUpdateRequest is generated from the Flashduty OpenAPI schema.
type CalendarsService ¶
type CalendarsService service
CalendarsService handles the "On-call/Calendars" API resource.
func (*CalendarsService) CalEventDelete ¶
func (s *CalendarsService) CalEventDelete(ctx context.Context, req *CalEventIDRequest) (*Response, error)
Delete calendar event.
Delete one personal-calendar event by ID, or clear the calendar's own events from a date range.
API: POST /calendar/event/delete (calEventDelete).
func (*CalendarsService) CalEventList ¶
func (s *CalendarsService) CalEventList(ctx context.Context, req *CalEventListRequest) (*CalEventListResponse, *Response, error)
List calendar events.
Return a personal calendar's events for a year, month or day, plus the resolved state of each day.
API: POST /calendar/event/list (calEventList).
func (*CalendarsService) CalEventUpsert ¶
func (s *CalendarsService) CalEventUpsert(ctx context.Context, req *CalEventUpsertRequest) (*CalEventUpsertResponse, *Response, error)
Upsert calendar event.
Create or update one of a personal calendar's own events: a day off or a working-day override.
API: POST /calendar/event/upsert (calEventUpsert).
func (*CalendarsService) CalendarCreate ¶
func (s *CalendarsService) CalendarCreate(ctx context.Context, req *CalendarCreateRequest) (*CalendarCreateResponse, *Response, error)
Create calendar.
Create a personal service calendar with its weekly workdays and linked holiday calendars.
API: POST /calendar/create (calendarCreate).
func (*CalendarsService) CalendarDelete ¶
func (s *CalendarsService) CalendarDelete(ctx context.Context, req *CalendarIDRequest) (*Response, error)
Delete calendar.
Delete a personal service calendar and its events when no rule references it.
API: POST /calendar/delete (calendarDelete).
func (*CalendarsService) CalendarInfo ¶
func (s *CalendarsService) CalendarInfo(ctx context.Context, req *CalendarIDRequest) (*CalendarItem, *Response, error)
Get calendar info.
Return the details of one service calendar of the account by its ID.
API: POST /calendar/info (calendarInfo).
func (*CalendarsService) CalendarList ¶
func (s *CalendarsService) CalendarList(ctx context.Context, req *CalendarListRequest) (*CalendarListResponse, *Response, error)
List calendars.
Return the list of service calendars visible to the current account.
API: POST /calendar/list (calendarList).
func (*CalendarsService) CalendarUpdate ¶
func (s *CalendarsService) CalendarUpdate(ctx context.Context, req *CalendarUpdateRequest) (*Response, error)
Update calendar.
Update a personal service calendar; only the fields you send are changed.
API: POST /calendar/update (calendarUpdate).
type CancelStatusPageMigrationRequest ¶
type CancelStatusPageMigrationRequest struct {
// Migration job ID, returned when the migration job is created; check progress via `GET /status-page/migration/status`.
JobID string `json:"job_id" toon:"job_id"`
}
CancelStatusPageMigrationRequest is generated from the Flashduty OpenAPI schema.
type ChangeEventItem ¶ added in v0.4.0
type ChangeEventItem struct {
// Account this change event belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// Stable key that groups events belonging to the same change.
ChangeKey string `json:"change_key" toon:"change_key"`
// Lifecycle status of the change event, reported by the change source as execution progresses.
// | Value | Meaning |
// |---|---|
// | `Planned` | Planned, not started. |
// | `Ready` | Ready for execution. |
// | `Processing` | Being executed. |
// | `Canceled` | Canceled. |
// | `Done` | Completed. |
// | `Failed` | Failed. |
ChangeStatus string `json:"change_status" toon:"change_status"`
// Collaboration channel this change event is routed to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Unix timestamp in seconds when the change event was created.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Unix timestamp in seconds when the change event was deleted. Omitted when not deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Change event description.
Description string `json:"description" toon:"description"`
// Change event ID, a MongoDB ObjectID hex string.
EventID string `json:"event_id" toon:"event_id"`
// Unix timestamp in seconds when the change event occurred.
EventTime Timestamp `json:"event_time" toon:"event_time"`
// Integration that reported this change event.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Key-value labels attached to the change event.
Labels map[string]string `json:"labels" toon:"labels"`
// External link to the source change record.
Link string `json:"link" toon:"link"`
// Change event title.
Title string `json:"title" toon:"title"`
// Unix timestamp in seconds when the change event was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
ChangeEventItem is generated from the Flashduty OpenAPI schema.
type ChangeItem ¶ added in v0.4.0
type ChangeItem struct {
// Account this change belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// Change ID, a MongoDB ObjectID hex string.
ChangeID string `json:"change_id" toon:"change_id"`
// Stable key that groups events belonging to the same change.
ChangeKey string `json:"change_key" toon:"change_key"`
// Current lifecycle status of the change.
// | Value | Meaning |
// |---|---|
// | `Planned` | Planned, not started. |
// | `Ready` | Ready for execution. |
// | `Processing` | Being executed. |
// | `Canceled` | Canceled. |
// | `Done` | Completed. |
// | `Failed` | Failed. |
ChangeStatus string `json:"change_status" toon:"change_status"`
// Collaboration channel this change is routed to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Name of the collaboration channel; an empty string when the change is not routed to an existing channel.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Status of the collaboration channel: `enabled` or `disabled`; an empty string when the change is not routed to an existing channel.
ChannelStatus string `json:"channel_status" toon:"channel_status"`
// Change description.
Description string `json:"description" toon:"description"`
// Unix timestamp in seconds when the change ended.
EndTime Timestamp `json:"end_time" toon:"end_time"`
// Raw change events reported by the integration that make up this change. Present only when `include_events` is `true`.
Events []ChangeEventItem `json:"events" toon:"events"`
// Integration that reported this change.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Name of the reporting integration.
IntegrationName string `json:"integration_name" toon:"integration_name"`
// Key-value labels attached to the change; `null` when it has none.
Labels map[string]string `json:"labels" toon:"labels"`
// Unix timestamp in seconds of the most recent change activity.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// External link to the source change record.
Link string `json:"link" toon:"link"`
// Unix timestamp in seconds when the change started.
StartTime Timestamp `json:"start_time" toon:"start_time"`
// Change title.
Title string `json:"title" toon:"title"`
}
ChangeItem is generated from the Flashduty OpenAPI schema.
type ChangesService ¶ added in v0.4.0
type ChangesService service
ChangesService handles the "On-call/Changes" API resource.
func (*ChangesService) List ¶ added in v0.4.0
func (s *ChangesService) List(ctx context.Context, req *ListChangeRequest) (*ListChangeResponse, *Response, error)
List changes.
Query change records within a time window, with filtering, search, and pagination.
API: POST /change/list (change-read-list).
type ChannelCreateResponse ¶
type ChannelCreateResponse struct {
// Newly created channel ID.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name echoed back from the request.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Token for external reporters. Returned only when the request set `is_external_report_enabled` to `true`; it can be read again later from `POST /channel/info`.
ExternalReportToken string `json:"external_report_token" toon:"external_report_token"`
}
ChannelCreateResponse is generated from the Flashduty OpenAPI schema.
type ChannelIDRequest ¶
type ChannelIDRequest struct {
// Channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
}
ChannelIDRequest is generated from the Flashduty OpenAPI schema.
type ChannelInfoRequest ¶
type ChannelInfoRequest struct {
// ID of the channel to query; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
}
ChannelInfoRequest is generated from the Flashduty OpenAPI schema.
type ChannelInfosRequest ¶
type ChannelInfosRequest struct {
// Channel IDs to look up. Up to 1000.
ChannelIDs []int64 `json:"channel_ids" toon:"channel_ids"`
}
ChannelInfosRequest is generated from the Flashduty OpenAPI schema.
type ChannelInfosResponse ¶
type ChannelInfosResponse struct {
// Requested channels that exist, including deleted ones; unknown IDs are skipped. Ordered by channel creation, not by request order.
Items []ChannelShort `json:"items" toon:"items"`
}
ChannelInfosResponse is generated from the Flashduty OpenAPI schema.
type ChannelIntegrationCreateRequest ¶ added in v0.15.21
type ChannelIntegrationCreateRequest struct {
// Target channel ID; the channel must be enabled.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Description, at most 499 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Optional supplied integration key. A non-empty value must have 35 characters, match the account suffix, and be unique.
IntegrationKey string `json:"integration_key,omitempty" toon:"integration_key,omitempty"`
// Integration name, 2–49 characters when supplied; omitted or empty uses the integration type default.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Enabled alert integration type identifier, such as `standard.alert`.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Integration-type-specific configuration; saved secret values in responses are masked as `******`.
Settings map[string]any `json:"settings,omitempty" toon:"settings,omitempty"`
}
ChannelIntegrationCreateRequest is generated from the Flashduty OpenAPI schema.
type ChannelIntegrationCreateResponse ¶ added in v0.15.21
type ChannelIntegrationCreateResponse struct {
// Created dedicated integration ID.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Integration key for alert ingestion.
IntegrationKey string `json:"integration_key" toon:"integration_key"`
}
ChannelIntegrationCreateResponse is generated from the Flashduty OpenAPI schema.
type ChannelIntegrationIDRequest ¶ added in v0.15.21
type ChannelIntegrationIDRequest struct {
// Dedicated integration ID returned by create, list, or info. Public integration IDs are not accepted.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
ChannelIntegrationIDRequest is generated from the Flashduty OpenAPI schema.
type ChannelIntegrationItem ¶ added in v0.15.21
type ChannelIntegrationItem struct {
// Integration category; dedicated integration creation accepts `event.alert` alert integrations.
Category string `json:"category" toon:"category"`
// ID of the channel that owns the dedicated integration.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Creation time as a Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Integration description; empty when unset.
Description string `json:"description" toon:"description"`
// Compatibility identifier for earlier integrations; `0` when absent. Use `integration_id` for this API group.
ExclusiveDataSourceID int64 `json:"exclusive_data_source_id" toon:"exclusive_data_source_id"`
// Dedicated integration ID; use this ID for subsequent API calls.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Complete integration key for alert ingestion; separate from the management App Key.
IntegrationKey string `json:"integration_key" toon:"integration_key"`
// Source time of the most recent event as a Unix timestamp in seconds; `0` when unavailable.
LastSourceTime Timestamp `json:"last_source_time" toon:"last_source_time"`
// Most recent received-event time as a Unix timestamp in seconds; `0` when no event has arrived.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Integration name.
Name string `json:"name" toon:"name"`
// Numeric integration type ID. Create uses the string `plugin_type` instead.
PluginID int64 `json:"plugin_id" toon:"plugin_id"`
// Integration type identifier, such as `standard.alert`.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Integration type display name, localized to the request language.
PluginTypeName string `json:"plugin_type_name" toon:"plugin_type_name"`
// Integration-type-specific configuration; saved secret values in responses are masked as `******`.
Settings map[string]any `json:"settings" toon:"settings"`
// Lifecycle status: `enabled` accepts alerts; `disabled` pauses ingestion.
Status string `json:"status" toon:"status"`
// Last update time as a Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
ChannelIntegrationItem is generated from the Flashduty OpenAPI schema.
type ChannelIntegrationListRequest ¶ added in v0.15.21
type ChannelIntegrationListRequest struct {
ListOptions
// Channel ID to list dedicated integrations for.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Filter by integration name.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Filter by one integration type.
PluginType string `json:"plugin_type,omitempty" toon:"plugin_type,omitempty"`
// Filter by `enabled` integrations that accept alerts or `disabled` integrations that pause ingestion.
Status string `json:"status,omitempty" toon:"status,omitempty"`
}
ChannelIntegrationListRequest is generated from the Flashduty OpenAPI schema.
type ChannelIntegrationListResponse ¶ added in v0.15.21
type ChannelIntegrationListResponse struct {
ListOptions
// Dedicated integrations on this page.
Items []ChannelIntegrationItem `json:"items" toon:"items"`
// Total number of matching dedicated integrations.
Total int64 `json:"total" toon:"total"`
}
ChannelIntegrationListResponse is generated from the Flashduty OpenAPI schema.
type ChannelIntegrationUpdateRequest ¶ added in v0.15.21
type ChannelIntegrationUpdateRequest struct {
// New description, at most 499 characters; empty clears it, omitted or null keeps it.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Dedicated integration ID returned by create, list, or info. Public integration IDs are not accepted.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// New name, 2–49 characters; omitted or null keeps the stored name.
Name *string `json:"name,omitempty" toon:"name,omitempty"`
// Replacement type-specific configuration. Omitted or null keeps it; masked or omitted secret fields retain their stored value.
Settings map[string]any `json:"settings,omitzero" toon:"settings,omitempty"`
}
ChannelIntegrationUpdateRequest is generated from the Flashduty OpenAPI schema.
type ChannelItem ¶
type ChannelItem struct {
// Owning account ID.
AccountID int64 `json:"account_id" toon:"account_id"`
// Highest severity among the channel's active (triggered or processing) incidents: `Critical`, `Warning` or `Info`. Omitted when there are no active incidents.
ActiveIncidentHighestSeverity string `json:"active_incident_highest_severity" toon:"active_incident_highest_severity"`
// How the auto-resolve timer is reset. `trigger` (default) starts the timer once when the incident is triggered — later merged alerts do not affect it; `update` restarts the timer from the latest alert time whenever a new alert merges into the incident.
AutoResolveMode string `json:"auto_resolve_mode" toon:"auto_resolve_mode"`
// Auto-resolve timeout in seconds. 0 disables auto-resolve.
AutoResolveTimeout int64 `json:"auto_resolve_timeout" toon:"auto_resolve_timeout"`
// Channel ID; pass it as `channel_id` to the other channel and rule endpoints.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name, unique within the account, 1–59 characters.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Member ID who created the channel.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Name of the member who created the channel. Returned only by `POST /channel/list` without `is_brief`; omitted when the lookup fails.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Deletion time, Unix timestamp in seconds. Non-zero only for soft-deleted channels.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Free-form description.
Description string `json:"description" toon:"description"`
// When true, automatic incident closing is disabled.
DisableAutoClose bool `json:"disable_auto_close" toon:"disable_auto_close"`
// When true, outlier incident detection is disabled.
DisableOutlierDetection bool `json:"disable_outlier_detection" toon:"disable_outlier_detection"`
// Alert event merge configuration. When never set, merging is enabled with a 1,440-minute window.
EventGroup EventGroup `json:"event_group" toon:"event_group"`
// Token external reporters use to file incidents into this channel. Returned only when external reporting is enabled and the caller can edit the channel.
ExternalReportToken string `json:"external_report_token" toon:"external_report_token"`
// Flapping detection configuration. When never set, the defaults are returned: enabled, 4 changes within 60 minutes, muted for 120 minutes.
Flapping Flapping `json:"flapping" toon:"flapping"`
// Alert grouping configuration. When never set, `{"method": "n"}` (no grouping) is returned.
Group Group `json:"group" toon:"group"`
// Whether external reporters can file incidents into this channel.
IsExternalReportEnabled bool `json:"is_external_report_enabled" toon:"is_external_report_enabled"`
// When true, the channel is visible only to its managing teams.
IsPrivate bool `json:"is_private" toon:"is_private"`
// Whether the caller has starred this channel. Returned only by `POST /channel/list`.
IsStarred bool `json:"is_starred" toon:"is_starred"`
// Time of the most recent incident, Unix timestamp in seconds.
LastIncidentAt Timestamp `json:"last_incident_at" toon:"last_incident_at"`
// Additional teams that can manage the channel.
ManagingTeamIDs []int64 `json:"managing_team_ids" toon:"managing_team_ids"`
// Counts of incidents started in the last 30 days that are still open, by progress. Not returned with `is_brief`.
ProgressToIncidentCnts IncProgressCnts `json:"progress_to_incident_cnts" toon:"progress_to_incident_cnts"`
// Channel status:
// - `enabled`: incoming alert events are processed.
// - `disabled`: incoming alert events are discarded.
// - `deleted`: the channel was deleted; returned only by `POST /channel/info` and `POST /channel/infos`, never by `POST /channel/list`.
Status string `json:"status" toon:"status"`
// Owning team ID.
TeamID int64 `json:"team_id" toon:"team_id"`
// Owning team name, resolved from the team directory. Returned only by `POST /channel/list` without `is_brief`; omitted when the lookup fails.
TeamName string `json:"team_name" toon:"team_name"`
// Last update time, Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
ChannelItem is generated from the Flashduty OpenAPI schema.
type ChannelRuleIDRequest ¶
type ChannelRuleIDRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule ID (24-character hex), as returned in `rule_id` by the create or list endpoint of the same rule type.
RuleID string `json:"rule_id" toon:"rule_id"`
}
ChannelRuleIDRequest is generated from the Flashduty OpenAPI schema.
type ChannelScopedListRequest ¶
type ChannelScopedListRequest struct {
// Channel whose rules to list; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
}
ChannelScopedListRequest is generated from the Flashduty OpenAPI schema.
type ChannelShort ¶
type ChannelShort struct {
// Channel ID, one of the requested `channel_ids`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name, unique within the account.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Channel status:
// - `enabled`: incoming alert events are processed.
// - `disabled`: incoming alert events are discarded.
// - `deleted`: the channel was deleted.
Status string `json:"status" toon:"status"`
}
ChannelShort is generated from the Flashduty OpenAPI schema.
type ChannelsService ¶
type ChannelsService service
ChannelsService handles the "On-call/Channels" API resource.
func (*ChannelsService) ChannelCreate ¶
func (s *ChannelsService) ChannelCreate(ctx context.Context, req *CreateChannelRequest) (*ChannelCreateResponse, *Response, error)
Create channel.
Create a channel, optionally with a default escalation rule and channel-exclusive integrations.
API: POST /channel/create (channelCreate).
func (*ChannelsService) ChannelDelete ¶
func (s *ChannelsService) ChannelDelete(ctx context.Context, req *ChannelIDRequest) (*Response, error)
Delete channel.
Delete a disabled channel together with its rules and channel-exclusive integrations.
API: POST /channel/delete (channelDelete).
func (*ChannelsService) ChannelDisable ¶
func (s *ChannelsService) ChannelDisable(ctx context.Context, req *ChannelIDRequest) (*Response, error)
Disable channel.
Disable a channel; while disabled it discards all incoming alert events.
API: POST /channel/disable (channelDisable).
func (*ChannelsService) ChannelEnable ¶
func (s *ChannelsService) ChannelEnable(ctx context.Context, req *ChannelIDRequest) (*Response, error)
Enable channel.
Enable a disabled channel so it processes incoming alert events again.
API: POST /channel/enable (channelEnable).
func (*ChannelsService) ChannelEscalateRuleCreate ¶
func (s *ChannelsService) ChannelEscalateRuleCreate(ctx context.Context, req *CreateEscalationRuleRequest) (*RuleCreateResponse, *Response, error)
Create escalation rule.
Create an escalation rule that decides who is notified about a channel's incidents, and how.
API: POST /channel/escalate/rule/create (channelEscalateRuleCreate).
func (*ChannelsService) ChannelEscalateRuleDelete ¶
func (s *ChannelsService) ChannelEscalateRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Delete escalation rule.
Delete a disabled escalation rule so it no longer appears in the channel's rule list.
API: POST /channel/escalate/rule/delete (channelEscalateRuleDelete).
func (*ChannelsService) ChannelEscalateRuleDisable ¶
func (s *ChannelsService) ChannelEscalateRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Disable escalation rule.
Disable an escalation rule without deleting it.
API: POST /channel/escalate/rule/disable (channelEscalateRuleDisable).
func (*ChannelsService) ChannelEscalateRuleEnable ¶
func (s *ChannelsService) ChannelEscalateRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Enable escalation rule.
Enable a disabled escalation rule so it can take new incidents again.
API: POST /channel/escalate/rule/enable (channelEscalateRuleEnable).
func (*ChannelsService) ChannelEscalateRuleInfo ¶
func (s *ChannelsService) ChannelEscalateRuleInfo(ctx context.Context, req *ChannelRuleIDRequest) (*EscalateRuleItem, *Response, error)
Get escalation rule detail.
Return one escalation rule of a channel, including its levels, time windows and filters.
API: POST /channel/escalate/rule/info (channelEscalateRuleInfo).
func (*ChannelsService) ChannelEscalateRuleList ¶
func (s *ChannelsService) ChannelEscalateRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListEscalationRulesResponse, *Response, error)
List escalation rules.
List a channel's escalation rules in the order they are evaluated.
API: POST /channel/escalate/rule/list (channelEscalateRuleList).
func (*ChannelsService) ChannelEscalateRuleReorder ¶ added in v0.15.19
func (s *ChannelsService) ChannelEscalateRuleReorder(ctx context.Context, req *ReorderEscalationRulesRequest) (*Response, error)
Reorder escalation rules.
Change the evaluation order of a channel's escalation rules by moving one rule into another rule's slot.
API: POST /channel/escalate/rule/reorder (channelEscalateRuleReorder).
func (*ChannelsService) ChannelEscalateRuleUpdate ¶
func (s *ChannelsService) ChannelEscalateRuleUpdate(ctx context.Context, req *UpdateEscalationRuleRequest) (*Response, error)
Update escalation rule.
Replace the configuration of an existing escalation rule.
API: POST /channel/escalate/rule/update (channelEscalateRuleUpdate).
func (*ChannelsService) ChannelInfo ¶
func (s *ChannelsService) ChannelInfo(ctx context.Context, req *ChannelInfoRequest) (*ChannelItem, *Response, error)
Get channel detail.
Return one channel's full configuration with counts of its active incidents from the last 30 days.
API: POST /channel/info (channelInfo).
func (*ChannelsService) ChannelInfos ¶
func (s *ChannelsService) ChannelInfos(ctx context.Context, req *ChannelInfosRequest) (*ChannelInfosResponse, *Response, error)
Batch get channels.
Return the ID, name and status of up to 1,000 channels in one call.
API: POST /channel/infos (channelInfos).
func (*ChannelsService) ChannelInhibitRuleCreate ¶
func (s *ChannelsService) ChannelInhibitRuleCreate(ctx context.Context, req *CreateInhibitRuleRequest) (*RuleCreateResponse, *Response, error)
Create inhibit rule.
Create an inhibit rule that mutes alert events while a related source alert is still active.
API: POST /channel/inhibit/rule/create (channelInhibitRuleCreate).
func (*ChannelsService) ChannelInhibitRuleDelete ¶
func (s *ChannelsService) ChannelInhibitRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Delete inhibit rule.
Delete a disabled inhibit rule so it no longer appears in the channel's rule list.
API: POST /channel/inhibit/rule/delete (channelInhibitRuleDelete).
func (*ChannelsService) ChannelInhibitRuleDisable ¶
func (s *ChannelsService) ChannelInhibitRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Disable inhibit rule.
Disable an inhibit rule without deleting it.
API: POST /channel/inhibit/rule/disable (channelInhibitRuleDisable).
func (*ChannelsService) ChannelInhibitRuleEnable ¶
func (s *ChannelsService) ChannelInhibitRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Enable inhibit rule.
Enable a disabled inhibit rule so it mutes matching alert events again.
API: POST /channel/inhibit/rule/enable (channelInhibitRuleEnable).
func (*ChannelsService) ChannelInhibitRuleList ¶
func (s *ChannelsService) ChannelInhibitRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListInhibitRulesResponse, *Response, error)
List inhibit rules.
List a channel's inhibit rules, oldest first.
API: POST /channel/inhibit/rule/list (channelInhibitRuleList).
func (*ChannelsService) ChannelInhibitRuleUpdate ¶
func (s *ChannelsService) ChannelInhibitRuleUpdate(ctx context.Context, req *UpdateInhibitRuleRequest) (*Response, error)
Update inhibit rule.
Replace the configuration of an existing inhibit rule.
API: POST /channel/inhibit/rule/update (channelInhibitRuleUpdate).
func (*ChannelsService) ChannelList ¶
func (s *ChannelsService) ChannelList(ctx context.Context, req *ListChannelsRequest) (*ListChannelsResponse, *Response, error)
List channels.
List the channels visible to the caller, with filters, sorting and pagination.
API: POST /channel/list (channelList).
func (*ChannelsService) ChannelSilenceRuleCreate ¶
func (s *ChannelsService) ChannelSilenceRuleCreate(ctx context.Context, req *CreateSilenceRuleRequest) (*RuleCreateResponse, *Response, error)
Create silence rule.
Create a silence rule that mutes or drops matching alert events during a time window.
API: POST /channel/silence/rule/create (channelSilenceRuleCreate).
func (*ChannelsService) ChannelSilenceRuleDelete ¶
func (s *ChannelsService) ChannelSilenceRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Delete silence rule.
Delete a disabled silence rule so it no longer appears in the channel's rule list.
API: POST /channel/silence/rule/delete (channelSilenceRuleDelete).
func (*ChannelsService) ChannelSilenceRuleDisable ¶
func (s *ChannelsService) ChannelSilenceRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Disable silence rule.
Disable a silence rule without deleting it.
API: POST /channel/silence/rule/disable (channelSilenceRuleDisable).
func (*ChannelsService) ChannelSilenceRuleEnable ¶
func (s *ChannelsService) ChannelSilenceRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Enable silence rule.
Enable a disabled silence rule so it silences matching alert events again.
API: POST /channel/silence/rule/enable (channelSilenceRuleEnable).
func (*ChannelsService) ChannelSilenceRuleList ¶
func (s *ChannelsService) ChannelSilenceRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListSilenceRulesResponse, *Response, error)
List silence rules.
List a channel's silence rules and whether each one is in effect right now.
API: POST /channel/silence/rule/list (channelSilenceRuleList).
func (*ChannelsService) ChannelSilenceRuleUpdate ¶
func (s *ChannelsService) ChannelSilenceRuleUpdate(ctx context.Context, req *UpdateSilenceRuleRequest) (*Response, error)
Update silence rule.
Replace the configuration of an existing silence rule.
API: POST /channel/silence/rule/update (channelSilenceRuleUpdate).
func (*ChannelsService) ChannelUnsubscribeRuleCreate ¶
func (s *ChannelsService) ChannelUnsubscribeRuleCreate(ctx context.Context, req *CreateDropRuleRequest) (*RuleCreateResponse, *Response, error)
Create drop rule.
Create a drop rule that discards matching alert events before any alert or incident is created.
API: POST /channel/unsubscribe/rule/create (channelUnsubscribeRuleCreate).
func (*ChannelsService) ChannelUnsubscribeRuleDelete ¶
func (s *ChannelsService) ChannelUnsubscribeRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Delete drop rule.
Delete a disabled drop rule so it no longer appears in the channel's rule list.
API: POST /channel/unsubscribe/rule/delete (channelUnsubscribeRuleDelete).
func (*ChannelsService) ChannelUnsubscribeRuleDisable ¶
func (s *ChannelsService) ChannelUnsubscribeRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Disable drop rule.
Disable a drop rule without deleting it.
API: POST /channel/unsubscribe/rule/disable (channelUnsubscribeRuleDisable).
func (*ChannelsService) ChannelUnsubscribeRuleEnable ¶
func (s *ChannelsService) ChannelUnsubscribeRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)
Enable drop rule.
Enable a disabled drop rule so it discards matching alert events again.
API: POST /channel/unsubscribe/rule/enable (channelUnsubscribeRuleEnable).
func (*ChannelsService) ChannelUnsubscribeRuleList ¶
func (s *ChannelsService) ChannelUnsubscribeRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListDropRulesResponse, *Response, error)
List drop rules.
List a channel's drop rules, oldest first.
API: POST /channel/unsubscribe/rule/list (channelUnsubscribeRuleList).
func (*ChannelsService) ChannelUnsubscribeRuleUpdate ¶
func (s *ChannelsService) ChannelUnsubscribeRuleUpdate(ctx context.Context, req *UpdateDropRuleRequest) (*Response, error)
Update drop rule.
Replace the name, description and conditions of an existing drop rule.
API: POST /channel/unsubscribe/rule/update (channelUnsubscribeRuleUpdate).
func (*ChannelsService) ChannelUpdate ¶
func (s *ChannelsService) ChannelUpdate(ctx context.Context, req *UpdateChannelRequest) (*UpdateChannelResponse, *Response, error)
Update channel.
Update a channel's settings; only the fields present in the request are changed.
API: POST /channel/update (channelUpdate).
func (*ChannelsService) RouteInfo ¶
func (s *ChannelsService) RouteInfo(ctx context.Context, req *RouteInfoRequest) (*RouteItem, *Response, error)
Get routing rule detail.
Return the routing rule of one shared integration.
API: POST /route/info (routeInfo).
func (*ChannelsService) RouteList ¶
func (s *ChannelsService) RouteList(ctx context.Context, req *ListRoutesRequest) (*ListRoutesResponse, *Response, error)
List routing rules.
Return the routing rules of several shared integrations in one call.
API: POST /route/list (routeList).
func (*ChannelsService) RouteUpsert ¶
func (s *ChannelsService) RouteUpsert(ctx context.Context, req *UpsertRouteRequest) (*Response, error)
Upsert routing rule.
Create or replace the routing rule that sends a shared integration's alerts to channels.
API: POST /route/upsert (routeUpsert).
type ClickHouseQueryParams ¶ added in v0.15.2
type ClickHouseQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
}
ClickHouseQueryParams are the params for `clickhouse.query`. Expr is a single read-only SQL statement. Execution.Kind must be `window`.
type Client ¶
Client is a Flashduty Open API client. Construct it with NewClient and use the service fields (added by the generator) to call endpoints.
Example (ErrorHandling) ¶
ExampleClient_errorHandling distinguishes API errors from rate-limit errors.
package main
import (
"context"
"errors"
"fmt"
"log"
"time"
flashduty "github.com/flashcatcloud/go-flashduty"
)
func main() {
ctx := context.Background()
client, err := flashduty.NewClient("YOUR_APP_KEY")
if err != nil {
log.Fatal(err)
}
_, _, err = client.Incidents.Info(ctx, &flashduty.IncidentInfoRequest{
IncidentID: "does-not-exist",
})
var rl *flashduty.RateLimitError
if errors.As(err, &rl) {
// Back off for the duration the server asked for, then retry.
time.Sleep(rl.RetryAfter)
return
}
var apiErr *flashduty.ErrorResponse
if errors.As(err, &apiErr) {
fmt.Printf("api error code=%s request_id=%s\n", apiErr.Code, apiErr.RequestID)
return
}
if err != nil {
log.Fatal(err)
}
}
Output:
func NewClient ¶
NewClient returns a Flashduty client authenticated with the given app key.
Example ¶
ExampleNewClient shows how to construct a client with a couple of options.
package main
import (
"fmt"
"log"
"time"
flashduty "github.com/flashcatcloud/go-flashduty"
)
func main() {
client, err := flashduty.NewClient(
"YOUR_APP_KEY",
flashduty.WithTimeout(30*time.Second),
flashduty.WithUserAgent("my-app/1.0"),
)
if err != nil {
log.Fatal(err)
}
_ = client
fmt.Println("client ready")
}
Output:
func NewClientWithAccessToken ¶ added in v0.15.11
NewClientWithAccessToken returns a Flashduty client that authenticates every request with an OAuth access token, sent as "Authorization: Bearer <token>" instead of the app_key query parameter.
type CommentIncidentRequest ¶
type CommentIncidentRequest struct {
// Comment body. Leading and trailing whitespace is trimmed; the comment must be non-empty after trimming and at most 1024 characters (counted after @mention normalization).
Comment string `json:"comment" toon:"comment"`
// Optional ID of an account-level comment type to attach to the comment (MongoDB ObjectID). An invalid or all-zero ID is rejected with 400.
CommentTypeID *string `json:"comment_type_id,omitempty" toon:"comment_type_id,omitempty"`
// Incident IDs to comment on. At most 100 per call.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
// When true, do not trigger webhook reply actions for this comment.
MuteReply bool `json:"mute_reply,omitempty" toon:"mute_reply,omitempty"`
}
CommentIncidentRequest is generated from the Flashduty OpenAPI schema.
type CompleteWorkItemRequest ¶ added in v0.8.0
type CompleteWorkItemRequest struct {
// Client-generated idempotency key (max 128 characters; letters, digits, `_`, `-`, `.`, `:` only).
IdempotencyKey string `json:"idempotency_key" toon:"idempotency_key"`
// Target status. Must be `done`; any other value is rejected.
TargetStatus string `json:"target_status" toon:"target_status"`
// Current item version for optimistic locking. Must match the stored version.
Version int64 `json:"version" toon:"version"`
// Work item ID (opaque string, max 128 characters).
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
CompleteWorkItemRequest is generated from the Flashduty OpenAPI schema.
type ContextResolvedItem ¶ added in v0.5.4
type ContextResolvedItem struct {
// Resolved account-scope knowledge ID.
AccountPackID string `json:"account_pack_id" toon:"account_pack_id"`
// Bound incident id, when war-room originated.
IncidentID string `json:"incident_id" toon:"incident_id"`
// Unix timestamp in milliseconds when the knowledge was resolved.
ResolvedAtMs TimestampMilli `json:"resolved_at_ms" toon:"resolved_at_ms"`
// Resolved team-scope knowledge ID.
TeamPackID string `json:"team_pack_id" toon:"team_pack_id"`
// Map from knowledge ID to the version the agent last loaded.
Versions map[string]int64 `json:"versions" toon:"versions"`
}
ContextResolvedItem is generated from the Flashduty OpenAPI schema.
type ConvertWorkItemRequest ¶ added in v0.8.0
type ConvertWorkItemRequest struct {
// Client-generated idempotency key (max 128 characters; letters, digits, `_`, `-`, `.`, `:` only).
IdempotencyKey string `json:"idempotency_key" toon:"idempotency_key"`
// Optional status to set on the converted follow-up; omitted or `null` keeps the current status. Values: `open` (not started), `in_progress` (being worked on), `done` (finished), `cancelled` (no longer needed).
TargetStatus *string `json:"target_status,omitempty" toon:"target_status,omitempty"`
// The item's current `version` (≥ 1) for optimistic locking.
Version int64 `json:"version" toon:"version"`
// Work item ID (opaque string, max 128 characters).
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
ConvertWorkItemRequest is generated from the Flashduty OpenAPI schema.
type CreateChannelRequest ¶
type CreateChannelRequest struct {
// How the auto-resolve timer runs. `trigger` (default) starts the timer once when the incident is triggered; `update` restarts it whenever a new alert merges into the incident.
AutoResolveMode string `json:"auto_resolve_mode,omitempty" toon:"auto_resolve_mode,omitempty"`
// Auto-resolve timeout in seconds. 0 disables auto-resolve. Max 30 days.
AutoResolveTimeout int64 `json:"auto_resolve_timeout,omitempty" toon:"auto_resolve_timeout,omitempty"`
// Channel name, 1–59 characters, unique within the account. Must not contain a comma or start or end with whitespace.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Free-form description. Up to 500 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Disable automatic incident closing.
DisableAutoClose bool `json:"disable_auto_close,omitempty" toon:"disable_auto_close,omitempty"`
// Disable outlier incident detection.
DisableOutlierDetection bool `json:"disable_outlier_detection,omitempty" toon:"disable_outlier_detection,omitempty"`
// Creates an enabled escalation rule named `Default` with a single level that notifies `target` once. Omit to create the channel without escalation rules.
EscalateRule CreateChannelRequestEscalateRule `json:"escalate_rule,omitzero" toon:"escalate_rule,omitempty"`
// Alert event merge configuration. Omit to use the default (merge enabled, 1440-minute window).
EventGroup EventGroup `json:"event_group,omitzero" toon:"event_group,omitempty"`
// Flapping detection configuration. Omit to use the defaults.
Flapping Flapping `json:"flapping,omitzero" toon:"flapping,omitempty"`
// Alert grouping configuration. Omit for no grouping (`method` `n`).
Group Group `json:"group,omitzero" toon:"group,omitempty"`
// When true, external reporters can file incidents into this channel, and the response carries the generated `external_report_token`.
IsExternalReportEnabled bool `json:"is_external_report_enabled,omitempty" toon:"is_external_report_enabled,omitempty"`
// When true, the channel is visible only to its managing teams.
IsPrivate bool `json:"is_private,omitempty" toon:"is_private,omitempty"`
// Additional teams that can manage the channel. Up to 3 entries.
ManagingTeamIDs []int64 `json:"managing_team_ids,omitempty" toon:"managing_team_ids,omitempty"`
// Integration type IDs (the `plugin_id` shown on integrations returned by `POST /integration/list`). For each ID, a channel-exclusive integration of that type is created, named after the type. An unknown ID returns `InvalidParameter`.
PluginIDs []int64 `json:"plugin_ids,omitempty" toon:"plugin_ids,omitempty"`
// Owning team ID; obtain it from `POST /team/list`. Required and must exist.
TeamID int64 `json:"team_id" toon:"team_id"`
}
CreateChannelRequest is generated from the Flashduty OpenAPI schema.
type CreateChannelRequestEscalateRule ¶
type CreateChannelRequestEscalateRule struct {
// Delay in seconds, 0–3600, before the first notification for a newly assigned incident; `0` notifies immediately.
AggrWindow int64 `json:"aggr_window,omitempty" toon:"aggr_window,omitempty"`
// Who to notify and through which channels.
Target EscalateTarget `json:"target" toon:"target"`
// Notification template ID (24-character hex); obtain it from `POST /template/list`. Must exist.
TemplateID string `json:"template_id" toon:"template_id"`
}
CreateChannelRequestEscalateRule is generated from the Flashduty OpenAPI schema.
type CreateDropRuleRequest ¶
type CreateDropRuleRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Alert event conditions (OR of AND groups). A matching event is discarded entirely: no alert, incident or notification. Keys: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`. When omitted or empty, the rule matches nothing.
Filters FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
}
CreateDropRuleRequest is generated from the Flashduty OpenAPI schema.
type CreateEscalationRuleRequest ¶
type CreateEscalationRuleRequest struct {
// Delay in seconds, 0–3600, before the first notification for a newly assigned incident; `0` notifies immediately.
AggrWindow int64 `json:"aggr_window,omitempty" toon:"aggr_window,omitempty"`
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Incident conditions (OR of AND groups), matched against the incident the alert was grouped into, not against the alert. Keys: `title`, `description`, `severity` (alias `incident_severity`, `alert_severity`), `status` (alias `incident_status`, `alert_status`), `dedup_key`, `integration_id` (alias `data_source_id`), or any `labels.<name>`. Omit or leave empty to match every incident in the channel.
Filters FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
// Escalation levels in order; the incident starts at the first level.
Layers []EscalateLayer `json:"layers" toon:"layers"`
// Evaluation order from `0` to `200`; lower values are evaluated first. Omit to place the rule after all existing rules (current highest priority + 1).
Priority *int64 `json:"priority,omitempty" toon:"priority,omitempty"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Notification template ID (24-character hex); obtain it from `POST /template/list`. Must exist.
TemplateID string `json:"template_id" toon:"template_id"`
// Recurring time windows during which the rule can match; omit or leave empty to match at any time.
TimeFilters []TimeFilter `json:"time_filters,omitempty" toon:"time_filters,omitempty"`
}
CreateEscalationRuleRequest is generated from the Flashduty OpenAPI schema.
type CreateFieldRequest ¶
type CreateFieldRequest struct {
// Optional default value. Type must match `field_type`: `bool` for checkbox; one of `options` for single_select; subset of `options` for multi_select; string ≤3000 chars for text.
DefaultValue any `json:"default_value,omitempty" toon:"default_value,omitempty"`
// Optional free-text description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Human-readable name. Must be unique within the account.
DisplayName string `json:"display_name" toon:"display_name"`
// Machine name: 1–39 characters of `[a-zA-Z0-9_]`, starting with a letter or underscore. Immutable after creation.
FieldName string `json:"field_name" toon:"field_name"`
// Field type, immutable after creation.
// | Value | Meaning |
// |---|---|
// | `text` | Free text; `value_type` must be `string`, no `options`. |
// | `single_select` | Single choice from `options`; `value_type` must be `string`. |
// | `multi_select` | Multiple choices from `options`; `value_type` must be `string`. |
// | `checkbox` | Boolean checkbox; `value_type` must be `bool`, no `options`. |
FieldType string `json:"field_type" toon:"field_type"`
// Required and non-empty for `single_select`/`multi_select` (unique strings, each 1–200 chars). Must be omitted or empty for `checkbox`/`text`.
Options []string `json:"options,omitempty" toon:"options,omitempty"`
// Value type. `checkbox` requires `bool`; all other types require `string`. Immutable after creation. `float` is a reserved value currently rejected for every `field_type`.
ValueType string `json:"value_type" toon:"value_type"`
}
CreateFieldRequest is generated from the Flashduty OpenAPI schema.
type CreateFieldResponse ¶
type CreateFieldResponse struct {
// Newly assigned field ID — 24-character hex ObjectID.
FieldID string `json:"field_id" toon:"field_id"`
// Echo of the submitted `field_name`.
FieldName string `json:"field_name" toon:"field_name"`
}
CreateFieldResponse is generated from the Flashduty OpenAPI schema.
type CreateIncidentCommentTypeRequest ¶ added in v0.8.0
type CreateIncidentCommentTypeRequest struct {
// Label color as a hex value in #RRGGBB format. Normalized to uppercase.
Color string `json:"color" toon:"color"`
// Display name. Trimmed before storing; must be unique within the account (case-insensitive). At most 40 characters. Must not contain control or text-direction characters.
Name string `json:"name" toon:"name"`
}
CreateIncidentCommentTypeRequest is generated from the Flashduty OpenAPI schema.
type CreateIncidentCommentTypeResponse ¶ added in v0.8.0
type CreateIncidentCommentTypeResponse struct {
// ID of the created comment type (24-character hex ObjectID).
CommentTypeID string `json:"comment_type_id" toon:"comment_type_id"`
Item IncidentCommentTypeItem `json:"item" toon:"item"`
}
CreateIncidentCommentTypeResponse is generated from the Flashduty OpenAPI schema.
type CreateIncidentRequest ¶
type CreateIncidentRequest struct {
// Who to assign. When omitted or empty, the channel's escalation rules decide (a standalone incident gets no responders); required when the account has a create form. `person_ids`, `escalate_rule_id` and `emails` can be combined — responders are the union. Assignment runs after creation, and its failure does not undo the incident.
AssignedTo CreateIncidentRequestAssignedTo `json:"assigned_to,omitzero" toon:"assigned_to,omitempty"`
// Channel to file the incident into; must exist in the account. Optional unless the account has a create form; leave it unset for a standalone incident.
ChannelID int64 `json:"channel_id,omitempty" toon:"channel_id,omitempty"`
// Incident description, up to 1024 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Custom field values keyed by field name. When a create form applies, only its visible fields are accepted.
Fields CustomFieldValues `json:"fields,omitempty" toon:"fields,omitempty"`
// Incident severity: `Info`, `Warning` or `Critical` (most severe).
IncidentSeverity string `json:"incident_severity" toon:"incident_severity"`
// Labels to store on the created incident, up to 50 entries. Blank values are dropped. Spaces and selected punctuation in keys become `_`; keys and values are trimmed, and values are truncated at 8 KiB.
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Incident title, up to 512 characters. Required (non-blank) when the account has a create form.
Title string `json:"title,omitempty" toon:"title,omitempty"`
}
CreateIncidentRequest is generated from the Flashduty OpenAPI schema.
type CreateIncidentRequestAssignedTo ¶
type CreateIncidentRequestAssignedTo struct {
// Recipients to assign by email (1–100): resolved to account members and merged into `person_ids`; emails with no matching member are ignored.
Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
// Escalation rule ID (MongoDB ObjectID); assigns the people at the rule's `layer_idx` layer.
EscalateRuleID string `json:"escalate_rule_id,omitempty" toon:"escalate_rule_id,omitempty"`
// Zero-based escalation-rule layer to assign (default 0, the first layer). Used only with `escalate_rule_id`; an out-of-range value leaves the incident without responders instead of failing the request.
LayerIdx int64 `json:"layer_idx,omitempty" toon:"layer_idx,omitempty"`
// Override the notification channels used for this assignment.
Notify CreateIncidentRequestAssignedToNotify `json:"notify,omitzero" toon:"notify,omitempty"`
// Member IDs to assign directly (1–100). Can be combined with `escalate_rule_id`.
PersonIDs []int64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
// Assignment type. Normally omitted: the server then sets `assign`, because a manual create is always a first assignment. A value you send is stored as-is.
// - `assign`: first assignment of the incident.
// - `reassign`: assignment replacing an earlier one.
// - `escalate`: assignment triggered by escalation to the next layer.
// - `reopen`: assignment restarted from the first layer after the incident is reopened.
Type string `json:"type,omitempty" toon:"type,omitempty"`
}
CreateIncidentRequestAssignedTo is generated from the Flashduty OpenAPI schema.
type CreateIncidentRequestAssignedToNotify ¶
type CreateIncidentRequestAssignedToNotify struct {
// When false, use `personal_channels`; when true or omitted, use each responder's personal preference.
FollowPreference *bool `json:"follow_preference,omitempty" toon:"follow_preference,omitempty"`
// Channels to use when `follow_preference` is false: `sms`, `voice`, `email`, `push`, or an IM app channel prefixed `feishu_app:`, `dingtalk_app:`, `wecom_app:`, `slack_app:` or `teams_app:`.
PersonalChannels []string `json:"personal_channels,omitempty" toon:"personal_channels,omitempty"`
// Notification template ID (MongoDB ObjectID).
TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
}
CreateIncidentRequestAssignedToNotify is generated from the Flashduty OpenAPI schema.
type CreateIncidentResponse ¶
type CreateIncidentResponse struct {
// Newly created incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Incident title as sent in the request; empty when the request had no title.
Title string `json:"title" toon:"title"`
}
CreateIncidentResponse is generated from the Flashduty OpenAPI schema.
type CreateInhibitRuleRequest ¶
type CreateInhibitRuleRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Keys whose values must be equal on the source alert and the incoming event. Only `title`, `severity` and `labels.<name>` take effect; any other key (for example `data_source_id`) is accepted but makes the rule never fire. Must be present; an empty array also makes the rule inert.
Equals []string `json:"equals" toon:"equals"`
// When true, matching alert events are discarded entirely; when false, alerts are still recorded but marked as muted by this rule.
IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Conditions the source (inhibiting) alert must match, evaluated against active alerts already stored in the channel. Keys: `title`, `description`, `severity` (alias `incident_severity`, `alert_severity`), `status` (alias `incident_status`, `alert_status`), or any `labels.<name>`. Empty makes the rule inert.
SourceFilters FilterGroup `json:"source_filters,omitempty" toon:"source_filters,omitempty"`
// Conditions the incoming target alert event must match to be inhibited; empty means every incoming event is a target. Keys: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`.
TargetFilters FilterGroup `json:"target_filters,omitempty" toon:"target_filters,omitempty"`
}
CreateInhibitRuleRequest is generated from the Flashduty OpenAPI schema.
type CreateIntegrationRequest ¶ added in v0.15.9
type CreateIntegrationRequest struct {
// Free-form description, at most 499 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Optional pre-generated key: 35 characters, ending with the account ID modulo 1000 padded to three digits; it must not already be in use. Omit to generate a key.
IntegrationKey string `json:"integration_key,omitempty" toon:"integration_key,omitempty"`
// Run the plugin test during creation; false when omitted. Inspect the returned `test.success` for the test outcome.
IsTest bool `json:"is_test,omitempty" toon:"is_test,omitempty"`
// Integration name, 2–49 characters when nonempty; defaults to the integration type name when omitted or empty.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Integration type. Must be one listed by `POST /integration/type/list` with `supports_api_create: true`.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Type-specific configuration; the accepted keys depend on `plugin_type`.
Settings map[string]any `json:"settings,omitempty" toon:"settings,omitempty"`
// Owning team ID; omit or use `0` for no team. A nonzero ID must belong to the current account.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
CreateIntegrationRequest is generated from the Flashduty OpenAPI schema.
type CreateIntegrationResponse ¶ added in v0.15.9
type CreateIntegrationResponse struct {
// ID of the new integration.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Integration key for inbound pushes; also readable from `/integration/list` and `/integration/info`.
IntegrationKey string `json:"integration_key" toon:"integration_key"`
// Plugin test result, returned only when a test is performed.
Test *CreateIntegrationResponseTest `json:"test,omitempty" toon:"test,omitempty"`
}
CreateIntegrationResponse is generated from the Flashduty OpenAPI schema.
type CreateIntegrationResponseTest ¶ added in v0.15.15
type CreateIntegrationResponseTest struct {
// Test failure message; empty on success.
Message string `json:"message" toon:"message"`
// Whether the plugin test succeeded.
Success bool `json:"success" toon:"success"`
}
CreateIntegrationResponseTest is generated from the Flashduty OpenAPI schema.
type CreateSilenceRuleRequest ¶
type CreateSilenceRuleRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Alert event conditions (OR of AND groups); matching events are silenced while the time window is active. Required, with at least one condition. Keys: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`.
Filters FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
// ID of the incident this rule is created from (24-character hex). The incident must exist, and only one enabled silence rule may exist per incident.
FromIncidentID string `json:"from_incident_id,omitempty" toon:"from_incident_id,omitempty"`
// When true, a rule with a one-off `time_filter` is permanently removed about 24 hours after `end_time` (or after its last update, whichever is later). Rules created with `from_incident_id` are cleaned up the same way. Rules with recurring `time_filters` are never removed automatically. Defaults to `false`.
IsAutoDelete bool `json:"is_auto_delete,omitempty" toon:"is_auto_delete,omitempty"`
// When true, matching alert events are discarded entirely; when false, alerts are still recorded but marked as muted by this rule.
IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// One-off silence window. Set exactly one of `time_filter` or `time_filters`.
TimeFilter OnceTimeFilter `json:"time_filter,omitzero" toon:"time_filter,omitempty"`
// Recurring silence windows. Set exactly one of `time_filters` or `time_filter`.
TimeFilters []TimeFilter `json:"time_filters,omitempty" toon:"time_filters,omitempty"`
}
CreateSilenceRuleRequest is generated from the Flashduty OpenAPI schema.
type CreateStatusPageChangeRequest ¶
type CreateStatusPageChangeRequest struct {
// Maintenance only: automatically advance the status based on the scheduled window.
AutoUpdateBySchedule bool `json:"auto_update_by_schedule,omitempty" toon:"auto_update_by_schedule,omitempty"`
// Event close time in Unix seconds; must be greater than or equal to the first update's `at_seconds`. For maintenances this is the scheduled end; with `auto_update_by_schedule` the event switches to `completed` at this time, which must be within 30 days from now. For a retrospective event in a terminal status, omitting it uses the latest update's time.
CloseAtSeconds int64 `json:"close_at_seconds,omitempty" toon:"close_at_seconds,omitempty"`
// Event description (Markdown). Must not be empty.
Description string `json:"description" toon:"description"`
// ID of a draft created by `POST /status-page/draft/create` to publish with this event. The draft must be pending, target this `page_id` and `type`, and have no `change_id`; it is marked published once the event is created. Omit when not publishing a draft.
DraftID string `json:"draft_id,omitempty" toon:"draft_id,omitempty"`
// Mark the event as retrospective (a past event recorded afterwards). Requires at least 2 entries in `updates`.
IsRetrospective bool `json:"is_retrospective,omitempty" toon:"is_retrospective,omitempty"`
// Linked change IDs (related incidents, deployments, etc.).
LinkedChanges []string `json:"linked_changes,omitempty" toon:"linked_changes,omitempty"`
// Notify subscribers about this event. On creation one notification is sent for the last update; later timeline entries also notify while this is `true`.
NotifySubscribers bool `json:"notify_subscribers,omitempty" toon:"notify_subscribers,omitempty"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Member IDs responsible for the event.
Responders []int64 `json:"responders,omitempty" toon:"responders,omitempty"`
// Event start time in Unix seconds. Maintenances store this value as the scheduled start (with `auto_update_by_schedule`, the time the event switches to `ongoing`); when it is omitted or 0, and always for incidents, the start time is the first update's `at_seconds`.
StartAtSeconds int64 `json:"start_at_seconds,omitempty" toon:"start_at_seconds,omitempty"`
// Initial event status. `investigating`/`identified`/`monitoring`/`resolved` apply to incidents; `scheduled`/`ongoing`/`completed` apply to maintenances.
Status string `json:"status" toon:"status"`
// Event title, up to 255 characters.
Title string `json:"title" toon:"title"`
// Change type: `incident` unplanned incident, `maintenance` planned maintenance.
Type string `json:"type" toon:"type"`
// Timeline updates in non-decreasing `at_seconds` order. At least one update is required, and at least one of them must contain `component_changes`. Immediate events normally pass one update; retrospective events must pass at least 2.
Updates []CreateStatusPageChangeRequestUpdatesItem `json:"updates" toon:"updates"`
}
CreateStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.
type CreateStatusPageChangeRequestUpdatesItem ¶
type CreateStatusPageChangeRequestUpdatesItem struct {
// Update timestamp in Unix seconds. When omitted or 0 on the first update, defaults to the current time.
AtSeconds int64 `json:"at_seconds,omitempty" toon:"at_seconds,omitempty"`
// Component status transitions applied by this update.
ComponentChanges []CreateStatusPageChangeRequestUpdatesItemComponentChangesItem `json:"component_changes,omitempty" toon:"component_changes,omitempty"`
// Update description (Markdown).
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Change status after this update. May be omitted (or null) when the overall status does not change. The first four values apply to incident-type changes, the last three to maintenance-type changes.
// | Value | Meaning |
// |---|---|
// | `investigating` | Investigating (incident). |
// | `identified` | Root cause identified (incident). |
// | `monitoring` | Fix deployed, monitoring (incident). |
// | `resolved` | Resolved (incident). |
// | `scheduled` | Scheduled (maintenance). |
// | `ongoing` | In progress (maintenance). |
// | `completed` | Completed (maintenance). |
Status *string `json:"status,omitempty" toon:"status,omitempty"`
// Update ID. Server-assigned on create; supply when replaying historical updates.
UpdateID string `json:"update_id,omitempty" toon:"update_id,omitempty"`
}
CreateStatusPageChangeRequestUpdatesItem is generated from the Flashduty OpenAPI schema.
type CreateStatusPageChangeRequestUpdatesItemComponentChangesItem ¶
type CreateStatusPageChangeRequestUpdatesItemComponentChangesItem struct {
// Component ID; obtain it from `GET /status-page/info`.
ComponentID string `json:"component_id" toon:"component_id"`
// New component status. `operational`/`degraded`/`partial_outage`/`full_outage` apply to incidents; `operational`/`under_maintenance` apply to maintenances.
Status string `json:"status" toon:"status"`
}
CreateStatusPageChangeRequestUpdatesItemComponentChangesItem is generated from the Flashduty OpenAPI schema.
type CreateStatusPageChangeTimelineRequest ¶
type CreateStatusPageChangeTimelineRequest struct {
// Update time in Unix seconds; must not be earlier than the event's latest timeline entry. Defaults to the current time when omitted or 0.
AtSeconds int64 `json:"at_seconds,omitempty" toon:"at_seconds,omitempty"`
// Target change ID; obtain it from `GET /status-page/change/list`.
ChangeID int64 `json:"change_id" toon:"change_id"`
// Component status transitions applied by this update. Component IDs must be unique.
ComponentChanges []CreateStatusPageChangeTimelineRequestComponentChangesItem `json:"component_changes,omitempty" toon:"component_changes,omitempty"`
// Update description (Markdown). Must not be empty.
Description string `json:"description" toon:"description"`
// ID of a pending draft created by `POST /status-page/draft/create` whose `change_id` is this event; it is marked published when the update is stored. Omit when not publishing a draft.
DraftID string `json:"draft_id,omitempty" toon:"draft_id,omitempty"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Event status after this update; must be valid for the event type. Pass the current status to post an update without a status change. When moving to `resolved` or `completed`, all affected components must be back to `operational`.
// | Value | Meaning |
// |---|---|
// | `investigating` | Investigating (incident). |
// | `identified` | Root cause identified (incident). |
// | `monitoring` | Fix deployed, monitoring (incident). |
// | `resolved` | Resolved (incident). |
// | `scheduled` | Scheduled (maintenance). |
// | `ongoing` | In progress (maintenance). |
// | `completed` | Completed (maintenance). |
Status string `json:"status" toon:"status"`
}
CreateStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.
type CreateStatusPageChangeTimelineRequestComponentChangesItem ¶
type CreateStatusPageChangeTimelineRequestComponentChangesItem struct {
// Component ID; obtain it from `GET /status-page/info`.
ComponentID string `json:"component_id" toon:"component_id"`
// New component status. `operational`/`degraded`/`partial_outage`/`full_outage` apply to incidents; `operational`/`under_maintenance` apply to maintenances.
Status string `json:"status" toon:"status"`
}
CreateStatusPageChangeTimelineRequestComponentChangesItem is generated from the Flashduty OpenAPI schema.
type CreateStatusPageDraftRequest ¶ added in v0.14.5
type CreateStatusPageDraftRequest struct {
// Draft payload, stored verbatim (at most 64 KB serialized). The server validates the fields below and keeps any other fields unchanged for the console.
Draft CreateStatusPageDraftRequestDraft `json:"draft" toon:"draft"`
// Free-form text recording where the draft came from, such as an AI session reference; stored and shown with the draft, not interpreted. Up to 64 characters.
Source string `json:"source,omitempty" toon:"source,omitempty"`
}
CreateStatusPageDraftRequest is generated from the Flashduty OpenAPI schema.
type CreateStatusPageDraftRequestDraft ¶ added in v0.16.0
type CreateStatusPageDraftRequestDraft struct {
// Components the draft affects.
AffectedComponents []CreateStatusPageDraftRequestDraftAffectedComponentsItem `json:"affected_components,omitempty" toon:"affected_components,omitempty"`
// Event to append an update to; it must be an event of the same `type` on `page_id`. Omit or pass 0 to draft a new event.
ChangeID int64 `json:"change_id,omitempty" toon:"change_id,omitempty"`
// Scheduled end in Unix seconds, for a new maintenance; must be greater than `start_time` when both are set.
EndTime int64 `json:"end_time,omitempty" toon:"end_time,omitempty"`
// Event or update description (Markdown). Must not be empty.
Message string `json:"message" toon:"message"`
// Event title, 1 to 255 characters.
Name string `json:"name" toon:"name"`
// Target status page ID; must belong to the caller's account.
PageID int64 `json:"page_id" toon:"page_id"`
// Page name for display in the console; not validated.
PageName string `json:"page_name,omitempty" toon:"page_name,omitempty"`
// Scheduled start in Unix seconds, for a new maintenance.
StartTime int64 `json:"start_time,omitempty" toon:"start_time,omitempty"`
// Proposed event status; when set, it must be valid for `type` (`investigating`/`identified`/`monitoring`/`resolved` for incidents, `scheduled`/`ongoing`/`completed` for maintenances).
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Event type the draft creates or updates: `incident` unplanned incident, `maintenance` planned maintenance.
Type string `json:"type" toon:"type"`
// Payload format version chosen by the producer; stored, not interpreted.
V int64 `json:"v,omitempty" toon:"v,omitempty"`
}
CreateStatusPageDraftRequestDraft is generated from the Flashduty OpenAPI schema.
type CreateStatusPageDraftRequestDraftAffectedComponentsItem ¶ added in v0.16.0
type CreateStatusPageDraftRequestDraftAffectedComponentsItem struct {
// Component ID; must exist on the page.
ComponentID string `json:"component_id" toon:"component_id"`
// Component name for display; not validated.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Proposed component status; when set, it must be valid for `type` (`operational`/`degraded`/`partial_outage`/`full_outage` for incidents, `operational`/`under_maintenance` for maintenances).
Status string `json:"status,omitempty" toon:"status,omitempty"`
}
CreateStatusPageDraftRequestDraftAffectedComponentsItem is generated from the Flashduty OpenAPI schema.
type CreateStatusPageRequest ¶ added in v0.5.5
type CreateStatusPageRequest struct {
// Get-in-touch contact, such as a mailto or website URL.
ContactInfo string `json:"contact_info,omitempty" toon:"contact_info,omitempty"`
// Custom domain; allowed only for public pages and must not be used by another status page.
CustomDomain string `json:"custom_domain,omitempty" toon:"custom_domain,omitempty"`
// Custom navigation links shown on the status page.
CustomLinks []map[string]string `json:"custom_links,omitempty" toon:"custom_links,omitempty"`
// How change dates are displayed: `calendar` calendar view, `list` list view.
DateView string `json:"date_view" toon:"date_view"`
// Uptime display mode: `chart_and_percentage` chart plus percentage, `chart` chart only, `none` hidden.
DisplayUptimeMode string `json:"display_uptime_mode" toon:"display_uptime_mode"`
// Display name of the status page.
Name string `json:"name" toon:"name"`
PageFooter string `json:"page_footer,omitempty" toon:"page_footer,omitempty"`
// Header content shown on the status page.
PageHeader string `json:"page_header,omitempty" toon:"page_header,omitempty"`
// Accepted for compatibility but not stored; it has no effect.
PageTitle string `json:"page_title,omitempty" toon:"page_title,omitempty"`
// Subscription channel toggles; both default to `false`. A public page can enable only `email` and an internal page only `im`.
Subscription StatusPageSubscriptionItem `json:"subscription,omitzero" toon:"subscription,omitempty"`
// Visibility type: `public` accessible to anyone, `internal` restricted to logged-in members of this account.
Type string `json:"type" toon:"type"`
// URL-safe slug; normalized to lowercase with non-alphanumeric characters replaced by hyphens, and must be unique among the account's pages of the same type.
URLName string `json:"url_name" toon:"url_name"`
}
CreateStatusPageRequest is generated from the Flashduty OpenAPI schema.
type CreateStatusPageResponse ¶ added in v0.5.5
type CreateStatusPageResponse struct {
// Created status page ID.
PageID int64 `json:"page_id" toon:"page_id"`
// Created status page name.
PageName string `json:"page_name" toon:"page_name"`
// Final URL-safe slug assigned to the status page.
PageURLName string `json:"page_url_name" toon:"page_url_name"`
}
CreateStatusPageResponse is generated from the Flashduty OpenAPI schema.
type CreateWarRoomRequest ¶
type CreateWarRoomRequest struct {
// When true, also invite members who were assigned or added as responders earlier but are no longer current responders.
AddObservers bool `json:"add_observers,omitempty" toon:"add_observers,omitempty"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// IM integration ID with war room enabled; obtain it from `POST /datasource/im/war-room-enabled/list`. Feishu, DingTalk, WeCom (self-built app only), and Slack are supported.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Member IDs to invite into the group; every ID must be a valid member of the account.
MemberIDs []int64 `json:"member_ids,omitempty" toon:"member_ids,omitempty"`
}
CreateWarRoomRequest is generated from the Flashduty OpenAPI schema.
type CreateWorkItemRequest ¶ added in v0.8.0
type CreateWorkItemRequest struct {
// Legacy alias for the initial assignees. Equivalent to `assignees` with every entry `type` `person`. Mutually exclusive with `assignees`: sending both returns an error. Assignees must be active members who can already read the anchor; assignment never grants access.
AssigneeIDs []int64 `json:"assignee_ids,omitempty" toon:"assignee_ids,omitempty"`
// Initial assignees. Each entry is `{type, id?}`. `type` is `person` or `ai_sre`; an `ai_sre` entry omits `id`. Mutually exclusive with `assignee_ids`: sending both returns an error. `assignee_ids` is the legacy alias and is equivalent to an all-`person` list. At most 20 entries. Person assignees must be active members who can already read the anchor; assignment never grants access.
Assignees []WorkItemAssignee `json:"assignees,omitempty" toon:"assignees,omitempty"`
// Optional longer description (max 65,535 characters).
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Client-generated idempotency key (max 128 characters; letters, digits, `_`, `-`, `.`, `:` only).
IdempotencyKey string `json:"idempotency_key" toon:"idempotency_key"`
// Incident ID (MongoDB ObjectID) the item is anchored to.
IncidentID string `json:"incident_id" toon:"incident_id"`
// Work item type.
// - `action`: a to-do on an incident that is not closed yet; must not set `post_mortem_id`.
// - `follow_up`: a post-mortem follow-up on a closed incident; `post_mortem_id` is optional.
ItemType string `json:"item_type" toon:"item_type"`
// Post-mortem ID (32-character hex string). Forbidden for `action`. Optional for `follow_up`: when set, the incident must be linked to that report; when omitted, the incident's post-mortem is used if it exists.
PostMortemID string `json:"post_mortem_id,omitempty" toon:"post_mortem_id,omitempty"`
// Optional free-form priority, at most 64 characters. The console uses `high`, `medium` and `low`; any other string is stored as-is.
Priority string `json:"priority,omitempty" toon:"priority,omitempty"`
// Initial status. One of `open`, `in_progress`, `done`, `cancelled`; defaults to `open` when omitted or blank.
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Item title, at most 512 characters; leading and trailing spaces are trimmed and it must not be blank.
Title string `json:"title" toon:"title"`
}
CreateWorkItemRequest is generated from the Flashduty OpenAPI schema.
type CustomFieldValues ¶ added in v0.5.7
CustomFieldValues is a free-form JSON object.
type DashboardAbsoluteTimeRange ¶ added in v0.15.9
type DashboardAbsoluteTimeRange struct {
// Start of the window as a Unix timestamp in milliseconds. Must be 0 or greater and less than `to_ms`.
FromMs int64 `json:"from_ms" toon:"from_ms"`
// End of the window as a Unix timestamp in milliseconds. Must be greater than `from_ms`; `instant` queries are evaluated at this time.
ToMs int64 `json:"to_ms" toon:"to_ms"`
}
DashboardAbsoluteTimeRange is generated from the Flashduty OpenAPI schema.
type DashboardActor ¶ added in v0.15.9
type DashboardActor struct {
// Member ID of the person who performed the action.
ID uint64 `json:"id" toon:"id"`
// Member display name, recorded at the time of the action.
Name string `json:"name" toon:"name"`
}
DashboardActor is generated from the Flashduty OpenAPI schema.
type DashboardBarViz ¶ added in v0.15.9
type DashboardBarViz struct {
// Result field supplying the category axis; required, at most 1024 Unicode code points, not `frame_index` or `field_index`.
CategoryField string `json:"category_field" toon:"category_field"`
DataLink DashboardDataLink `json:"data_link,omitzero" toon:"data_link,omitempty"`
// Fixed number of decimal places, 0–15; omit or send null to let the console decide.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Visualization kind discriminator; always `bar`.
Kind string `json:"kind" toon:"kind"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
Threshold DashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit for the panel's numeric values: `unitless` = raw number; `ratio` = fraction of 1; `percent` = percentage; `milliseconds` = duration in milliseconds; `seconds` = duration in seconds; `bytes` = size in bytes; `bits` = size in bits; `count_per_second` = per-second count; `bytes_per_second` = bytes per second; `bits_per_second` = bits per second. Defaults to `unitless` when omitted.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Result fields supplying the bar values; at least one, each listed once. Names must not be `frame_index` or `field_index`.
ValueFields []string `json:"value_fields" toon:"value_fields"`
}
DashboardBarViz is generated from the Flashduty OpenAPI schema.
type DashboardCandidate ¶ added in v0.15.9
type DashboardCandidate struct {
// Label shown in the picker.
Text string `json:"text" toon:"text"`
// Value substituted into templates.
Value string `json:"value" toon:"value"`
}
DashboardCandidate is generated from the Flashduty OpenAPI schema.
type DashboardColumnOption ¶ added in v0.15.9
type DashboardColumnOption struct {
DataLink DashboardDataLink `json:"data_link,omitzero" toon:"data_link,omitempty"`
// Header text replacing the raw field name.
DisplayName string `json:"display_name,omitempty" toon:"display_name,omitempty"`
// Hide the column; omit to keep it visible.
Hidden *bool `json:"hidden,omitempty" toon:"hidden,omitempty"`
Threshold DashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// How the threshold is painted: `text` = colours the cell text; `background` = colours the cell background.
ThresholdDisplay string `json:"threshold_display,omitempty" toon:"threshold_display,omitempty"`
// Unit override for the column: `unitless` = raw number; `ratio` = fraction of 1; `percent` = percentage; `milliseconds` = duration in milliseconds; `seconds` = duration in seconds; `bytes` = size in bytes; `bits` = size in bits; `count_per_second` = per-second count; `bytes_per_second` = bytes per second; `bits_per_second` = bits per second. Defaults to `unitless` when omitted.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Column width in pixels, 80–1200.
WidthPx *int64 `json:"width_px,omitempty" toon:"width_px,omitempty"`
}
DashboardColumnOption is generated from the Flashduty OpenAPI schema.
type DashboardCreateRequest ¶ added in v0.15.9
type DashboardCreateRequest struct {
// Lowercase canonical UUIDv7 generated by the caller; it becomes the dashboard's permanent ID.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition DashboardDefinition `json:"definition" toon:"definition"`
// Folder to create the dashboard in; must exist and be accessible to the `app_key` owner, otherwise `FolderNotFound`.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Wire schema version; only `dashboard.v1` is accepted.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
}
DashboardCreateRequest is generated from the Flashduty OpenAPI schema.
type DashboardCustomVariable ¶ added in v0.15.9
type DashboardCustomVariable struct {
Default DashboardSelection `json:"default,omitzero" toon:"default,omitempty"`
// Variable kind discriminator; always `custom`, with candidates from a fixed list supplied inline.
Kind string `json:"kind" toon:"kind"`
// Optional display label; falls back to `name`.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Variable name, unique within the definition. Queries reference it as `${name}` (or `$name` inside Prometheus and Loki expressions). Names starting with `__` are reserved for the built-in variables `__interval`, `__rate_interval`, `__range` and `__auto`.
Name string `json:"name" toon:"name"`
// Candidate list, 1–1000 entries. Values must be non-empty, unique and must not be `$__all`.
Options []DashboardCandidate `json:"options" toon:"options"`
Selection DashboardSelectionConfig `json:"selection" toon:"selection"`
}
DashboardCustomVariable is generated from the Flashduty OpenAPI schema.
type DashboardDataLink ¶ added in v0.15.9
type DashboardDataLink struct {
// ID of the dashboard to open; must be a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// When true the current time range is forwarded to the target.
PassTime bool `json:"pass_time" toon:"pass_time"`
// Optional tab, section or panel ID to focus in the target dashboard.
TargetID string `json:"target_id,omitempty" toon:"target_id,omitempty"`
// Values to set in the target dashboard, keyed by target variable name (must match `^[A-Za-z_][A-Za-z0-9_]{0,63}$`); each entry says where the value comes from. Send `{}` for none.
VariableMappings map[string]DashboardLinkMapping `json:"variable_mappings" toon:"variable_mappings"`
}
DashboardDataLink is generated from the Flashduty OpenAPI schema.
type DashboardDatasourceRef ¶ added in v0.15.9
type DashboardDatasourceRef struct {
// Datasource ID. Required when `kind` is `fixed`, forbidden when `kind` is `variable`.
DatasourceID uint64 `json:"datasource_id,omitempty" toon:"datasource_id,omitempty"`
// Datasource type identifier: lowercase letters, digits and underscores, starting with a letter. The set is open, so saving accepts any such value, but the dashboard runtime only runs `prometheus`, `mysql` and `loki` datasources; panels on other types fail when run. With `kind` = `variable` it must equal the referenced datasource variable's `datasource_type`.
DatasourceType string `json:"datasource_type" toon:"datasource_type"`
// `fixed` uses `datasource_id`; `variable` resolves `name` against a datasource variable.
Kind string `json:"kind" toon:"kind"`
// Name of a `datasource` variable in the same definition. Required when `kind` is `variable`, forbidden when `kind` is `fixed`.
Name string `json:"name,omitempty" toon:"name,omitempty"`
}
DashboardDatasourceRef is generated from the Flashduty OpenAPI schema.
type DashboardDatasourceVariable ¶ added in v0.15.9
type DashboardDatasourceVariable struct {
// Type of datasource offered as candidates; candidates are the account's enabled datasources of this type. The set is open, so saving accepts any such value, but the dashboard runtime only runs `prometheus`, `mysql` and `loki` datasources; panels on other types fail when run.
DatasourceType string `json:"datasource_type" toon:"datasource_type"`
// Default datasource ID. Without a usable default the runtime picks the first candidate by name, then ID.
DefaultDatasourceID uint64 `json:"default_datasource_id,omitempty" toon:"default_datasource_id,omitempty"`
// Variable kind discriminator; always `datasource`, selecting a datasource.
Kind string `json:"kind" toon:"kind"`
// Optional display label; falls back to `name`.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Variable name, unique within the definition. Queries reference it as `${name}` (or `$name` inside Prometheus and Loki expressions). Names starting with `__` are reserved for the built-in variables `__interval`, `__rate_interval`, `__range` and `__auto`.
Name string `json:"name" toon:"name"`
// Wildcard patterns narrowing the candidates; empty means every datasource of the type.
NamePatterns []string `json:"name_patterns,omitempty" toon:"name_patterns,omitempty"`
}
DashboardDatasourceVariable is generated from the Flashduty OpenAPI schema.
type DashboardDefinition ¶ added in v0.15.9
type DashboardDefinition struct {
DefaultTimeRange DashboardRelativeTimeRange `json:"default_time_range" toon:"default_time_range"`
// Optional description, at most 1024 Unicode code points.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Auto-refresh cadence applied by the console: `off` disables auto-refresh; `30s` = every 30 seconds; `1m` = every minute; `5m` = every 5 minutes.
RefreshInterval string `json:"refresh_interval" toon:"refresh_interval"`
// Tabs, 1–10. Every tab, section and panel `id` must be a canonical UUIDv7 used only once across the definition. Tab titles do not need to be unique. A dashboard may hold at most 100 panels and 300 queries across all tabs.
Tabs []DashboardTab `json:"tabs" toon:"tabs"`
// Dashboard title, 1–189 Unicode code points after trimming.
Title string `json:"title" toon:"title"`
// Dashboard variables, at most 20, with unique names. Variables may reference other variables but not in a cycle.
Variables []DashboardVariable `json:"variables" toon:"variables"`
}
DashboardDefinition is generated from the Flashduty OpenAPI schema.
type DashboardDeleteOutput ¶ added in v0.15.9
type DashboardDeleteOutput struct {
// ID of the dashboard moved to the trash.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision after the deletion; send it as `expected_revision` to restore.
Revision uint64 `json:"revision" toon:"revision"`
}
DashboardDeleteOutput is generated from the Flashduty OpenAPI schema.
type DashboardDeleteRequest ¶ added in v0.15.9
type DashboardDeleteRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision the caller last read. The write fails with `DashboardRevisionConflict` unless it still matches the stored revision.
ExpectedRevision uint64 `json:"expected_revision" toon:"expected_revision"`
}
DashboardDeleteRequest is generated from the Flashduty OpenAPI schema.
type DashboardDraftContext ¶ added in v0.15.9
type DashboardDraftContext struct {
// Required for `existing`, forbidden for `new`. The caller must have access to the dashboard's folder.
DashboardID string `json:"dashboard_id,omitempty" toon:"dashboard_id,omitempty"`
// Required for `new`, forbidden for `existing`. Must be a folder the caller can access, otherwise the call returns `FolderNotFound` (HTTP 404).
FolderID uint64 `json:"folder_id,omitempty" toon:"folder_id,omitempty"`
// Draft context kind: `existing` = targets a stored dashboard (`dashboard_id` required); `new` = a folder that does not contain one yet (`folder_id` required).
Kind string `json:"kind" toon:"kind"`
}
DashboardDraftContext is generated from the Flashduty OpenAPI schema.
type DashboardFieldSort ¶ added in v0.15.9
type DashboardFieldSort struct {
// Sort direction: `asc` = ascending; `desc` = descending.
Direction string `json:"direction" toon:"direction"`
// Result field name to sort by; at most 1024 Unicode code points, not `frame_index` or `field_index`.
Field string `json:"field" toon:"field"`
}
DashboardFieldSort is generated from the Flashduty OpenAPI schema.
type DashboardGaugeViz ¶ added in v0.15.9
type DashboardGaugeViz struct {
// Fixed number of decimal places, 0–15; omit or send null to let the console decide.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Visualization kind discriminator; always `gauge`.
Kind string `json:"kind" toon:"kind"`
// Scale upper bound; must exceed `min` when both are set.
Max *float64 `json:"max,omitempty" toon:"max,omitempty"`
// Scale lower bound.
Min *float64 `json:"min,omitempty" toon:"min,omitempty"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
// Reduction applied across the returned rows: `last_non_null` = most recent non-null value; `min` = minimum; `max` = maximum; `mean` = average; `sum` = sum.
Reducer string `json:"reducer" toon:"reducer"`
Threshold DashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit for the panel's numeric values: `unitless` = raw number; `ratio` = fraction of 1; `percent` = percentage; `milliseconds` = duration in milliseconds; `seconds` = duration in seconds; `bytes` = size in bytes; `bits` = size in bits; `count_per_second` = per-second count; `bytes_per_second` = bytes per second; `bits_per_second` = bits per second. Defaults to `unitless` when omitted.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Result fields reduced to the gauge value; at least one, each listed once. Names are matched exactly and must not be `frame_index` or `field_index`.
ValueFields []string `json:"value_fields" toon:"value_fields"`
}
DashboardGaugeViz is generated from the Flashduty OpenAPI schema.
type DashboardGridPosition ¶ added in v0.15.9
type DashboardGridPosition struct {
// Height in grid rows, 1–100.
H int64 `json:"h" toon:"h"`
// Width in grid columns, 1–24.
W int64 `json:"w" toon:"w"`
// Zero-based column offset.
X int64 `json:"x" toon:"x"`
// Zero-based row offset.
Y int64 `json:"y" toon:"y"`
}
DashboardGridPosition is generated from the Flashduty OpenAPI schema.
type DashboardIDRequest ¶ added in v0.15.9
type DashboardIDRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
}
DashboardIDRequest is generated from the Flashduty OpenAPI schema.
type DashboardInvestigationTarget ¶ added in v0.15.2
type DashboardInvestigationTarget struct {
// Target dashboard ID; must be a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Panel ID inside the dashboard; must be a canonical UUIDv7. Optional.
TargetID string `json:"target_id,omitempty" toon:"target_id,omitempty"`
// Dashboard variable values, keyed by variable name. Values may reference event labels through `{{ }}` templates; defaults to an empty object.
Variables map[string]string `json:"variables" toon:"variables"`
}
DashboardInvestigationTarget is generated from the Flashduty OpenAPI schema.
type DashboardLabelFilter ¶ added in v0.15.9
type DashboardLabelFilter struct {
// Prometheus label name to match, e.g. `job`; letters, digits, `_`, `:`, `.` and `-`, starting with a letter or `_`.
Label string `json:"label" toon:"label"`
// Matcher operator: `=` = equals; `!=` = not equals; `=~` = regex match; `!~` = regex does-not-match.
Op string `json:"op" toon:"op"`
// Matcher value; may reference other variables as `${name}`. A multi-value or `all` variable needs `=~` or `!~`.
Value string `json:"value" toon:"value"`
}
DashboardLabelFilter is generated from the Flashduty OpenAPI schema.
type DashboardLinkMapping ¶ added in v0.15.9
type DashboardLinkMapping struct {
// Table column (result field) to read; required when `source` is `row_column` and forbidden otherwise.
Column string `json:"column,omitempty" toon:"column,omitempty"`
// Variable of the source dashboard to read; required when `source` is `variable` and must exist in the same definition; forbidden for other sources.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Where the value comes from: `variable` = the current value of a variable of the source dashboard (requires `name`), allowed on table and bar panels; `row_column` = the clicked row's value in a table column (requires `column`), table panels only; `category` = the clicked bar's category, `series` = its series name, `value` = its value — these three are bar panels only and take no extra fields.
Source string `json:"source" toon:"source"`
}
DashboardLinkMapping is generated from the Flashduty OpenAPI schema.
type DashboardListItem ¶ added in v0.15.9
type DashboardListItem struct {
// Dashboard ID; pass it to `POST /monit/dashboard/get` for the full definition.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Dashboard description; omitted when unset.
Description string `json:"description" toon:"description"`
// Folder path from the root.
FolderBreadcrumb []string `json:"folder_breadcrumb" toon:"folder_breadcrumb"`
// ID of the folder the dashboard is stored in.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Current revision number.
Revision uint64 `json:"revision" toon:"revision"`
// Dashboard title.
Title string `json:"title" toon:"title"`
// Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
UpdatedBy DashboardActor `json:"updated_by" toon:"updated_by"`
}
DashboardListItem is generated from the Flashduty OpenAPI schema.
type DashboardListOutput ¶ added in v0.15.9
type DashboardListOutput struct {
// Dashboards in this page.
Items []DashboardListItem `json:"items" toon:"items"`
// Total number of matching dashboards across all pages.
Total int64 `json:"total" toon:"total"`
}
DashboardListOutput is generated from the Flashduty OpenAPI schema.
type DashboardListRequest ¶ added in v0.15.9
type DashboardListRequest struct {
ListOptions
// Folder whose directly contained dashboards are listed; subfolders are not included.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Optional search words separated by whitespace, at most 128 Unicode code points. A dashboard matches when every word appears in its title or description.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Sort keys; defaults to `updated_at` descending.
Sort []DashboardSort `json:"sort,omitempty" toon:"sort,omitempty"`
}
DashboardListRequest is generated from the Flashduty OpenAPI schema.
type DashboardLogsVariableQuery ¶ added in v0.15.9
type DashboardLogsVariableQuery struct {
// Named query arguments; defaults to an empty object. Must be empty for a Loki datasource.
Args map[string]string `json:"args" toon:"args"`
// Logs query expression; may reference other variables as `${name}`. Logs variable queries run only on Loki datasources, where `expr` may be empty to list the field's values across all streams.
Expr string `json:"expr" toon:"expr"`
// Log field whose values become candidates. For a Loki datasource it must be a bare stream label name (letters, digits and underscores).
Field string `json:"field" toon:"field"`
// Query kind discriminator; always `logs`, a logs query returning one field's values as candidates.
Kind string `json:"kind" toon:"kind"`
}
DashboardLogsVariableQuery is generated from the Flashduty OpenAPI schema.
type DashboardLogsViz ¶ added in v0.15.9
type DashboardLogsViz struct {
// Log fields rendered for each row.
DisplayFields []string `json:"display_fields,omitempty" toon:"display_fields,omitempty"`
// Visualization kind discriminator; always `logs`.
Kind string `json:"kind" toon:"kind"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
}
DashboardLogsViz is generated from the Flashduty OpenAPI schema.
type DashboardMoveRequest ¶ added in v0.15.9
type DashboardMoveRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision the caller last read. The write fails with `DashboardRevisionConflict` unless it still matches the stored revision.
ExpectedRevision uint64 `json:"expected_revision" toon:"expected_revision"`
// Destination folder ID; must exist and be accessible to the caller, otherwise `FolderNotFound`.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
}
DashboardMoveRequest is generated from the Flashduty OpenAPI schema.
type DashboardOutline ¶ added in v0.15.9
type DashboardOutline struct {
Dashboard DashboardOutlineInfo `json:"dashboard" toon:"dashboard"`
Folder DashboardOutlineFolder `json:"folder" toon:"folder"`
// Tabs, narrowed by `target_id` when supplied.
Tabs []DashboardOutlineTab `json:"tabs" toon:"tabs"`
// Variable summaries.
Variables []DashboardOutlineVariable `json:"variables" toon:"variables"`
}
DashboardOutline is generated from the Flashduty OpenAPI schema.
type DashboardOutlineFolder ¶ added in v0.15.9
type DashboardOutlineFolder struct {
// Folder names from the root.
Breadcrumb []string `json:"breadcrumb" toon:"breadcrumb"`
// ID of the folder the dashboard is stored in.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
}
DashboardOutlineFolder is generated from the Flashduty OpenAPI schema.
type DashboardOutlineInfo ¶ added in v0.15.9
type DashboardOutlineInfo struct {
// Dashboard ID, as passed in the request.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Dashboard description; omitted when unset.
Description string `json:"description" toon:"description"`
// Current revision number.
Revision uint64 `json:"revision" toon:"revision"`
// Dashboard title.
Title string `json:"title" toon:"title"`
// Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
DashboardOutlineInfo is generated from the Flashduty OpenAPI schema.
type DashboardOutlinePanel ¶ added in v0.15.9
type DashboardOutlinePanel struct {
// Full path of titles from the dashboard down to the panel.
Breadcrumb []string `json:"breadcrumb" toon:"breadcrumb"`
// Datasource type from the panel's `datasource_ref`, such as `prometheus`, `mysql` or `loki`; omitted for text panels, which have no datasource. The set is open: it echoes whatever type was saved.
DatasourceType string `json:"datasource_type" toon:"datasource_type"`
// Panel description; omitted when unset.
Description string `json:"description" toon:"description"`
// Panel ID; use it as `panel_id` for `POST /monit/dashboard/panel/run` or as `target_id` here.
ID string `json:"id" toon:"id"`
// Panel title.
Title string `json:"title" toon:"title"`
VizConfig DashboardOutlineVizConfig `json:"viz_config" toon:"viz_config"`
}
DashboardOutlinePanel is generated from the Flashduty OpenAPI schema.
type DashboardOutlineRequest ¶ added in v0.15.9
type DashboardOutlineRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Optional tab, section or panel ID. When set, the response keeps only the branch that contains it, and an unknown ID returns `TargetNotFound`.
TargetID string `json:"target_id,omitempty" toon:"target_id,omitempty"`
}
DashboardOutlineRequest is generated from the Flashduty OpenAPI schema.
type DashboardOutlineSection ¶ added in v0.15.9
type DashboardOutlineSection struct {
// Dashboard, tab and section titles.
Breadcrumb []string `json:"breadcrumb" toon:"breadcrumb"`
// Section description; omitted when unset.
Description string `json:"description" toon:"description"`
// Section ID; pass it as `target_id` to narrow the outline to this section.
ID string `json:"id" toon:"id"`
// Panels in the section.
Panels []DashboardOutlinePanel `json:"panels" toon:"panels"`
// Section title.
Title string `json:"title" toon:"title"`
}
DashboardOutlineSection is generated from the Flashduty OpenAPI schema.
type DashboardOutlineTab ¶ added in v0.15.9
type DashboardOutlineTab struct {
// Dashboard title followed by the tab title.
Breadcrumb []string `json:"breadcrumb" toon:"breadcrumb"`
// Tab description; omitted when unset.
Description string `json:"description" toon:"description"`
// Tab ID; pass it as `target_id` to narrow the outline to this tab.
ID string `json:"id" toon:"id"`
// Sections on the tab.
Sections []DashboardOutlineSection `json:"sections" toon:"sections"`
// Tab title as stored in the definition.
Title string `json:"title" toon:"title"`
// Panels placed directly on the tab.
TopPanels []DashboardOutlinePanel `json:"top_panels" toon:"top_panels"`
}
DashboardOutlineTab is generated from the Flashduty OpenAPI schema.
type DashboardOutlineVariable ¶ added in v0.15.9
type DashboardOutlineVariable struct {
// Variable kind: `datasource` = selects a datasource; `custom` = fixed inline list; `query` = resolved by running a query.
Kind string `json:"kind" toon:"kind"`
// Display label; omitted when unset.
Label string `json:"label" toon:"label"`
// Variable name.
Name string `json:"name" toon:"name"`
Selection DashboardSelectionConfig `json:"selection" toon:"selection"`
}
DashboardOutlineVariable is generated from the Flashduty OpenAPI schema.
type DashboardOutlineVizConfig ¶ added in v0.15.9
type DashboardOutlineVizConfig struct {
// Visualization kind: `time_series` = time series; `table` = table; `stat` = single value; `bar` = bar chart; `gauge` = gauge; `logs` = log stream; `text` = Markdown text.
Kind string `json:"kind" toon:"kind"`
}
DashboardOutlineVizConfig is generated from the Flashduty OpenAPI schema.
type DashboardPanel ¶ added in v0.15.9
type DashboardPanel struct {
DatasourceRef DashboardDatasourceRef `json:"datasource_ref,omitzero" toon:"datasource_ref,omitempty"`
// Optional panel description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
Grid DashboardGridPosition `json:"grid" toon:"grid"`
// Canonical UUIDv7 identifying the panel; unique across the definition.
ID string `json:"id" toon:"id"`
// Queries in the panel. `time_series` accepts 1–26, `text` accepts none, every other kind accepts exactly one.
Queries []DashboardPanelQuery `json:"queries" toon:"queries"`
// Panel title.
Title string `json:"title" toon:"title"`
VizConfig DashboardVizConfig `json:"viz_config" toon:"viz_config"`
}
DashboardPanel is generated from the Flashduty OpenAPI schema.
type DashboardPanelPreviewRequest ¶ added in v0.15.9
type DashboardPanelPreviewRequest struct {
Context DashboardDraftContext `json:"context" toon:"context"`
// Target maximum number of points per series for `range` queries; the server derives the query step from it. 2–5000; omit or send null for the default of 100.
MaxDataPoints *int64 `json:"max_data_points,omitempty" toon:"max_data_points,omitempty"`
Panel DashboardPanel `json:"panel" toon:"panel"`
// Selections keyed by variable name, at most 20 entries. Variables without an entry fall back to their draft default.
Selections map[string]DashboardSelection `json:"selections,omitempty" toon:"selections,omitempty"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Draft variables the panel may reference, at most 20. Required; the panel's queries can only use variables listed here.
Variables []DashboardVariable `json:"variables" toon:"variables"`
}
DashboardPanelPreviewRequest is generated from the Flashduty OpenAPI schema.
type DashboardPanelPreviewResponse ¶ added in v0.15.9
type DashboardPanelPreviewResponse struct {
Budget DashboardPanelRunBudget `json:"budget" toon:"budget"`
Display DashboardVizConfig `json:"display" toon:"display"`
// ID of the draft panel, echoing `panel.id` from the request.
PanelID string `json:"panel_id" toon:"panel_id"`
// One entry per query of the panel, in the panel's query order. A query that failed to resolve appears with `state` `error`.
Refs []DashboardPanelRunRef `json:"refs" toon:"refs"`
// Aggregate state of the run: `success` = every query succeeded; `partial` = at least one query succeeded and at least one did not; `cancelled` = no query succeeded and the client cancelled the request; `incompatible` = no query succeeded and at least one query ran but returned a result that does not fit the panel's visualization; `error` = no query succeeded and none is `incompatible` (also when the panel has no queries).
RunState string `json:"run_state" toon:"run_state"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Effective selections of the variables that resolved successfully, keyed by variable name; variables that failed to resolve are left out.
Variables map[string]DashboardSelection `json:"variables" toon:"variables"`
}
DashboardPanelPreviewResponse is generated from the Flashduty OpenAPI schema.
type DashboardPanelQuery ¶ added in v0.15.9
type DashboardPanelQuery struct {
// Optional legend label, at most 1024 Unicode code points. The console replaces `{{label}}` with that series label's value (for example `{{env}} requests`); dashboard variables are not substituted here.
LegendAlias string `json:"legend_alias,omitempty" toon:"legend_alias,omitempty"`
Query DashboardQuery `json:"query" toon:"query"`
// Single uppercase letter (A–Z) naming the query inside its panel.
RefID string `json:"ref_id" toon:"ref_id"`
}
DashboardPanelQuery is generated from the Flashduty OpenAPI schema.
type DashboardPanelRunBudget ¶ added in v0.15.9
type DashboardPanelRunBudget struct {
// Number of queries that resolved successfully and were dispatched for execution; queries that failed to resolve are not counted.
ExecutionCount int64 `json:"execution_count" toon:"execution_count"`
// Maximum number of the panel's queries executed at the same time; fixed at 6.
MaxConcurrency int64 `json:"max_concurrency" toon:"max_concurrency"`
}
DashboardPanelRunBudget is generated from the Flashduty OpenAPI schema.
type DashboardPanelRunRef ¶ added in v0.15.9
type DashboardPanelRunRef struct {
// Request ID of the underlying datasource execution; use it when tracing a single query. Absent when the query never reached the datasource.
ChildRequestID string `json:"child_request_id" toon:"child_request_id"`
Error DashboardRuntimeError `json:"error" toon:"error"`
// Datasource-specific execution result, passed through unmodified. Present when `state` is `success` or `incompatible`; absent when `state` is `error`.
Execution map[string]any `json:"execution" toon:"execution"`
// Query reference within the panel: a single letter `A`–`Z`, as set in the panel's `queries`.
RefID string `json:"ref_id" toon:"ref_id"`
// Per-query state: `success` = the query ran and `execution` is present; `error` = the query could not be resolved or executed, or the run was cancelled or timed out, and `error` explains why; `incompatible` = the query ran, but its result does not fit the panel's visualization (for example a configured field is missing or not numeric), so `execution` is still present and `error` explains the mismatch.
State string `json:"state" toon:"state"`
}
DashboardPanelRunRef is generated from the Flashduty OpenAPI schema.
type DashboardPanelRunRequest ¶ added in v0.15.9
type DashboardPanelRunRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Target maximum number of points per series for `range` queries; the server derives the query step from it. 2–5000; omit or send null for the default of 100.
MaxDataPoints *int64 `json:"max_data_points,omitempty" toon:"max_data_points,omitempty"`
// ID of the panel to execute. It must belong to the dashboard, otherwise the call returns `TargetNotFound` (HTTP 404).
PanelID string `json:"panel_id" toon:"panel_id"`
// Revision guard. When set (non-zero) it must equal the dashboard's current revision, otherwise the call fails with `DashboardRevisionConflict` (HTTP 409). Omit or send 0 to skip the check.
Revision uint64 `json:"revision,omitempty" toon:"revision,omitempty"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Selections keyed by variable name, at most 20 entries. Variables without an entry fall back to their stored defaults; a name the dashboard does not define fails the call with HTTP 400.
Variables map[string]DashboardSelection `json:"variables,omitempty" toon:"variables,omitempty"`
}
DashboardPanelRunRequest is generated from the Flashduty OpenAPI schema.
type DashboardPanelRunResponse ¶ added in v0.15.9
type DashboardPanelRunResponse struct {
Budget DashboardPanelRunBudget `json:"budget" toon:"budget"`
// ID of the dashboard that was run, echoing the request.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Display DashboardVizConfig `json:"display" toon:"display"`
// ID of the panel that was run, echoing the request.
PanelID string `json:"panel_id" toon:"panel_id"`
// One entry per query of the panel, in the panel's query order. A query that failed to resolve appears with `state` `error`.
Refs []DashboardPanelRunRef `json:"refs" toon:"refs"`
// Revision the run executed against.
Revision uint64 `json:"revision" toon:"revision"`
// Aggregate state of the run: `success` = every query succeeded; `partial` = at least one query succeeded and at least one did not; `cancelled` = no query succeeded and the client cancelled the request; `incompatible` = no query succeeded and at least one query ran but returned a result that does not fit the panel's visualization; `error` = no query succeeded and none is `incompatible` (also when the panel has no queries).
RunState string `json:"run_state" toon:"run_state"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Effective selections of the variables that resolved successfully, keyed by variable name; variables that failed to resolve are left out.
Variables map[string]DashboardSelection `json:"variables" toon:"variables"`
}
DashboardPanelRunResponse is generated from the Flashduty OpenAPI schema.
type DashboardPrometheusVariableQuery ¶ added in v0.15.9
type DashboardPrometheusVariableQuery struct {
// Query kind discriminator; always `prometheus`, a label-values query against Prometheus.
Kind string `json:"kind" toon:"kind"`
// Label whose values become candidates.
Label string `json:"label" toon:"label"`
// Optional matchers narrowing the series before label values are read.
LabelFilters []DashboardLabelFilter `json:"label_filters,omitempty" toon:"label_filters,omitempty"`
// Optional metric selector that restricts the series considered; may reference other variables as `${name}` or `$name`.
Metric string `json:"metric,omitempty" toon:"metric,omitempty"`
}
DashboardPrometheusVariableQuery is generated from the Flashduty OpenAPI schema.
type DashboardQueriesResolveRequest ¶ added in v0.15.9
type DashboardQueriesResolveRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Target maximum number of points per series, used to compute the step and render the built-in time variables. 2–5000; omit or send null for the default of 100.
MaxDataPoints *int64 `json:"max_data_points,omitempty" toon:"max_data_points,omitempty"`
// Panels to resolve, 1–100 unique IDs. A panel that does not exist yields an `error` arm rather than failing the call.
PanelIDs []string `json:"panel_ids" toon:"panel_ids"`
// Keep built-in time variables verbatim in the resolved expressions so a caller with its own execution window can render them; user variables are still resolved.
PreserveBuiltinVariables bool `json:"preserve_builtin_variables,omitempty" toon:"preserve_builtin_variables,omitempty"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Selections keyed by variable name, at most 20 entries. Variables without an entry fall back to their stored defaults; a name the dashboard does not define fails the call with HTTP 400.
Variables map[string]DashboardSelection `json:"variables,omitempty" toon:"variables,omitempty"`
}
DashboardQueriesResolveRequest is generated from the Flashduty OpenAPI schema.
type DashboardQueriesResolveResponse ¶ added in v0.15.9
type DashboardQueriesResolveResponse struct {
// ID of the dashboard the queries were resolved against, echoing the request.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// One entry per requested panel, in request order.
Panels []DashboardResolvedPanelQueries `json:"panels" toon:"panels"`
// Revision the resolution ran against.
Revision uint64 `json:"revision" toon:"revision"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Effective selections of the variables that resolved successfully, keyed by variable name; variables that failed to resolve are left out.
Variables map[string]DashboardSelection `json:"variables" toon:"variables"`
}
DashboardQueriesResolveResponse is generated from the Flashduty OpenAPI schema.
type DashboardQuery ¶ added in v0.15.4
type DashboardQuery struct {
// Named query arguments; defaults to an empty object. In dashboard panels values may use `${name}` templates except for Loki and MySQL datasources. In drill-down entries keys and values must not contain `{{ }}` templates.
Args map[string]string `json:"args" toon:"args"`
// Query expression in the datasource's language. In dashboard panels it may reference variables as `${name}`, `${name:raw}` (one value inserted as is) `${name:regex}` (values joined as a regex alternation), or, outside Prometheus and Loki, `${name:csv}`, `${name:sqlstring}`, `${name:json}` and `${name:pipe}`, or as `$name` in Prometheus and Loki; write `$${...}` for a literal. Without a formatter, multi-value or `all` variables and values inside `=~`/`!~` are inserted in regex form, so they cannot be used with `=` or `!=`. MySQL queries do not support variables. In drill-down entries the expression may reference event labels through `{{ }}` templates.
Expr string `json:"expr" toon:"expr"`
// Minimum step, in seconds; must be greater than zero. In drill-down entries it is only accepted when `mode` is `range`. Omit or pass null to let the server decide.
MinStepSeconds *int64 `json:"min_step_seconds,omitempty" toon:"min_step_seconds,omitempty"`
// Evaluation mode: `instant` = evaluate at a single timestamp; `range` = evaluate a stepped series over the time range; `window` = return raw rows inside the time range. Dashboard panels on Prometheus and Loki accept `instant` or `range` (Loki `logs` panels need `range`); MySQL panels need `window`.
Mode string `json:"mode" toon:"mode"`
}
DashboardQuery is generated from the Flashduty OpenAPI schema.
type DashboardQueryVariable ¶ added in v0.15.9
type DashboardQueryVariable struct {
DatasourceRef DashboardDatasourceRef `json:"datasource_ref" toon:"datasource_ref"`
Default DashboardSelection `json:"default,omitzero" toon:"default,omitempty"`
// Variable kind discriminator; always `query`, with candidates resolved by running a query against a datasource.
Kind string `json:"kind" toon:"kind"`
// Optional display label; falls back to `name`.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Variable name, unique within the definition. Queries reference it as `${name}` (or `$name` inside Prometheus and Loki expressions). Names starting with `__` are reserved for the built-in variables `__interval`, `__rate_interval`, `__range` and `__auto`.
Name string `json:"name" toon:"name"`
// When the candidates are recomputed: `on_dashboard_load` = once when the dashboard loads; `on_time_range_change` = every time the time range changes.
Refresh string `json:"refresh" toon:"refresh"`
Selection DashboardSelectionConfig `json:"selection" toon:"selection"`
VariableQuery DashboardVariableQuery `json:"variable_query" toon:"variable_query"`
}
DashboardQueryVariable is generated from the Flashduty OpenAPI schema.
type DashboardRelativeTimeRange ¶ added in v0.15.9
type DashboardRelativeTimeRange struct {
// Start offset relative to `to`: `now-15m` = 15 minutes ago; `now-30m` = 30 minutes ago; `now-1h` = 1 hour ago; `now-3h` = 3 hours ago; `now-6h` = 6 hours ago; `now-12h` = 12 hours ago; `now-24h` = 24 hours ago; `now-7d` = 7 days ago.
From string `json:"from" toon:"from"`
// End of the window; only `now` is accepted.
To string `json:"to" toon:"to"`
}
DashboardRelativeTimeRange is generated from the Flashduty OpenAPI schema.
type DashboardResolvedPanelQueries ¶ added in v0.15.9
type DashboardResolvedPanelQueries struct {
Error DashboardRuntimeError `json:"error" toon:"error"`
// ID of the panel, echoing an entry of `panel_ids`.
PanelID string `json:"panel_id" toon:"panel_id"`
// Queries that resolved successfully, in the panel's query order. Queries that failed are left out; empty array when none resolved.
Queries []DashboardResolvedQuery `json:"queries" toon:"queries"`
// Resolution state of the panel's queries: `success` = every query resolved; `partial` = some resolved and some failed; `error` = none resolved, including a panel that does not exist.
State string `json:"state" toon:"state"`
}
DashboardResolvedPanelQueries is generated from the Flashduty OpenAPI schema.
type DashboardResolvedQuery ¶ added in v0.15.9
type DashboardResolvedQuery struct {
// Query arguments; an empty object when none. Only Loki queries carry arguments: `loki.limit` (a decimal integer from 1 to 1000, the maximum number of log entries) and `loki.direction` (`latest` or `earliest`).
Args map[string]string `json:"args" toon:"args"`
Datasource DashboardRuntimeDatasource `json:"datasource" toon:"datasource"`
// Expression with variable templates substituted. Built-in time variables stay verbatim when the request set `preserve_builtin_variables` to `true`.
Expr string `json:"expr" toon:"expr"`
// Minimum step in seconds from the panel query; omitted when unset.
MinStepSeconds int64 `json:"min_step_seconds" toon:"min_step_seconds"`
// Evaluation mode: `range` = a stepped time series; `instant` = a single point in time; `window` = rows inside a bounded time window. Prometheus and Loki queries use `range` or `instant`; MySQL queries use `window`.
Mode string `json:"mode" toon:"mode"`
// Query reference within the panel: a single letter `A`–`Z`.
RefID string `json:"ref_id" toon:"ref_id"`
}
DashboardResolvedQuery is generated from the Flashduty OpenAPI schema.
type DashboardResolvedVariable ¶ added in v0.15.9
type DashboardResolvedVariable struct {
// Selectable options, at most 1000; an empty array when there are none or resolution failed. Order: `custom` keeps the definition order, `datasource` is sorted by name then ID, `query` is sorted by value.
Candidates []DashboardCandidate `json:"candidates" toon:"candidates"`
Datasource DashboardRuntimeDatasource `json:"datasource" toon:"datasource"`
Error DashboardRuntimeError `json:"error" toon:"error"`
// Variable kind: `datasource` = selects a datasource; `custom` = fixed inline list; `query` = resolved by running a query.
Kind string `json:"kind" toon:"kind"`
// Variable name, as defined in the dashboard or draft.
Name string `json:"name" toon:"name"`
Selection DashboardSelection `json:"selection" toon:"selection"`
}
DashboardResolvedVariable is generated from the Flashduty OpenAPI schema.
type DashboardResource ¶ added in v0.15.9
type DashboardResource struct {
// Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
CreatedBy DashboardActor `json:"created_by" toon:"created_by"`
// Canonical UUIDv7 assigned by the caller at creation time.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition DashboardDefinition `json:"definition" toon:"definition"`
// Folder names from the root down to `folder_id`.
FolderBreadcrumb []string `json:"folder_breadcrumb" toon:"folder_breadcrumb"`
// ID of the dashboard's folder.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Current revision number.
Revision uint64 `json:"revision" toon:"revision"`
// Wire schema version of `definition`; only `dashboard.v1` is accepted.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
// Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
UpdatedBy DashboardActor `json:"updated_by" toon:"updated_by"`
}
DashboardResource is generated from the Flashduty OpenAPI schema.
type DashboardRestoreRequest ¶ added in v0.15.9
type DashboardRestoreRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Current revision of the trashed dashboard, as returned by the delete call or listed in the trash. The restore fails with `DashboardRevisionConflict` if it does not match.
ExpectedRevision uint64 `json:"expected_revision" toon:"expected_revision"`
// Destination folder. Omit or send null to restore into the original folder; if that folder no longer exists the call fails with `RestoreFolderRequired` and a destination must be passed.
FolderID *uint64 `json:"folder_id,omitempty" toon:"folder_id,omitempty"`
}
DashboardRestoreRequest is generated from the Flashduty OpenAPI schema.
type DashboardRevisionGetRequest ¶ added in v0.15.9
type DashboardRevisionGetRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision number to fetch.
Revision uint64 `json:"revision" toon:"revision"`
}
DashboardRevisionGetRequest is generated from the Flashduty OpenAPI schema.
type DashboardRevisionItem ¶ added in v0.15.9
type DashboardRevisionItem struct {
Actor DashboardActor `json:"actor" toon:"actor"`
// Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the dashboard this revision belongs to.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Folder the dashboard sat in at that revision.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Message passed to `POST /monit/dashboard/update`; omitted when none was given and on revisions written by create, move, delete and restore.
Message string `json:"message" toon:"message"`
// Revision number.
Revision uint64 `json:"revision" toon:"revision"`
}
DashboardRevisionItem is generated from the Flashduty OpenAPI schema.
type DashboardRevisionListOutput ¶ added in v0.15.9
type DashboardRevisionListOutput struct {
// Revisions, at most 20.
Items []DashboardRevisionItem `json:"items" toon:"items"`
}
DashboardRevisionListOutput is generated from the Flashduty OpenAPI schema.
type DashboardRevisionResource ¶ added in v0.15.9
type DashboardRevisionResource struct {
Actor DashboardActor `json:"actor" toon:"actor"`
// Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the dashboard this revision belongs to.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition DashboardDefinition `json:"definition" toon:"definition"`
// Folder the dashboard sat in at that revision.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Message passed to `POST /monit/dashboard/update`; omitted when none was given.
Message string `json:"message" toon:"message"`
// Revision number.
Revision uint64 `json:"revision" toon:"revision"`
// Wire schema version of `definition`; only `dashboard.v1` is accepted.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
}
DashboardRevisionResource is generated from the Flashduty OpenAPI schema.
type DashboardRuntimeDatasource ¶ added in v0.15.9
type DashboardRuntimeDatasource struct {
// Datasource ID, as listed by the datasource list endpoint.
ID uint64 `json:"id" toon:"id"`
// Datasource name.
Name string `json:"name" toon:"name"`
// Datasource type identifier. Resolved queries and `query` variables only use `prometheus`, `mysql` or `loki`; the datasource chosen by a `datasource` variable can be any type identifier the variable was configured with.
Type string `json:"type" toon:"type"`
}
DashboardRuntimeDatasource is generated from the Flashduty OpenAPI schema.
type DashboardRuntimeError ¶ added in v0.15.9
type DashboardRuntimeError struct {
// Human-readable detail for display or troubleshooting; its wording is not stable, so do not parse it.
Message string `json:"message" toon:"message"`
// Machine-readable failure reason. The set is open; current values:
// - `invalid_request`: the query or datasource setup is rejected (unsupported datasource type or query mode, non-empty `args` where none are allowed, a malformed argument).
// - `variable_invalid`: a variable could not be used (no selection and no default, a selection outside the candidates, an unresolved dependency, a bad substitution, or an unusable candidate list).
// - `panel_missing`: the panel is not in the dashboard (queries resolve only).
// - `datasource_permission_denied`: the datasource is missing, disabled, not accessible to the caller, or no accessible datasource matches the variable.
// - `field_missing`, `value_not_scalar`, `empty_field_name`, `duplicate_field_name`, `field_type_changed`: the result does not fit the panel's visualization, or a SQL variable query returned unusable columns.
// - `timeout`: the datasource call timed out; `panel_deadline`: the run hit the overall 35-second deadline.
// - `canceled`, `panel_canceled`: the call was cancelled.
// - `overloaded`: the datasource side is rate limiting.
// - `too_many_rows`, `result_too_large`, `source_too_large`: a row, size or candidate-count limit was exceeded.
// - `edge_unavailable`, `no_active_edge`, `edge_upgrade_required`, `edge_version_unknown`, `mixed_edge_versions`: the Edge cluster of the datasource is not connected, too old, of unknown version, or mixed.
// - `internal`: an unexpected server-side error.
Reason string `json:"reason" toon:"reason"`
}
DashboardRuntimeError is generated from the Flashduty OpenAPI schema.
type DashboardSearchRequest ¶ added in v0.15.9
type DashboardSearchRequest struct {
ListOptions
// Search words separated by whitespace; at least one word and at most 128 Unicode code points. A dashboard matches when every word appears in its title or description.
Query string `json:"query" toon:"query"`
// Sort keys; defaults to `updated_at` descending.
Sort []DashboardSort `json:"sort,omitempty" toon:"sort,omitempty"`
}
DashboardSearchRequest is generated from the Flashduty OpenAPI schema.
type DashboardSection ¶ added in v0.15.9
type DashboardSection struct {
// Whether the section renders collapsed by default.
Collapsed bool `json:"collapsed" toon:"collapsed"`
// Optional section description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Canonical UUIDv7 identifying the section; unique across the definition.
ID string `json:"id" toon:"id"`
// Panels in the section; they count toward the tab's 30-panel limit.
Panels []DashboardPanel `json:"panels" toon:"panels"`
// Section title.
Title string `json:"title" toon:"title"`
}
DashboardSection is generated from the Flashduty OpenAPI schema.
type DashboardSelection ¶ added in v0.15.9
type DashboardSelection struct {
// `values` selects the listed entries, `all` selects everything (only allowed when `include_all` is true).
Kind string `json:"kind" toon:"kind"`
// Selected values, unique and never `$__all`. Must be empty when `kind` is `all`.
Values []string `json:"values,omitempty" toon:"values,omitempty"`
}
DashboardSelection is generated from the Flashduty OpenAPI schema.
type DashboardSelectionConfig ¶ added in v0.15.9
type DashboardSelectionConfig struct {
// When true the variable also offers an `all` selection.
IncludeAll bool `json:"include_all" toon:"include_all"`
// Selection cardinality: `single` makes the resolved selection hold exactly one value; `multi` allows multiple values.
Mode string `json:"mode" toon:"mode"`
}
DashboardSelectionConfig is generated from the Flashduty OpenAPI schema.
type DashboardSort ¶ added in v0.15.9
type DashboardSort struct {
// Sort direction: `asc` = ascending; `desc` = descending.
Direction string `json:"direction" toon:"direction"`
// `title` is available everywhere; `updated_at` only on list/search, `deleted_at` only on the trash listing.
Field string `json:"field" toon:"field"`
}
DashboardSort is generated from the Flashduty OpenAPI schema.
type DashboardSqlVariableQuery ¶ added in v0.15.9
type DashboardSqlVariableQuery struct {
// Named query arguments; defaults to an empty object.
Args map[string]string `json:"args" toon:"args"`
// SQL statement whose result supplies the candidates. SQL variable queries run only on MySQL datasources, and MySQL queries do not support variable references.
Expr string `json:"expr" toon:"expr"`
// Query kind discriminator; always `sql`, a SQL query returning one column of candidates.
Kind string `json:"kind" toon:"kind"`
// Column used as the candidate label; defaults to the value column.
TextField string `json:"text_field,omitempty" toon:"text_field,omitempty"`
// Column used as the candidate value.
ValueField string `json:"value_field" toon:"value_field"`
}
DashboardSqlVariableQuery is generated from the Flashduty OpenAPI schema.
type DashboardStatViz ¶ added in v0.15.9
type DashboardStatViz struct {
// Fixed number of decimal places, 0–15; omit or send null to let the console decide.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Visualization kind discriminator; always `stat`.
Kind string `json:"kind" toon:"kind"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
// Reduction applied across the returned rows: `last_non_null` = most recent non-null value; `min` = minimum; `max` = maximum; `mean` = average; `sum` = sum.
Reducer string `json:"reducer" toon:"reducer"`
Threshold DashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit for the panel's numeric values: `unitless` = raw number; `ratio` = fraction of 1; `percent` = percentage; `milliseconds` = duration in milliseconds; `seconds` = duration in seconds; `bytes` = size in bytes; `bits` = size in bits; `count_per_second` = per-second count; `bytes_per_second` = bytes per second; `bits_per_second` = bits per second. Defaults to `unitless` when omitted.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Result fields reduced to the displayed values; at least one, each listed once. Names are matched exactly and must not be `frame_index` or `field_index`.
ValueFields []string `json:"value_fields" toon:"value_fields"`
}
DashboardStatViz is generated from the Flashduty OpenAPI schema.
type DashboardTab ¶ added in v0.15.9
type DashboardTab struct {
// Optional tab description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Canonical UUIDv7 identifying the tab; unique across the definition.
ID string `json:"id" toon:"id"`
// Sections on the tab, at most 10.
Sections []DashboardSection `json:"sections" toon:"sections"`
// Tab title, 1–189 Unicode code points after trimming.
Title string `json:"title" toon:"title"`
// Panels placed directly on the tab. A tab holds at most 30 panels in total, counting top panels and section panels, and at most 100 queries.
TopPanels []DashboardPanel `json:"top_panels" toon:"top_panels"`
}
DashboardTab is generated from the Flashduty OpenAPI schema.
type DashboardTableViz ¶ added in v0.15.9
type DashboardTableViz struct {
// Per-column display overrides keyed by result field name, at most 100 entries. Keys must be non-empty, at most 1024 Unicode code points and not `frame_index` or `field_index`.
ColumnOptions map[string]DashboardColumnOption `json:"column_options,omitempty" toon:"column_options,omitempty"`
// Visualization kind discriminator; always `table`.
Kind string `json:"kind" toon:"kind"`
// Drill-down links rendered as table columns. Together with per-column links a table allows at most 5.
LinkColumns []DashboardDataLink `json:"link_columns,omitempty" toon:"link_columns,omitempty"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
// Initial sort keys, applied in order; each field may appear once.
Sort []DashboardFieldSort `json:"sort,omitempty" toon:"sort,omitempty"`
}
DashboardTableViz is generated from the Flashduty OpenAPI schema.
type DashboardTextViz ¶ added in v0.15.9
type DashboardTextViz struct {
// Visualization kind discriminator; always `text`.
Kind string `json:"kind" toon:"kind"`
// Markdown body, at most 64 KiB. Allowed: paragraphs, headings, lists, block quotes, code blocks and spans, emphasis, tables, horizontal rules and links. Links must be `https://` URLs or site-relative paths starting with `/`. Images, raw HTML and `${` templates are rejected with `InvalidParameter`, not stripped.
Markdown string `json:"markdown" toon:"markdown"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
}
DashboardTextViz is generated from the Flashduty OpenAPI schema.
type DashboardThreshold ¶ added in v0.15.9
type DashboardThreshold struct {
// Critical bound; must be finite.
Critical *float64 `json:"critical,omitempty" toon:"critical,omitempty"`
// Direction of the comparison: `higher_is_worse` = values at or above the bound breach it; `lower_is_worse` = values at or below the bound breach it.
Mode string `json:"mode" toon:"mode"`
// Warning bound; must be finite.
Warning *float64 `json:"warning,omitempty" toon:"warning,omitempty"`
}
DashboardThreshold is generated from the Flashduty OpenAPI schema.
type DashboardTimeSeriesViz ¶ added in v0.15.9
type DashboardTimeSeriesViz struct {
// Fixed number of decimal places, 0–15; omit or send null to let the console decide.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Visualization kind discriminator; always `time_series`.
Kind string `json:"kind" toon:"kind"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
Threshold DashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit for the panel's numeric values: `unitless` = raw number; `ratio` = fraction of 1; `percent` = percentage; `milliseconds` = duration in milliseconds; `seconds` = duration in seconds; `bytes` = size in bytes; `bits` = size in bits; `count_per_second` = per-second count; `bytes_per_second` = bytes per second; `bits_per_second` = bits per second. Defaults to `unitless` when omitted.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
}
DashboardTimeSeriesViz is generated from the Flashduty OpenAPI schema.
type DashboardTrashItem ¶ added in v0.15.9
type DashboardTrashItem struct {
// ID of the trashed dashboard; pass it to `POST /monit/dashboard/restore`.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Unix timestamp in seconds.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
DeletedBy DashboardActor `json:"deleted_by" toon:"deleted_by"`
// Dashboard description; omitted when unset.
Description string `json:"description" toon:"description"`
// Folder path from the root.
FolderBreadcrumb []string `json:"folder_breadcrumb" toon:"folder_breadcrumb"`
// Folder the dashboard sat in when deleted.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// Current revision of the trashed dashboard (the deletion bumped it); send it as `expected_revision` to restore.
Revision uint64 `json:"revision" toon:"revision"`
// Dashboard title.
Title string `json:"title" toon:"title"`
}
DashboardTrashItem is generated from the Flashduty OpenAPI schema.
type DashboardTrashListOutput ¶ added in v0.15.9
type DashboardTrashListOutput struct {
// Deleted dashboards in this page.
Items []DashboardTrashItem `json:"items" toon:"items"`
// Total number of trashed dashboards visible to the caller, across all pages.
Total int64 `json:"total" toon:"total"`
}
DashboardTrashListOutput is generated from the Flashduty OpenAPI schema.
type DashboardTrashListRequest ¶ added in v0.15.9
type DashboardTrashListRequest struct {
ListOptions
// Sort keys; only `title` and `deleted_at` are accepted here.
Sort []DashboardSort `json:"sort,omitempty" toon:"sort,omitempty"`
}
DashboardTrashListRequest is generated from the Flashduty OpenAPI schema.
type DashboardUpdateOutput ¶ added in v0.15.9
type DashboardUpdateOutput struct {
// Whether the dashboard was written and its `revision` incremented.
Changed bool `json:"changed" toon:"changed"`
Resource DashboardResource `json:"resource" toon:"resource"`
}
DashboardUpdateOutput is generated from the Flashduty OpenAPI schema.
type DashboardUpdateRequest ¶ added in v0.15.9
type DashboardUpdateRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition DashboardDefinition `json:"definition" toon:"definition"`
// Revision the caller last read. The write fails with `DashboardRevisionConflict` unless it still matches the stored revision.
ExpectedRevision uint64 `json:"expected_revision" toon:"expected_revision"`
// Optional revision message, at most 1024 Unicode code points. Stored with the revision and never returned by this endpoint.
Message string `json:"message,omitempty" toon:"message,omitempty"`
// Wire schema version; only `dashboard.v1` is accepted.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
}
DashboardUpdateRequest is generated from the Flashduty OpenAPI schema.
type DashboardVariable ¶ added in v0.15.9
type DashboardVariable struct {
DatasourceRef DashboardDatasourceRef `json:"datasource_ref,omitzero" toon:"datasource_ref,omitempty"`
// Type of datasource offered as candidates; candidates are the account's enabled datasources of this type. The set is open, so saving accepts any such value, but the dashboard runtime only runs `prometheus`, `mysql` and `loki` datasources; panels on other types fail when run.
DatasourceType string `json:"datasource_type,omitempty" toon:"datasource_type,omitempty"`
Default DashboardSelection `json:"default,omitzero" toon:"default,omitempty"`
// Default datasource ID. Without a usable default the runtime picks the first candidate by name, then ID.
DefaultDatasourceID uint64 `json:"default_datasource_id,omitempty" toon:"default_datasource_id,omitempty"`
// Variable kind discriminator; always `query`, with candidates resolved by running a query against a datasource.
Kind string `json:"kind" toon:"kind"`
// Optional display label; falls back to `name`.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Variable name, unique within the definition. Queries reference it as `${name}` (or `$name` inside Prometheus and Loki expressions). Names starting with `__` are reserved for the built-in variables `__interval`, `__rate_interval`, `__range` and `__auto`.
Name string `json:"name" toon:"name"`
// Wildcard patterns narrowing the candidates; empty means every datasource of the type.
NamePatterns []string `json:"name_patterns,omitempty" toon:"name_patterns,omitempty"`
// Candidate list, 1–1000 entries. Values must be non-empty, unique and must not be `$__all`.
Options []DashboardCandidate `json:"options,omitempty" toon:"options,omitempty"`
// When the candidates are recomputed: `on_dashboard_load` = once when the dashboard loads; `on_time_range_change` = every time the time range changes.
Refresh string `json:"refresh,omitempty" toon:"refresh,omitempty"`
Selection DashboardSelectionConfig `json:"selection,omitzero" toon:"selection,omitempty"`
VariableQuery DashboardVariableQuery `json:"variable_query,omitzero" toon:"variable_query,omitempty"`
}
DashboardVariable is generated from the Flashduty OpenAPI schema.
type DashboardVariableQuery ¶ added in v0.15.9
type DashboardVariableQuery struct {
// Named query arguments; defaults to an empty object. Must be empty for a Loki datasource.
Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
// Logs query expression; may reference other variables as `${name}`. Logs variable queries run only on Loki datasources, where `expr` may be empty to list the field's values across all streams.
Expr string `json:"expr,omitempty" toon:"expr,omitempty"`
// Log field whose values become candidates. For a Loki datasource it must be a bare stream label name (letters, digits and underscores).
Field string `json:"field,omitempty" toon:"field,omitempty"`
// Query kind discriminator; always `logs`, a logs query returning one field's values as candidates.
Kind string `json:"kind" toon:"kind"`
// Label whose values become candidates.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Optional matchers narrowing the series before label values are read.
LabelFilters []DashboardLabelFilter `json:"label_filters,omitempty" toon:"label_filters,omitempty"`
// Optional metric selector that restricts the series considered; may reference other variables as `${name}` or `$name`.
Metric string `json:"metric,omitempty" toon:"metric,omitempty"`
// Column used as the candidate label; defaults to the value column.
TextField string `json:"text_field,omitempty" toon:"text_field,omitempty"`
// Column used as the candidate value.
ValueField string `json:"value_field,omitempty" toon:"value_field,omitempty"`
}
DashboardVariableQuery is generated from the Flashduty OpenAPI schema.
type DashboardVariablesPreviewRequest ¶ added in v0.15.9
type DashboardVariablesPreviewRequest struct {
Context DashboardDraftContext `json:"context" toon:"context"`
// Selections keyed by variable name, at most 20 entries. Variables without an entry fall back to their draft default; a name that is not in `variables` fails the call with HTTP 400.
Selections map[string]DashboardSelection `json:"selections,omitempty" toon:"selections,omitempty"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Draft variables, at most 20. They are validated like a stored definition (names, dependencies, option limits) and must stay within 1 MiB.
Variables []DashboardVariable `json:"variables" toon:"variables"`
}
DashboardVariablesPreviewRequest is generated from the Flashduty OpenAPI schema.
type DashboardVariablesPreviewResponse ¶ added in v0.15.9
type DashboardVariablesPreviewResponse struct {
// Effective selections keyed by variable name; only variables that resolved successfully appear.
Selections map[string]DashboardSelection `json:"selections" toon:"selections"`
// Resolved variables, in the order of the draft `variables`.
Variables []DashboardResolvedVariable `json:"variables" toon:"variables"`
}
DashboardVariablesPreviewResponse is generated from the Flashduty OpenAPI schema.
type DashboardVariablesResolveRequest ¶ added in v0.15.9
type DashboardVariablesResolveRequest struct {
// Canonical UUIDv7 of the dashboard.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Time DashboardAbsoluteTimeRange `json:"time" toon:"time"`
// Selections already made, keyed by variable name, at most 20 entries. Variables without an entry fall back to their stored defaults; a name the dashboard does not define fails the call with HTTP 400.
Variables map[string]DashboardSelection `json:"variables,omitempty" toon:"variables,omitempty"`
}
DashboardVariablesResolveRequest is generated from the Flashduty OpenAPI schema.
type DashboardVariablesResolveResponse ¶ added in v0.15.9
type DashboardVariablesResolveResponse struct {
// ID of the dashboard the variables were resolved for, echoing the request.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision the resolution ran against.
Revision uint64 `json:"revision" toon:"revision"`
// Effective selections keyed by variable name; only variables that resolved successfully appear.
Selections map[string]DashboardSelection `json:"selections" toon:"selections"`
// Resolved variables, in definition order.
Variables []DashboardResolvedVariable `json:"variables" toon:"variables"`
}
DashboardVariablesResolveResponse is generated from the Flashduty OpenAPI schema.
type DashboardVizConfig ¶ added in v0.15.9
type DashboardVizConfig struct {
// Result field supplying the category axis; required, at most 1024 Unicode code points, not `frame_index` or `field_index`.
CategoryField string `json:"category_field,omitempty" toon:"category_field,omitempty"`
// Per-column display overrides keyed by result field name, at most 100 entries. Keys must be non-empty, at most 1024 Unicode code points and not `frame_index` or `field_index`.
ColumnOptions map[string]DashboardColumnOption `json:"column_options,omitempty" toon:"column_options,omitempty"`
DataLink DashboardDataLink `json:"data_link,omitzero" toon:"data_link,omitempty"`
// Fixed number of decimal places, 0–15; omit or send null to let the console decide.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Log fields rendered for each row.
DisplayFields []string `json:"display_fields,omitempty" toon:"display_fields,omitempty"`
// Visualization kind discriminator; always `text`.
Kind string `json:"kind" toon:"kind"`
// Drill-down links rendered as table columns. Together with per-column links a table allows at most 5.
LinkColumns []DashboardDataLink `json:"link_columns,omitempty" toon:"link_columns,omitempty"`
// Markdown body, at most 64 KiB. Allowed: paragraphs, headings, lists, block quotes, code blocks and spans, emphasis, tables, horizontal rules and links. Links must be `https://` URLs or site-relative paths starting with `/`. Images, raw HTML and `${` templates are rejected with `InvalidParameter`, not stripped.
Markdown string `json:"markdown,omitempty" toon:"markdown,omitempty"`
// Scale upper bound; must exceed `min` when both are set.
Max *float64 `json:"max,omitempty" toon:"max,omitempty"`
// Scale lower bound.
Min *float64 `json:"min,omitempty" toon:"min,omitempty"`
// Open options object for the chosen visualization kind; the only part of the definition that round-trips losslessly. Missing or null normalizes to `{}`.
Options map[string]any `json:"options" toon:"options"`
// Reduction applied across the returned rows: `last_non_null` = most recent non-null value; `min` = minimum; `max` = maximum; `mean` = average; `sum` = sum.
Reducer string `json:"reducer,omitempty" toon:"reducer,omitempty"`
// Initial sort keys, applied in order; each field may appear once.
Sort []DashboardFieldSort `json:"sort,omitempty" toon:"sort,omitempty"`
Threshold DashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit for the panel's numeric values: `unitless` = raw number; `ratio` = fraction of 1; `percent` = percentage; `milliseconds` = duration in milliseconds; `seconds` = duration in seconds; `bytes` = size in bytes; `bits` = size in bits; `count_per_second` = per-second count; `bytes_per_second` = bytes per second; `bits_per_second` = bits per second. Defaults to `unitless` when omitted.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Result fields reduced to the gauge value; at least one, each listed once. Names are matched exactly and must not be `frame_index` or `field_index`.
ValueFields []string `json:"value_fields,omitempty" toon:"value_fields,omitempty"`
}
DashboardVizConfig is generated from the Flashduty OpenAPI schema.
type DashboardsService ¶ added in v0.15.9
type DashboardsService service
DashboardsService handles the "Monitors/Dashboards" API resource.
func (*DashboardsService) PanelReadPreview ¶ added in v0.15.9
func (s *DashboardsService) PanelReadPreview(ctx context.Context, req *DashboardPanelPreviewRequest) (*DashboardPanelPreviewResponse, *Response, error)
Preview draft panel.
Execute a draft panel inline without saving a dashboard revision.
API: POST /monit/dashboard/panel/preview (monit-dashboard-panel-read-preview).
func (*DashboardsService) PanelReadRun ¶ added in v0.15.9
func (s *DashboardsService) PanelReadRun(ctx context.Context, req *DashboardPanelRunRequest) (*DashboardPanelRunResponse, *Response, error)
Run dashboard panel.
Execute one panel of a stored dashboard and return the datasource results.
API: POST /monit/dashboard/panel/run (monit-dashboard-panel-read-run).
func (*DashboardsService) QueryReadResolve ¶ added in v0.15.9
func (s *DashboardsService) QueryReadResolve(ctx context.Context, req *DashboardQueriesResolveRequest) (*DashboardQueriesResolveResponse, *Response, error)
Resolve panel queries.
Bind panel queries to datasources and substitute variables without executing them.
API: POST /monit/dashboard/runtime/queries/resolve (monit-dashboard-query-read-resolve).
func (*DashboardsService) ReadGet ¶ added in v0.15.9
func (s *DashboardsService) ReadGet(ctx context.Context, req *DashboardIDRequest) (*DashboardResource, *Response, error)
Get dashboard detail.
Fetch one dashboard with its full definition.
API: POST /monit/dashboard/get (monit-dashboard-read-get).
func (*DashboardsService) ReadList ¶ added in v0.15.9
func (s *DashboardsService) ReadList(ctx context.Context, req *DashboardListRequest) (*DashboardListOutput, *Response, error)
List dashboards.
List the dashboards stored directly in one folder, with word search and paging.
API: POST /monit/dashboard/list (monit-dashboard-read-list).
func (*DashboardsService) ReadOutline ¶ added in v0.15.9
func (s *DashboardsService) ReadOutline(ctx context.Context, req *DashboardOutlineRequest) (*DashboardOutline, *Response, error)
Get dashboard outline.
Get a dashboard's structure without queries or definitions.
API: POST /monit/dashboard/outline (monit-dashboard-read-outline).
func (*DashboardsService) ReadSearch ¶ added in v0.15.9
func (s *DashboardsService) ReadSearch(ctx context.Context, req *DashboardSearchRequest) (*DashboardListOutput, *Response, error)
Search dashboards.
Search dashboards across every readable folder.
API: POST /monit/dashboard/search (monit-dashboard-read-search).
func (*DashboardsService) RevisionReadGet ¶ added in v0.15.9
func (s *DashboardsService) RevisionReadGet(ctx context.Context, req *DashboardRevisionGetRequest) (*DashboardRevisionResource, *Response, error)
Get dashboard revision.
Fetch one historical revision with its full definition.
API: POST /monit/dashboard/revisions/get (monit-dashboard-revision-read-get).
func (*DashboardsService) RevisionReadList ¶ added in v0.15.9
func (s *DashboardsService) RevisionReadList(ctx context.Context, req *DashboardIDRequest) (*DashboardRevisionListOutput, *Response, error)
List dashboard revisions.
List a dashboard's revision history, newest first.
API: POST /monit/dashboard/revisions/list (monit-dashboard-revision-read-list).
func (*DashboardsService) TrashReadList ¶ added in v0.15.9
func (s *DashboardsService) TrashReadList(ctx context.Context, req *DashboardTrashListRequest) (*DashboardTrashListOutput, *Response, error)
List trashed dashboards.
List deleted dashboards still inside the 30-day retention window.
API: POST /monit/dashboard/trash/list (monit-dashboard-trash-read-list).
func (*DashboardsService) VariableReadPreview ¶ added in v0.15.9
func (s *DashboardsService) VariableReadPreview(ctx context.Context, req *DashboardVariablesPreviewRequest) (*DashboardVariablesPreviewResponse, *Response, error)
Preview draft variables.
Resolve a draft variable set that is not stored in any dashboard.
API: POST /monit/dashboard/runtime/variables/preview (monit-dashboard-variable-read-preview).
func (*DashboardsService) VariableReadResolve ¶ added in v0.15.9
func (s *DashboardsService) VariableReadResolve(ctx context.Context, req *DashboardVariablesResolveRequest) (*DashboardVariablesResolveResponse, *Response, error)
Resolve dashboard variables.
Resolve every variable of a stored dashboard for a time range.
API: POST /monit/dashboard/runtime/variables/resolve (monit-dashboard-variable-read-resolve).
func (*DashboardsService) WriteCreate ¶ added in v0.15.9
func (s *DashboardsService) WriteCreate(ctx context.Context, req *DashboardCreateRequest) (*DashboardResource, *Response, error)
Create dashboard.
Create a dashboard from a full definition.
API: POST /monit/dashboard/create (monit-dashboard-write-create).
func (*DashboardsService) WriteDelete ¶ added in v0.15.9
func (s *DashboardsService) WriteDelete(ctx context.Context, req *DashboardDeleteRequest) (*DashboardDeleteOutput, *Response, error)
Delete dashboard.
Move a dashboard to the trash, where it can be restored for 30 days.
API: POST /monit/dashboard/delete (monit-dashboard-write-delete).
func (*DashboardsService) WriteMove ¶ added in v0.15.9
func (s *DashboardsService) WriteMove(ctx context.Context, req *DashboardMoveRequest) (*DashboardUpdateOutput, *Response, error)
Move dashboard.
Move a dashboard to another folder without changing its definition.
API: POST /monit/dashboard/move (monit-dashboard-write-move).
func (*DashboardsService) WriteRestore ¶ added in v0.15.9
func (s *DashboardsService) WriteRestore(ctx context.Context, req *DashboardRestoreRequest) (*DashboardResource, *Response, error)
Restore dashboard.
Bring a trashed dashboard back, optionally into a different folder.
API: POST /monit/dashboard/restore (monit-dashboard-write-restore).
func (*DashboardsService) WriteUpdate ¶ added in v0.15.9
func (s *DashboardsService) WriteUpdate(ctx context.Context, req *DashboardUpdateRequest) (*DashboardUpdateOutput, *Response, error)
Update dashboard.
Replace a dashboard definition with compare-and-swap on the revision counter.
API: POST /monit/dashboard/update (monit-dashboard-write-update).
type DataQueryService ¶ added in v0.5.4
type DataQueryService service
DataQueryService handles the "RUM/Data query" API resource.
func (*DataQueryService) Query ¶ added in v0.5.4
func (s *DataQueryService) Query(ctx context.Context, req *RUMDataQueryRequest) (*RUMDataQueryResponse, *Response, error)
Query RUM data.
Run one or more SQL-style RUM data queries over a bounded time range.
API: POST /rum/data/query (rum-read-data-query).
type DataSourceItem ¶
type DataSourceItem struct {
// ID of the account that owns the datasource; always the caller's account.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Connection address as stored, after normalization. The format depends on `type_ident`; see the `address` field of the create request for each type. At most 4096 characters.
Address string `json:"address" toon:"address"`
// Whether alert evaluation is allowed. Alerting also requires enabled=true and an alerting-capable type. Always false for diagnostic-only types; false does not block non-alerting queries or tools.
AlertingEnabled bool `json:"alerting_enabled" toon:"alerting_enabled"`
// ID of the member who created the datasource; `null` when not recorded. The creator can always manage the datasource.
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Monitors edge cluster name responsible for evaluating rules using this datasource.
EdgeClusterName string `json:"edge_cluster_name" toon:"edge_cluster_name"`
// Whether business execution is enabled. Disabled datasources reject business queries and tools; enabling does not change alerting_enabled.
Enabled bool `json:"enabled" toon:"enabled"`
// Unique datasource ID. Pass it as `id` to update, delete and info, and as `datasource_id` to tool invocation.
ID uint64 `json:"id" toon:"id"`
// ID of the managing team. Its members can edit, delete, enable or disable the datasource and view its full configuration. `null` means no managing team: any caller with the Datasources Manage permission can manage it. The creator, the account owner and Admin members can always manage.
ManageTeamID uint64 `json:"manage_team_id" toon:"manage_team_id"`
// The caller's access level on this datasource. Only present in list responses.
// - `manage`: can edit, delete, enable or disable the datasource, view its configuration and query it.
// - `readonly`: can query and reference the datasource but not change it or read its configuration.
MyPerm string `json:"my_perm" toon:"my_perm"`
// Datasource name, unique within the account across all types.
Name string `json:"name" toon:"name"`
// Free-text note; an empty string when not set.
Note string `json:"note" toon:"note"`
// Type-specific configuration block; must contain the key matching `type_ident`. Always `null` in `/monit/datasource/list` responses (the list query does not read the payload column); populated in create/update/info responses. For `tencent_cls`, `secret_key` is masked to an empty string unless it is an `${env:...}` reference. For diagnostic types, password and Kafka tls_key are omitted from responses unless they are ${env:...} references. On update, omit those fields to preserve stored secrets; explicitly send an empty string to clear. Other configuration fields retain their existing behavior.
Payload *DsPayload `json:"payload" toon:"payload"`
// IDs of the teams allowed to query and reference the datasource, in addition to the managing team, the creator, the account owner and Admin members. `null` or an empty array means every member of the account can query it.
ReadonlyTeamIDs []uint64 `json:"readonly_team_ids" toon:"readonly_team_ids"`
// Datasource type.
//
// Alerting types (can evaluate alert rules):
// - `prometheus`: Prometheus-compatible metrics.
// - `loki`: Grafana Loki logs.
// - `mysql`: MySQL.
// - `oracle`: Oracle Database.
// - `postgres`: PostgreSQL.
// - `clickhouse`: ClickHouse.
// - `elasticsearch`: Elasticsearch.
// - `sls`: Alibaba Cloud Simple Log Service.
// - `tencent_cls`: Tencent Cloud Log Service (CLS).
// - `victorialogs`: VictoriaLogs.
//
// Diagnostic-only types (cannot evaluate alerts, `alerting_enabled` is always `false`):
// - `redis_node`: a single Redis node.
// - `redis_sentinel`: Redis Sentinel.
// - `mongodb_mongod`: a MongoDB mongod instance.
// - `mongodb_mongos`: a MongoDB mongos router.
// - `kafka`: a Kafka cluster.
//
// The `payload` key that holds the type-specific settings has the same name as the type.
TypeIdent string `json:"type_ident" toon:"type_ident"`
// Last update timestamp, Unix epoch seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
DataSourceItem is generated from the Flashduty OpenAPI schema.
type DataSourceListRequest ¶
type DataSourceListRequest struct {
// Return only the datasource whose name equals this value exactly (names are unique within the account, so at most one item). Omit or leave empty for no name filter.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Return only datasources of this type; omit or leave empty to return all types. An unrecognized value matches nothing and returns an empty array.
//
// Alerting types (can evaluate alert rules):
// - `prometheus`: Prometheus-compatible metrics.
// - `loki`: Grafana Loki logs.
// - `mysql`: MySQL.
// - `oracle`: Oracle Database.
// - `postgres`: PostgreSQL.
// - `clickhouse`: ClickHouse.
// - `elasticsearch`: Elasticsearch.
// - `sls`: Alibaba Cloud Simple Log Service.
// - `tencent_cls`: Tencent Cloud Log Service (CLS).
// - `victorialogs`: VictoriaLogs.
//
// Diagnostic-only types (cannot evaluate alerts, `alerting_enabled` is always `false`):
// - `redis_node`: a single Redis node.
// - `redis_sentinel`: Redis Sentinel.
// - `mongodb_mongod`: a MongoDB mongod instance.
// - `mongodb_mongos`: a MongoDB mongos router.
// - `kafka`: a Kafka cluster.
Type string `json:"type,omitempty" toon:"type,omitempty"`
}
DataSourceListRequest is generated from the Flashduty OpenAPI schema.
type DataSourceListResponse ¶
type DataSourceListResponse []DataSourceItem
DataSourceListResponse is a list response payload.
type DataSourceUpsertRequest ¶
type DataSourceUpsertRequest struct {
// Connection address, required for every type except `elasticsearch` with `deployment: cloud`. At most 4096 characters after normalization. Format by type:
// - `prometheus`, `loki`, `victorialogs`: HTTP URL; `http://` is prepended when the value does not start with `http`.
// - `mysql`, `oracle`, `postgres`: `host:port`.
// - `clickhouse`: one or more comma-separated `host:port` endpoints; duplicates are rejected.
// - `elasticsearch` with `self-managed`: one or more comma-separated HTTP(S) URLs (scheme defaults to `http://`) that share identical query parameters; duplicates are rejected. Not needed for `cloud`.
// - `sls`: endpoint without the `http://` or `https://` prefix.
// - `tencent_cls`: exactly `cls.tencentcloudapi.com` or `cls.internal.tencentcloudapi.com` (requires Monitors edge >= v0.66.0).
// - `redis_node`, `redis_sentinel`, `mongodb_mongod`, `mongodb_mongos`: a single `host:port` (bracket IPv6) with no URI, userinfo or query.
// - `kafka`: 1-32 unique comma-separated `host:port` bootstrap addresses (the payload has no broker list).
Address string `json:"address,omitempty" toon:"address,omitempty"`
// Whether this datasource may evaluate alerts. Omitted on create: true for alerting types, false for diagnostic-only types; omitted on update: preserve current value. null is invalid. redis_node, redis_sentinel, mongodb_mongod, mongodb_mongos and kafka reject true. Disabling is rejected with conflict when enabled rules reference the datasource.
AlertingEnabled *bool `json:"alerting_enabled,omitempty" toon:"alerting_enabled,omitempty"`
// Name of the Monitors edge cluster that evaluates rules and runs queries for this datasource. It must be an existing edge cluster of the account, otherwise the call fails with `InvalidParameter`. Changing it on update closes open alerts of rules that use this datasource.
EdgeClusterName string `json:"edge_cluster_name" toon:"edge_cluster_name"`
// Whether business execution is enabled. Omitted on create: true; omitted on update: preserve the current value. Explicit false disables execution; null is invalid. Does not change alerting_enabled.
Enabled *bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// Datasource ID. Required for update (an unknown ID, or one in another account, fails with `ResourceNotFound`); ignored on create.
ID uint64 `json:"id,omitempty" toon:"id,omitempty"`
// ID of the managing team (see the response field of the same name). On create, omitted means no managing team. On update, omitted keeps the current value, while `null` or `0` clears it. Required whenever `readonly_team_ids` is non-empty.
ManageTeamID *uint64 `json:"manage_team_id,omitempty" toon:"manage_team_id,omitempty"`
// Datasource name; required and unique within the account across all types. This is the name referenced as `ds_name` in query APIs. Duplicates fail with `InvalidParameter`.
Name string `json:"name" toon:"name"`
// Free-text note. On update, an omitted or empty value clears the stored note.
Note string `json:"note,omitempty" toon:"note,omitempty"`
// Type-specific configuration block; must include the key named by `type_ident`. An update replaces the whole payload, so resend every setting you want to keep (including credentials of non-diagnostic types, which the info endpoint returns). Exceptions: for the diagnostic types, omit the password (and the Kafka `tls_key`) to keep the stored value or send an empty string to clear it; for `tencent_cls`, an omitted or empty `secret_key` keeps the stored key. Stored secrets are not carried over when `type_ident` changes. The serialized JSON may not exceed 65,535 bytes.
Payload DsPayload `json:"payload" toon:"payload"`
// IDs of the teams allowed to query and reference the datasource (see the response field of the same name). On create, omitted means unrestricted. On update, omitted keeps the current value, while `null` or an empty array clears it (everyone can query). Duplicates and `0` are dropped. Requires `manage_team_id`: a non-empty list without a managing team fails with `InvalidParameter`.
ReadonlyTeamIDs []uint64 `json:"readonly_team_ids,omitzero" toon:"readonly_team_ids,omitempty"`
// Datasource type.
//
// Alerting types (can evaluate alert rules):
// - `prometheus`: Prometheus-compatible metrics.
// - `loki`: Grafana Loki logs.
// - `mysql`: MySQL.
// - `oracle`: Oracle Database.
// - `postgres`: PostgreSQL.
// - `clickhouse`: ClickHouse.
// - `elasticsearch`: Elasticsearch.
// - `sls`: Alibaba Cloud Simple Log Service.
// - `tencent_cls`: Tencent Cloud Log Service (CLS).
// - `victorialogs`: VictoriaLogs.
//
// Diagnostic-only types (cannot evaluate alerts, `alerting_enabled` is always `false`):
// - `redis_node`: a single Redis node.
// - `redis_sentinel`: Redis Sentinel.
// - `mongodb_mongod`: a MongoDB mongod instance.
// - `mongodb_mongos`: a MongoDB mongos router.
// - `kafka`: a Kafka cluster.
//
// The `payload` key that holds the type-specific settings has the same name as the type.
TypeIdent string `json:"type_ident" toon:"type_ident"`
}
DataSourceUpsertRequest is generated from the Flashduty OpenAPI schema.
type DataSourcesService ¶
type DataSourcesService service
DataSourcesService handles the "Monitors/Data sources" API resource.
func (*DataSourcesService) ReadInfo ¶
func (s *DataSourcesService) ReadInfo(ctx context.Context, req *IDRequest) (*DataSourceItem, *Response, error)
Get datasource detail.
Return one datasource by ID, including its full `payload` configuration.
API: POST /monit/datasource/info (monit-datasource-read-info).
func (*DataSourcesService) ReadList ¶
func (s *DataSourcesService) ReadList(ctx context.Context, req *DataSourceListRequest) (*DataSourceListResponse, *Response, error)
List datasources.
List the account's datasources that the caller can query, optionally filtered by type or exact name.
API: POST /monit/datasource/list (monit-datasource-read-list).
func (*DataSourcesService) ReadPrometheusLabelValues ¶ added in v0.15.3
func (s *DataSourcesService) ReadPrometheusLabelValues(ctx context.Context, dataSourceID uint64, labelName string) (*PrometheusLabelValuesResponse, *Response, error)
ReadPrometheusLabelValues lists the values of one label from a Prometheus-compatible data source, through the Monitors proxy.
Unlike the generated typed endpoints, the response body is the data source's native Prometheus HTTP API payload: it is not wrapped in the Flashduty {request_id, error, data} envelope, so decoding goes straight into PrometheusLabelValuesResponse. A non-2xx status can come from either side of the proxy — the platform itself (plain text, raised before the data source is reached) or the data source (its own JSON error shape, distinct from Flashduty's) — so the raw body is carried as-is on the returned error's Message rather than parsed as a Flashduty error.
API: GET /monit/prometheus/api/v1/label/{label_name}/values (monit-prometheus-read-label-values).
func (*DataSourcesService) ReadSLSLogstores ¶
func (s *DataSourcesService) ReadSLSLogstores(ctx context.Context, req *SLSLogstoresRequest) (*SLSLogstoresResponse, *Response, error)
List SLS logstores.
List logstores within an SLS project for the specified SLS datasource.
API: POST /monit/datasource/sls/logstores (monit-datasource-read-sls-logstores).
func (*DataSourcesService) ReadSLSProjects ¶
func (s *DataSourcesService) ReadSLSProjects(ctx context.Context, req *SLSProjectsRequest) (*SLSProjectsResponse, *Response, error)
List SLS projects.
List Alibaba Cloud SLS (Simple Log Service) projects available in the specified SLS datasource.
API: POST /monit/datasource/sls/projects (monit-datasource-read-sls-projects).
func (*DataSourcesService) ToolsInvoke ¶ added in v0.15.0
func (s *DataSourcesService) ToolsInvoke(ctx context.Context, req *DatasourceToolInvokeRequest) (*DatasourceToolResult, *Response, error)
Invoke datasource tool.
Execute one deterministic diagnostic or query tool against a configured datasource.
API: POST /monit/datasource/tools/invoke (monit-datasource-tools-invoke).
func (*DataSourcesService) WriteCreate ¶
func (s *DataSourcesService) WriteCreate(ctx context.Context, req *DataSourceUpsertRequest) (*DataSourceItem, *Response, error)
Create datasource.
Create a monitoring datasource of one of 15 supported types and bind it to a Monitors edge cluster.
API: POST /monit/datasource/create (monit-datasource-write-create).
func (*DataSourcesService) WriteDelete ¶
Delete datasource.
Delete a datasource by ID; alert rules that reference it are not blocked.
API: POST /monit/datasource/delete (monit-datasource-write-delete).
func (*DataSourcesService) WriteUpdate ¶
func (s *DataSourcesService) WriteUpdate(ctx context.Context, req *DataSourceUpsertRequest) (*DataSourceItem, *Response, error)
Update datasource.
Update a datasource by ID, replacing its name, note, address, payload and edge cluster.
API: POST /monit/datasource/update (monit-datasource-write-update).
type DatasourceQueryExecution ¶ added in v0.15.2
type DatasourceQueryExecution struct {
Kind string `json:"kind"`
// Window or range start as a Unix epoch timestamp in milliseconds.
FromMS *int64 `json:"from_ms,omitempty"`
// Query end time as a Unix epoch timestamp in milliseconds; for `instant`
// it is the evaluation timestamp.
ToMS *int64 `json:"to_ms,omitempty"`
// `range` only, required: maximum returned data points.
MaxDataPoints *int64 `json:"max_data_points,omitempty"`
// `range` only, optional: positive lower bound in seconds for the computed
// step.
MinStepSeconds *int64 `json:"min_step_seconds,omitempty"`
}
DatasourceQueryExecution describes when a `<type>.query` tool evaluates.
Kind selects the evaluation mode:
- `instant` evaluates once at ToMS; only ToMS is set.
- `range` evaluates a stepped series over [FromMS, ToMS]; MaxDataPoints is required and bounds the returned points (the server computes the step).
- `window` evaluates one bounded window [FromMS, ToMS].
The reserved `step_seconds` field is not modeled and must stay omitted.
type DatasourceToolInvokeRequest ¶ added in v0.15.0
type DatasourceToolInvokeRequest struct {
// Optional consistency check; must equal the authenticated account.
AccountID uint64 `json:"account_id,omitempty" toon:"account_id,omitempty"`
// ID of the datasource to run the tool against, from `/monit/datasource/list`. The caller needs query access to it. For query tools (`<type>.query`) the ID must not exceed 9007199254740991.
DatasourceID uint64 `json:"datasource_id" toon:"datasource_id"`
// Tool-specific JSON parameters; omitted means {}. Explicit null is invalid. Query tools (`<type>.query`) use the per-datasource params schemas named in the `tool` description.
Params json.RawMessage `json:"params,omitempty" toon:"params,omitempty"`
// Single tool name prefixed by the datasource type. Diagnostic tools are defined by the executing Edge (e.g. `mysql.overview`). Query tools are `<type>.query` where `<type>` is one of `prometheus`, `mysql`, `postgres`, `oracle`, `clickhouse`, `elasticsearch`, `loki`, `victorialogs`, `sls`, `tencent_cls`; their `params` follow `PrometheusQueryParams`, `MySQLQueryParams`, `PostgresQueryParams`, `OracleQueryParams`, `ClickHouseQueryParams`, `ElasticsearchQueryParams`, `LokiQueryParams`, `VictoriaLogsQueryParams`, `SLSQueryParams`, or `TencentCLSQueryParams` respectively.
Tool string `json:"tool" toon:"tool"`
}
DatasourceToolInvokeRequest is generated from the Flashduty OpenAPI schema.
func NewDatasourceQueryInvokeRequest ¶ added in v0.15.2
func NewDatasourceQueryInvokeRequest(datasourceID uint64, tool string, params any) (*DatasourceToolInvokeRequest, error)
NewDatasourceQueryInvokeRequest builds a ToolsInvoke request for a `<type>.query` tool by marshaling params (one of the *QueryParams types above) into the request's raw JSON Params. A nil params returns an error: query tools must not omit their params.
type DatasourceToolResult ¶ added in v0.15.0
type DatasourceToolResult struct {
// Tool-specific JSON evidence, preserved without conversion; never null. No nested legacy diagnose envelope.
Data json.RawMessage `json:"data" toon:"data"`
// Datasource ID from /monit/datasource/list.
DatasourceID uint64 `json:"datasource_id" toon:"datasource_id"`
// Optional non-empty summary.
Summary *string `json:"summary,omitempty" toon:"summary,omitempty"`
// Executed tool name matching the request.
Tool string `json:"tool" toon:"tool"`
Truncated *DatasourceToolTruncation `json:"truncated,omitempty" toon:"truncated,omitempty"`
}
DatasourceToolResult is generated from the Flashduty OpenAPI schema.
type DatasourceToolTruncation ¶ added in v0.15.0
type DatasourceToolTruncation struct {
// Why the result was truncated, as reported by the executing Edge; treat it as an opaque string. The object is present only when the result was truncated.
Reason string `json:"reason" toon:"reason"`
}
DatasourceToolTruncation is generated from the Flashduty OpenAPI schema.
type DedicatedIntegrationsService ¶ added in v0.15.21
type DedicatedIntegrationsService service
DedicatedIntegrationsService handles the "On-call/Dedicated integrations" API resource.
func (*DedicatedIntegrationsService) ReadInfo ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) ReadInfo(ctx context.Context, req *ChannelIntegrationIDRequest) (*ChannelIntegrationItem, *Response, error)
Get dedicated integration detail.
Get one channel-owned integration, including its integration key and masked settings.
API: POST /channel/integration/info (channel-integration-read-info).
func (*DedicatedIntegrationsService) ReadList ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) ReadList(ctx context.Context, req *ChannelIntegrationListRequest) (*ChannelIntegrationListResponse, *Response, error)
List dedicated integrations.
List the dedicated integrations owned by one channel.
API: POST /channel/integration/list (channel-integration-read-list).
func (*DedicatedIntegrationsService) WriteCreate ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) WriteCreate(ctx context.Context, req *ChannelIntegrationCreateRequest) (*ChannelIntegrationCreateResponse, *Response, error)
Create dedicated integration.
Create a dedicated alert integration for an enabled channel.
API: POST /channel/integration/create (channel-integration-write-create).
func (*DedicatedIntegrationsService) WriteDelete ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) WriteDelete(ctx context.Context, req *ChannelIntegrationIDRequest) (*Response, error)
Delete dedicated integration.
Delete a dedicated integration after its references have been removed.
API: POST /channel/integration/delete (channel-integration-write-delete).
func (*DedicatedIntegrationsService) WriteDisable ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) WriteDisable(ctx context.Context, req *ChannelIntegrationIDRequest) (*Response, error)
Disable dedicated integration.
Disable a dedicated integration to pause alert ingestion.
API: POST /channel/integration/disable (channel-integration-write-disable).
func (*DedicatedIntegrationsService) WriteEnable ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) WriteEnable(ctx context.Context, req *ChannelIntegrationIDRequest) (*Response, error)
Enable dedicated integration.
Enable a dedicated integration so it can receive alerts.
API: POST /channel/integration/enable (channel-integration-write-enable).
func (*DedicatedIntegrationsService) WriteRotateKey ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) WriteRotateKey(ctx context.Context, req *ChannelIntegrationIDRequest) (*RotateIntegrationKeyResponse, *Response, error)
Rotate dedicated integration key.
Issue a new dedicated integration key and invalidate the previous key.
API: POST /channel/integration/key/rotate (channel-integration-write-rotate-key).
func (*DedicatedIntegrationsService) WriteUpdate ¶ added in v0.15.21
func (s *DedicatedIntegrationsService) WriteUpdate(ctx context.Context, req *ChannelIntegrationUpdateRequest) (*ChannelIntegrationItem, *Response, error)
Update dedicated integration.
Update the name, description, or settings of a dedicated integration.
API: POST /channel/integration/update (channel-integration-write-update).
type DeleteFieldRequest ¶
type DeleteFieldRequest struct {
// Field ID — 24-character hex ObjectID.
FieldID string `json:"field_id" toon:"field_id"`
}
DeleteFieldRequest is generated from the Flashduty OpenAPI schema.
type DeleteIncidentCommentTypeRequest ¶ added in v0.8.0
type DeleteIncidentCommentTypeRequest struct {
// ID of the comment type to delete (24-character hex ObjectID).
CommentTypeID string `json:"comment_type_id" toon:"comment_type_id"`
}
DeleteIncidentCommentTypeRequest is generated from the Flashduty OpenAPI schema.
type DeletePostMortemRequest ¶
type DeletePostMortemRequest struct {
// Post-mortem report ID; obtain it from `POST /incident/post-mortem/list`.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
}
DeletePostMortemRequest is generated from the Flashduty OpenAPI schema.
type DeletePostMortemTemplateRequest ¶ added in v0.5.4
type DeletePostMortemTemplateRequest struct {
// ID of the custom template to delete; obtain it from `POST /incident/post-mortem/template/list`.
TemplateID string `json:"template_id" toon:"template_id"`
}
DeletePostMortemTemplateRequest is generated from the Flashduty OpenAPI schema.
type DeleteStatusPageChangeRequest ¶
type DeleteStatusPageChangeRequest struct {
// Target change ID; obtain it from `GET /status-page/change/list`.
ChangeID int64 `json:"change_id" toon:"change_id"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
}
DeleteStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.
type DeleteStatusPageChangeTimelineRequest ¶
type DeleteStatusPageChangeTimelineRequest struct {
// Owning change ID; obtain it from `GET /status-page/change/list`.
ChangeID int64 `json:"change_id" toon:"change_id"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Timeline update ID to delete; obtain it from `GET /status-page/change/info`.
UpdateID string `json:"update_id" toon:"update_id"`
}
DeleteStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.
type DeleteStatusPageComponentRequest ¶ added in v0.5.4
type DeleteStatusPageComponentRequest struct {
// Component IDs to delete; obtain them from `GET /status-page/info`.
ComponentIDs []string `json:"component_ids" toon:"component_ids"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
}
DeleteStatusPageComponentRequest is generated from the Flashduty OpenAPI schema.
type DeleteStatusPageRequest ¶ added in v0.6.0
type DeleteStatusPageRequest struct {
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
}
DeleteStatusPageRequest is generated from the Flashduty OpenAPI schema.
type DeleteStatusPageSectionRequest ¶ added in v0.5.4
type DeleteStatusPageSectionRequest struct {
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Section IDs to delete; obtain them from `GET /status-page/info`.
SectionIDs []string `json:"section_ids" toon:"section_ids"`
}
DeleteStatusPageSectionRequest is generated from the Flashduty OpenAPI schema.
type DeleteStatusPageTemplateRequest ¶ added in v0.5.4
type DeleteStatusPageTemplateRequest struct {
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// ID of the template to delete; obtain it from `GET /status-page/template/list`.
TemplateID string `json:"template_id" toon:"template_id"`
// Template kind: `pre_defined` predefined template, `message` message template.
Type string `json:"type" toon:"type"`
}
DeleteStatusPageTemplateRequest is generated from the Flashduty OpenAPI schema.
type DeleteWarRoomRequest ¶
type DeleteWarRoomRequest struct {
// Chat ID of the war room to unlink, from `POST /incident/war-room/list`. Required when `unlink_only` is `true` and must match the current war room; ignored otherwise.
ChatID string `json:"chat_id,omitempty" toon:"chat_id,omitempty"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// IM integration ID; obtain it from `POST /datasource/im/war-room-enabled/list`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// When true, only remove the link between the incident and the war room without dissolving the group. Allowed only for account owners and admins, only when the IM integration is disabled or deleted, and requires `chat_id`.
UnlinkOnly bool `json:"unlink_only,omitempty" toon:"unlink_only,omitempty"`
}
DeleteWarRoomRequest is generated from the Flashduty OpenAPI schema.
type DeleteWorkItemRequest ¶ added in v0.8.0
type DeleteWorkItemRequest struct {
// The item's current `version` (≥ 1) for optimistic locking.
Version int64 `json:"version" toon:"version"`
// Work item ID (opaque string, max 128 characters).
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
DeleteWorkItemRequest is generated from the Flashduty OpenAPI schema.
type DiagnosticsService ¶
type DiagnosticsService service
DiagnosticsService handles the "Monitors/Diagnostics" API resource.
func (*DiagnosticsService) QueryData ¶ added in v0.13.1
func (s *DiagnosticsService) QueryData(ctx context.Context, req *QueryDataRequest) (*QueryDataResponse, *Response, error)
Query structured data.
Run a synchronous ad-hoc query against a data source and return a `query_result.v1` result as frames, records, or samples.
API: POST /monit/query/data (monit-read-query-data).
func (*DiagnosticsService) QueryExplore ¶ added in v0.15.3
func (s *DiagnosticsService) QueryExplore(ctx context.Context, req *QueryExploreRequest) (*ExploreData, *Response, error)
Run Explore query.
Run an Explore query against a configured data source and return frames, samples, or logs.
API: POST /monit/query/explore (monit-read-query-explore).
type DimensionInsightItem ¶
type DimensionInsightItem struct {
// Acknowledgement rate (%): acknowledged incidents ÷ total incidents × 100, rounded to two decimals and capped at 100; 0 when the bucket has no incidents.
AcknowledgementPct float64 `json:"acknowledgement_pct" toon:"acknowledgement_pct"`
// Channel ID, returned only when aggregating by channel (`/insight/channel`).
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name, returned when aggregating by channel; omitted when the name cannot be resolved.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Hour bucket when `split_hours` is enabled. `work` is Mon–Fri 08:00–19:00, `sleep` is daily 23:00–08:00, and `off` is everything else, all evaluated in the account timezone (`sleep` takes precedence over `work`). Omitted when `split_hours` is false.
Hours string `json:"hours" toon:"hours"`
// Mean time to first acknowledgement in seconds; 0 when no incident in the bucket was acknowledged.
MeanSecondsToAck float64 `json:"mean_seconds_to_ack" toon:"mean_seconds_to_ack"`
// Mean time to close in seconds; 0 when no incident in the bucket was closed.
MeanSecondsToClose float64 `json:"mean_seconds_to_close" toon:"mean_seconds_to_close"`
// Noise reduction ratio (%): 100 − incidents ÷ alert events × 100, rounded to two decimals; 0 when there is no alert-event data or alert events do not exceed incidents.
NoiseReductionPct float64 `json:"noise_reduction_pct" toon:"noise_reduction_pct"`
// Responder (person) ID, returned only when aggregating by responder (`/insight/responder`).
ResponderID int64 `json:"responder_id" toon:"responder_id"`
// Responder name, returned when aggregating by responder; omitted when the name cannot be resolved.
ResponderName string `json:"responder_name" toon:"responder_name"`
// Team ID, returned only by `/insight/team`. Omitted on the row that aggregates incidents without a team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Team name, returned when aggregating by team; omitted when the name cannot be resolved (e.g. team deleted).
TeamName string `json:"team_name" toon:"team_name"`
// Total number of alerts.
TotalAlertCnt int64 `json:"total_alert_cnt" toon:"total_alert_cnt"`
// Total number of alert events.
TotalAlertEventCnt int64 `json:"total_alert_event_cnt" toon:"total_alert_event_cnt"`
// Total engaged time in seconds: each incident contributes the sum of close time minus acknowledgement time across its acknowledged responders.
TotalEngagedSeconds int64 `json:"total_engaged_seconds" toon:"total_engaged_seconds"`
// Total number of incidents.
TotalIncidentCnt int64 `json:"total_incident_cnt" toon:"total_incident_cnt"`
// Incidents that were acknowledged at least once.
TotalIncidentsAcknowledged int64 `json:"total_incidents_acknowledged" toon:"total_incidents_acknowledged"`
// Incidents closed automatically because all alerts recovered.
TotalIncidentsAutoClosed int64 `json:"total_incidents_auto_closed" toon:"total_incidents_auto_closed"`
// Incidents that are closed.
TotalIncidentsClosed int64 `json:"total_incidents_closed" toon:"total_incidents_closed"`
// Sum of `total_incidents_manually_escalated` and `total_incidents_timeout_escalated`; an incident escalated both ways counts twice.
TotalIncidentsEscalated int64 `json:"total_incidents_escalated" toon:"total_incidents_escalated"`
// Incidents closed manually.
TotalIncidentsManuallyClosed int64 `json:"total_incidents_manually_closed" toon:"total_incidents_manually_closed"`
// Incidents escalated manually at least once.
TotalIncidentsManuallyEscalated int64 `json:"total_incidents_manually_escalated" toon:"total_incidents_manually_escalated"`
// Incidents that were reassigned at least once.
TotalIncidentsReassigned int64 `json:"total_incidents_reassigned" toon:"total_incidents_reassigned"`
// Incidents closed automatically on timeout.
TotalIncidentsTimeoutClosed int64 `json:"total_incidents_timeout_closed" toon:"total_incidents_timeout_closed"`
// Incidents escalated on timeout at least once.
TotalIncidentsTimeoutEscalated int64 `json:"total_incidents_timeout_escalated" toon:"total_incidents_timeout_escalated"`
// Total interruptions: notifications sent via app push, SMS, or voice call; consecutive notifications to the same responder within 60 seconds count as one.
TotalInterruptions int64 `json:"total_interruptions" toon:"total_interruptions"`
// Total number of notifications sent.
TotalNotifications int64 `json:"total_notifications" toon:"total_notifications"`
// Total time to first acknowledgement in seconds.
TotalSecondsToAck int64 `json:"total_seconds_to_ack" toon:"total_seconds_to_ack"`
// Total time to close in seconds.
TotalSecondsToClose int64 `json:"total_seconds_to_close" toon:"total_seconds_to_close"`
// Start of the time bucket, Unix seconds. Equals `start_time` when `aggregate_unit` is not set.
TS Timestamp `json:"ts" toon:"ts"`
}
DimensionInsightItem is generated from the Flashduty OpenAPI schema.
type DimensionInsightResponse ¶
type DimensionInsightResponse struct {
// Metric rows, newest bucket first. Buckets or dimension values without incidents produce no row; an empty array means no incidents matched.
Items []DimensionInsightItem `json:"items" toon:"items"`
}
DimensionInsightResponse is generated from the Flashduty OpenAPI schema.
type DisableIncidentMergeRequest ¶
type DisableIncidentMergeRequest struct {
// Incident IDs whose automatic merge should be disabled.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
}
DisableIncidentMergeRequest is generated from the Flashduty OpenAPI schema.
type DoIncidentCustomActionRequest ¶
type DoIncidentCustomActionRequest struct {
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Custom action integration ID. Must be enabled and associated with the incident's channel.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
DoIncidentCustomActionRequest is generated from the Flashduty OpenAPI schema.
type DoIncidentCustomActionResponse ¶
type DoIncidentCustomActionResponse struct {
// Error returned by the HTTP request to the action's URL (for example, a timeout after 2 seconds).
Message string `json:"message" toon:"message"`
}
DoIncidentCustomActionResponse is generated from the Flashduty OpenAPI schema.
type DsClickHouseConfig ¶
type DsClickHouseConfig struct {
// Default database for authentication.
Database string `json:"database,omitempty" toon:"database,omitempty"`
// Dial timeout in milliseconds.
DialTimeoutMills int64 `json:"dial_timeout_mills,omitempty" toon:"dial_timeout_mills,omitempty"`
// Maximum number of idle connections in the pool; `0` or omitted uses the default of 4.
IdleConns int64 `json:"idle_conns,omitempty" toon:"idle_conns,omitempty"`
// Maximum connection lifetime in seconds; `0` or omitted uses the default of 600 (10 minutes).
LifetimeSeconds int64 `json:"lifetime_seconds,omitempty" toon:"lifetime_seconds,omitempty"`
// Max query execution time in seconds.
MaxExecutionSeconds int64 `json:"max_execution_seconds,omitempty" toon:"max_execution_seconds,omitempty"`
// Maximum number of open connections in the pool; `0` or omitted uses the default of 32.
OpenConns int64 `json:"open_conns,omitempty" toon:"open_conns,omitempty"`
// ClickHouse authentication password.
Password string `json:"password,omitempty" toon:"password,omitempty"`
// Per-query timeout in milliseconds; `0` or omitted uses the default of 10000 (10 seconds).
TimeoutMills int64 `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
// PEM-encoded CA certificate used to verify the server certificate.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// PEM-encoded client certificate for mutual TLS; must be configured together with `tls_key`.
TlsCert string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
// Whether TLS is enabled; when `false`, all `tls_*` fields are cleared before saving.
TlsEnabled bool `json:"tls_enabled,omitempty" toon:"tls_enabled,omitempty"`
// PEM-encoded client private key; must be configured together with `tls_cert`.
TlsKey string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
// Maximum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint.
TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
// Minimum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint and it must not exceed `tls_max_version`.
TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
// Server name used for TLS SNI and certificate verification; defaults to the host from the connection address when empty.
TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
// Whether to skip server certificate verification (insecure, for self-signed setups only).
TlsSkipVerify bool `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
// ClickHouse authentication username.
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsClickHouseConfig is generated from the Flashduty OpenAPI schema.
type DsElasticSearchConfig ¶
type DsElasticSearchConfig struct {
// Elastic Cloud API key. Only for `cloud` deployment.
APIKey string `json:"api_key,omitempty" toon:"api_key,omitempty"`
// SHA-256 fingerprint of the Elasticsearch CA certificate, used to verify the server chain (the recommended check for ES 8 default security).
CertificateFingerprint string `json:"certificate_fingerprint,omitempty" toon:"certificate_fingerprint,omitempty"`
// Elastic Cloud deployment ID. Only for `cloud` deployment.
CloudID string `json:"cloud_id,omitempty" toon:"cloud_id,omitempty"`
// Deployment type; required. `cloud` uses Elastic Cloud (`address` is not needed); `self-managed` uses a self-hosted cluster (`address` is required).
Deployment string `json:"deployment,omitempty" toon:"deployment,omitempty"`
// Custom HTTP headers added to every request, each entry formatted as `Key: Value`.
Headers []string `json:"headers,omitempty" toon:"headers,omitempty"`
// Authentication password for self-managed clusters; ignored when `service_token` is set.
Password string `json:"password,omitempty" toon:"password,omitempty"`
// Service token; overrides username/password if set.
ServiceToken string `json:"service_token,omitempty" toon:"service_token,omitempty"`
// Per-query timeout in milliseconds; `0` or omitted uses the default of 10000 (10 seconds).
TimeoutMills int64 `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
// PEM-encoded CA certificate used to verify the Elasticsearch server certificate.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// Username for `self-managed` deployment.
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsElasticSearchConfig is generated from the Flashduty OpenAPI schema.
type DsKafkaConfig ¶ added in v0.15.0
type DsKafkaConfig struct {
// Authentication password; supports ${env:NAME}. Required with `username` for SASL authentication and must be empty when `sasl_mechanism` is `none`. On update, omit to keep the stored password; explicitly send an empty string to clear. Literal passwords are omitted from responses.
Password *string `json:"password,omitempty" toon:"password,omitempty"`
// SASL mechanism: none (default, no credentials), plain, scram-sha-256, scram-sha-512 (require username and password).
SaslMechanism string `json:"sasl_mechanism,omitempty" toon:"sasl_mechanism,omitempty"`
// Connection timeout in milliseconds; defaults to 5000 when omitted.
TimeoutMs int64 `json:"timeout_ms,omitempty" toon:"timeout_ms,omitempty"`
// PEM CA certificates or an ${env:NAME} reference.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// PEM client certificate or ${env:NAME}; configure both tls_cert and tls_key.
TlsCert string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
// Whether TLS is enabled; defaults to false. When false, all `tls_*` fields are cleared on save.
TlsEnabled bool `json:"tls_enabled,omitempty" toon:"tls_enabled,omitempty"`
// PEM client private key or ${env:NAME}; configure both tls_cert and tls_key. Omit on update to preserve; an empty string clears it. Literal keys are omitted from responses.
TlsKey *string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
// Maximum TLS version: 1.2 or 1.3; empty means no constraint. Must not be below the minimum.
TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
// Minimum TLS version: 1.2 (default) or 1.3.
TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
// Server name used for TLS SNI and certificate verification; defaults to the host from the connection address when empty.
TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
// Skip server certificate verification when TLS is enabled.
TlsSkipVerify bool `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
// Authentication username; an ${env:NAME} reference is supported. Required when `sasl_mechanism` is `plain`, `scram-sha-256` or `scram-sha-512`; must be empty when it is `none`.
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsKafkaConfig is generated from the Flashduty OpenAPI schema.
type DsLokiConfig ¶
type DsLokiConfig struct {
// Whether HTTP Basic Auth is enabled; when `false`, `basic_auth_username`/`basic_auth_password` are ignored.
BasicAuthEnabled bool `json:"basic_auth_enabled,omitempty" toon:"basic_auth_enabled,omitempty"`
// Basic Auth password, effective when `basic_auth_enabled` is `true`.
BasicAuthPassword string `json:"basic_auth_password,omitempty" toon:"basic_auth_password,omitempty"`
// Basic Auth username, effective when `basic_auth_enabled` is `true`.
BasicAuthUsername string `json:"basic_auth_username,omitempty" toon:"basic_auth_username,omitempty"`
// Custom HTTP headers added to every request, each entry formatted as `Key: Value`; usable for tenancy headers such as `X-Scope-OrgID`.
Headers []string `json:"headers,omitempty" toon:"headers,omitempty"`
// Custom query parameters appended to every request URL, each entry formatted as `key=value`.
Params []string `json:"params,omitempty" toon:"params,omitempty"`
// PEM-encoded CA certificate used to verify the server certificate.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// PEM-encoded client certificate for mutual TLS; must be configured together with `tls_key`.
TlsCert string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
// PEM-encoded client private key; must be configured together with `tls_cert`.
TlsKey string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
// Maximum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint.
TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
// Minimum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint and it must not exceed `tls_max_version`.
TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
// Server name used for TLS SNI and certificate verification; defaults to the host from the connection address when empty.
TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
// Whether to skip server certificate verification (insecure, for self-signed setups only).
TlsSkipVerify bool `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
}
DsLokiConfig is generated from the Flashduty OpenAPI schema.
type DsMongoDBConfig ¶ added in v0.15.0
type DsMongoDBConfig struct {
// Authentication database; defaults to admin. Username and password must be configured together. Client certificates are unsupported.
AuthSource string `json:"auth_source,omitempty" toon:"auth_source,omitempty"`
// Authentication password; supports ${env:NAME}. Omit on update to preserve; explicitly send an empty string to clear. Literal passwords are omitted from responses.
Password *string `json:"password,omitempty" toon:"password,omitempty"`
// Connection timeout in milliseconds; defaults to 3000 when omitted.
TimeoutMs int64 `json:"timeout_ms,omitempty" toon:"timeout_ms,omitempty"`
// PEM CA certificates or an ${env:NAME} reference.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// Whether TLS is enabled; defaults to false. When false, all `tls_*` fields are cleared on save.
TlsEnabled bool `json:"tls_enabled,omitempty" toon:"tls_enabled,omitempty"`
// Maximum TLS version: 1.2 or 1.3; empty means no constraint. Must not be below the minimum.
TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
// Minimum TLS version: 1.2 (default) or 1.3.
TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
// Server name used for TLS SNI and certificate verification; defaults to the host from the connection address when empty.
TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
// Skip server certificate verification when TLS is enabled.
TlsSkipVerify bool `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
// Authentication username; an ${env:NAME} reference is supported. Must be configured together with `password`.
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsMongoDBConfig is generated from the Flashduty OpenAPI schema.
type DsMySqlConfig ¶
type DsMySqlConfig struct {
// Maximum idle connections.
IdleConns int64 `json:"idle_conns,omitempty" toon:"idle_conns,omitempty"`
// Connection maximum lifetime in seconds.
LifetimeSeconds int64 `json:"lifetime_seconds,omitempty" toon:"lifetime_seconds,omitempty"`
// Maximum open connections.
OpenConns int64 `json:"open_conns,omitempty" toon:"open_conns,omitempty"`
// MySQL authentication password.
Password string `json:"password,omitempty" toon:"password,omitempty"`
// Query timeout in milliseconds.
TimeoutMills int64 `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
// PEM-encoded CA certificate used to verify the server certificate; only allowed when `tls_mode` is `verify-full` (or empty legacy mode).
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// PEM-encoded client certificate for mutual TLS; must be configured together with `tls_key`.
TlsCert string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
// PEM-encoded client private key; must be configured together with `tls_cert`.
TlsKey string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
// Maximum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint.
TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
// Minimum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint and it must not exceed `tls_max_version`.
TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
// TLS mode for the MySQL connection. Empty keeps the legacy per-field TLS behavior. `disable` = no TLS (all `tls_*` fields are cleared on save); `require` = TLS without server certificate verification; `verify-full` = TLS with full server verification (CA chain and hostname). MySQL has no `verify-ca` — verifying the CA implies verifying the hostname.
TlsMode string `json:"tls_mode,omitempty" toon:"tls_mode,omitempty"`
// Server name used for TLS SNI and certificate verification; defaults to the host from the connection address when empty.
TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
// Whether to skip server certificate verification; derived from `tls_mode` when set (`require` → `true`, `verify-full` → `false`) — only manually effective under legacy empty `tls_mode`.
TlsSkipVerify bool `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
// MySQL authentication username.
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsMySqlConfig is generated from the Flashduty OpenAPI schema.
type DsOracleConfig ¶
type DsOracleConfig struct {
// Maximum number of idle connections in the pool; `0` or omitted uses the default of 4.
IdleConns int64 `json:"idle_conns,omitempty" toon:"idle_conns,omitempty"`
// Maximum connection lifetime in seconds; `0` or omitted uses the default of 600 (10 minutes).
LifetimeSeconds int64 `json:"lifetime_seconds,omitempty" toon:"lifetime_seconds,omitempty"`
// Maximum number of open connections in the pool; `0` or omitted uses the default of 32.
OpenConns int64 `json:"open_conns,omitempty" toon:"open_conns,omitempty"`
// Extra connection options as key-value pairs.
Options map[string]string `json:"options,omitempty" toon:"options,omitempty"`
// Oracle authentication password.
Password string `json:"password,omitempty" toon:"password,omitempty"`
// Per-query timeout in milliseconds; `0` or omitted uses the default of 10000 (10 seconds).
TimeoutMills int64 `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
// Oracle authentication username.
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsOracleConfig is generated from the Flashduty OpenAPI schema.
type DsPayload ¶
type DsPayload struct {
// Settings for `type_ident` `clickhouse`.
Clickhouse DsClickHouseConfig `json:"clickhouse,omitzero" toon:"clickhouse,omitempty"`
// Settings for `type_ident` `elasticsearch`.
Elasticsearch DsElasticSearchConfig `json:"elasticsearch,omitzero" toon:"elasticsearch,omitempty"`
// Settings for `type_ident` `kafka` (diagnostic-only).
Kafka *DsKafkaConfig `json:"kafka,omitempty" toon:"kafka,omitempty"`
// Settings for `type_ident` `loki`.
Loki DsLokiConfig `json:"loki,omitzero" toon:"loki,omitempty"`
// Settings for `type_ident` `mongodb_mongod` (diagnostic-only); same fields as `mongodb_mongos`.
MongodbMongod *DsMongoDBConfig `json:"mongodb_mongod,omitempty" toon:"mongodb_mongod,omitempty"`
// Settings for `type_ident` `mongodb_mongos` (diagnostic-only); same fields as `mongodb_mongod`.
MongodbMongos *DsMongoDBConfig `json:"mongodb_mongos,omitempty" toon:"mongodb_mongos,omitempty"`
// Settings for `type_ident` `mysql`.
Mysql DsMySqlConfig `json:"mysql,omitzero" toon:"mysql,omitempty"`
// Settings for `type_ident` `oracle`.
Oracle DsOracleConfig `json:"oracle,omitzero" toon:"oracle,omitempty"`
// Settings for `type_ident` `postgres`.
Postgres DsPostgresConfig `json:"postgres,omitzero" toon:"postgres,omitempty"`
// Settings for `type_ident` `prometheus`.
Prometheus DsPrometheusConfig `json:"prometheus,omitzero" toon:"prometheus,omitempty"`
// Settings for `type_ident` `redis_node` (diagnostic-only).
RedisNode *DsRedisNodeConfig `json:"redis_node,omitempty" toon:"redis_node,omitempty"`
// Settings for `type_ident` `redis_sentinel` (diagnostic-only).
RedisSentinel *DsRedisSentinelConfig `json:"redis_sentinel,omitempty" toon:"redis_sentinel,omitempty"`
// Settings for `type_ident` `sls`.
SLS DsslsConfig `json:"sls,omitzero" toon:"sls,omitempty"`
// Tencent CLS credentials. Required when `type_ident` is `tencent_cls`.
TencentCls DsTencentClsConfig `json:"tencent_cls,omitzero" toon:"tencent_cls,omitempty"`
// Settings for `type_ident` `victorialogs`.
Victorialogs DsVictoriaLogsConfig `json:"victorialogs,omitzero" toon:"victorialogs,omitempty"`
}
DsPayload is generated from the Flashduty OpenAPI schema.
type DsPostgresConfig ¶
type DsPostgresConfig struct {
// Maximum number of idle connections in the pool; `0` or omitted uses the default of 4.
IdleConns int64 `json:"idle_conns,omitempty" toon:"idle_conns,omitempty"`
// Maximum connection lifetime in seconds; `0` or omitted uses the default of 600 (10 minutes).
LifetimeSeconds int64 `json:"lifetime_seconds,omitempty" toon:"lifetime_seconds,omitempty"`
// Maximum number of open connections in the pool; `0` or omitted uses the default of 32.
OpenConns int64 `json:"open_conns,omitempty" toon:"open_conns,omitempty"`
// PostgreSQL authentication password.
Password string `json:"password,omitempty" toon:"password,omitempty"`
// SSL mode for the PostgreSQL connection. Empty keeps the legacy behavior inferred from `tls_ca`. `disable` = no TLS (all `tls_*` fields are cleared on save); `require` = TLS without server certificate verification (`tls_ca` not allowed); `verify-ca` = verify the server certificate CA chain but not the hostname; `verify-full` = verify both CA chain and hostname.
SslMode string `json:"ssl_mode,omitempty" toon:"ssl_mode,omitempty"`
// Per-query timeout in milliseconds; `0` or omitted uses the default of 10000 (10 seconds).
TimeoutMills int64 `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
// PEM-encoded CA certificate used to verify the server certificate; used with `ssl_mode` `verify-ca`/`verify-full` and rejected under `require`.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// PEM-encoded client certificate for mutual TLS; must be configured together with `tls_key`.
TlsCert string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
// PEM-encoded client private key; must be configured together with `tls_cert`.
TlsKey string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
// PostgreSQL authentication username.
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsPostgresConfig is generated from the Flashduty OpenAPI schema.
type DsPrometheusConfig ¶
type DsPrometheusConfig struct {
// Enable HTTP Basic Auth.
BasicAuthEnabled bool `json:"basic_auth_enabled,omitempty" toon:"basic_auth_enabled,omitempty"`
// Basic Auth password, effective when `basic_auth_enabled` is `true`. Returned as stored in create, update and info responses.
BasicAuthPassword string `json:"basic_auth_password,omitempty" toon:"basic_auth_password,omitempty"`
// Basic Auth username, effective when `basic_auth_enabled` is `true`.
BasicAuthUsername string `json:"basic_auth_username,omitempty" toon:"basic_auth_username,omitempty"`
// Custom HTTP headers in `Key: Value` format.
Headers []string `json:"headers,omitempty" toon:"headers,omitempty"`
// Custom query parameters in `key=value` format.
Params []string `json:"params,omitempty" toon:"params,omitempty"`
// PEM-encoded CA certificate used to verify the server certificate.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// PEM-encoded client certificate for mutual TLS; must be configured together with `tls_key`.
TlsCert string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
// PEM-encoded client private key; must be configured together with `tls_cert`.
TlsKey string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
// Maximum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint.
TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
// Minimum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint and it must not exceed `tls_max_version`.
TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
// Server name used for TLS SNI and certificate verification; defaults to the host from the connection address when empty.
TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
// Whether to skip server certificate verification (insecure, for self-signed setups only).
TlsSkipVerify bool `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
}
DsPrometheusConfig is generated from the Flashduty OpenAPI schema.
type DsRedisNodeConfig ¶ added in v0.15.0
type DsRedisNodeConfig struct {
// Redis database number; defaults to 0.
Database int64 `json:"database,omitempty" toon:"database,omitempty"`
// Authentication password; supports ${env:NAME}. Omit on update to preserve; explicitly send an empty string to clear. Literal passwords are omitted from responses.
Password *string `json:"password,omitempty" toon:"password,omitempty"`
// Connection timeout in milliseconds; defaults to 3000 when omitted.
TimeoutMs int64 `json:"timeout_ms,omitempty" toon:"timeout_ms,omitempty"`
// Authentication username; an ${env:NAME} reference is supported. When set, `password` is required (on update, omit `password` to keep the stored one).
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsRedisNodeConfig is generated from the Flashduty OpenAPI schema.
type DsRedisSentinelConfig ¶ added in v0.15.0
type DsRedisSentinelConfig struct {
// Authentication password; supports ${env:NAME}. Omit on update to preserve; explicitly send an empty string to clear. Literal passwords are omitted from responses.
Password *string `json:"password,omitempty" toon:"password,omitempty"`
// Connection timeout in milliseconds; defaults to 3000 when omitted.
TimeoutMs int64 `json:"timeout_ms,omitempty" toon:"timeout_ms,omitempty"`
// Authentication username; an ${env:NAME} reference is supported. When set, `password` is required (on update, omit `password` to keep the stored one).
Username string `json:"username,omitempty" toon:"username,omitempty"`
}
DsRedisSentinelConfig is generated from the Flashduty OpenAPI schema.
type DsTencentClsConfig ¶ added in v0.14.3
type DsTencentClsConfig struct {
// Tencent Cloud API SecretId. Always required (create and update). Supports `${env:VAR}` references resolved on the edge.
SecretID string `json:"secret_id" toon:"secret_id"`
// Tencent Cloud API SecretKey. Required on create; on update, omit to keep the stored key. Supports `${env:VAR}` references. Never returned by read APIs: responses carry an empty string unless the stored value is an `${env:...}` reference.
SecretKey string `json:"secret_key,omitempty" toon:"secret_key,omitempty"`
}
DsTencentClsConfig is generated from the Flashduty OpenAPI schema.
type DsVictoriaLogsConfig ¶
type DsVictoriaLogsConfig struct {
// Whether HTTP Basic Auth is enabled; when `false`, `basic_auth_username`/`basic_auth_password` are ignored.
BasicAuthEnabled bool `json:"basic_auth_enabled,omitempty" toon:"basic_auth_enabled,omitempty"`
// Basic Auth password, effective when `basic_auth_enabled` is `true`.
BasicAuthPassword string `json:"basic_auth_password,omitempty" toon:"basic_auth_password,omitempty"`
// Basic Auth username, effective when `basic_auth_enabled` is `true`.
BasicAuthUsername string `json:"basic_auth_username,omitempty" toon:"basic_auth_username,omitempty"`
// Custom HTTP headers added to every request, each entry formatted as `Key: Value`; usable for tenancy headers such as `AccountID`/`ProjectID`.
Headers []string `json:"headers,omitempty" toon:"headers,omitempty"`
// Custom query parameters appended to every request URL, each entry formatted as `key=value`.
Params []string `json:"params,omitempty" toon:"params,omitempty"`
// PEM-encoded CA certificate used to verify the server certificate.
TlsCa string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
// PEM-encoded client certificate for mutual TLS; must be configured together with `tls_key`.
TlsCert string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
// PEM-encoded client private key; must be configured together with `tls_cert`.
TlsKey string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
// Maximum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint.
TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
// Minimum TLS version, one of `1.0`, `1.1`, `1.2`, `1.3`; empty means no constraint and it must not exceed `tls_max_version`.
TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
// Server name used for TLS SNI and certificate verification; defaults to the host from the connection address when empty.
TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
// Whether to skip server certificate verification (insecure, for self-signed setups only).
TlsSkipVerify bool `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
}
DsVictoriaLogsConfig is generated from the Flashduty OpenAPI schema.
type DsslsConfig ¶
type DsslsConfig struct {
// Alibaba Cloud Access Key ID.
AccessKeyID string `json:"access_key_id,omitempty" toon:"access_key_id,omitempty"`
// Alibaba Cloud Access Key Secret.
AccessKeySecret string `json:"access_key_secret,omitempty" toon:"access_key_secret,omitempty"`
// Custom HTTP headers.
Headers []string `json:"headers,omitempty" toon:"headers,omitempty"`
}
DsslsConfig is generated from the Flashduty OpenAPI schema.
type DutyError ¶
type DutyError struct {
Code string `json:"code"`
Reason string `json:"reason,omitempty"`
Message string `json:"message"`
}
DutyError is the Flashduty API error object carried inside the response envelope's "error" field.
type ElasticsearchQueryParams ¶ added in v0.15.2
type ElasticsearchQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
}
ElasticsearchQueryParams are the params for `elasticsearch.query`. Expr is a single SQL statement; Elasticsearch DSL queries are not supported. Execution.Kind must be `window`.
type EmptyObject ¶
type EmptyObject struct{}
EmptyObject is generated from the Flashduty OpenAPI schema.
type EmptyRequest ¶
type EmptyRequest struct{}
EmptyRequest is generated from the Flashduty OpenAPI schema.
type EmptyResponse ¶
type EmptyResponse struct{}
EmptyResponse is generated from the Flashduty OpenAPI schema.
type EnabledTime ¶
type EnabledTime struct {
// Days of week the window applies to, `0` = Sunday through `6` = Saturday; non-empty, no duplicates.
Days []int64 `json:"days,omitempty" toon:"days,omitempty"`
// End time in 24-hour `HH:MM` format, e.g. `18:00`.
Etime string `json:"etime,omitempty" toon:"etime,omitempty"`
// Start time in 24-hour `HH:MM` format, e.g. `09:00`.
Stime string `json:"stime,omitempty" toon:"stime,omitempty"`
}
EnabledTime is generated from the Flashduty OpenAPI schema.
type EnrichFilter ¶
type EnrichFilter struct {
// Event key to match on: `title`, `description`, `labels.<name>` or another alert/change event key. A `labels.<name>` key must use a valid label name.
Key string `json:"key" toon:"key"`
// Match operator.
// - `IN`: matches when the key's value matches any of `vals`. A key missing from the event never matches.
// - `NOTIN`: matches when the value matches none of `vals`. A key missing from the event always matches.
Oper string `json:"oper" toon:"oper"`
// Values to match (at least one). Each value is one of: an exact string; `/regex/` for a regular expression; a wildcard pattern with `*` and `?`; `cidr:<CIDR>` (e.g. `cidr:203.0.113.0/24`) for an IP range; `num:lt:<n>`, `num:le:<n>`, `num:gt:<n>` or `num:ge:<n>` for a numeric comparison.
Vals []string `json:"vals" toon:"vals"`
}
EnrichFilter is generated from the Flashduty OpenAPI schema.
type EnrichRule ¶
type EnrichRule struct {
// Optional AND-filter list; the rule is skipped unless every filter matches. `null` when the rule has no condition. Filter keys come from the alert/change event vocabulary (e.g. `title`, `labels.severity`).
If []EnrichFilter `json:"if,omitempty" toon:"if,omitempty"`
// Rule type.
// | Value | Meaning |
// |---|---|
// | `extraction` | Extract a value from the alert's `title`, `description`, or a `labels.*` key via regex or GJson, and write it to a label. |
// | `composition` | Render a Go `text/template` against the event and write the result to a label. |
// | `mapping` | Look up labels from a mapping schema or an external mapping API. |
// | `drop` | Remove the listed labels from the alert. |
Kind string `json:"kind" toon:"kind"`
// Rule-kind–specific settings. The shape depends on `kind`.
Settings any `json:"settings" toon:"settings"`
}
EnrichRule is generated from the Flashduty OpenAPI schema.
type EnrichStep ¶ added in v0.16.0
type EnrichStep struct {
// Labels the rule wrote that were not there before. `null` when it added none.
Added map[string]string `json:"added" toon:"added"`
// Labels the rule rewrote, each as a `[old_value, new_value]` pair. `null` when it rewrote none.
Changed map[string]string `json:"changed" toon:"changed"`
// Rule-specific detail: the matched mapping row, the rendered value, or the error message when `skipped_reason` is `error`.
Detail string `json:"detail" toon:"detail"`
// Zero-based position of the rule in `rules`.
Index int64 `json:"index" toon:"index"`
// Rule type that ran.
// | Value | Meaning |
// |---|---|
// | `extraction` | Extract a value from the alert's `title`, `description` or a `labels.*` key and write it to a label. |
// | `composition` | Render a template against the event and write the result to a label. |
// | `mapping` | Look up labels from a mapping schema or an external mapping API. |
// | `drop` | Remove the listed labels from the alert. |
Kind string `json:"kind" toon:"kind"`
// The mapping row the rule matched. `null` for a rule that is not a mapping rule or matched no row.
MappingRow map[string]string `json:"mapping_row" toon:"mapping_row"`
// Whether the rule's `if` conditions all matched. `false` means the rule changed nothing.
Matched bool `json:"matched" toon:"matched"`
// Labels the rule deleted. `null` when it removed none.
Removed []string `json:"removed" toon:"removed"`
// Why the rule was skipped: `condition_not_met`, `regex_not_matched`, `source_label_missing`, `mapping_row_not_found`, `result_label_exists` or `error`. Empty when the rule ran.
SkippedReason string `json:"skipped_reason" toon:"skipped_reason"`
}
EnrichStep is generated from the Flashduty OpenAPI schema.
type EnrichmentInfoRequest ¶
type EnrichmentInfoRequest struct {
// Integration ID to query enrichment rules for. Must be greater than 0.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
EnrichmentInfoRequest is generated from the Flashduty OpenAPI schema.
type EnrichmentItem ¶
type EnrichmentItem struct {
// Creation timestamp, Unix seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator member ID.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Deletion time, Unix seconds. Omitted when the rule set is not deleted; read endpoints never return soft-deleted rule sets, so this is effectively always omitted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// ID of the integration this rule set belongs to; one integration has at most one rule set.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Rules in execution order; each rule sees the labels written by the rules before it.
Rules []EnrichRule `json:"rules" toon:"rules"`
// Rule set status: `enabled` (active) or `deleted` (soft-deleted). Read endpoints exclude soft-deleted rule sets, so responses always carry `enabled`.
Status string `json:"status" toon:"status"`
// Last update timestamp, Unix seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Last updater member ID.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
EnrichmentItem is generated from the Flashduty OpenAPI schema.
type EnrichmentListRequest ¶
type EnrichmentListRequest struct {
// List of integration IDs to query. Must contain at least one ID.
IntegrationIDs []int64 `json:"integration_ids" toon:"integration_ids"`
}
EnrichmentListRequest is generated from the Flashduty OpenAPI schema.
type EnrichmentListResponse ¶
type EnrichmentListResponse struct {
// Enrichment rule sets.
Items []EnrichmentItem `json:"items" toon:"items"`
}
EnrichmentListResponse is generated from the Flashduty OpenAPI schema.
type EnrichmentPreviewEvent ¶ added in v0.16.0
type EnrichmentPreviewEvent struct {
// Label set after the steps applied so far.
Labels map[string]string `json:"labels" toon:"labels"`
// Event title after the steps applied so far.
Title string `json:"title" toon:"title"`
}
EnrichmentPreviewEvent is generated from the Flashduty OpenAPI schema.
type EnrichmentPreviewRequest ¶ added in v0.16.0
type EnrichmentPreviewRequest struct {
// The event to run the rules over.
Event AlertEvent `json:"event" toon:"event"`
// Integration whose context the preview runs in. The rules you send are not saved.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Enrichment rules to try, in order. At most 50. The integration's stored rules are not used.
Rules []EnrichRule `json:"rules,omitempty" toon:"rules,omitempty"`
}
EnrichmentPreviewRequest is generated from the Flashduty OpenAPI schema.
type EnrichmentPreviewResponse ¶ added in v0.16.0
type EnrichmentPreviewResponse struct {
// The event after the rules ran, with the `[TPL]` labels, title and description of a firing event rendered.
After EnrichmentPreviewEvent `json:"after" toon:"after"`
// The event as it arrived.
Before EnrichmentPreviewEvent `json:"before" toon:"before"`
// One entry per rule, in the order they ran.
Steps []EnrichStep `json:"steps" toon:"steps"`
}
EnrichmentPreviewResponse is generated from the Flashduty OpenAPI schema.
type EnrichmentSample ¶ added in v0.16.0
type EnrichmentSample struct {
// `true` when the stored description was cut to the sample size limit.
DescriptionTruncated bool `json:"description_truncated" toon:"description_truncated"`
// `true` when the integration discarded the event before it became an alert. Omitted when `false`.
Dropped bool `json:"dropped" toon:"dropped"`
// The raw event, before any enrichment rule ran.
Event AlertEvent `json:"event" toon:"event"`
// Unix timestamp in seconds of when the integration received the event.
ReceivedAt Timestamp `json:"received_at" toon:"received_at"`
}
EnrichmentSample is generated from the Flashduty OpenAPI schema.
type EnrichmentSampleListRequest ¶ added in v0.16.0
type EnrichmentSampleListRequest struct {
// Integration whose recent raw events to list.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
EnrichmentSampleListRequest is generated from the Flashduty OpenAPI schema.
type EnrichmentSampleListResponse ¶ added in v0.16.0
type EnrichmentSampleListResponse struct {
// Samples, newest first. Empty when no event has arrived yet.
Items []EnrichmentSample `json:"items" toon:"items"`
}
EnrichmentSampleListResponse is generated from the Flashduty OpenAPI schema.
type EnrichmentUpsertRequest ¶
type EnrichmentUpsertRequest struct {
// Integration ID to configure enrichment rules for.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Ordered rule list that replaces the integration's whole rule set; send `[]` to remove all rules. Rules run in this order.
Rules []EnrichRule `json:"rules" toon:"rules"`
}
EnrichmentUpsertRequest is generated from the Flashduty OpenAPI schema.
type EnvironmentBinding ¶ added in v0.5.4
type EnvironmentBinding struct {
// Environment identifier: a cloud sandbox ID for `cloud` bindings, a runner/environment ID for `byoc` bindings.
ID string `json:"id" toon:"id"`
// Environment kind bound to the session: `cloud` (managed sandbox) or `byoc` (self-hosted runner).
Kind string `json:"kind" toon:"kind"`
// Human-readable environment name; empty for cloud bindings using the default allowlist.
Name string `json:"name" toon:"name"`
// Live health of the binding. Omitted when unknown.
//
// For `byoc`:
// - `online`: runner connected and ready
// - `degraded`: runner connected but its executor is unhealthy; messages are still accepted
// - `pending`: runner has never connected
// - `offline`: runner heartbeat lost; messages cannot be served
// - `deleted`: the environment no longer exists; choose another
//
// For `cloud`:
// - `available`: the sandbox can serve the next message (paused or starting sandboxes resume automatically)
// - `rebuilding`: the sandbox is being resumed or recreated
// - `expired`: the sandbox failed permanently and cannot recover by itself
// - `deleted`: the selected cloud environment template was deleted
Status string `json:"status" toon:"status"`
// Team that owns the bound environment; 0 for account-scope environments.
TeamID int64 `json:"team_id" toon:"team_id"`
}
EnvironmentBinding is generated from the Flashduty OpenAPI schema.
type ErrorCode ¶
type ErrorCode string
ErrorCode Error code. Every failed response sets `error.code` to one of these stable strings; branch on it rather than on the HTTP status.
const ( ErrorCodeOK ErrorCode = "OK" ErrorCodeInvalidParameter ErrorCode = "InvalidParameter" ErrorCodeBadRequest ErrorCode = "BadRequest" ErrorCodeInvalidContentType ErrorCode = "InvalidContentType" ErrorCodeResourceNotFound ErrorCode = "ResourceNotFound" ErrorCodeNoLicense ErrorCode = "NoLicense" ErrorCodeReferenceExist ErrorCode = "ReferenceExist" ErrorCodeBalanceNotEnough ErrorCode = "BalanceNotEnough" ErrorCodeAccessDenied ErrorCode = "AccessDenied" ErrorCodeRouteNotFound ErrorCode = "RouteNotFound" ErrorCodeMethodNotAllowed ErrorCode = "MethodNotAllowed" ErrorCodeUndonedOrderExist ErrorCode = "UndonedOrderExist" ErrorCodeEntityTooLarge ErrorCode = "EntityTooLarge" ErrorCodeRequestLocked ErrorCode = "RequestLocked" ErrorCodeRequestVerifyRequired ErrorCode = "RequestVerifyRequired" ErrorCodeDangerousOperation ErrorCode = "DangerousOperation" ErrorCodeRequestTooFrequently ErrorCode = "RequestTooFrequently" ErrorCodeInternalError ErrorCode = "InternalError" )
func ErrorCodeOf ¶
ErrorCodeOf extracts the API ErrorCode carried by err, if any.
It searches the error chain with errors.As for an *ErrorResponse and returns ErrorCode(apiErr.Code). Because *RateLimitError unwraps to *ErrorResponse, this also resolves the code for rate-limit errors. If no *ErrorResponse is present in the chain, it returns the empty ErrorCode ("").
type ErrorIngestionRulesService ¶ added in v0.10.0
type ErrorIngestionRulesService service
ErrorIngestionRulesService handles the "RUM/Error ingestion rules" API resource.
func (*ErrorIngestionRulesService) Create ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) Create(ctx context.Context, req *RUMErrorIngestionCreateRequest) (*RUMErrorIngestionCreateResponse, *Response, error)
Create an error ingestion rule.
Create a rule whose matching errors are kept out of issue grouping; matched errors are still stored.
API: POST /rum/error-ingestion/rules/create (rum-error-ingestion-rules-create).
func (*ErrorIngestionRulesService) Delete ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) Delete(ctx context.Context, req *RUMErrorIngestionRuleIDRequest) (*Response, error)
Delete an error ingestion rule.
Delete an error ingestion rule from a RUM application.
API: POST /rum/error-ingestion/rules/delete (rum-error-ingestion-rules-delete).
func (*ErrorIngestionRulesService) Disable ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) Disable(ctx context.Context, req *RUMErrorIngestionRuleIDRequest) (*Response, error)
Disable an error ingestion rule.
Disable an error ingestion rule without deleting it.
API: POST /rum/error-ingestion/rules/disable (rum-error-ingestion-rules-disable).
func (*ErrorIngestionRulesService) Enable ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) Enable(ctx context.Context, req *RUMErrorIngestionRuleIDRequest) (*Response, error)
Enable an error ingestion rule.
Re-enable a previously disabled error ingestion rule.
API: POST /rum/error-ingestion/rules/enable (rum-error-ingestion-rules-enable).
func (*ErrorIngestionRulesService) HistoryList ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) HistoryList(ctx context.Context, req *RUMErrorIngestionHistoryListRequest) (*RUMErrorIngestionHistoryListResponse, *Response, error)
List error ingestion rule history.
Return paginated snapshots of an application's error ingestion rule history.
API: POST /rum/error-ingestion/rules/history/list (rum-error-ingestion-rules-history-list).
func (*ErrorIngestionRulesService) HistoryRevert ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) HistoryRevert(ctx context.Context, req *RUMErrorIngestionRevertRequest) (*Response, error)
Revert error ingestion rules to a history version.
Restore an application's entire rule set to a prior history version.
API: POST /rum/error-ingestion/rules/history/revert (rum-error-ingestion-rules-history-revert).
func (*ErrorIngestionRulesService) List ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) List(ctx context.Context, req *RUMErrorIngestionListRequest) (*RUMErrorIngestionListResponse, *Response, error)
List error ingestion rules.
Return every error ingestion rule configured for a RUM application.
API: POST /rum/error-ingestion/rules/list (rum-error-ingestion-rules-list).
func (*ErrorIngestionRulesService) Update ¶ added in v0.10.0
func (s *ErrorIngestionRulesService) Update(ctx context.Context, req *RUMErrorIngestionUpdateRequest) (*Response, error)
Update an error ingestion rule.
Update the name, description, or filters of an error ingestion rule.
API: POST /rum/error-ingestion/rules/update (rum-error-ingestion-rules-update).
type ErrorResponse ¶
type ErrorResponse struct {
Response *http.Response `json:"-"`
Code string `json:"code"`
Reason string `json:"reason,omitempty"`
Message string `json:"message"`
RequestID string `json:"request_id"`
}
ErrorResponse is returned by any Flashduty API call that does not succeed — either the envelope carried an error or the HTTP status was non-2xx. Recover it with errors.As to inspect Code (see the generated ErrorCode constants) and RequestID.
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type ErsComposition ¶
type ErsComposition struct {
// When `false` (default) the rule is skipped if `result_label` already exists on the event; when `true` the existing value is overwritten.
Override bool `json:"override,omitempty" toon:"override,omitempty"`
// Destination label key the composed value is written to. Must match `^[a-zA-Z_][a-zA-Z0-9_]*$`.
ResultLabel string `json:"result_label" toon:"result_label"`
// Go `text/template` string (1–500 characters) rendered against the event struct — e.g. `{{.Title}}`, `{{.Description}}`, `{{.Labels.key}}`. Example: `{{.Labels.region}}-{{.Labels.env}}`.
Template string `json:"template" toon:"template"`
}
ErsComposition is generated from the Flashduty OpenAPI schema.
type ErsDrop ¶
type ErsDrop struct {
// Label names to remove from the event (at least one), given without the `labels.` prefix.
DropLabels []string `json:"drop_labels" toon:"drop_labels"`
}
ErsDrop is generated from the Flashduty OpenAPI schema.
type ErsExtraction ¶
type ErsExtraction struct {
// GJSON path (a leading `$.` is ignored) used when the source value is a JSON string, e.g. `host.name`. If the source value is not valid JSON the rule is skipped; if the path does not exist an empty string is written. Exactly one of `pattern` and `g_json` must be set.
GJSON string `json:"g_json,omitempty" toon:"g_json,omitempty"`
// When `false` (default) the rule is skipped if `result_label` already exists on the event; when `true` the existing value is overwritten.
Override bool `json:"override,omitempty" toon:"override,omitempty"`
// Regular expression (RE2) applied to the source value; may be wrapped in `/.../`. All capture groups are joined with a space and written to `result_label`. Nothing is written when the expression does not match, has no capture group, or the first group is empty. Exactly one of `pattern` and `g_json` must be set.
Pattern string `json:"pattern,omitempty" toon:"pattern,omitempty"`
// Destination label key the extracted value is written to. Must match `^[a-zA-Z_][a-zA-Z0-9_]*$`.
ResultLabel string `json:"result_label" toon:"result_label"`
// Source field to extract from. Must be `title`, `description`, or a label key prefixed with `labels.` (e.g. `labels.env`).
SourceField string `json:"source_field" toon:"source_field"`
}
ErsExtraction is generated from the Flashduty OpenAPI schema.
type ErsMapping ¶
type ErsMapping struct {
// Mapping API ID (MongoDB ObjectID hex). Required when `mapping_type` is `api`.
APIID string `json:"api_id,omitempty" toon:"api_id,omitempty"`
// Lookup source.
// - `schema` (default): look up a row in the mapping schema `schema_id` using the event's values of the schema's `source_labels`; the rule does nothing if any source label is missing or no row matches.
// - `api`: call the mapping API `api_id` with the event; runs for alert events only.
MappingType string `json:"mapping_type,omitempty" toon:"mapping_type,omitempty"`
// When `false` (default) the rule is skipped if every label in `result_labels` already exists, and otherwise only the missing labels are filled. When `true` all `result_labels` are overwritten with the lookup result.
Override bool `json:"override,omitempty" toon:"override,omitempty"`
// Label keys to fill from the lookup result (at least one). For `schema` they are normally the schema's `result_labels`; for `api` they are sent to the API as `result_label_keys`.
ResultLabels []string `json:"result_labels" toon:"result_labels"`
// Mapping schema ID (MongoDB ObjectID hex). Required when `mapping_type` is `schema`.
SchemaID string `json:"schema_id,omitempty" toon:"schema_id,omitempty"`
}
ErsMapping is generated from the Flashduty OpenAPI schema.
type EscalateLayer ¶
type EscalateLayer struct {
// Minutes to wait after this level's first notification before escalating to the next level, 0–720. Ignored on the last level.
EscalateWindow int64 `json:"escalate_window,omitempty" toon:"escalate_window,omitempty"`
// When true, escalate even after the incident has been acknowledged (`Processing`). When false, escalation stops once the incident is acknowledged. Closed or snoozed incidents never escalate.
ForceEscalate bool `json:"force_escalate,omitempty" toon:"force_escalate,omitempty"`
// Total notifications sent in this level, including the first, 0–6; `0` and `1` both notify once.
MaxTimes int64 `json:"max_times,omitempty" toon:"max_times,omitempty"`
// Minutes between repeat notifications in this level, 0.5–120, kept to one decimal place. Used only when `max_times` is greater than 1.
NotifyStep float64 `json:"notify_step,omitempty" toon:"notify_step,omitempty"`
Target EscalateTarget `json:"target" toon:"target"`
}
EscalateLayer is generated from the Flashduty OpenAPI schema.
type EscalateRuleItem ¶
type EscalateRuleItem struct {
// Owning account ID.
AccountID int64 `json:"account_id" toon:"account_id"`
// Delay in seconds, 0–3600, before the first notification for a newly assigned incident is sent; `0` notifies immediately.
AggrWindow int64 `json:"aggr_window" toon:"aggr_window"`
// Channel the rule belongs to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Deletion time, Unix timestamp in seconds. Omitted unless the rule is soft-deleted; deleted rules are excluded from list responses.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Rule description.
Description string `json:"description" toon:"description"`
// Incident conditions (OR of AND groups), matched against the incident the alert was grouped into. Empty means the rule matches every incident in the channel.
Filters FilterGroup `json:"filters" toon:"filters"`
// Escalation levels in order.
Layers []EscalateLayer `json:"layers" toon:"layers"`
// Evaluation order from `0` to `200`: lower values are evaluated first, ties broken by creation time. The first enabled rule whose time windows and filters match a new incident takes it.
Priority int64 `json:"priority" toon:"priority"`
// Escalation rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name, 1–39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Rule status: `enabled` means active, `disabled` means paused, `deleted` is soft-deleted (possible only from the detail endpoint; lists never return deleted rules).
Status string `json:"status" toon:"status"`
// Notification template ID (24-character hex); see `POST /template/list`.
TemplateID string `json:"template_id" toon:"template_id"`
// Recurring time windows during which the rule can match; empty means at any time.
TimeFilters []TimeFilter `json:"time_filters" toon:"time_filters"`
// Last update time, Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Member ID that last updated the rule.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
EscalateRuleItem is generated from the Flashduty OpenAPI schema.
type EscalateTarget ¶
type EscalateTarget struct {
// Personal notification channels for the people in this target, per incident severity. Required unless `webhooks` is set; returned as `null` when not set.
By *EscalateTargetBy `json:"by,omitempty" toon:"by,omitempty"`
// Email addresses of account members; each address is resolved to the member who owns it when the level fires.
Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
// Member IDs to notify directly; obtain them from `POST /member/list`. Every ID must exist.
PersonIDs []int64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
// Notify whoever is on call: keys are schedule IDs (from `POST /schedule/list`) written as strings, values are the role IDs on that schedule. Each value must be non-empty.
ScheduleToRoleIDs map[string][]int64 `json:"schedule_to_role_ids,omitempty" toon:"schedule_to_role_ids,omitempty"`
// Team IDs whose members are notified; obtain them from `POST /team/list`. Each team must have at least one member.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
// Group chats to notify through robots or IM apps. Required unless `by` is set; returned as `null` when not set.
Webhooks []EscalateTargetWebhooksItem `json:"webhooks,omitempty" toon:"webhooks,omitempty"`
}
EscalateTarget is generated from the Flashduty OpenAPI schema.
type EscalateTargetBy ¶
type EscalateTargetBy struct {
// Channels used when the incident severity is `Critical`: `sms`, `voice`, `email`, `push`, or a direct message through an IM app integration written as `<app>:<integration_id>`, where `<app>` is `feishu_app`, `dingtalk_app`, `wecom_app`, `slack_app` or `teams_app` and `<integration_id>` is the ID of that IM integration. Other values return `InvalidParameter`.
Critical []string `json:"critical,omitempty" toon:"critical,omitempty"`
// When true, each person is notified through the channels in their own notification preferences for the incident's severity, and `critical`, `warning` and `info` are ignored.
FollowPreference bool `json:"follow_preference,omitempty" toon:"follow_preference,omitempty"`
// Channels used when the incident severity is `Info`; same values as `critical`.
Info []string `json:"info,omitempty" toon:"info,omitempty"`
// Channels used when the incident severity is `Warning`; same values as `critical`.
Warning []string `json:"warning,omitempty" toon:"warning,omitempty"`
}
EscalateTargetBy is generated from the Flashduty OpenAPI schema.
type EscalateTargetWebhooksItem ¶
type EscalateTargetWebhooksItem struct {
// Type-specific settings, such as the robot's webhook token or the app's chat IDs; `feishu_app` and `dingtalk_app` require it. To see the exact shape for a type, configure one in the console and read it back with `POST /channel/escalate/rule/info`. `token` and `verify_token` are removed from the response when the caller cannot edit the channel.
Settings map[string]any `json:"settings" toon:"settings"`
// Delivery type:
// - `feishu`, `dingtalk`, `wecom`, `slack`, `telegram`, `zoom`: a group robot (incoming webhook) of that IM.
// - `feishu_app`, `dingtalk_app`, `slack_app`, `teams_app`: group chats reached through the corresponding IM app integration.
Type string `json:"type" toon:"type"`
}
EscalateTargetWebhooksItem is generated from the Flashduty OpenAPI schema.
type EventGroup ¶ added in v0.14.3
type EventGroup struct {
// When true, repeated events of the same alert merge into the existing alert; when false, every event creates a separate alert. If you send `event_group`, set this explicitly: an omitted value means `false`. When the whole `event_group` is omitted on create, merging is enabled.
IsEnabled bool `json:"is_enabled,omitempty" toon:"is_enabled,omitempty"`
// Merge window in minutes, required when `is_enabled` is true. The range is 1–1440 by default; accounts with the extended merge window enabled can set up to 10080 (7 days). Ignored when merging is disabled.
TimeWindow int64 `json:"time_window,omitempty" toon:"time_window,omitempty"`
}
EventGroup is generated from the Flashduty OpenAPI schema.
type EventItem ¶ added in v0.5.4
type EventItem struct {
// ADK actions envelope (state deltas, transfers, escalation).
Actions map[string]any `json:"actions" toon:"actions"`
// Event author (e.g. user, the agent name).
Author string `json:"author" toon:"author"`
// ADK branch path for nested agents.
Branch string `json:"branch" toon:"branch"`
// ADK content envelope {role, parts:[...]}.
Content map[string]any `json:"content" toon:"content"`
// Unix timestamp in milliseconds when the event was written.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Delivery mode negotiated for the IM request that produced this event. `reply_only`: the IM client shows only explicit replies, not the agent's final text. Omitted for normal delivery.
DeliveryMode string `json:"delivery_mode" toon:"delivery_mode"`
// Error code when the event represents a failure.
ErrorCode string `json:"error_code" toon:"error_code"`
// Human-readable error message, when present.
ErrorMessage string `json:"error_message" toon:"error_message"`
// Event identifier.
EventID string `json:"event_id" toon:"event_id"`
// ID of the invocation (one agent turn) that wrote this event. Omitted when empty.
InvocationID string `json:"invocation_id" toon:"invocation_id"`
// True when this is an assistant event recording a runtime failure whose message is safe to show to users. Omitted when false.
IsError bool `json:"is_error" toon:"is_error"`
// True for a streaming partial chunk.
Partial bool `json:"partial" toon:"partial"`
// Member ID of the person who sent this user message. Omitted on assistant and tool events and when no member is recorded (automation runs, some IM turns).
PersonID int64 `json:"person_id" toon:"person_id"`
// Invocation ID of the top-level user turn this event belongs to, linking events written by nested subagent invocations back to it. Omitted when empty.
RootInvocationID string `json:"root_invocation_id" toon:"root_invocation_id"`
// Owning session id.
SessionID string `json:"session_id" toon:"session_id"`
// Event status. One of: `normal` (a live event included in the context fed to the model), `compressed` (folded into a compaction summary boundary event; no longer loaded for the model, kept as history only).
Status string `json:"status" toon:"status"`
// True on the terminal event of a turn.
TurnComplete bool `json:"turn_complete" toon:"turn_complete"`
// Per-turn token usage metadata.
UsageMetadata map[string]any `json:"usage_metadata" toon:"usage_metadata"`
}
EventItem is generated from the Flashduty OpenAPI schema.
type ExploreData ¶ added in v0.15.3
type ExploreData struct {
Execution ExploreResponseExecution `json:"execution" toon:"execution"`
// Result contract version; always `explore_result.v1`.
Format string `json:"format" toon:"format"`
Result ExploreResult `json:"result" toon:"result"`
}
ExploreData is generated from the Flashduty OpenAPI schema.
type ExploreField ¶ added in v0.15.3
type ExploreField struct {
// Label set of this column. Only `time_series` value fields may carry labels; a `table` field must not.
Labels map[string]string `json:"labels" toon:"labels"`
// Column name, at most 1 MiB of UTF-8.
Name string `json:"name" toon:"name"`
// Column type. `string` is rejected inside a `time_series` frame; `float` holds numbers and `time` holds UTC RFC3339Nano strings.
Type string `json:"type" toon:"type"`
// Column values in row order.
Values []any `json:"values" toon:"values"`
}
ExploreField is generated from the Flashduty OpenAPI schema.
type ExploreFrame ¶ added in v0.15.3
type ExploreFrame struct {
// Columns of the frame.
Fields []ExploreField `json:"fields" toon:"fields"`
// Frame shape. `table` is an unlabeled table. `time_series` carries exactly one time field and one float field; its time values are strictly increasing and never null.
Kind string `json:"kind" toon:"kind"`
}
ExploreFrame is generated from the Flashduty OpenAPI schema.
type ExploreLogEntry ¶ added in v0.15.3
type ExploreLogEntry struct {
// Log fields as raw JSON values. Integer literals outside JavaScript's safe integer range are returned as decimal strings.
Fields map[string]any `json:"fields" toon:"fields"`
// Entry time as a canonical unsigned decimal string of Unix epoch nanoseconds, at most 20 digits.
TimestampNs string `json:"timestamp_ns" toon:"timestamp_ns"`
}
ExploreLogEntry is generated from the Flashduty OpenAPI schema.
type ExploreResponseExecution ¶ added in v0.15.3
type ExploreResponseExecution struct {
// Step, in seconds, the query was executed with after applying `max_data_points` and `min_step_seconds`.
EffectiveStepSeconds int64 `json:"effective_step_seconds" toon:"effective_step_seconds"`
// Execution kind; always `range` when this object is present.
Kind string `json:"kind" toon:"kind"`
}
ExploreResponseExecution is generated from the Flashduty OpenAPI schema.
type ExploreResult ¶ added in v0.15.3
type ExploreResult struct {
// Entry limit applied to a logs result: 1 to 1000 (1 to 100 for `sls` data sources). Present only when `kind` is `logs`.
AppliedLimit int64 `json:"applied_limit" toon:"applied_limit"`
// Log entries. Present when `kind` is `logs`; never longer than `applied_limit`.
Entries []ExploreLogEntry `json:"entries" toon:"entries"`
// Columnar frames. Present when `kind` is `frames`; at most 1,000 frames, 1,000 table rows in total, and 100,000 values in total.
Frames []ExploreFrame `json:"frames" toon:"frames"`
// Whether a logs result was truncated by `applied_limit`.
HasMore bool `json:"has_more" toon:"has_more"`
// Result shape. `frames` returns columnar tables or time series, `samples` returns instant values with labels, and `logs` returns log entries.
Kind string `json:"kind" toon:"kind"`
// Instant samples. Present when `kind` is `samples`; at most 1,000 samples.
Samples []ExploreSample `json:"samples" toon:"samples"`
}
ExploreResult is generated from the Flashduty OpenAPI schema.
type ExploreSample ¶ added in v0.15.3
type ExploreSample struct {
// Label set of the sample. May be empty but never null.
Labels map[string]string `json:"labels" toon:"labels"`
// Sample value: a number, or one of the strings `NaN`, `+Inf`, and `-Inf`. Never null.
Value any `json:"value" toon:"value"`
}
ExploreSample is generated from the Flashduty OpenAPI schema.
type ExportLine ¶ added in v0.5.4
type ExportLine struct {
// Account id (on session_meta).
AccountID int64 `json:"account_id" toon:"account_id"`
// Dispatched subagent name (on subagent_dispatch).
AgentName string `json:"agent_name" toon:"agent_name"`
// Agent app (on session_meta).
AppName string `json:"app_name" toon:"app_name"`
// Child session id created by the dispatch (on subagent_dispatch).
ChildSessionID string `json:"child_session_id" toon:"child_session_id"`
// Text content of the line (messages, answers, errors).
Content string `json:"content" toon:"content"`
// Call duration in milliseconds.
DurationMs int64 `json:"duration_ms" toon:"duration_ms"`
// RFC3339 end timestamp; stamped on llm_call/tool_call/session_meta.
EndedAt string `json:"ended_at" toon:"ended_at"`
// Error detail when a call failed.
Error string `json:"error" toon:"error"`
// Tool call input arguments (on tool_call).
Input map[string]any `json:"input" toon:"input"`
// Byte size of the tool input.
InputBytes int64 `json:"input_bytes" toon:"input_bytes"`
// Chat model provider key; on session_meta and llm_call.
Model string `json:"model" toon:"model"`
// Tool name (on tool_call).
Name string `json:"name" toon:"name"`
// Tool call output (on tool_call response side).
Output string `json:"output" toon:"output"`
// Byte size of the tool output.
OutputBytes int64 `json:"output_bytes" toon:"output_bytes"`
// Parent session id for child sessions (on session_meta).
ParentSessionID string `json:"parent_session_id" toon:"parent_session_id"`
// 1-based monotonic sequence within the session (absent on session_meta).
Seq int64 `json:"seq" toon:"seq"`
// Session id (on session_meta).
SessionID string `json:"session_id" toon:"session_id"`
// RFC3339 start timestamp (session_meta uses session.created_at).
StartedAt string `json:"started_at" toon:"started_at"`
// Tool result status, e.g. ok or error.
Status string `json:"status" toon:"status"`
// RFC3339 timestamp of the event.
TS string `json:"ts" toon:"ts"`
// Line discriminator.
Type string `json:"type" toon:"type"`
Usage ExportUsage `json:"usage" toon:"usage"`
}
ExportLine is one decoded line of a session export stream. The Type field discriminates the event kind (session_meta, user_message, llm_call, tool_call, subagent_dispatch, final_answer, agent_text, error); the remaining fields are populated per kind. It is hand-maintained here, alongside the hand-written streaming Export endpoint, because the typed generator only models JSON-envelope responses and excludes the NDJSON export stream (so its line schema is pruned as unreferenced).
func DecodeExportLine ¶ added in v0.5.4
func DecodeExportLine(line []byte) (*ExportLine, error)
DecodeExportLine unmarshals one raw NDJSON export line into an ExportLine. Use the Type field to discriminate (session_meta, user_message, llm_call, tool_call, subagent_dispatch, final_answer, agent_text, error).
type ExportStatusPageSubscribersRequest ¶
type ExportStatusPageSubscribersRequest struct {
// Optional component IDs to filter subscribers by.
ComponentIDs []string `json:"component_ids,omitempty" toon:"component_ids,omitempty"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
}
ExportStatusPageSubscribersRequest is generated from the Flashduty OpenAPI schema.
type ExportUsage ¶ added in v0.5.4
type ExportUsage struct {
// Tokens written to the prompt cache.
CacheCreation int64 `json:"cache_creation" toon:"cache_creation"`
// Tokens served from the prompt cache.
CacheRead int64 `json:"cache_read" toon:"cache_read"`
// Prompt (input) tokens for the call.
InputTokens int64 `json:"input_tokens" toon:"input_tokens"`
// Generated (output) tokens for the call.
OutputTokens int64 `json:"output_tokens" toon:"output_tokens"`
}
ExportUsage is the token-usage sub-object on an ExportLine (llm_call events).
type ExportedStatusPageSubscriberItem ¶
type ExportedStatusPageSubscriberItem struct {
// Whether the subscriber is subscribed to all components.
All bool `json:"all" toon:"all"`
// Components the subscriber follows; each item carries only `component_id` and `name`. Empty when `all` is `true`.
Components []StatusPageComponentItem `json:"components" toon:"components"`
// Preferred locale for notifications. Omitted when empty.
Locale string `json:"locale" toon:"locale"`
// Subscription notification method. `email` is email subscription (public pages); `im` is IM subscription (internal pages). Determined by the page type.
Method string `json:"method" toon:"method"`
// Subscriber recipient: email address for public pages, user ID for internal pages.
Recipient string `json:"recipient" toon:"recipient"`
}
ExportedStatusPageSubscriberItem is generated from the Flashduty OpenAPI schema.
type FacetCountItem ¶ added in v0.5.4
type FacetCountItem struct {
// Number of events with this facet value in the time range.
Count int64 `json:"count" toon:"count"`
// The facet value. Type matches the field's `value_type`.
FacetValue any `json:"facet_value" toon:"facet_value"`
}
FacetCountItem is generated from the Flashduty OpenAPI schema.
type FacetsService ¶ added in v0.5.4
type FacetsService service
FacetsService handles the "RUM/Facets" API resource.
func (*FacetsService) FacetCount ¶ added in v0.5.4
func (s *FacetsService) FacetCount(ctx context.Context, req *RUMFacetCountRequest) (*RUMFacetCountResponse, *Response, error)
Count facet value distribution.
Return the top N values for a facet field within a time range, sorted by occurrence count descending.
API: POST /rum/facet/count (rum-read-facet-count).
func (*FacetsService) FieldList ¶ added in v0.5.4
func (s *FacetsService) FieldList(ctx context.Context, req *RUMFieldListRequest) (*RUMFieldListResponse, *Response, error)
List RUM fields.
Return RUM field definitions, optionally filtered by scope and facet status.
API: POST /rum/field/list (rum-read-field-list).
type FeedDetailAlertAck ¶ added in v0.14.3
type FeedDetailAlertAck struct{}
FeedDetailAlertAck is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertClose ¶
type FeedDetailAlertClose struct{}
FeedDetailAlertClose is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertComment ¶
type FeedDetailAlertComment struct {
// Comment body.
Comment string `json:"comment" toon:"comment"`
}
FeedDetailAlertComment is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertMerge ¶ added in v0.14.3
type FeedDetailAlertMerge struct {
// Comment recorded with the merge. Omitted when empty.
Comment string `json:"comment" toon:"comment"`
// New owner member ID set on the target incident. Omitted when unchanged.
OwnerID int64 `json:"owner_id" toon:"owner_id"`
// Source alerts merged into the target incident. Omitted when empty.
SourceAlerts []AlertShort `json:"source_alerts" toon:"source_alerts"`
// Incident the alerts were merged into. Omitted when not recorded.
TargetIncident IncidentShort `json:"target_incident" toon:"target_incident"`
// New title set on the target incident. Omitted when unchanged.
Title string `json:"title" toon:"title"`
}
FeedDetailAlertMerge is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertMuteByFlapping ¶ added in v0.14.3
type FeedDetailAlertMuteByFlapping struct {
// Window in seconds over which the state changes were counted. Omitted when zero.
InSecs int64 `json:"in_secs" toon:"in_secs"`
// State-change count threshold that triggered flapping detection. Omitted when zero.
MaxChanges int64 `json:"max_changes" toon:"max_changes"`
// Mute duration in seconds. Omitted when zero.
MuteSecs int64 `json:"mute_secs" toon:"mute_secs"`
}
FeedDetailAlertMuteByFlapping is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertMuteByInhibit ¶ added in v0.14.3
type FeedDetailAlertMuteByInhibit struct {
// Inhibit rule ID that muted the alert. Omitted when empty.
RuleID string `json:"rule_id" toon:"rule_id"`
// Inhibit rule name, resolved at read time. Omitted when empty.
RuleName string `json:"rule_name" toon:"rule_name"`
// ID of the source alert that triggered the inhibition. Omitted when empty.
SourceAlertID string `json:"source_alert_id" toon:"source_alert_id"`
// Title of the source alert, resolved at read time. Omitted when empty.
SourceAlertTitle string `json:"source_alert_title" toon:"source_alert_title"`
}
FeedDetailAlertMuteByInhibit is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertMuteBySilence ¶ added in v0.14.3
type FeedDetailAlertMuteBySilence struct {
// Silence rule ID that muted the alert. Omitted when empty.
RuleID string `json:"rule_id" toon:"rule_id"`
// Silence rule name, resolved at read time. Omitted when empty.
RuleName string `json:"rule_name" toon:"rule_name"`
}
FeedDetailAlertMuteBySilence is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertTrigger ¶
type FeedDetailAlertTrigger struct {
Severity FeedSeverity `json:"severity" toon:"severity"`
Status FeedSeverity `json:"status" toon:"status"`
}
FeedDetailAlertTrigger is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertUnack ¶ added in v0.14.3
type FeedDetailAlertUnack struct{}
FeedDetailAlertUnack is generated from the Flashduty OpenAPI schema.
type FeedDetailAlertUpdate ¶ added in v0.14.3
type FeedDetailAlertUpdate struct {
Severity FeedSeverity `json:"severity" toon:"severity"`
Status FeedSeverity `json:"status" toon:"status"`
}
FeedDetailAlertUpdate is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentAck ¶
type FeedDetailIncidentAck struct {
// Form summary recorded as a timeline comment. Omitted when no acknowledgement form summary was submitted.
Comment string `json:"comment" toon:"comment"`
// Images from the acknowledgement form, recorded on the timeline entry only. Omitted when none were submitted.
Images []Image `json:"images" toon:"images"`
// `Processing` when this acknowledgement moved the incident from `Triggered` to `Processing`; omitted when the incident was already `Processing`.
Progress string `json:"progress" toon:"progress"`
}
FeedDetailIncidentAck is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentAddRspd ¶
type FeedDetailIncidentAddRspd struct {
// Member IDs added as responders.
To []int64 `json:"to" toon:"to"`
}
FeedDetailIncidentAddRspd is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentAssign ¶
type FeedDetailIncidentAssign struct {
// Unix timestamp (seconds) when the assignment was made; set by the server.
AssignedAt Timestamp `json:"assigned_at" toon:"assigned_at"`
// Member IDs that actually received the assignment: `person_ids` plus the members of the selected escalation level, deduplicated and sorted. Set by the server; omitted when empty.
EffectivePersonIDs []int64 `json:"effective_person_ids" toon:"effective_person_ids"`
// Member emails; each is resolved to a member ID and merged into `person_ids`. Emails without a matching member are ignored.
Emails []string `json:"emails" toon:"emails"`
// Escalation rule ID (MongoDB ObjectID) to drive assignment.
EscalateRuleID string `json:"escalate_rule_id" toon:"escalate_rule_id"`
// Escalation rule name, filled by the server in responses; ignored in requests.
EscalateRuleName string `json:"escalate_rule_name" toon:"escalate_rule_name"`
// Assignment ID generated by the server for each assignment; set by the server.
ID string `json:"id" toon:"id"`
// Zero-based escalation level within `escalate_rule_id` (`0` = first level). Responders are taken from this level.
LayerIdx int64 `json:"layer_idx" toon:"layer_idx"`
// Override the notification channels used for this assignment.
Notify FeedDetailIncidentAssignNotify `json:"notify" toon:"notify"`
// Member IDs to assign directly.
PersonIDs []int64 `json:"person_ids" toon:"person_ids"`
// Member IDs that received the assignment.
To []int64 `json:"to" toon:"to"`
// How the assignment happened: `assign` first assignment; `reassign` reassignment of an already assigned incident; `escalate` moved by the escalation flow; `reopen` reassignment after the incident was reopened; empty string in responses when the incident was never assigned. Omit it in requests and the server derives it.
Type string `json:"type" toon:"type"`
}
FeedDetailIncidentAssign is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentAssignNotify ¶ added in v0.12.1
type FeedDetailIncidentAssignNotify struct {
// `true`: notify each person through their personal notification preference. `false`: use `personal_channels`, which must then be non-empty. When omitted, `personal_channels` must be set.
FollowPreference bool `json:"follow_preference" toon:"follow_preference"`
// Channels used when `follow_preference` is `false`: `sms`, `voice`, `email`, `push` (mobile app push), or an IM app channel written as `feishu_app:<integration_id>`, `dingtalk_app:<integration_id>`, `wecom_app:<integration_id>`, `slack_app:<integration_id>`, or `teams_app:<integration_id>`. Ignored when `follow_preference` is `true`.
PersonalChannels []string `json:"personal_channels" toon:"personal_channels"`
// Notification template ID (MongoDB ObjectID).
TemplateID string `json:"template_id" toon:"template_id"`
}
FeedDetailIncidentAssignNotify is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentAutoRefreshCard ¶
type FeedDetailIncidentAutoRefreshCard struct{}
FeedDetailIncidentAutoRefreshCard is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentComment ¶
type FeedDetailIncidentComment struct {
// Comment body.
Comment string `json:"comment" toon:"comment"`
// Name and color of the attached comment type, resolved at read time; omitted when no comment type is attached or it no longer exists.
CommentType IncidentCommentTypeDisplay `json:"comment_type" toon:"comment_type"`
// ObjectID of the account-level comment type attached to the comment.
CommentTypeID string `json:"comment_type_id" toon:"comment_type_id"`
// Whether replies to this comment are muted.
MuteReply bool `json:"mute_reply" toon:"mute_reply"`
}
FeedDetailIncidentComment is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentCustomAction ¶
type FeedDetailIncidentCustomAction struct {
// Integration ID that executed the action.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Integration display name.
IntegrationName string `json:"integration_name" toon:"integration_name"`
}
FeedDetailIncidentCustomAction is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentMerge ¶
type FeedDetailIncidentMerge struct {
// Merge comment.
Comment string `json:"comment" toon:"comment"`
// Not set by incident merges, which never change the owner; present only on older entries.
OwnerID int64 `json:"owner_id" toon:"owner_id"`
// `true` when the source incidents were permanently deleted after the merge.
RemoveSourceIncidents bool `json:"remove_source_incidents" toon:"remove_source_incidents"`
// Incidents merged into the target; present on the target incident's entry.
SourceIncidents []IncidentShort `json:"source_incidents" toon:"source_incidents"`
// Member IDs that were responders on the source incidents, for reference; they are not added to the target's responders.
SourceResponders []int64 `json:"source_responders" toon:"source_responders"`
// Incident this incident was merged into; present on each source incident's entry.
TargetIncident IncidentShort `json:"target_incident" toon:"target_incident"`
// New title the merge set on the target incident; present only on the target's entry and only when the title changed.
Title string `json:"title" toon:"title"`
}
FeedDetailIncidentMerge is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentMuteByFlapping ¶
type FeedDetailIncidentMuteByFlapping struct {
// Window length in minutes.
InMins int64 `json:"in_mins" toon:"in_mins"`
// Maximum state changes allowed within the window.
MaxChanges int64 `json:"max_changes" toon:"max_changes"`
// Mute duration in minutes once flapping is detected.
MuteMins int64 `json:"mute_mins" toon:"mute_mins"`
}
FeedDetailIncidentMuteByFlapping is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentMuteReply ¶
type FeedDetailIncidentMuteReply struct{}
FeedDetailIncidentMuteReply is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentNew ¶
type FeedDetailIncidentNew struct {
// Email of the reporter when the incident was created externally.
ReporterEmail string `json:"reporter_email" toon:"reporter_email"`
// Severity of the incident when it was created.
Severity FeedSeverity `json:"severity" toon:"severity"`
// Initial incident title.
Title string `json:"title" toon:"title"`
}
FeedDetailIncidentNew is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentNotify ¶
type FeedDetailIncidentNotify struct {
// Delivery channel or method label.
By string `json:"by" toon:"by"`
// Per-chat delivery records.
Chats []NotifyChat `json:"chats" toon:"chats"`
// Escalation rule ID (MongoDB ObjectID).
EscalateRuleID string `json:"escalate_rule_id" toon:"escalate_rule_id"`
// Escalation rule display name.
EscalateRuleName string `json:"escalate_rule_name" toon:"escalate_rule_name"`
// Whether this is the first fire or a refire. `fire`: the first notification for this escalation layer; `refire`: a repeat notification to the same layer when the incident remains unhandled, sent at the layer's notify interval and capped by the layer's maximum refire count.
FireType string `json:"fire_type" toon:"fire_type"`
// Escalation level index used for this notification.
LayerIdx int64 `json:"layer_idx" toon:"layer_idx"`
// Upstream message ID returned by the delivery channel.
MsgID string `json:"msg_id" toon:"msg_id"`
// Per-person delivery records.
Persons []NotifyPerson `json:"persons" toon:"persons"`
// Notification record ID.
Rid string `json:"rid" toon:"rid"`
// Per-robot delivery records.
Robots []NotifyRobot `json:"robots" toon:"robots"`
}
FeedDetailIncidentNotify is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentReopen ¶
type FeedDetailIncidentReopen struct {
// Free-text reason passed as `reason` to `POST /incident/reopen`; omitted when none was given.
Reason string `json:"reason" toon:"reason"`
}
FeedDetailIncidentReopen is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResetDescription ¶
type FeedDetailIncidentResetDescription struct{}
FeedDetailIncidentResetDescription is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResetField ¶
type FeedDetailIncidentResetField struct {
// Name of the custom field that was updated.
FieldName string `json:"field_name" toon:"field_name"`
// New value of the custom field. Type depends on the field definition.
To any `json:"to" toon:"to"`
}
FeedDetailIncidentResetField is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResetImpact ¶
type FeedDetailIncidentResetImpact struct{}
FeedDetailIncidentResetImpact is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResetResolution ¶
type FeedDetailIncidentResetResolution struct{}
FeedDetailIncidentResetResolution is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResetRootCause ¶
type FeedDetailIncidentResetRootCause struct{}
FeedDetailIncidentResetRootCause is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResetSeverity ¶
type FeedDetailIncidentResetSeverity struct {
// Severity before the change.
From FeedSeverity `json:"from" toon:"from"`
// Severity after the change.
To FeedSeverity `json:"to" toon:"to"`
}
FeedDetailIncidentResetSeverity is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResetTitle ¶
type FeedDetailIncidentResetTitle struct {
// Title before the change.
From string `json:"from" toon:"from"`
// Title after the change.
To string `json:"to" toon:"to"`
}
FeedDetailIncidentResetTitle is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentResolve ¶
type FeedDetailIncidentResolve struct {
// Form summary recorded as a timeline comment on resolution. Omitted when no resolve form summary was submitted.
Comment string `json:"comment" toon:"comment"`
// Source that triggered the resolve.
// | Value | Meaning |
// |---|---|
// | `voice` | Phone-call (voice DTMF) action. |
// | `console` | Console (Web UI) action. |
// | `card` | IM notification card button (DingTalk/Feishu/Slack/Teams). |
// | `wcard` | WeCom notification card button. |
// | `event` | Event-driven: auto-close when all related alerts recover to Ok, or a close synced from an external ITSM system. |
// | `autorslv` | Auto-resolve: closed by the system after no new alerts within the channel's auto-resolve timeout. |
// | `autorefresh` | Card auto-refresh (reserved; never appears on resolve feeds). |
// | `escalation` | Escalation flow (reserved; never appears on resolve feeds). |
From string `json:"from" toon:"from"`
// Images from the resolve form, recorded on the timeline entry only. Omitted when none were submitted.
Images []Image `json:"images" toon:"images"`
}
FeedDetailIncidentResolve is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentSnooze ¶
type FeedDetailIncidentSnooze struct {
// Snooze duration in minutes.
Minutes int64 `json:"minutes" toon:"minutes"`
}
FeedDetailIncidentSnooze is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentStorm ¶
type FeedDetailIncidentStorm struct {
// Storm threshold that was reached.
Threshold int64 `json:"threshold" toon:"threshold"`
}
FeedDetailIncidentStorm is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentUnack ¶
type FeedDetailIncidentUnack struct {
// `Triggered` when removing this acknowledgement returned the incident to `Triggered` (no responder still acknowledged); omitted otherwise.
Progress string `json:"progress" toon:"progress"`
}
FeedDetailIncidentUnack is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentWake ¶
type FeedDetailIncidentWake struct {
// Unix timestamp (seconds) at which the cancelled snooze would have ended.
SnoozedBefore Timestamp `json:"snoozedBefore" toon:"snoozedBefore"`
}
FeedDetailIncidentWake is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentWarRoomCreate ¶
type FeedDetailIncidentWarRoomCreate struct {
// Chat group identifier.
ChatID string `json:"chat_id" toon:"chat_id"`
// Chat group display name.
ChatName string `json:"chat_name" toon:"chat_name"`
// Integration ID that hosts the war room chat group.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Integration display name.
IntegrationName string `json:"integration_name" toon:"integration_name"`
// Plugin type of the IM integration: `feishu_app` (Feishu), `dingtalk_app` (DingTalk), `wecom_app` (WeCom), or `slack_app` (Slack).
PluginType string `json:"plugin_type" toon:"plugin_type"`
ShareLink string `json:"share_link" toon:"share_link"`
}
FeedDetailIncidentWarRoomCreate is generated from the Flashduty OpenAPI schema.
type FeedDetailIncidentWarRoomDelete ¶
type FeedDetailIncidentWarRoomDelete struct {
// Chat group identifier.
ChatID string `json:"chat_id" toon:"chat_id"`
// Chat group display name.
ChatName string `json:"chat_name" toon:"chat_name"`
// Integration ID that hosted the war room chat group.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Integration display name.
IntegrationName string `json:"integration_name" toon:"integration_name"`
// Plugin type of the IM integration: `feishu_app` (Feishu), `dingtalk_app` (DingTalk), `wecom_app` (WeCom), or `slack_app` (Slack).
PluginType string `json:"plugin_type" toon:"plugin_type"`
// `true` when the war room was only unlinked from the incident (`unlink_only` request) and the group was not dissolved. Omitted otherwise.
UnlinkOnly bool `json:"unlink_only" toon:"unlink_only"`
}
FeedDetailIncidentWarRoomDelete is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemAssigneesChanged ¶ added in v0.8.0
type FeedDetailWorkItemAssigneesChanged struct {
// Member IDs added as assignees.
AddedAssigneeIDs []int64 `json:"added_assignee_ids" toon:"added_assignee_ids"`
// Assignees added by this change, in submitted order. `added_assignee_ids` is the person-only subset. Omitted when nothing was added.
AddedAssignees []WorkItemAssignee `json:"added_assignees" toon:"added_assignees"`
// Assignee member IDs after the change.
AssigneeIDs []int64 `json:"assignee_ids" toon:"assignee_ids"`
// Assignees of the work item. Each entry is `{type, id?}`; an `ai_sre` entry omits `id`. Omitted when there is no assignee.
Assignees []WorkItemAssignee `json:"assignees" toon:"assignees"`
// Work item type. `action`: an action item anchored to the incident itself; `follow_up`: an improvement item anchored to a post-mortem.
ItemType string `json:"item_type" toon:"item_type"`
// Member IDs removed from assignees.
RemovedAssigneeIDs []int64 `json:"removed_assignee_ids" toon:"removed_assignee_ids"`
// Assignees removed by this change. `removed_assignee_ids` is the person-only subset. Omitted when nothing was removed.
RemovedAssignees []WorkItemAssignee `json:"removed_assignees" toon:"removed_assignees"`
// Work item title.
Title string `json:"title" toon:"title"`
// Work item ID (`wi_` followed by a random string); use it with the `/incident/work-item/*` endpoints.
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
FeedDetailWorkItemAssigneesChanged is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemAutoConverted ¶ added in v0.16.0
type FeedDetailWorkItemAutoConverted struct {
// Number of action items converted.
Count int64 `json:"count" toon:"count"`
// ID of the post-mortem the follow-ups are anchored to.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Titles of the converted work items.
Titles []string `json:"titles" toon:"titles"`
// IDs of the converted work items.
WorkItemIDs []string `json:"work_item_ids" toon:"work_item_ids"`
}
FeedDetailWorkItemAutoConverted is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemBound ¶ added in v0.8.0
type FeedDetailWorkItemBound struct {
// Work item type. `action`: an action item anchored to the incident itself; `follow_up`: an improvement item anchored to a post-mortem.
ItemType string `json:"item_type" toon:"item_type"`
// ID of the post-mortem the work item is bound to.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Work item title.
Title string `json:"title" toon:"title"`
// Work item ID (`wi_` followed by a random string); use it with the `/incident/work-item/*` endpoints.
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
FeedDetailWorkItemBound is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemCompleted ¶ added in v0.8.0
type FeedDetailWorkItemCompleted struct {
// Status before completion, usually `open` or `in_progress`; items created before these statuses existed may carry other text.
FromStatus string `json:"from_status" toon:"from_status"`
// Work item type. `action`: an action item anchored to the incident itself; `follow_up`: an improvement item anchored to a post-mortem.
ItemType string `json:"item_type" toon:"item_type"`
// ID of the post-mortem the work item is bound to.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Work item title.
Title string `json:"title" toon:"title"`
// Status after completion; always `done`.
ToStatus string `json:"to_status" toon:"to_status"`
// Work item ID (`wi_` followed by a random string); use it with the `/incident/work-item/*` endpoints.
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
FeedDetailWorkItemCompleted is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemConverted ¶ added in v0.8.0
type FeedDetailWorkItemConverted struct {
// Work item type before the conversion. `action`: an action item anchored to the incident itself; `follow_up`: an improvement item anchored to a post-mortem. Conversion currently only supports `action` → `follow_up`, so `from_type` is always `action` in this event.
FromType string `json:"from_type" toon:"from_type"`
// ID of the post-mortem the work item is bound to.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Work item status after the conversion, usually `open` or `in_progress` (conversion keeps the status).
Status string `json:"status" toon:"status"`
// Work item title.
Title string `json:"title" toon:"title"`
// Work item type after the conversion. `action`: an action item anchored to the incident itself; `follow_up`: an improvement item anchored to a post-mortem. Conversion currently only supports `action` → `follow_up`, so `to_type` is always `follow_up` in this event, and a successful conversion immediately tries to bind the incident's post-mortem.
ToType string `json:"to_type" toon:"to_type"`
// Work item ID (`wi_` followed by a random string); use it with the `/incident/work-item/*` endpoints.
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
FeedDetailWorkItemConverted is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemCreated ¶ added in v0.8.0
type FeedDetailWorkItemCreated struct {
// Assignee member IDs.
AssigneeIDs []int64 `json:"assignee_ids" toon:"assignee_ids"`
// Assignees of the work item. Each entry is `{type, id?}`; an `ai_sre` entry omits `id`. Omitted when there is no assignee.
Assignees []WorkItemAssignee `json:"assignees" toon:"assignees"`
// Work item type. `action`: an action item anchored to the incident itself, convertible to `follow_up` later; `follow_up`: an improvement item anchored to a post-mortem, requiring the incident to be linked to that post-mortem at creation.
ItemType string `json:"item_type" toon:"item_type"`
// ID of the post-mortem the work item is bound to.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Work item status at creation: `open` not started; `in_progress` being worked on; `done` completed; `cancelled` no longer needed.
Status string `json:"status" toon:"status"`
// Work item title.
Title string `json:"title" toon:"title"`
// Work item ID (`wi_` followed by a random string); use it with the `/incident/work-item/*` endpoints.
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
FeedDetailWorkItemCreated is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemDeleted ¶ added in v0.8.0
type FeedDetailWorkItemDeleted struct {
// Work item type. `action`: an action item anchored to the incident itself; `follow_up`: an improvement item anchored to a post-mortem.
ItemType string `json:"item_type" toon:"item_type"`
// ID of the post-mortem the work item is bound to.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Work item title.
Title string `json:"title" toon:"title"`
// Work item ID (`wi_` followed by a random string); use it with the `/incident/work-item/*` endpoints.
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
FeedDetailWorkItemDeleted is generated from the Flashduty OpenAPI schema.
type FeedDetailWorkItemUpdated ¶ added in v0.8.0
type FeedDetailWorkItemUpdated struct {
// Description before the update.
FromDescription string `json:"from_description" toon:"from_description"`
// Priority before the update. Free-text priority label defined by the client (up to 64 characters); present only when the priority changed.
FromPriority string `json:"from_priority" toon:"from_priority"`
// Status before the update; present only when the status changed. Usually one of `open`, `in_progress`, `done`, `cancelled`; items created before these statuses existed may carry other text.
FromStatus string `json:"from_status" toon:"from_status"`
// Title before the update.
FromTitle string `json:"from_title" toon:"from_title"`
// Work item type. `action`: an action item anchored to the incident itself; `follow_up`: an improvement item anchored to a post-mortem.
ItemType string `json:"item_type" toon:"item_type"`
// Work item title.
Title string `json:"title" toon:"title"`
// Description after the update.
ToDescription string `json:"to_description" toon:"to_description"`
// Priority after the update. Free-text priority label defined by the client (up to 64 characters); present only when the priority changed.
ToPriority string `json:"to_priority" toon:"to_priority"`
// Status after the update; present only when the status changed. `open` not started; `in_progress` being worked on; `done` completed; `cancelled` no longer needed.
ToStatus string `json:"to_status" toon:"to_status"`
// Work item ID (`wi_` followed by a random string); use it with the `/incident/work-item/*` endpoints.
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
FeedDetailWorkItemUpdated is generated from the Flashduty OpenAPI schema.
type FeedItem ¶
type FeedItem struct {
// ID of the account that owns the alert.
AccountID int64 `json:"account_id" toon:"account_id"`
// AI SRE session that produced the entry. Omitted when no agent wrote it.
AgentSessionID string `json:"agent_session_id" toon:"agent_session_id"`
// Creation timestamp in Unix epoch milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Member ID of the creator. 0 for system-generated entries.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Soft-delete time, Unix epoch milliseconds. Omitted when not deleted.
DeletedAt TimestampMilli `json:"deleted_at" toon:"deleted_at"`
// Type-specific payload; the concrete shape is determined by `type`. May be `null` for entries stored without detail.
Detail any `json:"detail" toon:"detail"`
// ObjectID of the alert this entry references.
RefID string `json:"ref_id" toon:"ref_id"`
Type AlertFeedType `json:"type" toon:"type"`
// Last update timestamp in Unix epoch milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Surface that wrote the entry on a user's behalf; currently only `ai_sre`. Omitted when a user created the entry directly.
Via string `json:"via" toon:"via"`
}
FeedItem is generated from the Flashduty OpenAPI schema.
type FeedSeverity ¶
type FeedSeverity string
FeedSeverity Severity level.
const ( FeedSeverityOK FeedSeverity = "Ok" FeedSeverityCritical FeedSeverity = "Critical" FeedSeverityWarning FeedSeverity = "Warning" FeedSeverityInfo FeedSeverity = "Info" )
func (FeedSeverity) String ¶ added in v0.5.2
func (e FeedSeverity) String() string
String returns the underlying string value, implementing fmt.Stringer.
type FieldDeleteReference ¶ added in v0.5.7
type FieldDeleteReference struct {
// Console URL for the referencing custom form.
Href string `json:"href" toon:"href"`
// Referenced resource kind. Always `custom_form` for this response.
Kind string `json:"kind" toon:"kind"`
// Human label of the referencing custom form's type (a Chinese label, e.g. `解决故障` for the resolve form).
Name string `json:"name" toon:"name"`
}
FieldDeleteReference is generated from the Flashduty OpenAPI schema.
type FieldDeleteReferenceError ¶ added in v0.5.7
type FieldDeleteReferenceError struct {
// Supplementary error payload; for this error it always contains the `refs` field.
Data FieldDeleteReferenceErrorData `json:"data" toon:"data"`
Error any `json:"error" toon:"error"`
// Trace ID of this request, identical to the `Flashcat-Request-Id` response header.
RequestID string `json:"request_id" toon:"request_id"`
}
FieldDeleteReferenceError is generated from the Flashduty OpenAPI schema.
type FieldDeleteReferenceErrorData ¶ added in v0.5.7
type FieldDeleteReferenceErrorData struct {
// Custom forms that still reference the field, each with `kind`/`name`/`href`; all references must be removed before the field can be deleted.
Refs []FieldDeleteReference `json:"refs" toon:"refs"`
}
FieldDeleteReferenceErrorData is generated from the Flashduty OpenAPI schema.
type FieldInfoRequest ¶
type FieldInfoRequest struct {
// Field ID — 24-character hex ObjectID.
FieldID string `json:"field_id" toon:"field_id"`
}
FieldInfoRequest is generated from the Flashduty OpenAPI schema.
type FieldItem ¶
type FieldItem struct {
// Owning account ID.
AccountID int64 `json:"account_id" toon:"account_id"`
// Creation timestamp, Unix seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator member ID.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Default value. Type depends on `field_type`: `bool` for checkbox; `string` for single_select/text; `string[]` for multi_select; may be `null` if no default.
DefaultValue any `json:"default_value" toon:"default_value"`
// Deletion timestamp, Unix seconds. Only present for soft-deleted fields.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Optional free-text description.
Description string `json:"description" toon:"description"`
// Human-readable name shown in the UI.
DisplayName string `json:"display_name" toon:"display_name"`
// Field ID — 24-character hex ObjectID.
FieldID string `json:"field_id" toon:"field_id"`
// Machine name used in incident payloads under `fields.<field_name>`. Immutable.
FieldName string `json:"field_name" toon:"field_name"`
// Field type.
// | Value | Meaning |
// |---|---|
// | `checkbox` | Checkbox; value is a bool, options are not supported. |
// | `multi_select` | Multi-select; value is a string array, each element must be one of options. |
// | `single_select` | Single-select; value is a string from options. |
// | `text` | Free text; value is a string. |
FieldType string `json:"field_type" toon:"field_type"`
// Allowed choices for `single_select`/`multi_select` (non-empty unique string array). `null` or empty for `checkbox`/`text`.
Options []string `json:"options" toon:"options"`
// Field status: `enabled` (active), `disabled` (set only via internal helpers, not via the API), or `deleted` (soft-deleted). `/field/list` excludes `deleted`; `/field/info` may return it.
Status string `json:"status" toon:"status"`
// Last update timestamp, Unix seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Last updater member ID.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Value type. `checkbox` is always `bool`; `single_select`/`multi_select`/`text` are always `string`. `float` is reserved and never occurs today.
ValueType string `json:"value_type" toon:"value_type"`
}
FieldItem is generated from the Flashduty OpenAPI schema.
type FieldListRequest ¶
type FieldListRequest struct {
// Sort ascending when `true`; descending otherwise.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by creator member ID. Omit or send `null` to skip.
CreatorID *int64 `json:"creator_id,omitempty" toon:"creator_id,omitempty"`
// Sort key. Defaults to `created_at` when omitted.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Regex filter matched against `field_name` only. An invalid regex is auto-escaped to a literal substring match.
Query string `json:"query,omitempty" toon:"query,omitempty"`
}
FieldListRequest is generated from the Flashduty OpenAPI schema.
type FieldListResponse ¶
type FieldListResponse struct {
// All non-deleted custom fields for the account. No pagination.
Items []FieldItem `json:"items" toon:"items"`
}
FieldListResponse is generated from the Flashduty OpenAPI schema.
type FilterCondition ¶
type FilterCondition struct {
// Field to match. Which built-in keys are allowed depends on the rule type and is listed on the field that holds the conditions; any `labels.<name>` key (for example `labels.env`) is always accepted. An unknown key returns `InvalidParameter`. When the alert or incident has no value for the key, `IN` does not match and `NOTIN` matches.
Key string `json:"key" toon:"key"`
// Match operator, case-sensitive. `IN`: matches when the field value matches any entry in `vals`. `NOTIN`: matches when it matches none of them.
Oper string `json:"oper" toon:"oper"`
// Values to compare, at least one. Each entry is matched as: an exact string; a wildcard pattern when it contains `*` or `?` (must match the whole value); a regular expression when wrapped in slashes, such as `/^db-/` (may match anywhere in the value); an IP range written `cidr:<network>`, such as `cidr:203.0.113.0/24`; or a numeric comparison `num:<op>:<number>` with `lt`, `le`, `gt` or `ge`, such as `num:gt:90`.
Vals []string `json:"vals" toon:"vals"`
}
FilterCondition is generated from the Flashduty OpenAPI schema.
type Flapping ¶
type Flapping struct {
// Observation window in minutes.
InMins int64 `json:"in_mins,omitempty" toon:"in_mins,omitempty"`
// When true, flapping detection is turned off.
IsDisabled bool `json:"is_disabled,omitempty" toon:"is_disabled,omitempty"`
// Max state changes allowed within `in_mins`, 2–100. When omitted or `0`, all three values fall back to the defaults: 4 changes, `in_mins` 60, `mute_mins` 120.
MaxChanges int64 `json:"max_changes,omitempty" toon:"max_changes,omitempty"`
// Mute duration in minutes after flapping is detected.
MuteMins int64 `json:"mute_mins,omitempty" toon:"mute_mins,omitempty"`
}
Flapping is generated from the Flashduty OpenAPI schema.
type FolderCreateRequest ¶ added in v0.15.18
type FolderCreateRequest struct {
// Folder name; required, and must not contain a period (`.`), slash (`/`), or comma (`,`).
Name string `json:"name" toon:"name"`
// Free-form note. Empty when omitted.
Note string `json:"note,omitempty" toon:"note,omitempty"`
// ID of the parent folder; 0 or omitted creates a root folder. The caller must be allowed to modify the parent.
ParentID uint64 `json:"parent_id,omitempty" toon:"parent_id,omitempty"`
// ID of the team the folder belongs to; 0 or omitted means no team. Members of the team can see and modify the folder and everything below it.
TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
FolderCreateRequest is generated from the Flashduty OpenAPI schema.
type FolderDeleteRequest ¶ added in v0.15.18
type FolderDeleteRequest struct {
// ID of the folder to delete, from `/monit/folder/list`. The folder must be empty.
ID uint64 `json:"id" toon:"id"`
}
FolderDeleteRequest is generated from the Flashduty OpenAPI schema.
type FolderHealthItem ¶ added in v0.15.18
type FolderHealthItem struct {
// ID of the folder this entry describes; matches `id` in `/monit/folder/list`.
FolderID uint64 `json:"folder_id" toon:"folder_id"`
// `true` when a rule in this folder or in any descendant has an active alert or a runtime problem (`runtime_state` of `offline`, `abnormal`, `stale`, or `no_datasource`). Rules in folders the caller cannot read are not counted.
HasIssue bool `json:"has_issue" toon:"has_issue"`
}
FolderHealthItem is generated from the Flashduty OpenAPI schema.
type FolderHealthOutput ¶ added in v0.15.18
type FolderHealthOutput struct {
// One health entry per folder visible to the caller, sorted by `folder_id`.
Items []FolderHealthItem `json:"items" toon:"items"`
}
FolderHealthOutput is generated from the Flashduty OpenAPI schema.
type FolderItem ¶ added in v0.15.9
type FolderItem struct {
// Owning account ID.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Creation time as a Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Member ID of the creator; the creator can always see and modify the folder.
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Name of the creator.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Folder ID. Pass it as `id` to update, move, or delete the folder, as `parent_id` or `dest_parent_id` to nest folders under it, and as `folder_id` on alert rules and dashboards.
ID uint64 `json:"id" toon:"id"`
// Folder name.
Name string `json:"name" toon:"name"`
// Free-form note.
Note string `json:"note" toon:"note"`
// Parent folder ID; 0 at the root.
ParentID uint64 `json:"parent_id" toon:"parent_id"`
// Comma-separated ancestor IDs from the root, excluding this folder; empty at the root.
ParentPath string `json:"parent_path" toon:"parent_path"`
// ID of the team the folder belongs to; 0 when it has no team. Members of the team can see and modify the folder.
TeamID uint64 `json:"team_id" toon:"team_id"`
// Time of the last update or move as a Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Member ID of the last updater. Updates and moves both set it.
UpdaterID uint64 `json:"updater_id" toon:"updater_id"`
// Name of the last updater.
UpdaterName string `json:"updater_name" toon:"updater_name"`
}
FolderItem is generated from the Flashduty OpenAPI schema.
type FolderMoveRequest ¶ added in v0.15.18
type FolderMoveRequest struct {
// ID of the new parent folder; send 0 to move to the root. The field cannot be omitted. Must differ from `id` and must not be a descendant of the folder.
DestParentID uint64 `json:"dest_parent_id" toon:"dest_parent_id"`
// ID of the folder to move, from `/monit/folder/list`.
ID uint64 `json:"id" toon:"id"`
}
FolderMoveRequest is generated from the Flashduty OpenAPI schema.
type FolderUpdateRequest ¶ added in v0.15.18
type FolderUpdateRequest struct {
// ID of the folder to update, from `/monit/folder/list` or the create response.
ID uint64 `json:"id" toon:"id"`
// New folder name; required, and must not contain a period (`.`), slash (`/`), or comma (`,`).
Name string `json:"name" toon:"name"`
// New note. Omitted or empty clears the note.
Note string `json:"note,omitempty" toon:"note,omitempty"`
// New team ID; 0 or omitted removes the team assignment.
TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
FolderUpdateRequest is generated from the Flashduty OpenAPI schema.
type GetIntegrationRequest ¶ added in v0.15.9
type GetIntegrationRequest struct {
// ID of a public integration, returned by `POST /integration/list`. An unknown ID or a channel-owned integration returns `ResourceNotFound`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
GetIntegrationRequest is generated from the Flashduty OpenAPI schema.
type GetRemoteConfigRequest ¶ added in v0.15.2
type GetRemoteConfigRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
}
GetRemoteConfigRequest is generated from the Flashduty OpenAPI schema.
type GetRemoteConfigResponse ¶ added in v0.15.2
type GetRemoteConfigResponse struct {
// The live configuration (the newest published version). `null` when the application has never been configured.
Config *RemoteConfig `json:"config" toon:"config"`
// Unix timestamp in milliseconds - when the current version was published. 0 when never configured.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Version the live configuration is stored under. 0 means the application has never been configured.
Version int64 `json:"version" toon:"version"`
}
GetRemoteConfigResponse is generated from the Flashduty OpenAPI schema.
type GetWarRoomDefaultObserversRequest ¶ added in v0.4.0
type GetWarRoomDefaultObserversRequest struct {
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
}
GetWarRoomDefaultObserversRequest is generated from the Flashduty OpenAPI schema.
type GetWarRoomDefaultObserversResponse ¶ added in v0.4.0
type GetWarRoomDefaultObserversResponse struct {
// Suggested observers, in timeline order. Empty array when there are none.
Observers []WarRoomPersonItem `json:"observers" toon:"observers"`
}
GetWarRoomDefaultObserversResponse is generated from the Flashduty OpenAPI schema.
type GetWarRoomDetailRequest ¶
type GetWarRoomDetailRequest struct {
// Chat ID of the IM group hosting the war room; obtain it from `POST /incident/war-room/list`.
ChatID string `json:"chat_id" toon:"chat_id"`
// IM integration ID that hosts the war room.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
GetWarRoomDetailRequest is generated from the Flashduty OpenAPI schema.
type GetWebhookHistoryDetailRequest ¶
type GetWebhookHistoryDetailRequest struct {
// `event_id` of a record returned by `POST /webhook/history/list`. It starts with the delivery date (`YYYYMMDD`); an ID without that prefix fails the request.
EventID string `json:"event_id" toon:"event_id"`
// Integration ID the event belongs to; available in the items returned by `POST /webhook/history/list`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
GetWebhookHistoryDetailRequest is generated from the Flashduty OpenAPI schema.
type Group ¶
type Group struct {
// When true, a key set matches only if every key in it is present on the alert. When false, missing keys compare as empty, but at least one key of the set must be present.
AllEqualsRequired bool `json:"all_equals_required,omitempty" toon:"all_equals_required,omitempty"`
// Per-filter grouping overrides.
Cases []GroupCasesItem `json:"cases,omitempty" toon:"cases,omitempty"`
// Key sets for rule-based (`p`) grouping, up to 5 sets. A new alert joins an active incident when every key of any one set has the same value on both. Keys: `title`, `description`, `severity`, or `labels.<name>`; each set must be non-empty. With `p`, at least one of `equals` or `cases` is required.
Equals [][]string `json:"equals,omitempty" toon:"equals,omitempty"`
// Fields used by intelligent (`i`) grouping, up to 10: `title`, `description`, `severity`, or `labels.<name>`. Empty uses `title`, `description`, `labels.service` and `labels.resource`.
IKeys []string `json:"i_keys,omitempty" toon:"i_keys,omitempty"`
// Minimum similarity, 0.5–1, for intelligent grouping to merge an alert into an existing incident. Omitted or `0` uses 0.9.
IScoreThreshold float64 `json:"i_score_threshold,omitempty" toon:"i_score_threshold,omitempty"`
// Grouping method:
// - `n`: no grouping; every new alert opens its own incident.
// - `p`: rule-based grouping by the keys in `equals` and `cases`; requires the Standard license or higher.
// - `i`: intelligent grouping by content similarity (see `i_keys`, `i_score_threshold`); requires the Pro license.
Method string `json:"method" toon:"method"`
// Legacy single storm threshold; used only when `storm_thresholds` is empty and the value is greater than 1. `0` disables it.
StormThreshold int64 `json:"storm_threshold,omitempty" toon:"storm_threshold,omitempty"`
// Alert counts at which an incident storm event fires: when the number of alerts merged into one incident reaches a threshold, a storm notification is sent. Up to 5 values, each at least 2; duplicates are removed and values are sorted.
StormThresholds []int64 `json:"storm_thresholds,omitempty" toon:"storm_thresholds,omitempty"`
// Grouping time window in minutes. Default max is 1440 minutes (24 h); extended accounts may allow up to 43200 minutes (30 days).
TimeWindow int64 `json:"time_window,omitempty" toon:"time_window,omitempty"`
// Window type, default `tumbling`. `tumbling` is a fixed window counted from incident creation — once it expires, new alerts open a new incident; `sliding` is a sliding window counted from the incident's most recent alert, extended each time a new alert merges in.
WindowType string `json:"window_type,omitempty" toon:"window_type,omitempty"`
}
Group is generated from the Flashduty OpenAPI schema.
type GroupCasesItem ¶ added in v0.14.3
type GroupCasesItem struct {
// Grouping keys for matching alerts. Supported values: `title`, `description`, `severity`, or any `labels.<name>`.
Equals []string `json:"equals" toon:"equals"`
// AND-ed match conditions evaluated against stored alert fields.
If []FilterCondition `json:"if" toon:"if"`
}
GroupCasesItem is generated from the Flashduty OpenAPI schema.
type IDRequest ¶
type IDRequest struct {
// Numeric ID of the target resource; the exact meaning depends on the API being called (e.g. datasource ID, ruleset ID).
ID uint64 `json:"id" toon:"id"`
}
IDRequest is generated from the Flashduty OpenAPI schema.
type ImIntegrationsService ¶ added in v0.4.0
type ImIntegrationsService service
ImIntegrationsService handles the "On-call/IM integrations" API resource.
func (*ImIntegrationsService) List ¶ added in v0.4.0
func (s *ImIntegrationsService) List(ctx context.Context) (*ListWarRoomEnabledResponse, *Response, error)
List war-room-enabled IM integrations.
List IM integrations that have the war-room feature enabled for the account.
API: POST /datasource/im/war-room-enabled/list (im-war-room-enabled-list).
type Image ¶
type Image struct {
// Alternative text shown when the image cannot be displayed; empty when not set.
Alt string `json:"alt" toon:"alt"`
// Optional link the image points to.
Href string `json:"href" toon:"href"`
// Image source. Either an `img_` upload token or an `http(s)` URL.
Src string `json:"src" toon:"src"`
}
Image is generated from the Flashduty OpenAPI schema.
type ImportStatusPageSubscriberItem ¶
type ImportStatusPageSubscriberItem struct {
// When `true`, the subscriber receives notifications for all components and events, and `component_ids`/`change_ids` are ignored. Must be `true` when both lists are empty.
All bool `json:"all,omitempty" toon:"all,omitempty"`
// Specific event IDs the subscriber should receive notifications for.
ChangeIDs []int64 `json:"change_ids,omitempty" toon:"change_ids,omitempty"`
// Component IDs the subscriber should receive notifications for.
ComponentIDs []string `json:"component_ids,omitempty" toon:"component_ids,omitempty"`
// Preferred locale for notifications. Defaults to the request locale when omitted.
Locale string `json:"locale,omitempty" toon:"locale,omitempty"`
// Email address (for public pages) or user ID (for internal pages).
Recipient string `json:"recipient" toon:"recipient"`
}
ImportStatusPageSubscriberItem is generated from the Flashduty OpenAPI schema.
type ImportStatusPageSubscribersRequest ¶
type ImportStatusPageSubscribersRequest struct {
// Subscription method. `email` is only valid for public pages; `im` is only valid for internal pages.
Method string `json:"method" toon:"method"`
// Target status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Subscribers to import. Each recipient's existing subscriptions on this page are replaced; an empty or omitted list does nothing.
Subscribers []ImportStatusPageSubscriberItem `json:"subscribers,omitempty" toon:"subscribers,omitempty"`
}
ImportStatusPageSubscribersRequest is generated from the Flashduty OpenAPI schema.
type IncProgressCnts ¶
type IncProgressCnts struct {
// Incidents started in the last 30 days that are `Processing` (acknowledged, not yet closed).
Processing int64 `json:"Processing" toon:"Processing"`
// Incidents started in the last 30 days that are still `Triggered` (not yet acknowledged).
Triggered int64 `json:"Triggered" toon:"Triggered"`
}
IncProgressCnts is generated from the Flashduty OpenAPI schema.
type IncidentActionImage ¶ added in v0.5.7
type IncidentActionImage struct {
// Alternative text for the image.
Alt string `json:"alt,omitempty" toon:"alt,omitempty"`
// Optional link that the image points to.
Href string `json:"href,omitempty" toon:"href,omitempty"`
// Image source. Accepts an `img_` upload token, an `http(s)` URL, or an object-storage key beginning with `/`.
Src string `json:"src" toon:"src"`
}
IncidentActionImage is generated from the Flashduty OpenAPI schema.
type IncidentCardHiddenFields ¶ added in v0.5.7
IncidentCardHiddenFields is a map response payload.
type IncidentCommentTypeDisplay ¶ added in v0.8.0
type IncidentCommentTypeDisplay struct {
// Badge color in #RRGGBB format.
Color string `json:"color" toon:"color"`
// Comment type ID (MongoDB ObjectID).
ID string `json:"id" toon:"id"`
// Display name of the comment type.
Name string `json:"name" toon:"name"`
}
IncidentCommentTypeDisplay is generated from the Flashduty OpenAPI schema.
type IncidentCommentTypeItem ¶ added in v0.8.0
type IncidentCommentTypeItem struct {
// Account ID that owns the comment type.
AccountID int64 `json:"account_id" toon:"account_id"`
// Label color as a hex value in #RRGGBB format (stored uppercase).
Color string `json:"color" toon:"color"`
// Comment type ID (24-character hex ObjectID).
CommentTypeID string `json:"comment_type_id" toon:"comment_type_id"`
// Creation time as a Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the user who created the comment type.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Display name of the comment type. Unique within the account (case-insensitive, trimmed).
Name string `json:"name" toon:"name"`
// 1-based display position of the comment type.
Position int64 `json:"position" toon:"position"`
// Last update time as a Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the user who last updated the comment type.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
IncidentCommentTypeItem is generated from the Flashduty OpenAPI schema.
type IncidentFeedItem ¶
type IncidentFeedItem struct {
// ID of the account that owns this record; the same for every record returned to one `app_key`.
AccountID int64 `json:"account_id" toon:"account_id"`
// ID of the AI SRE session that performed the action; present only when `via` is `ai_sre` and a session was recorded.
AgentSessionID string `json:"agent_session_id" toon:"agent_session_id"`
// Creation timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// User ID of the actor. `0` means system-generated.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Soft-delete timestamp in milliseconds. Zero if not deleted.
DeletedAt TimestampMilli `json:"deleted_at" toon:"deleted_at"`
// Type-specific payload. The concrete shape is determined by `type`; `null` when the entry has no structured detail.
Detail any `json:"detail" toon:"detail"`
// ID of the incident the entry belongs to; equals the requested `incident_id`.
RefID string `json:"ref_id" toon:"ref_id"`
Type IncidentFeedType `json:"type" toon:"type"`
// Last update timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// `ai_sre` when AI SRE performed the action on behalf of `creator_id`; omitted for direct actions.
Via string `json:"via" toon:"via"`
}
IncidentFeedItem is generated from the Flashduty OpenAPI schema.
type IncidentFeedType ¶
type IncidentFeedType string
IncidentFeedType Incident timeline entry type. Each value identifies one lifecycle event; the matching `detail` payload shape is determined by this field. Incident types are prefixed with `i_`.
const ( IncidentFeedTypeINew IncidentFeedType = "i_new" IncidentFeedTypeIAssign IncidentFeedType = "i_assign" IncidentFeedTypeIARspd IncidentFeedType = "i_a_rspd" IncidentFeedTypeINotify IncidentFeedType = "i_notify" IncidentFeedTypeIStorm IncidentFeedType = "i_storm" IncidentFeedTypeISnooze IncidentFeedType = "i_snooze" IncidentFeedTypeIWake IncidentFeedType = "i_wake" IncidentFeedTypeIAck IncidentFeedType = "i_ack" IncidentFeedTypeIUnack IncidentFeedType = "i_unack" IncidentFeedTypeIComm IncidentFeedType = "i_comm" IncidentFeedTypeIRslv IncidentFeedType = "i_rslv" IncidentFeedTypeIReopen IncidentFeedType = "i_reopen" IncidentFeedTypeIMerge IncidentFeedType = "i_merge" IncidentFeedTypeIRTitle IncidentFeedType = "i_r_title" IncidentFeedTypeIRDesc IncidentFeedType = "i_r_desc" IncidentFeedTypeIRImpact IncidentFeedType = "i_r_impact" IncidentFeedTypeIRRc IncidentFeedType = "i_r_rc" IncidentFeedTypeIRRsltn IncidentFeedType = "i_r_rsltn" IncidentFeedTypeIRSeverity IncidentFeedType = "i_r_severity" IncidentFeedTypeIRField IncidentFeedType = "i_r_field" IncidentFeedTypeIMFlapping IncidentFeedType = "i_m_flapping" IncidentFeedTypeIMReply IncidentFeedType = "i_m_reply" IncidentFeedTypeICustom IncidentFeedType = "i_custom" IncidentFeedTypeIWrCreate IncidentFeedType = "i_wr_create" IncidentFeedTypeIWrDelete IncidentFeedType = "i_wr_delete" IncidentFeedTypeIAutoRefresh IncidentFeedType = "i_auto_refresh" IncidentFeedTypeIWiCreated IncidentFeedType = "i_wi_created" IncidentFeedTypeIWiUpdated IncidentFeedType = "i_wi_updated" IncidentFeedTypeIWiAssignees IncidentFeedType = "i_wi_assignees" IncidentFeedTypeIWiCompleted IncidentFeedType = "i_wi_completed" IncidentFeedTypeIWiConverted IncidentFeedType = "i_wi_converted" IncidentFeedTypeIWiBound IncidentFeedType = "i_wi_bound" IncidentFeedTypeIWiDeleted IncidentFeedType = "i_wi_deleted" IncidentFeedTypeIWiAutoConverted IncidentFeedType = "i_wi_auto_converted" IncidentFeedTypeAMerge IncidentFeedType = "a_merge" )
func (IncidentFeedType) String ¶ added in v0.5.2
func (e IncidentFeedType) String() string
String returns the underlying string value, implementing fmt.Stringer.
type IncidentInfo ¶
type IncidentInfo struct {
// Account ID that owns the incident.
AccountID int64 `json:"account_id" toon:"account_id"`
// Always an empty string in API responses; filled only when the incident is rendered for notifications.
AccountLocale string `json:"account_locale" toon:"account_locale"`
// Always an empty string in API responses; filled only when the incident is rendered for notifications.
AccountName string `json:"account_name" toon:"account_name"`
// Always an empty string in API responses; filled only when the incident is rendered for notifications.
AccountTimeZone string `json:"account_time_zone" toon:"account_time_zone"`
// Unix timestamp (seconds) when the incident was first acknowledged. 0 if unacknowledged.
AckTime Timestamp `json:"ack_time" toon:"ack_time"`
// Count of alerts currently in Critical/Warning/Info state.
ActiveAlertCnt int64 `json:"active_alert_cnt" toon:"active_alert_cnt"`
// Reserved; always an empty string.
AISummary string `json:"ai_summary" toon:"ai_summary"`
// Total count of alerts merged into this incident.
AlertCnt int64 `json:"alert_cnt" toon:"alert_cnt"`
// Total raw alert event count across all merged alerts.
AlertEventCnt int64 `json:"alert_event_cnt" toon:"alert_event_cnt"`
// Not returned by the incident endpoints; present only in notification template and custom action payloads.
Alerts []AlertInfo `json:"alerts" toon:"alerts"`
// Current assignment target. Always present; for an incident that was never assigned, `type` and `id` are empty and `assigned_at` is `0`.
AssignedTo AssignedTo `json:"assigned_to" toon:"assigned_to"`
// Channel ID. 0 for standalone incidents.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel display name.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Status of the channel: `enabled`, `disabled`, or `deleted`. Empty string when the record has no channel or the channel no longer exists.
ChannelStatus string `json:"channel_status" toon:"channel_status"`
// Unix timestamp (seconds) when the incident was closed. 0 if still open.
CloseTime Timestamp `json:"close_time" toon:"close_time"`
// Closer member info.
Closer PersonShort `json:"closer" toon:"closer"`
// Member ID that closed the incident. 0 if auto-closed.
CloserID int64 `json:"closer_id" toon:"closer_id"`
// Creation timestamp (seconds).
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator member info.
Creator PersonShort `json:"creator" toon:"creator"`
// Member ID that created the incident. 0 if auto-created by the system.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Deprecated. Use `integration_id` instead.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Deprecated. Use `integration_ids` instead.
DataSourceIDs []int64 `json:"data_source_ids" toon:"data_source_ids"`
// Deprecated; same value as `integration_type`.
DataSourceType string `json:"data_source_type" toon:"data_source_type"`
// Deprecated. Use `integration_types` instead.
DataSourceTypes []string `json:"data_source_types" toon:"data_source_types"`
// Deduplication key used to coalesce alerts.
DedupKey string `json:"dedup_key" toon:"dedup_key"`
// Soft-delete timestamp (seconds). Zero if not deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Incident description.
Description string `json:"description" toon:"description"`
// Web console URL for the incident.
DetailURL string `json:"detail_url" toon:"detail_url"`
// Unix timestamp (seconds) when the incident ended. 0 if still active.
EndTime Timestamp `json:"end_time" toon:"end_time"`
// MD5 hash used for content-equality checks.
EqualsMD5 string `json:"equals_md5" toon:"equals_md5"`
// Whether the incident has ever been silenced.
EverMuted bool `json:"ever_muted" toon:"ever_muted"`
// Custom field values keyed by field name.
Fields map[string]any `json:"fields" toon:"fields"`
// Frequency bucket for recurrence analysis: `frequent` or `rare`.
Frequency string `json:"frequency" toon:"frequency"`
// Alert grouping method: `i` intelligent, `p` pattern, `n` none.
GroupMethod string `json:"group_method" toon:"group_method"`
// `true` when the incident still has at least one action item or follow-up that is neither `done` nor `cancelled`.
HasUnfinishedWorkItem bool `json:"has_unfinished_work_item" toon:"has_unfinished_work_item"`
// Images attached to the incident; `null` when there are none. Tokens starting with `img_` are returned as download URLs.
Images []Image `json:"images" toon:"images"`
// Impact description.
Impact string `json:"impact" toon:"impact"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Configured incident severity.
IncidentSeverity string `json:"incident_severity" toon:"incident_severity"`
// Current incident status, derived from alert statuses.
IncidentStatus string `json:"incident_status" toon:"incident_status"`
// First integration associated with the incident.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// IDs of all integrations contributing alerts to this incident; `null` for incidents without integrations, such as manually created ones.
IntegrationIDs []int64 `json:"integration_ids" toon:"integration_ids"`
// Plugin type of the incident's first integration (see `integration_types` for all). Open set, for example `prometheus.alert` or `monit.alert`; `POST /integration/type/list` returns the full list. Omitted when the incident has no integration or the endpoint does not fill it.
IntegrationType string `json:"integration_type" toon:"integration_type"`
// Plugin types of all contributing integrations (see `integration_type`); `null` when there are none.
IntegrationTypes []string `json:"integration_types" toon:"integration_types"`
// Labels on the incident, propagated from alerts or set at creation.
Labels map[string]string `json:"labels" toon:"labels"`
// Unix timestamp (seconds) of the most recent update.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Channel-level link integrations rendered for this incident.
Links []LinkItem `json:"links" toon:"links"`
// Fields edited manually and therefore no longer overwritten by merged alerts: `title`, `description`, `incident_severity`. `null` when none.
ManualOverrides []string `json:"manual_overrides" toon:"manual_overrides"`
// Short display identifier; not guaranteed unique.
Num string `json:"num" toon:"num"`
// Owner member info. May be deprecated.
Owner PersonShort `json:"owner" toon:"owner"`
// Primary owner member ID. 0 if none.
OwnerID int64 `json:"owner_id" toon:"owner_id"`
// Associated post-mortem ID, if any. One incident can only link to a single post-mortem.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Incident progress. `Triggered` means fired and unacknowledged; `Processing` means acknowledged and being handled (un-acknowledging moves it back to `Triggered`); `Closed` means resolved.
Progress string `json:"progress" toon:"progress"`
// Reporter email for manually created incidents.
ReporterEmail string `json:"reporter_email" toon:"reporter_email"`
// Resolution notes.
Resolution string `json:"resolution" toon:"resolution"`
// Current responders with assignment/acknowledgement state.
Responders []Responder `json:"responders" toon:"responders"`
// Root cause analysis.
RootCause string `json:"root_cause" toon:"root_cause"`
// Quick-silence URL for this incident.
SilenceURL string `json:"silence_url" toon:"silence_url"`
// Unix timestamp (seconds) until which notifications are snoozed. 0 if not snoozed.
SnoozedBefore Timestamp `json:"snoozed_before" toon:"snoozed_before"`
// Unix timestamp (seconds) when the incident started.
StartTime Timestamp `json:"start_time" toon:"start_time"`
// ID of the team that owns the incident's channel. 0 when the channel has no team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Incident title.
Title string `json:"title" toon:"title"`
// Last update timestamp (seconds).
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
IncidentInfo is generated from the Flashduty OpenAPI schema.
type IncidentInfoRequest ¶
type IncidentInfoRequest struct {
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
// Short incident ID (the 6-character uppercased id shown in the UI). Not unique — resolves to the most recent match. Supply either incident_id or num.
Num string `json:"num,omitempty" toon:"num,omitempty"`
}
IncidentInfoRequest is generated from the Flashduty OpenAPI schema.
type IncidentListResponse ¶
type IncidentListResponse struct {
// Whether another page exists. Reflects the real data with both `p`/`limit` and `search_after_ctx` paging, including past the 1,000 cap of `total`. Always `false` for `POST /incident/list-by-ids`.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Incident list for the current page.
Items []IncidentInfo `json:"items" toon:"items"`
// Cursor pointing at the last item of this page; pass it as `search_after_ctx` on the next request to continue past the 1,000-item page limit. Returned for every non-empty page in `p`/`limit` mode, and in cursor mode only when `has_next_page` is `true`. Omitted by `POST /incident/list-by-ids`.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Number of matching incidents, capped at 1,000. For `POST /incident/list-by-ids`, the number of incidents found.
Total int64 `json:"total" toon:"total"`
}
IncidentListResponse is generated from the Flashduty OpenAPI schema.
type IncidentRawItem ¶
type IncidentRawItem struct {
// Number of acknowledgements.
Acknowledgements int64 `json:"acknowledgements" toon:"acknowledgements"`
// Number of alerts still active (not recovered).
ActiveAlertCnt int64 `json:"active_alert_cnt" toon:"active_alert_cnt"`
// Total number of alerts aggregated into the incident.
AlertCnt int64 `json:"alert_cnt" toon:"alert_cnt"`
// Total number of alert events associated with the incident; each report of an alert counts as one event.
AlertEventCnt int64 `json:"alert_event_cnt" toon:"alert_event_cnt"`
// Current assignment target for the incident; `null` when the incident has no assignment record.
AssignedTo *IncidentRawItemAssignedTo `json:"assigned_to" toon:"assigned_to"`
// Number of assignments.
Assignments int64 `json:"assignments" toon:"assignments"`
// ID of the channel the incident belongs to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Name of the channel the incident belongs to.
ChannelName string `json:"channel_name" toon:"channel_name"`
// How the incident was closed: `auto`, `timeout`, or `manually`. Empty string while the incident is still open.
ClosedBy string `json:"closed_by" toon:"closed_by"`
// Member ID of the person who closed the incident. Omitted when 0 (not closed manually).
CloserID int64 `json:"closer_id" toon:"closer_id"`
// Display name of the person who closed the incident. Omitted when empty.
CloserName string `json:"closer_name" toon:"closer_name"`
// Incident creation time, as a Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Person ID of the incident creator.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Display name of the incident creator.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Incident description. Omitted when empty.
Description string `json:"description" toon:"description"`
// Total engaged time in seconds across acknowledged responders, each contributing close time minus their acknowledgement time; 0 if not closed.
EngagedSeconds int64 `json:"engaged_seconds" toon:"engaged_seconds"`
// Total escalations, the sum of `timeout_escalations` and `manual_escalations`.
Escalations int64 `json:"escalations" toon:"escalations"`
// Whether the incident was ever muted by noise reduction. Omitted when false.
EverMuted bool `json:"ever_muted" toon:"ever_muted"`
// Custom fields of the incident. Always omitted in this response (reserved for export).
Fields map[string]any `json:"fields" toon:"fields"`
// Frequency classification: `frequent` or `rare`. Omitted when not classified.
Frequency string `json:"frequency" toon:"frequency"`
// Time-of-day bucket of the creation time in the account timezone: `work` = Mon–Fri 08:00–19:00, `sleep` = 23:00–08:00 daily, `off` = all other times.
Hours string `json:"hours" toon:"hours"`
// Incident ID, unique within the account.
IncidentID string `json:"incident_id" toon:"incident_id"`
// Number of interruptions: notifications sent via app push, SMS, or voice call; consecutive notifications to the same responder within 60 seconds count as one.
Interruptions int64 `json:"interruptions" toon:"interruptions"`
// Incident labels as key-value pairs. Always omitted in this response (reserved for export).
Labels map[string]string `json:"labels" toon:"labels"`
// Manually triggered escalations.
ManualEscalations int64 `json:"manual_escalations" toon:"manual_escalations"`
// Total number of notifications sent.
Notifications int64 `json:"notifications" toon:"notifications"`
// Member ID of the incident owner. Omitted when 0 (no owner).
OwnerID int64 `json:"owner_id" toon:"owner_id"`
// Display name of the incident owner. Omitted when empty.
OwnerName string `json:"owner_name" toon:"owner_name"`
// Incident progress state — one of `Triggered`, `Processing`, `Closed`.
Progress string `json:"progress" toon:"progress"`
// Number of reassignments.
Reassignments int64 `json:"reassignments" toon:"reassignments"`
// Responders with per-person assignment and acknowledgement times.
Responders []IncidentRawItemRespondersItem `json:"responders" toon:"responders"`
// Seconds from incident creation to the first acknowledgement; 0 if never acknowledged.
SecondsToAck int64 `json:"seconds_to_ack" toon:"seconds_to_ack"`
// Seconds from incident creation to close; 0 if not closed.
SecondsToClose int64 `json:"seconds_to_close" toon:"seconds_to_close"`
// Incident severity.
Severity string `json:"severity" toon:"severity"`
// Unix timestamp in seconds until which the incident is snoozed. Omitted when the incident is not snoozed.
SnoozedBefore Timestamp `json:"snoozed_before" toon:"snoozed_before"`
// ID of the team that owns the incident.
TeamID int64 `json:"team_id" toon:"team_id"`
// Name of the team that owns the incident.
TeamName string `json:"team_name" toon:"team_name"`
// Escalations triggered by timeout.
TimeoutEscalations int64 `json:"timeout_escalations" toon:"timeout_escalations"`
// Incident title.
Title string `json:"title" toon:"title"`
}
IncidentRawItem is generated from the Flashduty OpenAPI schema.
type IncidentRawItemAssignedTo ¶
type IncidentRawItemAssignedTo struct {
// Unix timestamp (seconds) when this assignment was made.
AssignedAt Timestamp `json:"assigned_at" toon:"assigned_at"`
// Member IDs that actually receive the assignment: `person_ids` plus the members of the selected escalation level, deduplicated and sorted. Set by the server; omitted when empty.
EffectivePersonIDs []int64 `json:"effective_person_ids" toon:"effective_person_ids"`
// Escalation rule ID (MongoDB ObjectID) driving the assignment.
EscalateRuleID string `json:"escalate_rule_id" toon:"escalate_rule_id"`
// Display name of the escalation rule.
EscalateRuleName string `json:"escalate_rule_name" toon:"escalate_rule_name"`
// Internal assignment record ID.
ID string `json:"id" toon:"id"`
// Current level index within the escalation rule.
LayerIdx int64 `json:"layer_idx" toon:"layer_idx"`
// Member IDs assigned directly to this incident.
PersonIDs []int64 `json:"person_ids" toon:"person_ids"`
// Assignment type.
// | Value | Meaning |
// |---|---|
// | `assign` | Initial assignment when the incident is created manually. |
// | `reassign` | Re-assignment of an existing incident. |
// | `escalate` | Assignment triggered by escalation policy advancement. |
// | `reopen` | Assignment restarted from the first layer after the incident is reopened. |
Type string `json:"type" toon:"type"`
}
IncidentRawItemAssignedTo is generated from the Flashduty OpenAPI schema.
type IncidentRawItemRespondersItem ¶ added in v0.14.0
type IncidentRawItemRespondersItem struct {
// Acknowledgement time, as a Unix timestamp in seconds; 0 if not acknowledged.
AcknowledgedAt Timestamp `json:"acknowledged_at" toon:"acknowledged_at"`
// Responder's identity in an external chat tool (e.g. Slack); only present when backfilled by an external system.
As string `json:"as" toon:"as"`
// Assignment time, as a Unix timestamp in seconds.
AssignedAt Timestamp `json:"assigned_at" toon:"assigned_at"`
// Responder email. Omitted when empty.
Email string `json:"email" toon:"email"`
// Person ID of the responder.
PersonID int64 `json:"person_id" toon:"person_id"`
// Responder display name. Omitted when empty.
PersonName string `json:"person_name" toon:"person_name"`
}
IncidentRawItemRespondersItem is generated from the Flashduty OpenAPI schema.
type IncidentShort ¶
type IncidentShort struct {
// Incident ID (ObjectID hex string).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Incident progress: `Triggered` not yet acknowledged; `Processing` acknowledged and being handled; `Closed` resolved.
Progress string `json:"progress" toon:"progress"`
// Incident title.
Title string `json:"title" toon:"title"`
}
IncidentShort is generated from the Flashduty OpenAPI schema.
type IncidentsPostMortemInfoRequest ¶
type IncidentsPostMortemInfoRequest struct {
// Post-mortem ID: a 32-character hex string derived from the account ID and the linked incident IDs.
PostMortemID string `url:"post_mortem_id"`
}
IncidentsPostMortemInfoRequest holds the query parameters for Get post-mortem.
type IncidentsPostmortemReadTemplateInfoRequest ¶ added in v0.5.4
type IncidentsPostmortemReadTemplateInfoRequest struct {
// Template ID: a built-in ID such as `post_mortem_default_tmpl_en-us`, or a custom template ID from `POST /incident/post-mortem/template/list`.
TemplateID string `url:"template_id"`
}
IncidentsPostmortemReadTemplateInfoRequest holds the query parameters for Get post-mortem template detail.
type IncidentsService ¶
type IncidentsService service
IncidentsService handles the "On-call/Incidents" API resource.
func (*IncidentsService) Ack ¶
func (s *IncidentsService) Ack(ctx context.Context, req *AckIncidentRequest) (*Response, error)
Acknowledge incident.
Acknowledge an incident to indicate you are actively working on it.
API: POST /incident/ack (incidentAck).
func (*IncidentsService) AlertList ¶
func (s *IncidentsService) AlertList(ctx context.Context, req *ListIncidentAlertsRequest) (*ListIncidentAlertsResponse, *Response, error)
List alerts of incident.
List all alerts merged into a specific incident.
API: POST /incident/alert/list (incidentAlertList).
func (*IncidentsService) Assign ¶
func (s *IncidentsService) Assign(ctx context.Context, req *AssignIncidentRequest) (*Response, error)
Assign incident.
Reassign incidents to members or an escalation rule, replacing the current responders.
API: POST /incident/assign (incidentAssign).
func (*IncidentsService) Comment ¶
func (s *IncidentsService) Comment(ctx context.Context, req *CommentIncidentRequest) (*Response, error)
Add comment to incident.
Add a text comment to the incident timeline.
API: POST /incident/comment (incidentComment).
func (*IncidentsService) CommentTypeCreate ¶ added in v0.8.0
func (s *IncidentsService) CommentTypeCreate(ctx context.Context, req *CreateIncidentCommentTypeRequest) (*CreateIncidentCommentTypeResponse, *Response, error)
Create a comment type.
Create a comment type that can be attached to incident comments.
API: POST /incident/comment-type/create (incidentCommentTypeCreate).
func (*IncidentsService) CommentTypeDelete ¶ added in v0.8.0
func (s *IncidentsService) CommentTypeDelete(ctx context.Context, req *DeleteIncidentCommentTypeRequest) (*Response, error)
Delete a comment type.
Permanently delete a comment type; comments that used it keep their text but lose the label.
API: POST /incident/comment-type/delete (incidentCommentTypeDelete).
func (*IncidentsService) CommentTypeList ¶ added in v0.8.0
func (s *IncidentsService) CommentTypeList(ctx context.Context) (*ListIncidentCommentTypesResponse, *Response, error)
List comment types.
Retrieve all comment types of the account, ordered by their display position.
API: POST /incident/comment-type/list (incidentCommentTypeList).
func (*IncidentsService) CommentTypeReorder ¶ added in v0.8.0
func (s *IncidentsService) CommentTypeReorder(ctx context.Context, req *ReorderIncidentCommentTypesRequest) (*Response, error)
Reorder comment types.
Set the display order of all comment types by passing every type ID in the desired order.
API: POST /incident/comment-type/reorder (incidentCommentTypeReorder).
func (*IncidentsService) CommentTypeUpdate ¶ added in v0.8.0
func (s *IncidentsService) CommentTypeUpdate(ctx context.Context, req *UpdateIncidentCommentTypeRequest) (*Response, error)
Update a comment type.
Update the name and/or color of an existing account comment type.
API: POST /incident/comment-type/update (incidentCommentTypeUpdate).
func (*IncidentsService) Create ¶
func (s *IncidentsService) Create(ctx context.Context, req *CreateIncidentRequest) (*CreateIncidentResponse, *Response, error)
Create incident.
Manually create a new incident and assign responders.
API: POST /incident/create (incidentCreate).
func (*IncidentsService) CustomActionDo ¶
func (s *IncidentsService) CustomActionDo(ctx context.Context, req *DoIncidentCustomActionRequest) (*DoIncidentCustomActionResponse, *Response, error)
Execute custom action.
Execute a custom action configured for an incident.
API: POST /incident/custom-action/do (incidentCustomActionDo).
func (*IncidentsService) DisableMerge ¶
func (s *IncidentsService) DisableMerge(ctx context.Context, req *DisableIncidentMergeRequest) (*Response, error)
Disable incident merge.
Stop new alerts and events from being merged into the given incidents.
API: POST /incident/disable-merge (incidentDisableMerge).
func (*IncidentsService) Feed ¶
func (s *IncidentsService) Feed(ctx context.Context, req *ListIncidentFeedRequest) (*ListIncidentFeedResponse, *Response, error)
Get incident timeline.
List an incident's timeline entries, such as state changes, assignments, notifications, comments, and work item events.
API: POST /incident/feed (incidentFeed).
func (*IncidentsService) FieldReset ¶
func (s *IncidentsService) FieldReset(ctx context.Context, req *ResetIncidentFieldRequest) (*Response, error)
Update incident custom field.
Update a custom field value on an incident.
API: POST /incident/field/reset (incidentFieldReset).
func (*IncidentsService) Info ¶
func (s *IncidentsService) Info(ctx context.Context, req *IncidentInfoRequest) (*IncidentInfo, *Response, error)
Get incident detail.
Get one incident by ID or short number, with responders, assignment, custom fields, and alert counts.
API: POST /incident/info (incidentInfo).
func (*IncidentsService) List ¶
func (s *IncidentsService) List(ctx context.Context, req *ListIncidentsRequest) (*IncidentListResponse, *Response, error)
List incidents.
Query a paginated list of incidents with filters by channel, severity, status, responder, and time range.
API: POST /incident/list (incidentList).
func (*IncidentsService) ListByIDs ¶
func (s *IncidentsService) ListByIDs(ctx context.Context, req *ListIncidentsByIDsRequest) (*IncidentListResponse, *Response, error)
List incidents by IDs.
Retrieve multiple incidents by their IDs in a single request.
API: POST /incident/list-by-ids (incidentListByIds).
func (*IncidentsService) Merge ¶
func (s *IncidentsService) Merge(ctx context.Context, req *MergeIncidentsRequest) (*Response, error)
Merge incidents.
Merge one or more incidents into a target incident.
API: POST /incident/merge (incidentMerge).
func (*IncidentsService) PastList ¶
func (s *IncidentsService) PastList(ctx context.Context, req *ListPastIncidentsRequest) (*ListPastIncidentsResponse, *Response, error)
List past incidents.
List closed incidents in the same channel that resemble a given incident, to reuse past root causes and resolutions.
API: POST /incident/past/list (incidentPastList).
func (*IncidentsService) PostMortemDelete ¶
func (s *IncidentsService) PostMortemDelete(ctx context.Context, req *DeletePostMortemRequest) (*Response, error)
Delete post-mortem.
Permanently delete a post-mortem report together with its uploaded media.
API: POST /incident/post-mortem/delete (incidentPostMortemDelete).
func (*IncidentsService) PostMortemInfo ¶
func (s *IncidentsService) PostMortemInfo(ctx context.Context, req *IncidentsPostMortemInfoRequest) (*PostMortemItem, *Response, error)
Get post-mortem.
Get the full content and auto-aggregated basics of a post-mortem report by its ID.
API: GET /incident/post-mortem/info (incidentPostMortemInfo).
func (*IncidentsService) PostMortemList ¶
func (s *IncidentsService) PostMortemList(ctx context.Context, req *ListPostMortemsRequest) (*ListPostMortemsResponse, *Response, error)
List post-mortems.
List post-mortem reports, optionally filtered by status, team, channel, and creation time.
API: POST /incident/post-mortem/list (incidentPostMortemList).
func (*IncidentsService) PostMortemWriteResetContent ¶ added in v0.5.9
func (s *IncidentsService) PostMortemWriteResetContent(ctx context.Context, req *ResetPostMortemContentRequest) (*PostMortemContentResetResponse, *Response, error)
Reset post-mortem content.
Replace the body of a drafting post-mortem report with Markdown.
API: POST /incident/post-mortem/content/reset (incident-post-mortem-write-reset-content).
func (*IncidentsService) PostmortemReadListTemplates ¶ added in v0.5.4
func (s *IncidentsService) PostmortemReadListTemplates(ctx context.Context, req *ListPostMortemTemplatesRequest) (*ListPostMortemTemplatesResponse, *Response, error)
List post-mortem templates.
Return the built-in post-mortem template followed by the account's custom templates.
API: POST /incident/post-mortem/template/list (postmortem-read-list-templates).
func (*IncidentsService) PostmortemReadTemplateInfo ¶ added in v0.5.4
func (s *IncidentsService) PostmortemReadTemplateInfo(ctx context.Context, req *IncidentsPostmortemReadTemplateInfoRequest) (*PostMortemTemplate, *Response, error)
Get post-mortem template detail.
Return one post-mortem template by ID.
API: GET /incident/post-mortem/template/info (postmortem-read-template-info).
func (*IncidentsService) PostmortemWriteDeleteTemplate ¶ added in v0.5.4
func (s *IncidentsService) PostmortemWriteDeleteTemplate(ctx context.Context, req *DeletePostMortemTemplateRequest) (*Response, error)
Delete post-mortem template.
Delete a custom post-mortem template.
API: POST /incident/post-mortem/template/delete (postmortem-write-delete-template).
func (*IncidentsService) PostmortemWriteInit ¶ added in v0.5.4
func (s *IncidentsService) PostmortemWriteInit(ctx context.Context, req *InitPostMortemRequest) (*PostMortemItem, *Response, error)
Initialize post-mortem.
Create a post-mortem draft from one or more incidents and a template.
API: POST /incident/post-mortem/init (postmortem-write-init).
func (*IncidentsService) PostmortemWriteResetBasics ¶ added in v0.5.4
func (s *IncidentsService) PostmortemWriteResetBasics(ctx context.Context, req *ResetPostMortemBasicsRequest) (*Response, error)
Update post-mortem basics.
Overwrite the incident facts (severity, times, responders) stored on a post-mortem report.
API: POST /incident/post-mortem/basics/reset (postmortem-write-reset-basics).
func (*IncidentsService) PostmortemWriteResetFollowUps ¶ added in v0.5.4
func (s *IncidentsService) PostmortemWriteResetFollowUps(ctx context.Context, req *ResetPostMortemFollowUpsRequest) (*Response, error)
Update post-mortem follow-ups.
Replace the free-text follow-ups string stored on a post-mortem report.
API: POST /incident/post-mortem/follow-ups/reset (postmortem-write-reset-follow-ups).
func (*IncidentsService) PostmortemWriteResetStatus ¶ added in v0.5.4
func (s *IncidentsService) PostmortemWriteResetStatus(ctx context.Context, req *ResetPostMortemStatusRequest) (*Response, error)
Update post-mortem status.
Set a post-mortem report to drafting or published.
API: POST /incident/post-mortem/status/reset (postmortem-write-reset-status).
func (*IncidentsService) PostmortemWriteResetTitle ¶ added in v0.5.4
func (s *IncidentsService) PostmortemWriteResetTitle(ctx context.Context, req *ResetPostMortemTitleRequest) (*Response, error)
Update post-mortem title.
Replace the title of a post-mortem report.
API: POST /incident/post-mortem/title/reset (postmortem-write-reset-title).
func (*IncidentsService) PostmortemWriteUpsertTemplate ¶ added in v0.5.4
func (s *IncidentsService) PostmortemWriteUpsertTemplate(ctx context.Context, req *UpsertPostMortemTemplateRequest) (*PostMortemTemplate, *Response, error)
Create or update post-mortem template.
Create a custom post-mortem template, or replace an existing one identified by `template_id`.
API: POST /incident/post-mortem/template/upsert (postmortem-write-upsert-template).
func (*IncidentsService) ReadGetWarRoomDefaultObservers ¶ added in v0.4.0
func (s *IncidentsService) ReadGetWarRoomDefaultObservers(ctx context.Context, req *GetWarRoomDefaultObserversRequest) (*GetWarRoomDefaultObserversResponse, *Response, error)
Get war-room default observers.
Return people assigned to an incident earlier who are no longer responders, as suggested war-room observers.
API: POST /incident/war-room/default-observers (incident-read-get-war-room-default-observers).
func (*IncidentsService) Remove ¶
func (s *IncidentsService) Remove(ctx context.Context, req *RemoveIncidentRequest) (*Response, error)
Delete an incident.
Permanently delete incidents together with their alerts, raw events, and timelines.
API: POST /incident/remove (incidentRemove).
func (*IncidentsService) Reopen ¶
func (s *IncidentsService) Reopen(ctx context.Context, req *ReopenIncidentRequest) (*Response, error)
Reopen incident.
Reopen closed incidents and dispatch them again from the first escalation level.
API: POST /incident/reopen (incidentReopen).
func (*IncidentsService) Reset ¶
func (s *IncidentsService) Reset(ctx context.Context, req *UpdateIncidentFieldsRequest) (*Response, error)
Update incident fields.
Update an incident's title, description, impact, root cause, resolution, or severity in one call.
API: POST /incident/reset (incidentReset).
func (*IncidentsService) Resolve ¶
func (s *IncidentsService) Resolve(ctx context.Context, req *ResolveIncidentRequest) (*Response, error)
Resolve incident.
Close one or more incidents, optionally recording root cause, resolution, and resolution form values.
API: POST /incident/resolve (incidentResolve).
func (*IncidentsService) ResponderAdd ¶
func (s *IncidentsService) ResponderAdd(ctx context.Context, req *AddIncidentResponderRequest) (*Response, error)
Add incident responder.
Add members as responders to an open incident and notify them.
API: POST /incident/responder/add (incidentResponderAdd).
func (*IncidentsService) ServiceDeskPlusRequestReadList ¶ added in v0.5.8
func (s *IncidentsService) ServiceDeskPlusRequestReadList(ctx context.Context, req *ServiceDeskPlusRequestListRequest) (*ServiceDeskPlusRequestListResponse, *Response, error)
Get ServiceDeskPlus linked incidents.
List synchronization mappings between ServiceDeskPlus requests and Flashduty incidents.
API: POST /incident/sdp/request/list (incident-service-desk-plus-request-read-list).
func (*IncidentsService) Snooze ¶
func (s *IncidentsService) Snooze(ctx context.Context, req *SnoozeIncidentRequest) (*Response, error)
Snooze incident.
Pause notifications for acknowledged incidents for a given number of minutes.
API: POST /incident/snooze (incidentSnooze).
func (*IncidentsService) Unack ¶
func (s *IncidentsService) Unack(ctx context.Context, req *UnackIncidentRequest) (*Response, error)
Unacknowledge incident.
Withdraw the calling member's acknowledgement of one or more incidents.
API: POST /incident/unack (incidentUnack).
func (*IncidentsService) Wake ¶
func (s *IncidentsService) Wake(ctx context.Context, req *WakeIncidentRequest) (*Response, error)
Wake incident.
End the snooze on incidents so that their notifications resume immediately.
API: POST /incident/wake (incidentWake).
func (*IncidentsService) WarRoomCreate ¶
func (s *IncidentsService) WarRoomCreate(ctx context.Context, req *CreateWarRoomRequest) (*WarRoom, *Response, error)
Create war room.
Create an IM group chat as the war room for an incident and invite members into it.
API: POST /incident/war-room/create (incidentWarRoomCreate).
func (*IncidentsService) WarRoomDelete ¶
func (s *IncidentsService) WarRoomDelete(ctx context.Context, req *DeleteWarRoomRequest) (*Response, error)
Delete war room.
Dissolve an incident's war room group on the IM platform and unlink it from the incident.
API: POST /incident/war-room/delete (incidentWarRoomDelete).
func (*IncidentsService) WarRoomDetail ¶
func (s *IncidentsService) WarRoomDetail(ctx context.Context, req *GetWarRoomDetailRequest) (*WarRoom, *Response, error)
Get war room detail.
Fetch the current name and join link of a war room group from the IM platform.
API: POST /incident/war-room/detail (incidentWarRoomDetail).
func (*IncidentsService) WarRoomList ¶
func (s *IncidentsService) WarRoomList(ctx context.Context, req *ListWarRoomsRequest) (*ListWarRoomsResponse, *Response, error)
List war rooms.
List the IM war room groups linked to an incident.
API: POST /incident/war-room/list (incidentWarRoomList).
func (*IncidentsService) WorkItemBindPostMortem ¶ added in v0.8.0
func (s *IncidentsService) WorkItemBindPostMortem(ctx context.Context, req *BindWorkItemPostMortemRequest) (*WorkItemListResult, *Response, error)
Bind work items to a post-mortem.
Bulk-bind an incident's converted-but-unbound follow-ups to a post-mortem.
API: POST /incident/work-item/post-mortem/bind (incidentWorkItemBindPostMortem).
func (*IncidentsService) WorkItemComplete ¶ added in v0.8.0
func (s *IncidentsService) WorkItemComplete(ctx context.Context, req *CompleteWorkItemRequest) (*WorkItemMutationResult, *Response, error)
Complete a work item.
Mark a work item as done; only its current assignees can do this.
API: POST /incident/work-item/complete (incidentWorkItemComplete).
func (*IncidentsService) WorkItemConvert ¶ added in v0.8.0
func (s *IncidentsService) WorkItemConvert(ctx context.Context, req *ConvertWorkItemRequest) (*WorkItemMutationResult, *Response, error)
Convert a work item to a follow-up.
Convert an incident action item into a post-mortem follow-up in place.
API: POST /incident/work-item/convert (incidentWorkItemConvert).
func (*IncidentsService) WorkItemCreate ¶ added in v0.8.0
func (s *IncidentsService) WorkItemCreate(ctx context.Context, req *CreateWorkItemRequest) (*WorkItemCreateResult, *Response, error)
Create a work item.
Create an action on an open incident, or a follow-up on a closed incident.
API: POST /incident/work-item/create (incidentWorkItemCreate).
func (*IncidentsService) WorkItemDelete ¶ added in v0.8.0
func (s *IncidentsService) WorkItemDelete(ctx context.Context, req *DeleteWorkItemRequest) (*WorkItemMutationResult, *Response, error)
Delete a work item.
Soft-delete a work item so it no longer appears in work item lists.
API: POST /incident/work-item/delete (incidentWorkItemDelete).
func (*IncidentsService) WorkItemList ¶ added in v0.8.0
func (s *IncidentsService) WorkItemList(ctx context.Context, req *ListWorkItemRequest) (*WorkItemListResult, *Response, error)
List work items.
List incident work items (actions and post-mortem follow-ups) with cursor pagination.
API: POST /incident/work-item/list (incidentWorkItemList).
func (*IncidentsService) WorkItemResetAssignees ¶ added in v0.8.0
func (s *IncidentsService) WorkItemResetAssignees(ctx context.Context, req *ResetWorkItemAssigneesRequest) (*WorkItemMutationResult, *Response, error)
Reset work item assignees.
Replace a work item's entire assignee set.
API: POST /incident/work-item/assignees/reset (incidentWorkItemResetAssignees).
func (*IncidentsService) WorkItemUpdate ¶ added in v0.8.0
func (s *IncidentsService) WorkItemUpdate(ctx context.Context, req *UpdateWorkItemRequest) (*WorkItemMutationResult, *Response, error)
Update a work item.
Partially update a work item's title, description, status, or priority.
API: POST /incident/work-item/update (incidentWorkItemUpdate).
func (*IncidentsService) WriteAddWarRoomMember ¶ added in v0.4.0
func (s *IncidentsService) WriteAddWarRoomMember(ctx context.Context, req *AddWarRoomMemberRequest) (*string, *Response, error)
Add war-room member.
Add members to an existing incident war room on Feishu (Lark), DingTalk, WeCom, or Slack.
API: POST /incident/war-room/add-member (incident-write-add-war-room-member).
type InhibitRuleItem ¶
type InhibitRuleItem struct {
// ID of the account the rule belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// ID of the channel the rule belongs to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Deletion time, Unix timestamp in seconds. Omitted unless the rule is soft-deleted; deleted rules are excluded from list responses.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Rule description.
Description string `json:"description" toon:"description"`
// Keys whose values must be equal on the source alert and the incoming event. Only `title`, `severity` and `labels.<name>` take effect; with any other key the rule never fires.
Equals []string `json:"equals" toon:"equals"`
// When true, matching alert events are discarded entirely; when false, alerts are still recorded but marked as muted by this rule.
IsDirectlyDiscard bool `json:"is_directly_discard" toon:"is_directly_discard"`
// Rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Inhibit rule name, 1–39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Conditions the source alert must match, evaluated against stored active alerts. Supported keys: `status`, `incident_status`, `alert_status`, `severity`, `incident_severity`, `alert_severity`, `title`, `description`, or any `labels.<name>`. Empty makes the rule inert.
SourceFilters FilterGroup `json:"source_filters" toon:"source_filters"`
// Rule status: `enabled` or `disabled`; deleted rules never appear in the list.
Status string `json:"status" toon:"status"`
// Conditions the incoming target alert event must match to be inhibited; empty means every incoming event is a target. Keys: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`.
TargetFilters FilterGroup `json:"target_filters" toon:"target_filters"`
// Last update time, Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the user who last updated the rule.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
InhibitRuleItem is generated from the Flashduty OpenAPI schema.
type InitPostMortemRequest ¶ added in v0.5.4
type InitPostMortemRequest struct {
// Incident IDs (MongoDB ObjectIDs) to link to the report, 1–10. All must exist in the account. The same set always maps to the same report.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
// Template ID from `POST /incident/post-mortem/template/list`, e.g. the built-in `post_mortem_default_tmpl_en-us` or `post_mortem_default_tmpl_zh-cn`, or a custom template ID.
TemplateID string `json:"template_id" toon:"template_id"`
}
InitPostMortemRequest is generated from the Flashduty OpenAPI schema.
type InsightAlertByLabelItem ¶
type InsightAlertByLabelItem struct {
// Hour bucket when `split_hours` is enabled: `work`, `sleep`, or `off`. Omitted when `split_hours` is false.
Hours string `json:"hours" toon:"hours"`
// Aggregation key value (check name or resource identifier).
Label string `json:"label" toon:"label"`
// Total number of alerts in this label-value bucket.
TotalAlertCnt int64 `json:"total_alert_cnt" toon:"total_alert_cnt"`
// Total number of raw alert events in this label-value bucket.
TotalAlertEventCnt int64 `json:"total_alert_event_cnt" toon:"total_alert_event_cnt"`
}
InsightAlertByLabelItem is generated from the Flashduty OpenAPI schema.
type InsightAlertByLabelResponse ¶
type InsightAlertByLabelResponse struct {
// Top-K statistic rows aggregated by the requested label's values.
Items []InsightAlertByLabelItem `json:"items" toon:"items"`
}
InsightAlertByLabelResponse is generated from the Flashduty OpenAPI schema.
type InsightFilter ¶
type InsightFilter struct {
// Sort ascending when `true`, descending (default) otherwise. Used by the incident list and export; `/insight/alert/topk-by-label` has its own `asc`.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by channel IDs. At most 100 entries.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Strip HTML markup from the description column when exporting.
DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
// End time, Unix seconds. Must be greater than `start_time`.
EndTime int64 `json:"end_time" toon:"end_time"`
// CSV column keys to include in the export, in the given order; unknown or duplicate keys are rejected. The valid key set differs per export endpoint — see each export operation's description. Only used by the export endpoints; at most 50 entries.
ExportFields []string `json:"export_fields,omitempty" toon:"export_fields,omitempty"`
// Custom-field filters (exact match).
Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
// Filter by incident IDs (24-character hex). Used only by the incident list and export. At most 100 entries.
IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
// Include incidents that have ever been muted. By default, they are excluded.
IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,omitempty"`
// Restrict results to the caller's teams (intersected with `team_ids` when both are set). When that intersection is empty, or the caller belongs to no team, the result is empty.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Label filters (exact match).
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Sort field of the incident list; only `created_at` (incident creation time, the default). Used by `/insight/incident/list` and `/insight/incident/export`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Substring match on the incident title (SQL `LIKE %query%`).
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by responder member IDs. Used by `/insight/responder` (which responders to return) and the incident list/export (incidents any of them responded to); ignored by the account/team/channel and top-K endpoints. At most 100 entries.
ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
// Lower bound (inclusive) on time-to-acknowledge, in seconds.
SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"seconds_to_ack_from,omitempty"`
// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty" toon:"seconds_to_ack_to,omitempty"`
// Lower bound (inclusive) on time-to-close, in seconds.
SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"seconds_to_close_from,omitempty"`
// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty" toon:"seconds_to_close_to,omitempty"`
// Filter by severity: `Critical`, `Warning`, `Info`, or `Ok`. At most 3 entries.
Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
// Start time, Unix seconds. Must be greater than 0.
StartTime int64 `json:"start_time" toon:"start_time"`
// Filter by team IDs. At most 100 entries.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
// IANA time zone (for example `Asia/Shanghai` or `UTC`) used to cut `aggregate_unit` buckets; abbreviations such as `EST` and `Etc/GMT±N` are rejected. Defaults to UTC. `/insight/incident/export` uses it to render times, falling back to the account time zone and then `Asia/Shanghai`.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
InsightFilter is generated from the Flashduty OpenAPI schema.
type InsightIncidentExportRequest ¶
type InsightIncidentExportRequest = InsightFilter
InsightIncidentExportRequest is an alias for InsightFilter.
type InsightIncidentListRequest ¶
type InsightIncidentListRequest struct {
ListOptions
// Sort ascending when `true`, descending (default) otherwise. Used by the incident list and export; `/insight/alert/topk-by-label` has its own `asc`.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by channel IDs. At most 100 entries.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Strip HTML markup from the description column when exporting.
DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
// End time, Unix seconds. Must be greater than `start_time`.
EndTime int64 `json:"end_time" toon:"end_time"`
// CSV column keys to include in the export, in the given order; unknown or duplicate keys are rejected. The valid key set differs per export endpoint — see each export operation's description. Only used by the export endpoints; at most 50 entries.
ExportFields []string `json:"export_fields,omitempty" toon:"export_fields,omitempty"`
// Custom-field filters (exact match).
Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
// Filter by incident IDs (24-character hex). Used only by the incident list and export. At most 100 entries.
IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
// Include incidents that have ever been muted. By default, they are excluded.
IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,omitempty"`
// Restrict results to the caller's teams (intersected with `team_ids` when both are set). When that intersection is empty, or the caller belongs to no team, the result is empty.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Label filters (exact match).
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Sort field of the incident list; only `created_at` (incident creation time, the default). Used by `/insight/incident/list` and `/insight/incident/export`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Substring match on the incident title (SQL `LIKE %query%`).
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by responder member IDs. Used by `/insight/responder` (which responders to return) and the incident list/export (incidents any of them responded to); ignored by the account/team/channel and top-K endpoints. At most 100 entries.
ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
// Lower bound (inclusive) on time-to-acknowledge, in seconds.
SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"seconds_to_ack_from,omitempty"`
// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty" toon:"seconds_to_ack_to,omitempty"`
// Lower bound (inclusive) on time-to-close, in seconds.
SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"seconds_to_close_from,omitempty"`
// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty" toon:"seconds_to_close_to,omitempty"`
// Filter by severity: `Critical`, `Warning`, `Info`, or `Ok`. At most 3 entries.
Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
// Start time, Unix seconds. Must be greater than 0.
StartTime int64 `json:"start_time" toon:"start_time"`
// Filter by team IDs. At most 100 entries.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
// IANA time zone (for example `Asia/Shanghai` or `UTC`) used to cut `aggregate_unit` buckets; abbreviations such as `EST` and `Etc/GMT±N` are rejected. Defaults to UTC. `/insight/incident/export` uses it to render times, falling back to the account time zone and then `Asia/Shanghai`.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
InsightIncidentListRequest is generated from the Flashduty OpenAPI schema.
type InsightIncidentListResponse ¶
type InsightIncidentListResponse struct {
// Whether another page of results is available.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Incidents on this page; an empty array when none match.
Items []IncidentRawItem `json:"items" toon:"items"`
// Cursor token to fetch the next page — the incident ID of the last row on this page. Present only when `has_next_page` is true.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Number of matching incidents. When the request carried `search_after_ctx`, only incidents after the cursor are counted.
Total int64 `json:"total" toon:"total"`
}
InsightIncidentListResponse is generated from the Flashduty OpenAPI schema.
type InsightQueryRequest ¶
type InsightQueryRequest struct {
// Split the range into time buckets; omit for a single bucket covering the whole range. Requires a range of at least 24 hours, and `day` allows at most 31 days.
// - `day`: calendar days in `time_zone` (the first bucket runs from `start_time` to the next midnight).
// - `week`: consecutive 7-day buckets starting at `start_time` (not aligned to Monday).
// - `month`: calendar months in `time_zone` (the first bucket runs from `start_time` to the 1st of the next month).
AggregateUnit string `json:"aggregate_unit,omitempty" toon:"aggregate_unit,omitempty"`
// Sort ascending when `true`, descending (default) otherwise. Used by the incident list and export; `/insight/alert/topk-by-label` has its own `asc`.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by channel IDs. At most 100 entries.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Strip HTML markup from the description column when exporting.
DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
// End time, Unix seconds. Must be greater than `start_time`.
EndTime int64 `json:"end_time" toon:"end_time"`
// CSV column keys to include in the export, in the given order; unknown or duplicate keys are rejected. The valid key set differs per export endpoint — see each export operation's description. Only used by the export endpoints; at most 50 entries.
ExportFields []string `json:"export_fields,omitempty" toon:"export_fields,omitempty"`
// Custom-field filters (exact match).
Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
// Filter by incident IDs (24-character hex). Used only by the incident list and export. At most 100 entries.
IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
// Include incidents that have ever been muted. By default, they are excluded.
IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,omitempty"`
// Restrict results to the caller's teams (intersected with `team_ids` when both are set). When that intersection is empty, or the caller belongs to no team, the result is empty.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Label filters (exact match).
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Sort field of the incident list; only `created_at` (incident creation time, the default). Used by `/insight/incident/list` and `/insight/incident/export`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Substring match on the incident title (SQL `LIKE %query%`).
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by responder member IDs. Used by `/insight/responder` (which responders to return) and the incident list/export (incidents any of them responded to); ignored by the account/team/channel and top-K endpoints. At most 100 entries.
ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
// Lower bound (inclusive) on time-to-acknowledge, in seconds.
SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"seconds_to_ack_from,omitempty"`
// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty" toon:"seconds_to_ack_to,omitempty"`
// Lower bound (inclusive) on time-to-close, in seconds.
SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"seconds_to_close_from,omitempty"`
// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty" toon:"seconds_to_close_to,omitempty"`
// Filter by severity: `Critical`, `Warning`, `Info`, or `Ok`. At most 3 entries.
Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
// When `true`, each bucket is further split into `work`, `sleep` and `off` hours, returned as separate rows with `hours` set.
SplitHours bool `json:"split_hours,omitempty" toon:"split_hours,omitempty"`
// Start time, Unix seconds. Must be greater than 0.
StartTime int64 `json:"start_time" toon:"start_time"`
// Filter by team IDs. At most 100 entries.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
// IANA time zone (for example `Asia/Shanghai` or `UTC`) used to cut `aggregate_unit` buckets; abbreviations such as `EST` and `Etc/GMT±N` are rejected. Defaults to UTC. `/insight/incident/export` uses it to render times, falling back to the account time zone and then `Asia/Shanghai`.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
InsightQueryRequest is generated from the Flashduty OpenAPI schema.
type InsightTopkAlertByLabelRequest ¶
type InsightTopkAlertByLabelRequest struct {
// Split the range into time buckets; omit for a single bucket covering the whole range. Requires a range of at least 24 hours, and `day` allows at most 31 days.
// - `day`: calendar days in `time_zone` (the first bucket runs from `start_time` to the next midnight).
// - `week`: consecutive 7-day buckets starting at `start_time` (not aligned to Monday).
// - `month`: calendar months in `time_zone` (the first bucket runs from `start_time` to the 1st of the next month).
AggregateUnit string `json:"aggregate_unit,omitempty" toon:"aggregate_unit,omitempty"`
// Sort ascending when `true`, descending otherwise.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by channel IDs. At most 100 entries.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Strip HTML markup from the description column when exporting.
DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
// End time, Unix seconds. Must be greater than `start_time`.
EndTime int64 `json:"end_time" toon:"end_time"`
// CSV column keys to include in the export, in the given order; unknown or duplicate keys are rejected. The valid key set differs per export endpoint — see each export operation's description. Only used by the export endpoints; at most 50 entries.
ExportFields []string `json:"export_fields,omitempty" toon:"export_fields,omitempty"`
// Custom-field filters (exact match).
Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
// Filter by incident IDs (24-character hex). Used only by the incident list and export. At most 100 entries.
IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
// Include incidents that have ever been muted. By default, they are excluded.
IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,omitempty"`
// Restrict results to the caller's teams (intersected with `team_ids` when both are set). When that intersection is empty, or the caller belongs to no team, the result is empty.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Number of label values to return, between 1 and 100 (default 20). With `split_hours`, applied per hour bucket.
K int64 `json:"k,omitempty" toon:"k,omitempty"`
// Aggregation dimension. `check` aggregates by the event's `labels.check` label (monitoring check); `resource` aggregates by the `labels.resource` label (monitored resource identifier).
Label string `json:"label" toon:"label"`
// Label filters (exact match).
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Sort field. `total_alert_cnt` sorts by alert count; `total_alert_event_cnt` sorts by raw alert event count (default).
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Substring match on the incident title (SQL `LIKE %query%`).
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by responder member IDs. Used by `/insight/responder` (which responders to return) and the incident list/export (incidents any of them responded to); ignored by the account/team/channel and top-K endpoints. At most 100 entries.
ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
// Lower bound (inclusive) on time-to-acknowledge, in seconds.
SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"seconds_to_ack_from,omitempty"`
// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty" toon:"seconds_to_ack_to,omitempty"`
// Lower bound (inclusive) on time-to-close, in seconds.
SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"seconds_to_close_from,omitempty"`
// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set: the incident list and export reject such a range with `InvalidParameter`, and other endpoints return an empty result.
SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty" toon:"seconds_to_close_to,omitempty"`
// Filter by severity: `Critical`, `Warning`, `Info`, or `Ok`. At most 3 entries.
Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
// When `true`, each bucket is further split into `work`, `sleep` and `off` hours, returned as separate rows with `hours` set.
SplitHours bool `json:"split_hours,omitempty" toon:"split_hours,omitempty"`
// Start time, Unix seconds. Must be greater than 0.
StartTime int64 `json:"start_time" toon:"start_time"`
// Filter by team IDs. At most 100 entries.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
// IANA time zone (for example `Asia/Shanghai` or `UTC`) used to cut `aggregate_unit` buckets; abbreviations such as `EST` and `Etc/GMT±N` are rejected. Defaults to UTC. `/insight/incident/export` uses it to render times, falling back to the account time zone and then `Asia/Shanghai`.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
InsightTopkAlertByLabelRequest is generated from the Flashduty OpenAPI schema.
type IntegrationDetail ¶ added in v0.15.9
type IntegrationDetail struct {
// Category the integration belongs to: `event.alert` alert events, `event.change` change events, `im` IM bots, `webhook` custom webhooks.
Category string `json:"category" toon:"category"`
// Unix timestamp in seconds when the integration was created.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the member who created the integration.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Free-form description.
Description string `json:"description" toon:"description"`
// Whether the current caller passes the integration object-permission check; write calls also require Integrations Manage.
Editable bool `json:"editable" toon:"editable"`
// Integration ID; pass it as `integration_id` to the other `/integration/*` endpoints.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Decrypted integration key for inbound pushes. Empty when no key is stored; distinct from the account `app_key`.
IntegrationKey string `json:"integration_key" toon:"integration_key"`
// Unix timestamp in seconds of the most recent event received from the upstream tool, including events dropped before they became alerts. `0` when none has arrived yet.
LastSourceTime Timestamp `json:"last_source_time" toon:"last_source_time"`
// Unix timestamp in seconds of the most recent event received. `0` when no event has arrived yet.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Integration name.
Name string `json:"name" toon:"name"`
// Read-only flag. When true, the public APIs do not allow changes to this integration.
NoEditable bool `json:"no_editable" toon:"no_editable"`
// Internal integration type ID; use `plugin_type`, not this ID, when creating an integration.
PluginID int64 `json:"plugin_id" toon:"plugin_id"`
// Integration type, for example `standard.alert` or `zabbix.alert`.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Display name of the integration type, in the language of the request.
PluginTypeName string `json:"plugin_type_name" toon:"plugin_type_name"`
// Source reference ID, normally `a_<account_id>` for an account-level integration; legacy `w_` references may also exist. Channel-owned `c_` integrations are excluded.
RefID string `json:"ref_id" toon:"ref_id"`
// Stored type-specific configuration. Each saved secret (passwords, app secrets, tokens, encryption keys, webhook endpoints, HTTP pull URL and body, headers, custom bodies) is returned as `******`; unset values stay empty.
Settings map[string]any `json:"settings" toon:"settings"`
// Lifecycle status: `enabled` while the integration accepts events, `disabled` when it is paused.
Status string `json:"status" toon:"status"`
// ID of the team that owns the integration. `0` when it is not assigned to a team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Plugin test result, returned only when a test is performed.
Test *IntegrationDetailTest `json:"test,omitempty" toon:"test,omitempty"`
// Unix timestamp in seconds when the integration was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the member who last updated the integration.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
IntegrationDetail is generated from the Flashduty OpenAPI schema.
type IntegrationDetailTest ¶ added in v0.15.15
type IntegrationDetailTest struct {
// Test failure message; empty on success.
Message string `json:"message" toon:"message"`
// Whether the plugin test succeeded.
Success bool `json:"success" toon:"success"`
}
IntegrationDetailTest is generated from the Flashduty OpenAPI schema.
type IntegrationItem ¶ added in v0.15.9
type IntegrationItem struct {
// ID of the account that owns the integration.
AccountID int64 `json:"account_id" toon:"account_id"`
// Category the integration belongs to: `event.alert` alert events, `event.change` change events, `im` IM bots, `webhook` custom webhooks.
Category string `json:"category" toon:"category"`
// Unix timestamp in seconds when the integration was created.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the member who created the integration.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Legacy datasource ID, equal to `integration_id`.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Free-form description.
Description string `json:"description" toon:"description"`
// Whether the current caller passes the integration object-permission check; write calls also require Integrations Manage.
Editable bool `json:"editable" toon:"editable"`
// Legacy compatibility field; `0` for items returned by this public-integration list.
ExclusiveDataSourceID int64 `json:"exclusive_data_source_id" toon:"exclusive_data_source_id"`
// Integration ID; pass it as `integration_id` to the other `/integration/*` endpoints.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Decrypted integration key for inbound pushes. Empty when no key is stored; distinct from the account `app_key`.
IntegrationKey string `json:"integration_key" toon:"integration_key"`
// Unix timestamp in seconds of the most recent event received from the upstream tool, including events dropped before they became alerts. `0` when none has arrived yet.
LastSourceTime Timestamp `json:"last_source_time" toon:"last_source_time"`
// Unix timestamp in seconds of the most recent event received. `0` when no event has arrived yet.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Integration name.
Name string `json:"name" toon:"name"`
// Read-only flag. When true, the public APIs do not allow changes to this integration.
NoEditable bool `json:"no_editable" toon:"no_editable"`
// Internal integration type ID; use `plugin_type`, not this ID, when creating an integration.
PluginID int64 `json:"plugin_id" toon:"plugin_id"`
// Integration type, for example `standard.alert` or `zabbix.alert`.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Display name of the integration type, in the language of the request.
PluginTypeName string `json:"plugin_type_name" toon:"plugin_type_name"`
// Source reference ID, normally `a_<account_id>` for an account-level integration; legacy `w_` references may also exist. Channel-owned `c_` integrations are excluded.
RefID string `json:"ref_id" toon:"ref_id"`
// Stored type-specific configuration. Each saved secret (passwords, app secrets, tokens, encryption keys, webhook endpoints, HTTP pull URL and body, headers, custom bodies) is returned as `******`; unset values stay empty.
Settings map[string]any `json:"settings" toon:"settings"`
// Lifecycle status: `enabled` while the integration accepts events, `disabled` when it is paused.
Status string `json:"status" toon:"status"`
// ID of the team that owns the integration. `0` when it is not assigned to a team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Unix timestamp in seconds when the integration was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the member who last updated the integration.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
IntegrationItem is generated from the Flashduty OpenAPI schema.
type IntegrationLifecycleRequest ¶ added in v0.15.9
type IntegrationLifecycleRequest struct {
// ID of a public integration, returned by `POST /integration/list`. An unknown ID or a channel-owned integration returns `ResourceNotFound`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
IntegrationLifecycleRequest is generated from the Flashduty OpenAPI schema.
type IntegrationTypeItem ¶ added in v0.15.9
type IntegrationTypeItem struct {
// Category the type belongs to: `event.alert` alert events, `event.change` change events, `im` IM bots, `webhook` custom webhooks.
Category string `json:"category" toon:"category"`
// Type key to pass as `plugin_type` when creating an integration, for example `standard.alert`, `prometheus.alert`, `zabbix.alert` or `feishu`. The set grows as integrations are added; this endpoint returns the full list.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Logo URL of the type.
PluginTypeLogoURL string `json:"plugin_type_logo_url" toon:"plugin_type_logo_url"`
// Display name of the type.
PluginTypeName string `json:"plugin_type_name" toon:"plugin_type_name"`
// Platform status of the type: `enabled` types can be used; `disabled` types are switched off platform-wide and `POST /integration/create` or `POST /integration/update` returns `InvalidParameter` for them.
Status string `json:"status" toon:"status"`
// Whether `POST /integration/create` accepts this type.
SupportsAPICreate bool `json:"supports_api_create" toon:"supports_api_create"`
}
IntegrationTypeItem is generated from the Flashduty OpenAPI schema.
type IntegrationTypeListRequest ¶ added in v0.15.9
type IntegrationTypeListRequest struct {
ListOptions
// Sort ascending when `true` (the default); descending when `false`.
Asc *bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Comma-separated category filter. Values: `event.alert` (alert events), `event.change` (change events), `im` (IM bots), `webhook` (custom webhooks). Unknown values are not rejected and match nothing.
Category string `json:"category,omitempty" toon:"category,omitempty"`
// Sort field. When omitted, types are returned in console ranking order.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
}
IntegrationTypeListRequest is generated from the Flashduty OpenAPI schema.
type IntegrationsService ¶
type IntegrationsService service
IntegrationsService handles the "On-call/Integrations" API resource.
func (*IntegrationsService) AlertReadEmailPreview ¶ added in v0.16.0
func (s *IntegrationsService) AlertReadEmailPreview(ctx context.Context, req *AlertEmailPreviewRequest) (*AlertEmailPreviewResponse, *Response, error)
Preview email-to-alert conversion.
Run unsaved email integration settings over one email, the way ingestion would.
API: POST /alert/email/preview (alert-read-email-preview).
func (*IntegrationsService) DatasourceImPersonTryLink ¶ added in v0.5.4
func (s *IntegrationsService) DatasourceImPersonTryLink(ctx context.Context, req *TryLinkPersonRequest) (*TryLinkPersonResponse, *Response, error)
Attempt IM person linking.
Try to automatically link unbound members to their IM accounts for one integration.
API: POST /datasource/im/person/try-link (datasourceImPersonTryLink).
func (*IntegrationsService) Detail ¶
func (s *IntegrationsService) Detail(ctx context.Context, req *GetWebhookHistoryDetailRequest) (*WebhookHistoryDetail, *Response, error)
Get webhook delivery detail.
Retrieve the detailed payload and response for a specific webhook delivery attempt.
API: POST /webhook/history/detail (webhookHistoryDetail).
func (*IntegrationsService) IntegrationAPIReadInfo ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIReadInfo(ctx context.Context, req *GetIntegrationRequest) (*IntegrationDetail, *Response, error)
Get public integration detail.
Get a public integration with its stored settings and decrypted integration key.
API: POST /integration/info (integration-api-read-info).
func (*IntegrationsService) IntegrationAPIReadList ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIReadList(ctx context.Context, req *ListIntegrationsRequest) (*ListIntegrationsResponse, *Response, error)
List public integrations.
List public integrations with their stored settings, decrypted keys, and edit permissions.
API: POST /integration/list (integration-api-read-list).
func (*IntegrationsService) IntegrationAPIReadTypeList ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIReadTypeList(ctx context.Context, req *IntegrationTypeListRequest) (*ListIntegrationTypesResponse, *Response, error)
List integration types.
List the integration types the account can configure.
API: POST /integration/type/list (integration-api-read-type-list).
func (*IntegrationsService) IntegrationAPIWriteCreate ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIWriteCreate(ctx context.Context, req *CreateIntegrationRequest) (*CreateIntegrationResponse, *Response, error)
Create public integration.
Create a public integration for a supported alert, change, IM, or webhook type.
API: POST /integration/create (integration-api-write-create).
func (*IntegrationsService) IntegrationAPIWriteDelete ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIWriteDelete(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error)
Delete public integration.
Delete an integration that nothing else references.
API: POST /integration/delete (integration-api-write-delete).
func (*IntegrationsService) IntegrationAPIWriteDisable ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIWriteDisable(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error)
Disable public integration.
Disable an integration without deleting its configuration.
API: POST /integration/disable (integration-api-write-disable).
func (*IntegrationsService) IntegrationAPIWriteEnable ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIWriteEnable(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error)
Enable public integration.
Re-enable a disabled integration so it accepts events again.
API: POST /integration/enable (integration-api-write-enable).
func (*IntegrationsService) IntegrationAPIWriteRotateKey ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIWriteRotateKey(ctx context.Context, req *IntegrationLifecycleRequest) (*RotateIntegrationKeyResponse, *Response, error)
Rotate public integration key.
Issue a new integration key and invalidate the previous one.
API: POST /integration/key/rotate (integration-api-write-rotate-key).
func (*IntegrationsService) IntegrationAPIWriteUpdate ¶ added in v0.15.9
func (s *IntegrationsService) IntegrationAPIWriteUpdate(ctx context.Context, req *UpdateIntegrationRequest) (*IntegrationDetail, *Response, error)
Update public integration.
Update an integration's name, description, team, or settings.
API: POST /integration/update (integration-api-write-update).
func (*IntegrationsService) List ¶
func (s *IntegrationsService) List(ctx context.Context, req *ListWebhookHistoryRequest) (*ListWebhookHistoryResponse, *Response, error)
List webhook delivery history.
List the delivery history for outbound webhook notifications.
API: POST /webhook/history/list (webhookHistoryList).
type InvestigationTarget ¶ added in v0.15.2
type InvestigationTarget struct {
// Configuration for the `dashboard` kind; required when `kind` is `dashboard`.
Dashboard DashboardInvestigationTarget `json:"dashboard,omitzero" toon:"dashboard,omitempty"`
// Entry kind: `dashboard` opens a dashboard panel, `query` opens an Explore query. It decides whether `dashboard` or `query` must be supplied; supplying the other one is rejected.
Kind string `json:"kind" toon:"kind"`
// One-sentence plain text explaining what this entry helps confirm during investigation. Literal text, not a template, and not part of the alert identity. At most 512 bytes; control characters are rejected.
Purpose string `json:"purpose,omitempty" toon:"purpose,omitempty"`
// Configuration for the `query` kind; required when `kind` is `query`, and rejected when `kind` is `dashboard`.
Query QueryInvestigationTarget `json:"query,omitzero" toon:"query,omitempty"`
// Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor.
TimeRange InvestigationTimeRange `json:"time_range" toon:"time_range"`
}
InvestigationTarget is generated from the Flashduty OpenAPI schema.
type InvestigationTimeRange ¶ added in v0.15.4
type InvestigationTimeRange struct {
// Seconds to look forward from the event time, so behaviour after the event stays visible.
AfterSeconds int64 `json:"after_seconds" toon:"after_seconds"`
// Seconds to look back from the event time.
BeforeSeconds int64 `json:"before_seconds" toon:"before_seconds"`
}
InvestigationTimeRange is generated from the Flashduty OpenAPI schema.
type InviteMemberItem ¶
type InviteMemberItem struct {
// ISO 3166-1 alpha-2 region code for `phone` (e.g. "CN"). Validated and normalized to upper case before storage; invalid values are rejected with a 400. Also the parsing hint when `phone` has no "+" prefix (defaults to "CN").
CountryCode string `json:"country_code,omitempty" toon:"country_code,omitempty"`
// Email address, stored in lower case. Required when `phone` is not provided.
Email string `json:"email,omitempty" toon:"email,omitempty"`
// Locale: `zh-CN` (Simplified Chinese) or `en-US` (English); other values are rejected with a 400. Defaults to the account's locale when omitted.
Locale string `json:"locale,omitempty" toon:"locale,omitempty"`
// Display name, 2–39 characters. Required when `email` is not provided; derived from the email prefix when omitted.
MemberName string `json:"member_name,omitempty" toon:"member_name,omitempty"`
// Phone number. Required when `email` is not provided.
Phone string `json:"phone,omitempty" toon:"phone,omitempty"`
// External reference ID (for example an employee ID in an HR system), usable later as a lookup key in `POST /member/delete` and `POST /member/info/reset`.
RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
// Role IDs to assign: built-in `2` (Admin), `6` (Responder), `8` (Viewer), or custom role IDs from `POST /role/list`. Defaults to Viewer (`8`) when omitted; an ID that does not exist returns `400`.
RoleIDs []uint64 `json:"role_ids,omitempty" toon:"role_ids,omitempty"`
// Schedule to add the member to after the member is created or accepts the invitation. The join runs as the caller; if the caller cannot edit the schedule, the schedule is deleted, or it has no joinable layer, the invitation still succeeds but the member is not added. Omit it to invite without a schedule.
ScheduleID uint64 `json:"schedule_id,omitempty" toon:"schedule_id,omitempty"`
// IANA time zone name such as `Asia/Shanghai`. Omit it to have the member follow the account's time zone; an invalid name returns `400`.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
InviteMemberItem is generated from the Flashduty OpenAPI schema.
type IssuePresetSeverityRulesService ¶ added in v0.10.0
type IssuePresetSeverityRulesService service
IssuePresetSeverityRulesService handles the "RUM/Issue preset severity rules" API resource.
func (*IssuePresetSeverityRulesService) Create ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) Create(ctx context.Context, req *RUMPresetSeverityRuleCreateRequest) (*RUMPresetSeverityRuleCreateResponse, *Response, error)
Create preset severity rule.
Create a new preset severity rule for a RUM application.
API: POST /rum/issue/preset-severity/rules/create (rum-issue-preset-severity-rules-create).
func (*IssuePresetSeverityRulesService) Delete ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) Delete(ctx context.Context, req *RUMPresetSeverityRuleIDRequest) (*Response, error)
Delete preset severity rule.
Delete a preset severity rule.
API: POST /rum/issue/preset-severity/rules/delete (rum-issue-preset-severity-rules-delete).
func (*IssuePresetSeverityRulesService) Disable ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) Disable(ctx context.Context, req *RUMPresetSeverityRuleIDRequest) (*Response, error)
Disable preset severity rule.
Disable a preset severity rule.
API: POST /rum/issue/preset-severity/rules/disable (rum-issue-preset-severity-rules-disable).
func (*IssuePresetSeverityRulesService) Enable ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) Enable(ctx context.Context, req *RUMPresetSeverityRuleIDRequest) (*Response, error)
Enable preset severity rule.
Enable a preset severity rule.
API: POST /rum/issue/preset-severity/rules/enable (rum-issue-preset-severity-rules-enable).
func (*IssuePresetSeverityRulesService) HistoryList ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) HistoryList(ctx context.Context, req *RUMPresetSeverityRuleHistoryListRequest) (*RUMPresetSeverityRuleHistoryListResponse, *Response, error)
List preset severity rule history.
Return the change history of preset severity rules for a RUM application.
API: POST /rum/issue/preset-severity/rules/history/list (rum-issue-preset-severity-rules-history-list).
func (*IssuePresetSeverityRulesService) HistoryRevert ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) HistoryRevert(ctx context.Context, req *RUMPresetSeverityRuleHistoryRevertRequest) (*Response, error)
Revert preset severity rules to a history snapshot.
Roll back preset severity rules to the state captured in a specific history snapshot.
API: POST /rum/issue/preset-severity/rules/history/revert (rum-issue-preset-severity-rules-history-revert).
func (*IssuePresetSeverityRulesService) List ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) List(ctx context.Context, req *RUMPresetSeverityRuleListRequest) (*RUMPresetSeverityRuleListResponse, *Response, error)
List preset severity rules.
Return all preset severity rules configured for a RUM application.
API: POST /rum/issue/preset-severity/rules/list (rum-issue-preset-severity-rules-list).
func (*IssuePresetSeverityRulesService) Reorder ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) Reorder(ctx context.Context, req *RUMPresetSeverityRuleReorderRequest) (*Response, error)
Reorder preset severity rule.
Move one preset severity rule to another rule's position in evaluation order.
API: POST /rum/issue/preset-severity/rules/reorder (rum-issue-preset-severity-rules-reorder).
func (*IssuePresetSeverityRulesService) Update ¶ added in v0.10.0
func (s *IssuePresetSeverityRulesService) Update(ctx context.Context, req *RUMPresetSeverityRuleUpdateRequest) (*Response, error)
Update preset severity rule.
Update the name, description, filters, or severity of a preset severity rule.
API: POST /rum/issue/preset-severity/rules/update (rum-issue-preset-severity-rules-update).
type IssuesService ¶
type IssuesService service
IssuesService handles the "RUM/Issues" API resource.
func (*IssuesService) ReadExport ¶ added in v0.14.4
func (s *IssuesService) ReadExport(ctx context.Context, req *RUMIssueExportRequest) (*Response, error)
Export issues as CSV.
Export the issues matching the `POST /rum/issue/list` filters as a CSV file of at most 100 rows.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: POST /rum/issue/export (rum-issue-read-export).
func (*IssuesService) ReadInfo ¶
func (s *IssuesService) ReadInfo(ctx context.Context, req *RUMIssueIDRequest) (*RUMIssueItem, *Response, error)
Get issue detail.
Retrieve full details of a single issue by `issue_id`.
API: POST /rum/issue/info (rum-issue-read-info).
func (*IssuesService) ReadList ¶
func (s *IssuesService) ReadList(ctx context.Context, req *RUMIssueListRequest) (*RUMIssueListResponse, *Response, error)
List issues.
Return a paginated list of RUM error tracking issues matching the given filters.
API: POST /rum/issue/list (rum-issue-read-list).
func (*IssuesService) WriteUpdate ¶
func (s *IssuesService) WriteUpdate(ctx context.Context, req *RUMIssueUpdateRequest) (*Response, error)
Update issue.
Update the status or suspected cause of an issue.
API: POST /rum/issue/update (rum-issue-write-update).
type KnowledgeFileDeleteRequest ¶ added in v0.12.0
type KnowledgeFileDeleteRequest struct {
// Optimistic-concurrency guard. `0` or omitted: delete unconditionally. A positive value: delete only if the knowledge's current `version` equals it; otherwise nothing is deleted and the call returns HTTP 200 with `status` = `conflict` and the current `version`.
ExpectedVersion int64 `json:"expected_version,omitempty" toon:"expected_version,omitempty"`
// Delete even when other knowledge files reference this file; the referrers are then returned as warnings instead of blocking the delete.
Force bool `json:"force,omitempty" toon:"force,omitempty"`
// Knowledge ID; defaults to the caller's account-scope knowledge.
PackID string `json:"pack_id,omitempty" toon:"pack_id,omitempty"`
// Path of the file relative to the knowledge root. Same path rules as `POST /safari/knowledge/file/put`.
RelPath string `json:"rel_path" toon:"rel_path"`
}
KnowledgeFileDeleteRequest is generated from the Flashduty OpenAPI schema.
type KnowledgeFileDeleteResponse ¶ added in v0.12.0
type KnowledgeFileDeleteResponse struct {
// Explanation of the conflict. Present only when `status` is `conflict`.
Message string `json:"message" toon:"message"`
// Outcome of the delete.
// - `ok`: the file was deleted, or did not exist.
// - `conflict`: `expected_version` did not match the current knowledge version, so nothing was deleted.
Status string `json:"status" toon:"status"`
// Knowledge `version` after the delete (unchanged if the file did not exist). When the file did not exist and `expected_version` was not sent, this is `0`. On `conflict`, the current version.
Version int64 `json:"version" toon:"version"`
// Non-blocking warnings; `still_referenced_by` means `force` deleted a file that other files still reference (`refs` lists them). Omitted when there are no warnings.
Warnings []KnowledgeWarning `json:"warnings" toon:"warnings"`
}
KnowledgeFileDeleteResponse is generated from the Flashduty OpenAPI schema.
type KnowledgeFileGetRequest ¶ added in v0.12.0
type KnowledgeFileGetRequest struct {
// Knowledge ID; defaults to the caller's account-scope knowledge.
PackID string `json:"pack_id,omitempty" toon:"pack_id,omitempty"`
// Path of the file relative to the knowledge root. If no file exists at this path, the call still succeeds with `file` set to `null` and an empty `content_b64`.
RelPath string `json:"rel_path" toon:"rel_path"`
}
KnowledgeFileGetRequest is generated from the Flashduty OpenAPI schema.
type KnowledgeFileGetResponse ¶ added in v0.12.0
type KnowledgeFileGetResponse struct {
// Base64-encoded file content. Empty string when the file does not exist (or is empty).
ContentB64 string `json:"content_b64" toon:"content_b64"`
// Metadata of the file; `null` when no file exists at `rel_path`.
File *KnowledgeFileItem `json:"file" toon:"file"`
// Current `version` of the knowledge. Pass it as `expected_version` to `POST /safari/knowledge/file/put` or `POST /safari/knowledge/file/delete` to reject the write if someone else changed the knowledge in between.
Version int64 `json:"version" toon:"version"`
}
KnowledgeFileGetResponse is generated from the Flashduty OpenAPI schema.
type KnowledgeFileItem ¶ added in v0.12.0
type KnowledgeFileItem struct {
// SHA-256 hex digest of the file content.
Checksum string `json:"checksum" toon:"checksum"`
// MIME type stored with the file. Open set: when `content_type` is omitted on write it is derived from the extension of `rel_path` — `.md` → `text/markdown`, `.yaml`/`.yml` → `text/yaml`, `.json` → `application/json`, `.sh` → `text/x-sh`, anything else → `text/plain`; a value passed explicitly is stored as given.
ContentType string `json:"content_type" toon:"content_type"`
// File ID (`kfl_` prefix).
FileID string `json:"file_id" toon:"file_id"`
// ID of the knowledge that contains the file.
PackID string `json:"pack_id" toon:"pack_id"`
// Path relative to the knowledge root, using `/` separators, e.g. `runbooks/restart.md`. Unique within the knowledge.
RelPath string `json:"rel_path" toon:"rel_path"`
// File size in bytes.
SizeBytes int64 `json:"size_bytes" toon:"size_bytes"`
// Unix timestamp in milliseconds when the file was last modified.
UpdatedAtMs TimestampMilli `json:"updated_at_ms" toon:"updated_at_ms"`
// Person ID of the member who last modified the file.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
KnowledgeFileItem is generated from the Flashduty OpenAPI schema.
type KnowledgeFileListRequest ¶ added in v0.12.0
type KnowledgeFileListRequest struct {
ListOptions
// Knowledge ID; defaults to the caller's account-scope knowledge.
PackID string `json:"pack_id,omitempty" toon:"pack_id,omitempty"`
}
KnowledgeFileListRequest is generated from the Flashduty OpenAPI schema.
type KnowledgeFileListResponse ¶ added in v0.12.0
type KnowledgeFileListResponse struct {
// Array of files in the specified knowledge; empty array when it has no files.
Files []KnowledgeFileItem `json:"files" toon:"files"`
// Number of files in `files` — always the full file count of the knowledge, since this endpoint does not paginate.
Total int64 `json:"total" toon:"total"`
// Current `version` of the knowledge; usable as `expected_version` for file writes.
Version int64 `json:"version" toon:"version"`
}
KnowledgeFileListResponse is generated from the Flashduty OpenAPI schema.
type KnowledgeFilePutRequest ¶ added in v0.12.0
type KnowledgeFilePutRequest struct {
// Base64-encoded (standard alphabet) file content. The decoded bytes must be UTF-8 text with no NUL bytes and at most 1 MiB (`DUTY.md`: at most 32 KiB). Omit or send an empty string to write an empty file.
ContentB64 string `json:"content_b64,omitempty" toon:"content_b64,omitempty"`
// MIME type to store with the file. Optional: when omitted it is derived from the extension of `rel_path` (`.md` → `text/markdown`, `.yaml`/`.yml` → `text/yaml`, `.json` → `application/json`, `.sh` → `text/x-sh`, otherwise `text/plain`). Any value passed is stored as given.
ContentType string `json:"content_type,omitempty" toon:"content_type,omitempty"`
// Optimistic-concurrency guard. `0` or omitted: write unconditionally. A positive value: write only if the knowledge's current `version` equals it; otherwise nothing is written and the call returns HTTP 200 with `status` = `conflict` and the current `version`.
ExpectedVersion int64 `json:"expected_version,omitempty" toon:"expected_version,omitempty"`
// Knowledge ID; defaults to the caller's account-scope knowledge.
PackID string `json:"pack_id,omitempty" toon:"pack_id,omitempty"`
// Destination path relative to the knowledge root; an existing file at this path is overwritten. Must use `/` separators, must not start with `/`, must already be in normalized form, and no segment may be empty, `.`, `..`, or start with `.` (dotfiles are rejected).
RelPath string `json:"rel_path" toon:"rel_path"`
}
KnowledgeFilePutRequest is generated from the Flashduty OpenAPI schema.
type KnowledgeFilePutResponse ¶ added in v0.12.0
type KnowledgeFilePutResponse struct {
// The file as stored after the write. Omitted when `status` is `conflict`.
File KnowledgeFileItem `json:"file" toon:"file"`
// Explanation of the conflict (`this knowledge was updated by someone else`). Present only when `status` is `conflict`.
Message string `json:"message" toon:"message"`
// Outcome of the write.
// - `ok`: the change was committed.
// - `conflict`: `expected_version` did not match the current knowledge version, so nothing was changed; re-read the file and retry with the returned `version`.
Status string `json:"status" toon:"status"`
// Knowledge `version` produced by this write when `status` is `ok`; the current version when `status` is `conflict`. Use it as `expected_version` for the next write.
Version int64 `json:"version" toon:"version"`
// Non-blocking warnings; `unresolved_reference` means an @ref in the written content points to a path that does not exist in the knowledge. Omitted when there are no warnings.
Warnings []KnowledgeWarning `json:"warnings" toon:"warnings"`
}
KnowledgeFilePutResponse is generated from the Flashduty OpenAPI schema.
type KnowledgeGetRequest ¶ added in v0.12.0
type KnowledgeGetRequest struct{}
KnowledgeGetRequest is generated from the Flashduty OpenAPI schema.
type KnowledgeGetResponse ¶ added in v0.12.0
type KnowledgeGetResponse struct {
// Array of files in this knowledge; empty array when it has no files.
Files []KnowledgeFileItem `json:"files" toon:"files"`
Pack KnowledgePackItem `json:"pack" toon:"pack"`
}
KnowledgeGetResponse is generated from the Flashduty OpenAPI schema.
type KnowledgePackDeleteRequest ¶ added in v0.12.0
type KnowledgePackDeleteRequest struct {
// Knowledge ID to delete.
PackID string `json:"pack_id" toon:"pack_id"`
}
KnowledgePackDeleteRequest is generated from the Flashduty OpenAPI schema.
type KnowledgePackDeleteResponse ¶ added in v0.12.0
type KnowledgePackDeleteResponse struct {
// Always `true` on success; a failed delete returns an error instead.
OK bool `json:"ok" toon:"ok"`
}
KnowledgePackDeleteResponse is generated from the Flashduty OpenAPI schema.
type KnowledgePackEnsureRequest ¶ added in v0.12.0
type KnowledgePackEnsureRequest struct {
// Scope of the knowledge to ensure.
// - `account`: the account knowledge. `scope_id` is replaced by the caller's account ID; only the account owner and admins may call this, even when the knowledge already exists. If the knowledge has no `DUTY.md`, a default one is written.
// - `team`: the knowledge of the team in `scope_id`. `scope_id` is required and the caller must be a member of that team.
Scope string `json:"scope" toon:"scope"`
// Team ID. Required (non-zero) for `team` scope, otherwise the request fails with `InvalidParameter`; ignored for `account` scope.
ScopeID int64 `json:"scope_id,omitempty" toon:"scope_id,omitempty"`
}
KnowledgePackEnsureRequest is generated from the Flashduty OpenAPI schema.
type KnowledgePackItem ¶ added in v0.12.0
type KnowledgePackItem struct {
// Account that owns the knowledge.
AccountID int64 `json:"account_id" toon:"account_id"`
// Whether the caller can change this knowledge and its files: for `account` scope, `true` only for the account owner and admins; for `team` scope, `true` only when the caller is a member of that team (owners and admins are not exempt).
CanEdit bool `json:"can_edit" toon:"can_edit"`
// Unix timestamp in milliseconds when the knowledge was created.
CreatedAtMs TimestampMilli `json:"created_at_ms" toon:"created_at_ms"`
// Person ID of the member whose request created the knowledge. Account knowledge is created automatically by the first request that needs it, so this can be any member of the account.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// The `version` at which `DUTY.md` was last written. Writing `DUTY.md` sets it to the new `version`; when `version` is greater, files were added, changed or deleted after `DUTY.md` was last updated, so `DUTY.md` may no longer index every file.
DutyVersion int64 `json:"duty_version" toon:"duty_version"`
// Number of files currently in the knowledge.
FileCount int64 `json:"file_count" toon:"file_count"`
// Knowledge ID (`kpk_` prefix).
PackID string `json:"pack_id" toon:"pack_id"`
// Knowledge scope.
// - `account`: account-level knowledge shared by the whole account; `scope_id` is the account ID.
// - `team`: knowledge owned by one team; `scope_id` is the team ID.
// - `channel`: legacy scope. It cannot be created or moved into through this API and is never returned by `POST /safari/knowledge/pack/list`; it can only appear when such knowledge is addressed directly by `pack_id`.
Scope string `json:"scope" toon:"scope"`
// Scope owner: the account ID for `account` scope, the team ID for `team` scope.
ScopeID int64 `json:"scope_id" toon:"scope_id"`
// Display name of the owning team (team scope only). Omitted when empty (account scope, or the team name could not be resolved).
TeamName string `json:"team_name" toon:"team_name"`
// Total size of all files in bytes. Capped at 5 MiB per knowledge.
TotalBytes int64 `json:"total_bytes" toon:"total_bytes"`
// Unix timestamp in milliseconds when the knowledge was last modified.
UpdatedAtMs TimestampMilli `json:"updated_at_ms" toon:"updated_at_ms"`
// Knowledge version. Starts at 0 and increases by 1 on every file write or file deletion. Moving the knowledge to another scope does not change it.
Version int64 `json:"version" toon:"version"`
}
KnowledgePackItem is generated from the Flashduty OpenAPI schema.
type KnowledgePackListRequest ¶ added in v0.12.0
type KnowledgePackListRequest struct {
ListOptions
// Whether to include the account knowledge when `scope` is `all` or omitted. Defaults to `true`.
IncludeAccount *bool `json:"include_account,omitempty" toon:"include_account,omitempty"`
// Case-insensitive substring filter over knowledge ID, scope, scope ID, account ID and team name. Account knowledge also matches `账户`/`账号` and team knowledge also matches `团队`. Leading and trailing spaces are ignored.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Which scopes to return:
// - `all` (default): account knowledge (unless `include_account` is `false`) plus the visible team knowledge.
// - `account`: only the account knowledge; `include_account` and `team_ids` are ignored.
// - `team`: only team knowledge, optionally narrowed by `team_ids`; `include_account` is ignored.
Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
// Restrict team knowledge to these team IDs. IDs of teams the caller does not belong to are silently dropped — this applies to every caller, including owners and admins.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
KnowledgePackListRequest is generated from the Flashduty OpenAPI schema.
type KnowledgePackListResponse ¶ added in v0.12.0
type KnowledgePackListResponse struct {
// Array of visible knowledge after filtering (current page), used with `total` for pagination.
Packs []KnowledgePackItem `json:"packs" toon:"packs"`
// Total number of knowledge entries after filtering, before pagination.
Total int64 `json:"total" toon:"total"`
}
KnowledgePackListResponse is generated from the Flashduty OpenAPI schema.
type KnowledgePackUpdateRequest ¶ added in v0.12.0
type KnowledgePackUpdateRequest struct {
// Knowledge ID to update.
PackID string `json:"pack_id" toon:"pack_id"`
// Destination scope. Omit to leave the knowledge unchanged and get it back.
// - `account`: make it the account knowledge (only the account owner and admins).
// - `team`: move it to the team in `scope_id` (the caller must be a member of that team).
// Any other value returns `InvalidParameter`. If the destination already has knowledge, the request fails with `ReferenceExist`.
Scope *string `json:"scope,omitempty" toon:"scope,omitempty"`
// Destination team ID. Required (non-zero) when `scope` is `team`; ignored when `scope` is `account` (the account ID is used).
ScopeID *int64 `json:"scope_id,omitempty" toon:"scope_id,omitempty"`
}
KnowledgePackUpdateRequest is generated from the Flashduty OpenAPI schema.
type KnowledgeService ¶ added in v0.12.0
type KnowledgeService service
KnowledgeService handles the "AI SRE/Knowledge" API resource.
func (*KnowledgeService) FileReadGet ¶ added in v0.12.0
func (s *KnowledgeService) FileReadGet(ctx context.Context, req *KnowledgeFileGetRequest) (*KnowledgeFileGetResponse, *Response, error)
Get knowledge file.
Return a knowledge file's metadata and its base64-encoded content.
API: POST /safari/knowledge/file/get (knowledge-file-read-get).
func (*KnowledgeService) FileReadList ¶ added in v0.12.0
func (s *KnowledgeService) FileReadList(ctx context.Context, req *KnowledgeFileListRequest) (*KnowledgeFileListResponse, *Response, error)
List knowledge files.
List knowledge files with metadata such as size and checksum.
API: POST /safari/knowledge/file/list (knowledge-file-read-list).
func (*KnowledgeService) FileWriteDelete ¶ added in v0.12.0
func (s *KnowledgeService) FileWriteDelete(ctx context.Context, req *KnowledgeFileDeleteRequest) (*KnowledgeFileDeleteResponse, *Response, error)
Delete knowledge file.
Delete a knowledge file by its relative path.
API: POST /safari/knowledge/file/delete (knowledge-file-write-delete).
func (*KnowledgeService) FileWritePut ¶ added in v0.12.0
func (s *KnowledgeService) FileWritePut(ctx context.Context, req *KnowledgeFilePutRequest) (*KnowledgeFilePutResponse, *Response, error)
Upload knowledge file.
Create or overwrite a knowledge file with base64-encoded content.
API: POST /safari/knowledge/file/put (knowledge-file-write-put).
func (*KnowledgeService) PackReadGet ¶ added in v0.12.0
func (s *KnowledgeService) PackReadGet(ctx context.Context) (*KnowledgeGetResponse, *Response, error)
Get account knowledge.
Return the metadata and file list of the account-scope knowledge.
API: POST /safari/knowledge/get (knowledge-pack-read-get).
func (*KnowledgeService) PackReadList ¶ added in v0.12.0
func (s *KnowledgeService) PackReadList(ctx context.Context, req *KnowledgePackListRequest) (*KnowledgePackListResponse, *Response, error)
List knowledge.
List the knowledge visible to the caller across account and team scopes.
API: POST /safari/knowledge/pack/list (knowledge-pack-read-list).
func (*KnowledgeService) PackWriteDelete ¶ added in v0.12.0
func (s *KnowledgeService) PackWriteDelete(ctx context.Context, req *KnowledgePackDeleteRequest) (*KnowledgePackDeleteResponse, *Response, error)
Delete knowledge.
Delete knowledge and all of its files.
API: POST /safari/knowledge/pack/delete (knowledge-pack-write-delete).
func (*KnowledgeService) PackWriteEnsure ¶ added in v0.12.0
func (s *KnowledgeService) PackWriteEnsure(ctx context.Context, req *KnowledgePackEnsureRequest) (*KnowledgePackItem, *Response, error)
Ensure knowledge.
Idempotently create the knowledge at the given scope, or return the existing one.
API: POST /safari/knowledge/pack/ensure (knowledge-pack-write-ensure).
func (*KnowledgeService) PackWriteUpdate ¶ added in v0.12.0
func (s *KnowledgeService) PackWriteUpdate(ctx context.Context, req *KnowledgePackUpdateRequest) (*KnowledgePackItem, *Response, error)
Update knowledge.
Move knowledge to a different account or team scope.
API: POST /safari/knowledge/pack/update (knowledge-pack-write-update).
type KnowledgeWarning ¶ added in v0.12.0
type KnowledgeWarning struct {
// Warning code. One of: `unresolved_reference` (an @ref in the written file's content points to a file that does not exist in the knowledge; `ref` carries it), `still_referenced_by` (the deleted file is still @ref-referenced by other files in the knowledge; `refs` lists the referrers).
Code string `json:"code" toon:"code"`
// Set only for `unresolved_reference`: the referenced path that does not exist in the knowledge.
Ref string `json:"ref" toon:"ref"`
// Set only for `still_referenced_by`: `rel_path` of every other file that still references the deleted file.
Refs []string `json:"refs" toon:"refs"`
}
KnowledgeWarning is generated from the Flashduty OpenAPI schema.
type LicenseListResponse ¶ added in v0.5.7
type LicenseListResponse struct {
// People holding an active license.
Items []LicensePersonItem `json:"items" toon:"items"`
// Whether the account has used up its license release quota for the current 30-day window. While `true`, releasing a seat fails with error code `NoLicense`.
ReleaseLimited bool `json:"release_limited" toon:"release_limited"`
// Number of people holding an active license.
Total int64 `json:"total" toon:"total"`
}
LicenseListResponse is generated from the Flashduty OpenAPI schema.
type LicensePersonItem ¶ added in v0.5.7
type LicensePersonItem struct {
// Unix timestamp when a fixed license was assigned. `0` for temporary licenses.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the licensed person.
PersonID int64 `json:"person_id" toon:"person_id"`
// Display name of the licensed person.
PersonName string `json:"person_name" toon:"person_name"`
// License assignment type. `fixed` is explicitly assigned; `temporary` is held from the active license window.
Type string `json:"type" toon:"type"`
// Unix timestamp when a fixed license was last changed. `0` for temporary licenses.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Person ID that last changed a fixed license. `0` for temporary licenses.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
LicensePersonItem is generated from the Flashduty OpenAPI schema.
type LicensesService ¶ added in v0.5.7
type LicensesService service
LicensesService handles the "On-call/Licenses" API resource.
func (*LicensesService) List ¶ added in v0.5.7
func (s *LicensesService) List(ctx context.Context) (*LicenseListResponse, *Response, error)
List On-call licenses.
List people with active fixed or temporary On-call licenses in the current account.
API: POST /oncall/license/list (oncall-license-read-license-list).
type LinkItem ¶
type LinkItem struct {
// Rendered URL for the link.
Endpoint string `json:"endpoint" toon:"endpoint"`
// Display name of the link.
Name string `json:"name" toon:"name"`
// How the link opens. `popup` opens it in a popup within the incident detail page; `tab` opens it in a new browser tab.
OpenType string `json:"open_type" toon:"open_type"`
}
LinkItem is generated from the Flashduty OpenAPI schema.
type ListChangeRequest ¶ added in v0.4.0
type ListChangeRequest struct {
ListOptions
// Sort in ascending order when true; default is descending.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by channel IDs.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Deprecated: use `integration_ids` instead. Single integration ID to filter by.
DataSourceID int64 `json:"data_source_id,omitempty" toon:"data_source_id,omitempty"`
// Deprecated: use `integration_ids` instead. At least 1 entry when provided.
DataSourceIDs []int64 `json:"data_source_ids,omitempty" toon:"data_source_ids,omitempty"`
// End of the query window, Unix seconds. Required in practice; see `start_time`.
EndTime int64 `json:"end_time" toon:"end_time"`
// Structured filters ANDed onto the query (e.g. on labels). Keys prefixed with `incident` are ignored. Supported keys are `labels.<name>`, `title`, `description`, `change_key`, `change_status` and `link`; keys are not validated, so any other key matches nothing under `IN` and everything under `NOTIN`. `oper` is case-insensitive and a condition with empty `vals` is dropped.
Filters []FilterCondition `json:"filters,omitempty" toon:"filters,omitempty"`
// Include the underlying change events for each change when true.
IncludeEvents bool `json:"include_events,omitempty" toon:"include_events,omitempty"`
// Deprecated: use `integration_ids` instead. Single integration ID to filter by.
IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
// Filter by reporting integration IDs. At least 1 entry when provided.
IntegrationIDs []int64 `json:"integration_ids,omitempty" toon:"integration_ids,omitempty"`
// Sort field: `start_time` or `last_time`. Defaults to `start_time`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Case-insensitive substring or regular-expression match over the change title, change_key, and description. An invalid regular expression falls back to a literal match.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Start of the query window, Unix seconds. Required in practice: it must be less than `end_time`, and the window can span at most 31 days. A change matches when its [start_time, last_time] range overlaps the window.
StartTime int64 `json:"start_time" toon:"start_time"`
}
ListChangeRequest is generated from the Flashduty OpenAPI schema.
type ListChangeResponse ¶ added in v0.4.0
type ListChangeResponse struct {
// Whether more pages are available after this one.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Changes on the current page.
Items []ChangeItem `json:"items" toon:"items"`
// Total number of matching changes.
Total int64 `json:"total" toon:"total"`
}
ListChangeResponse is generated from the Flashduty OpenAPI schema.
type ListChannelsRequest ¶
type ListChannelsRequest struct {
ListOptions
// When true, sort ascending; defaults to false (descending).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by explicit channel IDs.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Exact-match filter on channel name. Takes priority over `query` for name filtering. Must be valid UTF-8 — invalid byte sequences are rejected with `InvalidParameter`.
ChannelName string `json:"channel_name,omitempty" toon:"channel_name,omitempty"`
// When true, return only `channel_id`, `channel_name`, `description`, `status` and `is_starred` for each channel, with all matches in one page.
IsBrief bool `json:"is_brief,omitempty" toon:"is_brief,omitempty"`
// When true, return only channels owned by one of the caller's teams or created by the caller. Takes precedence over `is_my_team` and `is_my_starred`.
IsMyManaged bool `json:"is_my_managed,omitempty" toon:"is_my_managed,omitempty"`
// When true, return only channels the caller has starred. Cannot be combined with `is_my_team`.
IsMyStarred bool `json:"is_my_starred,omitempty" toon:"is_my_starred,omitempty"`
// When true, return only channels whose owning team is one of the caller's teams. Cannot be combined with `is_my_starred`.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Sort field, default `created_at`. `ranking` uses the caller's own channel order saved in the console and falls back to creation order when none is saved; `channel_name` sorts case-insensitively.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Case-insensitive regular expression matched against channel name and description; invalid regex syntax falls back to a literal match. Must be valid UTF-8 — invalid byte sequences are rejected with `InvalidParameter`.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Return only channels owned by these teams. Ignored when `is_my_managed` or `is_my_team` is true.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
ListChannelsRequest is generated from the Flashduty OpenAPI schema.
type ListChannelsResponse ¶
type ListChannelsResponse struct {
// Whether more pages follow. Reliable only when `p` is passed.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Channels on the current page.
Items []ChannelItem `json:"items" toon:"items"`
// Total number of matching channels across all pages.
Total int64 `json:"total" toon:"total"`
}
ListChannelsResponse is generated from the Flashduty OpenAPI schema.
type ListDropRulesResponse ¶
type ListDropRulesResponse struct {
// All drop (unsubscribe) rules of the channel, excluding deleted ones, ordered by creation time ascending.
Items []UnsubscribeRuleItem `json:"items" toon:"items"`
}
ListDropRulesResponse is generated from the Flashduty OpenAPI schema.
type ListEscalationRulesResponse ¶
type ListEscalationRulesResponse struct {
// Escalation rules of the channel, excluding deleted ones, in evaluation order: ascending `priority`, then creation time.
Items []EscalateRuleItem `json:"items" toon:"items"`
}
ListEscalationRulesResponse is generated from the Flashduty OpenAPI schema.
type ListIncidentAlertsRequest ¶
type ListIncidentAlertsRequest struct {
ListOptions
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// When true, include at most the 20 newest raw events in each alert item as a preview.
IncludeEvents bool `json:"include_events,omitempty" toon:"include_events,omitempty"`
// When true return only active alerts (Critical/Warning/Info); when false return only recovered alerts (Ok). Omit to include all.
IsActive *bool `json:"is_active,omitempty" toon:"is_active,omitempty"`
}
ListIncidentAlertsRequest is generated from the Flashduty OpenAPI schema.
type ListIncidentAlertsResponse ¶
type ListIncidentAlertsResponse struct {
// Alerts on the requested page; an empty array when no alert matches.
Items []AlertInfo `json:"items" toon:"items"`
// Total matching alerts.
Total int64 `json:"total" toon:"total"`
}
ListIncidentAlertsResponse is generated from the Flashduty OpenAPI schema.
type ListIncidentCommentTypesRequest ¶ added in v0.8.0
type ListIncidentCommentTypesRequest struct{}
ListIncidentCommentTypesRequest is generated from the Flashduty OpenAPI schema.
type ListIncidentCommentTypesResponse ¶ added in v0.8.0
type ListIncidentCommentTypesResponse struct {
// All comment types of the account, ordered by position.
Items []IncidentCommentTypeItem `json:"items" toon:"items"`
}
ListIncidentCommentTypesResponse is generated from the Flashduty OpenAPI schema.
type ListIncidentFeedRequest ¶
type ListIncidentFeedRequest struct {
ListOptions
// Ascending chronological order when true.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Return only entries of these types; omit to return all types.
Types []IncidentFeedType `json:"types,omitempty" toon:"types,omitempty"`
}
ListIncidentFeedRequest is generated from the Flashduty OpenAPI schema.
type ListIncidentFeedResponse ¶
type ListIncidentFeedResponse struct {
// True when more entries are available.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Timeline entries for the current page.
Items []IncidentFeedItem `json:"items" toon:"items"`
}
ListIncidentFeedResponse is generated from the Flashduty OpenAPI schema.
type ListIncidentsByIDsRequest ¶
type ListIncidentsByIDsRequest struct {
// Incident IDs to query; obtain them from `POST /incident/list`.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
}
ListIncidentsByIDsRequest is generated from the Flashduty OpenAPI schema.
type ListIncidentsRequest ¶
type ListIncidentsRequest struct {
ListOptions
// Filter by acker member IDs; obtain member IDs from `POST /member/list`.
AckerIDs []int64 `json:"acker_ids,omitempty" toon:"acker_ids,omitempty"`
// Ascending order when true.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Channel IDs to filter by. Use 0 for standalone (global) incidents.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Closer member IDs. Use 0 for automatically closed incidents.
CloserIDs []int64 `json:"closer_ids,omitempty" toon:"closer_ids,omitempty"`
// Creator member IDs. Use 0 for automatically created incidents.
CreatorIDs []int64 `json:"creator_ids,omitempty" toon:"creator_ids,omitempty"`
// Window end, Unix seconds. Must be greater than `start_time` and within 31 days.
EndTime int64 `json:"end_time" toon:"end_time"`
// When true, include only incidents that were ever silenced.
EverMuted bool `json:"ever_muted,omitempty" toon:"ever_muted,omitempty"`
// When true, include only incidents that still have an action item or follow-up that is neither `done` nor `cancelled`. `false` applies no filter.
HasUnfinishedWorkItem bool `json:"has_unfinished_work_item,omitempty" toon:"has_unfinished_work_item,omitempty"`
// Restrict to the given incident IDs.
IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
// Comma-separated severities to match, for example `Critical,Warning`. Values: `Critical` most severe, `Warning`, `Info` least severe.
IncidentSeverity string `json:"incident_severity,omitempty" toon:"incident_severity,omitempty"`
// When true, restrict to incidents in channels the user personally owns.
IsMyChannel bool `json:"is_my_channel,omitempty" toon:"is_my_channel,omitempty"`
// When true, restrict to incidents in channels owned by the user's teams.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// When true, include only outlier (rare) incidents.
IsRare bool `json:"is_rare,omitempty" toon:"is_rare,omitempty"`
// When true, include only snoozed incidents.
IsSnoozed bool `json:"is_snoozed,omitempty" toon:"is_snoozed,omitempty"`
// Filter by incident short numbers (the numbers shown before incident titles in the console).
Nums []string `json:"nums,omitempty" toon:"nums,omitempty"`
// Comma-separated progress states to match, for example `Triggered,Processing`. Values: `Triggered` not yet acknowledged; `Processing` acknowledged and being handled; `Closed` resolved. Omit to match every state.
Progress string `json:"progress,omitempty" toon:"progress,omitempty"`
// Full-text search query.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by responder member IDs; obtain member IDs from `POST /member/list`.
ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
// Start of the time window (Unix timestamp in seconds). The window with `end_time` may span at most 31 days and filters by incident start time.
StartTime int64 `json:"start_time" toon:"start_time"`
// Team IDs; resolved to channels via channel ownership.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
ListIncidentsRequest is generated from the Flashduty OpenAPI schema.
type ListInhibitRulesResponse ¶
type ListInhibitRulesResponse struct {
// All inhibit rules of the channel, excluding deleted ones, ordered by creation time ascending.
Items []InhibitRuleItem `json:"items" toon:"items"`
}
ListInhibitRulesResponse is generated from the Flashduty OpenAPI schema.
type ListIntegrationTypesResponse ¶ added in v0.15.9
type ListIntegrationTypesResponse struct {
ListOptions
// Integration types on the current page.
Items []IntegrationTypeItem `json:"items" toon:"items"`
// Total number of matching types.
Total int64 `json:"total" toon:"total"`
}
ListIntegrationTypesResponse is generated from the Flashduty OpenAPI schema.
type ListIntegrationsRequest ¶ added in v0.15.9
type ListIntegrationsRequest struct {
ListOptions
// Sort ascending when true, descending when false.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Comma-separated category filter. Values: `event.alert` (alert events), `event.change` (change events), `im` (IM bots), `webhook` (custom webhooks). Unknown values are not rejected and match nothing.
Category string `json:"category,omitempty" toon:"category,omitempty"`
// Limit the result to integrations owned by your teams.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Filter by integration name; matches any name that contains this text.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Sort field. Defaults to `created_at`; `plugin_type` is sorted by the underlying plugin.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Comma-separated integration type keys, for example `standard.alert,prometheus.alert`; the keys are the `plugin_type` values from `POST /integration/type/list`.
PluginType string `json:"plugin_type,omitempty" toon:"plugin_type,omitempty"`
// Filter by source reference IDs. Each value must start with `c_` (channel), `a_` (account) or `w_`.
RefIDs []string `json:"ref_ids,omitempty" toon:"ref_ids,omitempty"`
// Comma-separated status filter: `enabled` (accepting events) and/or `disabled` (paused).
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Filter by team IDs. With `is_my_team`, the values narrow that set further.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
// Deprecated alias of `plugin_type` (comma-separated type keys such as `prometheus.alert`, `zabbix.alert`). Ignored when `plugin_type` is also set.
Type string `json:"type,omitempty" toon:"type,omitempty"`
}
ListIntegrationsRequest is generated from the Flashduty OpenAPI schema.
type ListIntegrationsResponse ¶ added in v0.15.9
type ListIntegrationsResponse struct {
ListOptions
// Integrations on the current page.
Items []IntegrationItem `json:"items" toon:"items"`
// Total number of matching integrations.
Total int64 `json:"total" toon:"total"`
}
ListIntegrationsResponse is generated from the Flashduty OpenAPI schema.
type ListOptions ¶
type ListOptions struct {
// Page is the 1-based page number (wire field "p").
Page int `json:"p,omitempty"`
// Limit caps the number of items returned per page.
Limit int `json:"limit,omitempty"`
// SearchAfterCtx is the opaque cursor echoed by the previous page for deep
// pagination; pass it back to fetch the next page.
SearchAfterCtx string `json:"search_after_ctx,omitempty"`
}
ListOptions holds the pagination inputs shared by every list endpoint. Embed it in a service's request struct; zero values are omitted so they never override the server's defaults (the backend uses p=1, limit=20).
type ListPastIncidentsRequest ¶
type ListPastIncidentsRequest struct {
// Reference incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Maximum number of similar incidents to return.
Limit *int64 `json:"limit,omitempty" toon:"limit,omitempty"`
}
ListPastIncidentsRequest is generated from the Flashduty OpenAPI schema.
type ListPastIncidentsResponse ¶
type ListPastIncidentsResponse struct {
// Similar past incidents with similarity scores.
Items []PastIncidentItem `json:"items" toon:"items"`
}
ListPastIncidentsResponse is generated from the Flashduty OpenAPI schema.
type ListPostMortemTemplatesRequest ¶ added in v0.5.4
type ListPostMortemTemplatesRequest struct {
ListOptions
// Sort custom templates in ascending order when true; default false (newest first).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Sort field for custom templates. Only `created_at_seconds` is supported, which is also the default.
OrderBy string `json:"order_by,omitempty" toon:"order_by,omitempty"`
}
ListPostMortemTemplatesRequest is generated from the Flashduty OpenAPI schema.
type ListPostMortemTemplatesResponse ¶ added in v0.5.4
type ListPostMortemTemplatesResponse struct {
// True when another page is available.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Templates on this page; the built-in template is first on page 1.
Items []PostMortemTemplate `json:"items" toon:"items"`
// Total number of templates, including the built-in one.
Total int64 `json:"total" toon:"total"`
}
ListPostMortemTemplatesResponse is generated from the Flashduty OpenAPI schema.
type ListPostMortemsRequest ¶
type ListPostMortemsRequest struct {
ListOptions
// Ascending order when true.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Channel IDs to restrict the query to.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Upper bound of post-mortem creation time (Unix timestamp in seconds).
CreatedAtEndSeconds int64 `json:"created_at_end_seconds,omitempty" toon:"created_at_end_seconds,omitempty"`
// Lower bound of post-mortem creation time (Unix timestamp in seconds).
CreatedAtStartSeconds int64 `json:"created_at_start_seconds,omitempty" toon:"created_at_start_seconds,omitempty"`
// Sort field: `created_at_seconds` creation time, `updated_at_seconds` last update time.
OrderBy string `json:"order_by,omitempty" toon:"order_by,omitempty"`
// Optional status filter: `drafting` returns only drafts, `published` returns only published post-mortems. When omitted, post-mortems in all statuses are returned.
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Team IDs to restrict the query to.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
ListPostMortemsRequest is generated from the Flashduty OpenAPI schema.
type ListPostMortemsResponse ¶
type ListPostMortemsResponse struct {
// True when more results are available beyond this page.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Post-mortem metadata for the current page.
Items []PostMortemMeta `json:"items" toon:"items"`
// Cursor for forward pagination.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Total matching reports.
Total int64 `json:"total" toon:"total"`
}
ListPostMortemsResponse is generated from the Flashduty OpenAPI schema.
type ListRemoteConfigHistoryRequest ¶ added in v0.15.2
type ListRemoteConfigHistoryRequest struct {
ListOptions
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Ascending order. Default: false (descending).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Sort field:
//
// - `updated_at`: publish time (default).
// - `version`: version number.
//
// Any other value falls back to `updated_at`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
}
ListRemoteConfigHistoryRequest is generated from the Flashduty OpenAPI schema.
type ListRemoteConfigHistoryResponse ¶ added in v0.15.2
type ListRemoteConfigHistoryResponse struct {
// `true` when more versions remain after this page.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Versions on this page, newest first by default. Empty array when the application has never been configured.
Items []RemoteConfigHistoryItem `json:"items" toon:"items"`
// Number of retained versions (at most 50).
Total int64 `json:"total" toon:"total"`
}
ListRemoteConfigHistoryResponse is generated from the Flashduty OpenAPI schema.
type ListRoutesRequest ¶
type ListRoutesRequest struct {
// Shared integration IDs to fetch routing rules for, at least one; obtain them from `POST /integration/list`.
IntegrationIDs []int64 `json:"integration_ids" toon:"integration_ids"`
}
ListRoutesRequest is generated from the Flashduty OpenAPI schema.
type ListRoutesResponse ¶
type ListRoutesResponse struct {
// Routing rules of the requested integrations. Integrations without a configured rule are omitted.
Items []RouteItem `json:"items" toon:"items"`
}
ListRoutesResponse is generated from the Flashduty OpenAPI schema.
type ListSilenceRulesResponse ¶
type ListSilenceRulesResponse struct {
// All silence rules of the channel, excluding deleted ones, ordered by creation time ascending.
Items []SilenceRuleItem `json:"items" toon:"items"`
}
ListSilenceRulesResponse is generated from the Flashduty OpenAPI schema.
type ListStatusPageResponse ¶ added in v0.4.0
type ListStatusPageResponse struct {
// Status pages owned by the account.
Items []StatusPageItem `json:"items" toon:"items"`
}
ListStatusPageResponse is generated from the Flashduty OpenAPI schema.
type ListStatusPageTemplatesResponse ¶ added in v0.14.3
type ListStatusPageTemplatesResponse struct {
// Templates of the requested category.
Items []any `json:"items" toon:"items"`
}
ListStatusPageTemplatesResponse is generated from the Flashduty OpenAPI schema.
type ListWarRoomEnabledResponse ¶ added in v0.4.0
type ListWarRoomEnabledResponse struct {
// IM integrations with the war-room feature enabled.
Items []WarRoomDataSourceItem `json:"items" toon:"items"`
}
ListWarRoomEnabledResponse is generated from the Flashduty OpenAPI schema.
type ListWarRoomsRequest ¶
type ListWarRoomsRequest struct {
// When `true`, return only `exists` instead of `items`: whether the incident has any war room, on any integration and including ones whose integration is unavailable. `integration_id` is ignored.
ForCreate bool `json:"for_create,omitempty" toon:"for_create,omitempty"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Optional filter: only return war rooms for this IM integration.
IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
}
ListWarRoomsRequest is generated from the Flashduty OpenAPI schema.
type ListWarRoomsResponse ¶
type ListWarRoomsResponse struct {
// Whether the incident has a war room. Returned only when `for_create` is `true`.
Exists bool `json:"exists" toon:"exists"`
// War room records. Omitted when `for_create` is `true`.
Items []WarRoomItem `json:"items" toon:"items"`
}
ListWarRoomsResponse is generated from the Flashduty OpenAPI schema.
type ListWebhookHistoryRequest ¶
type ListWebhookHistoryRequest struct {
// Ascending order by `event_time` when true; otherwise descending.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Window end time in Unix milliseconds. Must be greater than `start_time`.
EndTime int64 `json:"end_time" toon:"end_time"`
// Filter by event type codes (e.g. `i_new` incident created, `a_new` alert triggered).
EventTypes []string `json:"event_types,omitempty" toon:"event_types,omitempty"`
// Filter by webhook integration ID; `0` or omitted returns all integrations.
IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
// Number of records per page, 1–100.
Limit int64 `json:"limit" toon:"limit"`
// Sort field. Currently only `event_time` is supported.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Reference ID filter (incident or alert ID).
RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
// Opaque cursor returned by a previous call for fetching the next page.
SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
// Window start time in Unix milliseconds.
StartTime int64 `json:"start_time" toon:"start_time"`
// Filter by delivery status: `success` or `failed`.
Status string `json:"status,omitempty" toon:"status,omitempty"`
}
ListWebhookHistoryRequest is generated from the Flashduty OpenAPI schema.
type ListWebhookHistoryResponse ¶
type ListWebhookHistoryResponse struct {
// Webhook delivery records on the current page.
Items []WebhookHistoryItem `json:"items" toon:"items"`
// Cursor to pass as `search_after_ctx` to fetch the next page. Empty when no further pages are available.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Total number of records matching the filters, not capped.
Total int64 `json:"total" toon:"total"`
}
ListWebhookHistoryResponse is generated from the Flashduty OpenAPI schema.
type ListWorkItemRequest ¶ added in v0.8.0
type ListWorkItemRequest struct {
// Restrict results to items assigned to this member ID. Listing by assignee alone requires being that member or an account owner or admin. Ignored when `assignee_type` is `ai_sre`.
AssigneeID int64 `json:"assignee_id,omitempty" toon:"assignee_id,omitempty"`
// Filter by assignee type: `person` or `ai_sre`. `ai_sre` returns items assigned to AI SRE (an AI caller uses this to list its own tasks) and does not require `assignee_id`. `person` together with `assignee_id` restricts results to that member. Omitted with a positive `assignee_id` means `person`.
AssigneeType string `json:"assignee_type,omitempty" toon:"assignee_type,omitempty"`
// Opaque cursor from a previous response's `next_cursor`. An invalid cursor returns `InvalidParameter`.
Cursor string `json:"cursor,omitempty" toon:"cursor,omitempty"`
// Incident ID (MongoDB ObjectID). Also returns follow-ups anchored on the incident's post-mortem.
IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
// Filter by work item type: `action` action item, `follow_up` post-mortem follow-up.
ItemType string `json:"item_type,omitempty" toon:"item_type,omitempty"`
// Page size. 0, negative or omitted means 50; values above 200 are treated as 200.
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Post-mortem ID (32-character hex string). Returns follow-ups bound to this post-mortem.
PostMortemID string `json:"post_mortem_id,omitempty" toon:"post_mortem_id,omitempty"`
}
ListWorkItemRequest is generated from the Flashduty OpenAPI schema.
type Logger ¶
type Logger interface {
Debug(msg string, keysAndValues ...any)
Info(msg string, keysAndValues ...any)
Warn(msg string, keysAndValues ...any)
Error(msg string, keysAndValues ...any)
}
Logger defines the logging interface for the SDK. Consumers can implement this to integrate with any logging backend.
The keysAndValues parameter uses alternating key-value pairs (slog-style):
logger.Info("request complete", "status", 200, "duration_ms", 42)
To adapt logrus, implement a thin wrapper that converts keysAndValues to logrus.Fields:
type logrusAdapter struct{ *logrus.Logger }
func (a *logrusAdapter) Info(msg string, kv ...any) { a.WithFields(kvToFields(kv)).Info(msg) }
func (a *logrusAdapter) Warn(msg string, kv ...any) { a.WithFields(kvToFields(kv)).Warn(msg) }
func (a *logrusAdapter) Error(msg string, kv ...any) { a.WithFields(kvToFields(kv)).Error(msg) }
func (a *logrusAdapter) Debug(msg string, kv ...any) { a.WithFields(kvToFields(kv)).Debug(msg) }
func kvToFields(kv []any) logrus.Fields {
fields := make(logrus.Fields, len(kv)/2)
for i := 0; i+1 < len(kv); i += 2 {
if key, ok := kv[i].(string); ok {
fields[key] = kv[i+1]
}
}
return fields
}
type LokiQueryParams ¶ added in v0.15.2
type LokiQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
// Maximum raw-log entries to return (1–1000); only bounds raw logs, not
// SQL rows or scanned data.
Limit *int64 `json:"limit,omitempty"`
// Raw-log retrieval order: `latest` or `earliest`.
Direction *string `json:"direction,omitempty"`
}
LokiQueryParams are the params for `loki.query`. Expr is LogQL. Execution.Kind must be `instant` or `range`; `instant` keeps the full time context so `$__auto` ranges resolve. Limit and Direction only apply to raw-log results.
type ManualRunRuleResult ¶ added in v0.5.7
type ManualRunRuleResult struct {
Preflight PreflightResult `json:"preflight" toon:"preflight"`
// Rule ID that was run.
RuleID string `json:"rule_id" toon:"rule_id"`
Run AutomationRunView `json:"run" toon:"run"`
// Always manual for this operation.
TriggerKind string `json:"trigger_kind" toon:"trigger_kind"`
}
ManualRunRuleResult is generated from the Flashduty OpenAPI schema.
type MappingAPICreateRequest ¶
type MappingAPICreateRequest struct {
// Name of the mapping API, unique among non-deleted mapping APIs (max 199 characters).
APIName string `json:"api_name" toon:"api_name"`
// Optional description. Values longer than 500 characters are silently truncated.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Custom HTTP request headers. In SaaS mode, security-sensitive names (`authorization`, `cookie`, `x-forwarded-for`, etc.) are rejected; keys must be RFC 7230 token characters (max 1024 chars) and values max 4096 chars.
Headers map[string]string `json:"headers,omitempty" toon:"headers,omitempty"`
// Skip TLS certificate verification. Default `false`.
InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty" toon:"insecure_skip_verify,omitempty"`
// Number of retries after a failed call (0–1). Defaults to 0.
RetryCount int64 `json:"retry_count,omitempty" toon:"retry_count,omitempty"`
// Owning team ID; obtain it from `POST /team/list`. `0` or omitted means no team. A non-zero ID must be an existing team.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Timeout of the whole request in seconds (1–3). Defaults to 2 when omitted or 0.
Timeout int64 `json:"timeout,omitempty" toon:"timeout,omitempty"`
// Endpoint called with `POST`. Must be an `http` or `https` URL of at most 500 characters; in SaaS the host must not resolve to an internal IP address.
URL string `json:"url" toon:"url"`
}
MappingAPICreateRequest is generated from the Flashduty OpenAPI schema.
type MappingAPICreateResponse ¶
type MappingAPICreateResponse struct {
// Created API ID (MongoDB ObjectID hex).
APIID string `json:"api_id" toon:"api_id"`
// Name of the created mapping API, as sent in the request.
APIName string `json:"api_name" toon:"api_name"`
}
MappingAPICreateResponse is generated from the Flashduty OpenAPI schema.
type MappingAPIItem ¶
type MappingAPIItem struct {
// API ID (MongoDB ObjectID hex).
APIID string `json:"api_id" toon:"api_id"`
// Name of the mapping API, unique among non-deleted mapping APIs.
APIName string `json:"api_name" toon:"api_name"`
// Creation time, Unix seconds. Omitted when 0 (legacy records).
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator member ID.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Deletion time, Unix seconds. Omitted when the API has not been soft-deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Free-text description (at most 500 characters); an empty string when none was given.
Description string `json:"description" toon:"description"`
// Request headers sent with every call, returned in plain text to callers who can edit the API (the account owner or an admin, the API's creator, or a member of its team). `null` when none are configured or the caller cannot edit the API.
Headers map[string]string `json:"headers" toon:"headers"`
// Whether TLS verification is skipped.
InsecureSkipVerify bool `json:"insecure_skip_verify" toon:"insecure_skip_verify"`
// Number of retries after a failed call: `0` or `1`.
RetryCount int64 `json:"retry_count" toon:"retry_count"`
// API status: `enabled` or `deleted` (soft-deleted). The list endpoint excludes `deleted` items; the info endpoint may return them.
Status string `json:"status" toon:"status"`
// Owning team ID.
TeamID int64 `json:"team_id" toon:"team_id"`
// Timeout of the whole request in seconds (1–3).
Timeout int64 `json:"timeout" toon:"timeout"`
// Last update time, Unix seconds. Omitted when 0 (legacy records).
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Last updater member ID.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Endpoint URL.
URL string `json:"url" toon:"url"`
}
MappingAPIItem is generated from the Flashduty OpenAPI schema.
type MappingAPIListResponse ¶
type MappingAPIListResponse struct {
// Mapping APIs.
Items []MappingAPIItem `json:"items" toon:"items"`
// Number of items returned; the list is not paginated.
Total int64 `json:"total" toon:"total"`
}
MappingAPIListResponse is generated from the Flashduty OpenAPI schema.
type MappingAPIUpdateRequest ¶
type MappingAPIUpdateRequest struct {
// Mapping API ID (MongoDB ObjectID hex).
APIID string `json:"api_id" toon:"api_id"`
// New name, unique among non-deleted mapping APIs (max 199 characters). Omit to keep.
APIName *string `json:"api_name,omitempty" toon:"api_name,omitempty"`
// New description; longer than 500 characters is truncated. Omit to keep, send `""` to clear.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Replaces the whole header map when sent; send `{}` to remove all headers. Omit to keep. In SaaS, sensitive header names (see `/enrichment/mapping/api/create`) are rejected; keys are at most 1,024 characters and values at most 4,096.
Headers map[string]string `json:"headers,omitempty" toon:"headers,omitempty"`
// New TLS skip-verify setting. Omit to keep.
InsecureSkipVerify *bool `json:"insecure_skip_verify,omitempty" toon:"insecure_skip_verify,omitempty"`
// New retry count (0–1). Omit to keep.
RetryCount *int64 `json:"retry_count,omitempty" toon:"retry_count,omitempty"`
// New owning team ID from `POST /team/list`; `0` removes the team. Omit to keep.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// New whole-request timeout in seconds (1–3). Omit to keep.
Timeout *int64 `json:"timeout,omitempty" toon:"timeout,omitempty"`
// New `http`/`https` endpoint (max 500 characters); in SaaS the host must not resolve to an internal IP. Omit to keep.
URL *string `json:"url,omitempty" toon:"url,omitempty"`
}
MappingAPIUpdateRequest is generated from the Flashduty OpenAPI schema.
type MappingApiidRequest ¶
type MappingApiidRequest struct {
// Mapping API ID (MongoDB ObjectID hex).
APIID string `json:"api_id" toon:"api_id"`
}
MappingApiidRequest is generated from the Flashduty OpenAPI schema.
type MappingDataDeleteRequest ¶
type MappingDataDeleteRequest struct {
// Row keys to delete (at most 100), as returned in `key` by `/enrichment/mapping/data/list` or in `keys` by `/enrichment/mapping/data/upsert`. Keys that match no row are ignored.
Keys []string `json:"keys" toon:"keys"`
// Mapping schema ID (MongoDB ObjectID hex).
SchemaID string `json:"schema_id" toon:"schema_id"`
}
MappingDataDeleteRequest is generated from the Flashduty OpenAPI schema.
type MappingDataItem ¶
type MappingDataItem struct {
// Time the row was last written, Unix seconds; a replaced row gets a new value. Omitted when 0.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// All label key-value pairs of this row. Omitted when empty.
Fields map[string]string `json:"fields" toon:"fields"`
// Composite row key — MD5 of the row's source label values (sorted by label name, joined with `:`). Omitted when empty.
Key string `json:"key" toon:"key"`
// Last update time, Unix seconds. Omitted when 0.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
MappingDataItem is generated from the Flashduty OpenAPI schema.
type MappingDataListRequest ¶
type MappingDataListRequest struct {
ListOptions
// Sort ascending when `true`; defaults to `false` (newest first).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Sort field. Defaults to `updated_at`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Exact-match filter on source label values. Keys that are not source labels of the schema are silently ignored; if any source label is given, all source labels must be provided.
Query map[string]string `json:"query,omitempty" toon:"query,omitempty"`
// Mapping schema ID (MongoDB ObjectID hex).
SchemaID string `json:"schema_id" toon:"schema_id"`
}
MappingDataListRequest is generated from the Flashduty OpenAPI schema.
type MappingDataListResponse ¶
type MappingDataListResponse struct {
// `true` when more rows follow this page.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Data rows of this page, ordered by `orderby`/`asc`. Empty when nothing matches.
Items []MappingDataItem `json:"items" toon:"items"`
// Cursor token (ObjectID hex of this page's last row) for fetching the next page. Omitted when there is no next page.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Number of rows matching `query`, counted up to 1,000; a value of 1,000 means at least 1,000.
Total int64 `json:"total" toon:"total"`
// Total number of rows stored in the schema, regardless of `query`. Compare it with the schema row limit (10,000 by default).
UsedCnt int64 `json:"used_cnt" toon:"used_cnt"`
}
MappingDataListResponse is generated from the Flashduty OpenAPI schema.
type MappingDataUploadRequest ¶
type MappingDataUploadRequest struct {
// SchemaID is the ID of the target mapping schema (ObjectID hex). Required.
SchemaID string
// DoNotTruncateFirst appends the CSV rows to the existing data instead of
// truncating it first.
DoNotTruncateFirst bool
// File is the CSV content. Required. Max 100 MB; the header row must
// include all of the schema's source/result label names.
File io.Reader
// Filename is the multipart file name; defaults to "mapping.csv".
Filename string
}
MappingDataUploadRequest carries the CSV file and options for MappingDataWriteUpload. It is hand-written rather than generated because the endpoint consumes multipart/form-data, which the generated JSON request path cannot encode.
type MappingDataUpsertRequest ¶
type MappingDataUpsertRequest struct {
// Rows to insert or replace (at most 1,000). Each row maps label names to values and must include every source and result label; other keys are dropped; a value longer than 2,048 bytes is rejected. A row whose source label values match an existing row replaces it.
Docs []map[string]string `json:"docs" toon:"docs"`
// Mapping schema ID (MongoDB ObjectID hex).
SchemaID string `json:"schema_id" toon:"schema_id"`
}
MappingDataUpsertRequest is generated from the Flashduty OpenAPI schema.
type MappingDataUpsertResponse ¶
type MappingDataUpsertResponse struct {
// Row keys of the written rows (in no particular order; rows are written in batches of 100 and deduplicated per batch, so a key can appear twice); use them with `/enrichment/mapping/data/delete`.
Keys []string `json:"keys" toon:"keys"`
}
MappingDataUpsertResponse is generated from the Flashduty OpenAPI schema.
type MappingSchemaCreateRequest ¶
type MappingSchemaCreateRequest struct {
// Optional description (max 500 chars).
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Output label names written on a match (1–10). Each must match `^[a-zA-Z_][a-zA-Z0-9_]*$`; entries must be unique and must not overlap with `source_labels`.
ResultLabels []string `json:"result_labels" toon:"result_labels"`
// Schema name, unique among the account's non-deleted schemas (max 39 characters).
SchemaName string `json:"schema_name" toon:"schema_name"`
// Lookup key label names (1–3). Each must match `^[a-zA-Z_][a-zA-Z0-9_]*$`; entries must be unique and must not overlap with `result_labels`.
SourceLabels []string `json:"source_labels" toon:"source_labels"`
// Owning team ID from `POST /team/list`. `0` or omitted means no team; a non-zero ID must be an existing team.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
MappingSchemaCreateRequest is generated from the Flashduty OpenAPI schema.
type MappingSchemaCreateResponse ¶
type MappingSchemaCreateResponse struct {
// Created schema ID (MongoDB ObjectID hex).
SchemaID string `json:"schema_id" toon:"schema_id"`
// Name of the created schema, as sent in the request.
SchemaName string `json:"schema_name" toon:"schema_name"`
}
MappingSchemaCreateResponse is generated from the Flashduty OpenAPI schema.
type MappingSchemaIDRequest ¶
type MappingSchemaIDRequest struct {
// Mapping schema ID (MongoDB ObjectID hex).
SchemaID string `json:"schema_id" toon:"schema_id"`
}
MappingSchemaIDRequest is generated from the Flashduty OpenAPI schema.
type MappingSchemaItem ¶
type MappingSchemaItem struct {
// Creation time, Unix seconds. Omitted when 0 (legacy records).
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator member ID.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Deletion time, Unix seconds. Omitted when the schema has not been soft-deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Schema description.
Description string `json:"description" toon:"description"`
// Label names written to the event when a row matches (1–10); fixed at creation.
ResultLabels []string `json:"result_labels" toon:"result_labels"`
// Schema ID (MongoDB ObjectID hex).
SchemaID string `json:"schema_id" toon:"schema_id"`
// Schema name, unique among the account's non-deleted schemas.
SchemaName string `json:"schema_name" toon:"schema_name"`
// Label names whose values form the lookup key of a data row (1–3); fixed at creation.
SourceLabels []string `json:"source_labels" toon:"source_labels"`
// Schema status: `enabled` or `deleted` (soft-deleted). The list endpoint excludes `deleted` items; the info endpoint may return them.
Status string `json:"status" toon:"status"`
// Owning team ID; `0` when the schema belongs to no team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Last update time, Unix seconds. Omitted when 0 (legacy records).
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Last updater member ID.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
MappingSchemaItem is generated from the Flashduty OpenAPI schema.
type MappingSchemaListResponse ¶
type MappingSchemaListResponse struct {
// Mapping schemas.
Items []MappingSchemaItem `json:"items" toon:"items"`
// Number of items returned; the list is not paginated.
Total int64 `json:"total" toon:"total"`
}
MappingSchemaListResponse is generated from the Flashduty OpenAPI schema.
type MappingSchemaUpdateRequest ¶
type MappingSchemaUpdateRequest struct {
// New description (max 500 characters). Omit to keep, send `""` to clear.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Schema ID (MongoDB ObjectID hex).
SchemaID string `json:"schema_id" toon:"schema_id"`
// New name, unique among non-deleted schemas (max 39 characters). Omit to keep.
SchemaName *string `json:"schema_name,omitempty" toon:"schema_name,omitempty"`
// New owning team ID from `POST /team/list`; `0` removes the team. Omit to keep.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
MappingSchemaUpdateRequest is generated from the Flashduty OpenAPI schema.
type McpServerCreateRequest ¶ added in v0.4.0
type McpServerCreateRequest struct {
// Allow this server's OAuth token exchange over plaintext HTTP. Testing use only; defaults to false.
AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
// Skip TLS certificate verification when connecting to this server. Testing use only; defaults to false.
AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
// Command arguments (stdio transport).
Args []string `json:"args,omitempty" toon:"args,omitempty"`
// Who supplies the credential:
// - `shared` (default; an empty value behaves the same): one credential stored on the server (`env` / `headers`) is used for every caller.
// - `per_user_secret`: each user stores their own secret, sent in the header named by `secret_schema.header_name`.
// - `per_user_oauth`: each user completes their own OAuth authorization; discovery and client registration run on first use.
//
// `per_user_secret` requires `secret_schema` with a non-empty `header_name`; any other value returns `InvalidParameter`.
AuthMode string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
// Tool-call timeout in seconds. Omitted or `0` is stored as `0` and means the 60-second default.
CallTimeout int64 `json:"call_timeout,omitempty" toon:"call_timeout,omitempty"`
// Executable command (stdio transport).
Command string `json:"command,omitempty" toon:"command,omitempty"`
// Connection timeout in seconds. Omitted or `0` is stored as `0` and means the 10-second default.
ConnectTimeout int64 `json:"connect_timeout,omitempty" toon:"connect_timeout,omitempty"`
// Server description.
Description string `json:"description" toon:"description"`
// Environment variables (`stdio` transport). Values under credential-looking names (containing `KEY`, `SECRET`, `TOKEN`, `PASSWORD`, …) are encrypted at rest and masked in responses.
Env map[string]string `json:"env,omitempty" toon:"env,omitempty"`
// Execution environments this server is callable from: `cloud` and/or BYOC runner environment IDs. Omitted or empty means all environments.
Environments []string `json:"environments,omitempty" toon:"environments,omitempty"`
// HTTP headers (`sse` / `streamable-http` transport). Values under credential-looking names (containing `KEY`, `TOKEN`, `AUTHORIZATION`, …) are encrypted at rest and masked in responses.
Headers map[string]string `json:"headers,omitempty" toon:"headers,omitempty"`
// JSON OAuth metadata; reserved for per_user_oauth.
OauthMetadata string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
// JSON secret schema; required when auth_mode=per_user_secret.
SecretSchema string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
// MCP server name: must start with a letter and contain only letters, digits, `-`, or `_` (`@` is reserved); unique within its scope (account-wide or one team).
ServerName string `json:"server_name" toon:"server_name"`
// Name of the marketplace template to install. When set, the template must exist, the server is created at account scope, and the connection fields must match the template except for its declared parameter values. Cannot be changed later.
SourceTemplateName string `json:"source_template_name,omitempty" toon:"source_template_name,omitempty"`
// Initial status: `enabled` (default) or `disabled` (created but kept off).
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Team scope: `0` = account-wide (account owner or admin only); `>0` = a team the caller belongs to. Ignored when `source_template_name` is set — marketplace installs are always account-wide.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Transport protocol: `stdio` launches a local process via `command`/`args`/`env`, `sse` / `streamable-http` connects to a remote service via `url`/`headers`.
Transport string `json:"transport" toon:"transport"`
// Server URL (sse / streamable-http transport).
URL string `json:"url,omitempty" toon:"url,omitempty"`
}
McpServerCreateRequest is generated from the Flashduty OpenAPI schema.
type McpServerDeleteRequest ¶ added in v0.4.0
type McpServerDeleteRequest struct {
// Target MCP server ID, from the list returned by `POST /safari/mcp/server/list`.
ServerID string `json:"server_id" toon:"server_id"`
}
McpServerDeleteRequest is generated from the Flashduty OpenAPI schema.
type McpServerGetRequest ¶ added in v0.4.0
type McpServerGetRequest struct {
// Target MCP server ID, from the list returned by `POST /safari/mcp/server/list`.
ServerID string `json:"server_id" toon:"server_id"`
}
McpServerGetRequest is generated from the Flashduty OpenAPI schema.
type McpServerItem ¶ added in v0.4.0
type McpServerItem struct {
// Owning account ID.
AccountID int64 `json:"account_id" toon:"account_id"`
// LLM-generated description, preferred over `description` when present. Omitted when not yet generated.
AIDescription string `json:"ai_description" toon:"ai_description"`
// Allow this server's OAuth token exchange over plaintext HTTP; testing use only. Omitted when false.
AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http" toon:"allow_insecure_oauth_http"`
// Skip TLS certificate verification when connecting to this server; testing use only. Omitted when false.
AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify" toon:"allow_insecure_tls_skip_verify"`
// Command arguments (stdio transport). Omitted when `can_edit` is `false`.
Args []string `json:"args" toon:"args"`
// Who supplies the credential; omitted when empty, which behaves like `shared`:
// - `shared`: one credential stored on the server (`env` / `headers`) is used for every caller.
// - `per_user_secret`: each user stores their own secret, sent in the header named by `secret_schema.header_name`.
// - `per_user_oauth`: each user completes their own OAuth authorization; discovery and client registration run on first use.
AuthMode string `json:"auth_mode" toon:"auth_mode"`
// Tool-call timeout in seconds as stored; `0` means the 60-second default is used.
CallTimeout int64 `json:"call_timeout" toon:"call_timeout"`
// Whether the caller may update, enable, disable, or delete this server: `true` for an account-scoped server only for the account owner or an admin, for a team server only for members of that team. Create and update responses always return `true`.
CanEdit bool `json:"can_edit" toon:"can_edit"`
// Executable command (stdio transport only).
Command string `json:"command" toon:"command"`
// Connection timeout in seconds as stored; `0` means the 10-second default is used.
ConnectTimeout int64 `json:"connect_timeout" toon:"connect_timeout"`
// Creation time. Unix timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Member ID that created the server.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// Server description.
Description string `json:"description" toon:"description"`
// Environment variables (`stdio` transport). Values under credential-looking names, or encrypted at rest, are masked as `****`. Omitted when empty.
Env map[string]string `json:"env" toon:"env"`
// Execution environments this server is callable from (`cloud` and/or BYOC runner environment IDs). Always present; `[]` means all environments (also the value on legacy rows created before this field).
Environments []string `json:"environments" toon:"environments"`
// HTTP headers (`sse` / `streamable-http` transport), masked by the same rule as `env`. Omitted when empty.
Headers map[string]string `json:"headers" toon:"headers"`
// JSON-encoded OAuth metadata (per_user_oauth mode).
OauthMetadata string `json:"oauth_metadata" toon:"oauth_metadata"`
// Outbound proxy URL used to reach the server. Not settable through the public API; omitted when empty. When `can_edit` is `false`, credentials in the URL are removed and every query value is replaced with `****`.
ProxyURL string `json:"proxy_url" toon:"proxy_url"`
// JSON-encoded secret schema (per_user_secret mode).
SecretSchema string `json:"secret_schema" toon:"secret_schema"`
// Unique MCP server ID (prefix `mcp_`).
ServerID string `json:"server_id" toon:"server_id"`
// MCP server name, unique within its scope (account-wide or one team).
ServerName string `json:"server_name" toon:"server_name"`
// Marketplace template this server was installed from; omitted for servers created by hand.
SourceTemplateName string `json:"source_template_name" toon:"source_template_name"`
// Whether the server's tools are offered to AI SRE sessions:
// - `enabled`: available (default on create).
// - `disabled`: kept but not offered; re-enable with `POST /safari/mcp/server/enable`.
Status string `json:"status" toon:"status"`
// Team scope: 0 = account-wide; >0 = the owning team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Error message from the last connection test; omitted when the last test succeeded or the server was never tested.
TestError string `json:"test_error" toon:"test_error"`
// Time of the last connection test, Unix timestamp in milliseconds; omitted if the server was never tested.
TestedAt TimestampMilli `json:"tested_at" toon:"tested_at"`
// Transport protocol. One of: `stdio` (standard I/O to a local subprocess), `sse` (standalone SSE, the legacy MCP transport), `streamable-http` (the newer HTTP streaming transport).
Transport string `json:"transport" toon:"transport"`
// Last update time. Unix timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Server URL (sse / streamable-http transport). When `can_edit` is `false`, credentials in the URL are removed and every query value is replaced with `****`.
URL string `json:"url" toon:"url"`
}
McpServerItem is generated from the Flashduty OpenAPI schema.
type McpServerListRequest ¶ added in v0.4.0
type McpServerListRequest struct {
ListOptions
// Include account-scoped (`team_id=0`) rows. Defaults to `true`; ignored when `scope` is `account` (always included) or `team` (never included).
IncludeAccount *bool `json:"include_account,omitempty" toon:"include_account,omitempty"`
// Case-insensitive substring search across name, description, AI-generated description, server ID, transport, URL, command, and source template name.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Restrict results to a scope: `account` for account-wide rows only, `team` for the caller's own visible team rows only, or omit (defaults to `all`) for both, subject to team_ids/include_account.
Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
// Restrict to these team IDs. IDs of teams the caller does not belong to are ignored; empty means all of the caller's teams.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
McpServerListRequest is generated from the Flashduty OpenAPI schema.
type McpServerListResponse ¶ added in v0.4.0
type McpServerListResponse struct {
// MCP servers on this page.
Servers []McpServerItem `json:"servers" toon:"servers"`
// Total number of matching servers.
Total int64 `json:"total" toon:"total"`
}
McpServerListResponse is generated from the Flashduty OpenAPI schema.
type McpServerStatusRequest ¶ added in v0.4.0
type McpServerStatusRequest struct {
// Target MCP server ID, from the list returned by `POST /safari/mcp/server/list`.
ServerID string `json:"server_id" toon:"server_id"`
}
McpServerStatusRequest is generated from the Flashduty OpenAPI schema.
type McpServerUpdateRequest ¶ added in v0.4.0
type McpServerUpdateRequest struct {
// Allow OAuth token exchange over plaintext HTTP. Omit to leave unchanged.
AllowInsecureOauthHTTP *bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
// Skip TLS certificate verification. Omit to leave unchanged.
AllowInsecureTlsSkipVerify *bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
// Command arguments (`stdio` transport); replaces the whole list — pass `[]` to clear, omit to leave unchanged.
Args []string `json:"args,omitempty" toon:"args,omitempty"`
// New auth mode; omitted or empty leaves it unchanged. Who supplies the credential:
// - `shared` (default; an empty value behaves the same): one credential stored on the server (`env` / `headers`) is used for every caller.
// - `per_user_secret`: each user stores their own secret, sent in the header named by `secret_schema.header_name`.
// - `per_user_oauth`: each user completes their own OAuth authorization; discovery and client registration run on first use.
//
// `per_user_secret` requires `secret_schema` with a non-empty `header_name`; any other value returns `InvalidParameter`.
AuthMode string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
// New tool-call timeout in seconds; omitted or `0` leaves it unchanged (a stored `0` means the 60-second default).
CallTimeout int64 `json:"call_timeout,omitempty" toon:"call_timeout,omitempty"`
// New executable command (`stdio` transport); omitted or empty leaves it unchanged.
Command string `json:"command,omitempty" toon:"command,omitempty"`
// New connection timeout in seconds; omitted or `0` leaves it unchanged (a stored `0` means the 10-second default).
ConnectTimeout int64 `json:"connect_timeout,omitempty" toon:"connect_timeout,omitempty"`
// New description; omitted or empty leaves it unchanged.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Environment variables (`stdio` transport); replaces the whole map, so keys left out are removed. For a protected key (see the masking rule on get), sending the masked value or an empty string keeps the stored value. Omit to leave unchanged.
Env map[string]string `json:"env,omitempty" toon:"env,omitempty"`
// Execution environments this server is callable from: `cloud` and/or BYOC runner environment IDs. Omit (null) to leave unchanged; send a list to set it — an empty list clears the restriction back to all environments.
Environments []string `json:"environments,omitempty" toon:"environments,omitempty"`
// HTTP headers (`sse` / `streamable-http` transport); replaces the whole map, with the same masked/empty-value preservation as `env`; omit to leave unchanged.
Headers map[string]string `json:"headers,omitempty" toon:"headers,omitempty"`
// New JSON OAuth metadata. A non-empty value is stored as sent. When omitted or empty, the stored value is kept unless `auth_mode` or `url` changes, in which case it is cleared.
OauthMetadata string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
// New JSON secret schema, e.g. `{"header_name":"X-Api-Key"}`. Applied only together with a non-empty `auth_mode`; sent alone it is ignored.
SecretSchema string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
// Target MCP server ID, from the list returned by `POST /safari/mcp/server/list`.
ServerID string `json:"server_id" toon:"server_id"`
// New name; omitted or empty leaves it unchanged.
ServerName string `json:"server_name,omitempty" toon:"server_name,omitempty"`
// Reassign team scope: `0` = account-wide (account owner or admin only); `>0` = a team the caller belongs to. Servers installed from the marketplace can only move to `0`. Omit to leave unchanged.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Transport protocol; when switching, also supply the matching fields (`command`/`args`/`env` for `stdio`, `url`/`headers` for `sse` / `streamable-http`); omitted or empty leaves it unchanged.
Transport string `json:"transport,omitempty" toon:"transport,omitempty"`
// New server URL (`sse` / `streamable-http` transport); omitted or empty leaves it unchanged. A real change also clears `oauth_metadata` unless a new one is sent.
URL string `json:"url,omitempty" toon:"url,omitempty"`
}
McpServerUpdateRequest is generated from the Flashduty OpenAPI schema.
type McpServersService ¶ added in v0.4.0
type McpServersService service
McpServersService handles the "AI SRE/MCP servers" API resource.
func (*McpServersService) ReadServerGet ¶ added in v0.4.0
func (s *McpServersService) ReadServerGet(ctx context.Context, req *McpServerGetRequest) (*McpServerItem, *Response, error)
Get MCP server detail.
Get one MCP server as a pure database read — no live probe is performed.
API: POST /safari/mcp/server/get (mcp-read-server-get).
func (*McpServersService) ReadServerList ¶ added in v0.4.0
func (s *McpServersService) ReadServerList(ctx context.Context, req *McpServerListRequest) (*McpServerListResponse, *Response, error)
List MCP servers.
List MCP servers visible to the caller across account and team scopes, with pagination.
API: POST /safari/mcp/server/list (mcp-read-server-list).
func (*McpServersService) WriteServerCreate ¶ added in v0.4.0
func (s *McpServersService) WriteServerCreate(ctx context.Context, req *McpServerCreateRequest) (*McpServerItem, *Response, error)
Create MCP server.
Register a new MCP server (connector) on the account.
API: POST /safari/mcp/server/create (mcp-write-server-create).
func (*McpServersService) WriteServerDelete ¶ added in v0.4.0
func (s *McpServersService) WriteServerDelete(ctx context.Context, req *McpServerDeleteRequest) (*any, *Response, error)
Delete MCP server.
Delete an MCP server by ID.
API: POST /safari/mcp/server/delete (mcp-write-server-delete).
func (*McpServersService) WriteServerDisable ¶ added in v0.4.0
func (s *McpServersService) WriteServerDisable(ctx context.Context, req *McpServerStatusRequest) (*any, *Response, error)
Disable MCP server.
Disable an enabled MCP server.
API: POST /safari/mcp/server/disable (mcp-write-server-disable).
func (*McpServersService) WriteServerEnable ¶ added in v0.4.0
func (s *McpServersService) WriteServerEnable(ctx context.Context, req *McpServerStatusRequest) (*any, *Response, error)
Enable MCP server.
Enable a disabled MCP server.
API: POST /safari/mcp/server/enable (mcp-write-server-enable).
func (*McpServersService) WriteServerUpdate ¶ added in v0.4.0
func (s *McpServersService) WriteServerUpdate(ctx context.Context, req *McpServerUpdateRequest) (*McpServerItem, *Response, error)
Update MCP server.
Update an MCP server's configuration. Omit a field to leave it unchanged.
API: POST /safari/mcp/server/update (mcp-write-server-update).
type MemberDeleteRequest ¶
type MemberDeleteRequest struct {
// Region hint for parsing `phone` when it has no "+" prefix — an ISO 3166-1 alpha-2 code such as "CN" (the default when omitted). Legacy digit calling codes like "86" are still accepted in this parsing context.
CountryCode string `json:"country_code,omitempty" toon:"country_code,omitempty"`
// Email address. Only used when neither `member_id` nor `member_name` is provided
Email string `json:"email,omitempty" toon:"email,omitempty"`
// Skip the reference check. When false (default), the call fails with `ReferenceExist` if the member belongs to a team, is targeted by an escalation rule, or is in a schedule. A forced delete does not remove those references.
IsForce bool `json:"is_force,omitempty" toon:"is_force,omitempty"`
// Member ID. When several lookup fields are provided, the first non-empty one wins in the order `member_id` > `member_name` > `email` > `phone` > `ref_id`
MemberID uint64 `json:"member_id,omitempty" toon:"member_id,omitempty"`
// Member name. Only used when `member_id` is not provided
MemberName string `json:"member_name,omitempty" toon:"member_name,omitempty"`
// Phone number. Only used when `member_id`, `member_name`, and `email` are all absent
Phone string `json:"phone,omitempty" toon:"phone,omitempty"`
// External reference ID. Only used when all other lookup fields are absent
RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
}
MemberDeleteRequest is generated from the Flashduty OpenAPI schema.
type MemberEmptyObject ¶
type MemberEmptyObject struct{}
MemberEmptyObject is generated from the Flashduty OpenAPI schema.
type MemberInfoRequest ¶
type MemberInfoRequest struct{}
MemberInfoRequest is generated from the Flashduty OpenAPI schema.
type MemberInfoResponse ¶
type MemberInfoResponse struct {
// Account avatar URL
AccountAvatar string `json:"account_avatar" toon:"account_avatar"`
// Contact email of the account owner.
AccountEmail string `json:"account_email" toon:"account_email"`
// ID of the account the member belongs to.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Account-level locale preference (e.g. zh-CN or en-US). Omitted when the account has none set.
AccountLocale string `json:"account_locale" toon:"account_locale"`
// Name of the account (organization).
AccountName string `json:"account_name" toon:"account_name"`
// IDs of the roles assigned to the member; resolve them with `POST /role/list`.
AccountRoleIDs []uint64 `json:"account_role_ids" toon:"account_role_ids"`
// The account's IANA time zone setting; empty string when the account has none. Always present.
AccountTimeZone string `json:"account_time_zone" toon:"account_time_zone"`
// Member avatar URL
Avatar string `json:"avatar" toon:"avatar"`
// ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. "CN", "US", "HK").
CountryCode string `json:"country_code" toon:"country_code"`
// Member creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Account domain, the subdomain used to sign in to the console.
Domain string `json:"domain" toon:"domain"`
// Email address
Email string `json:"email" toon:"email"`
// Whether email is verified
EmailVerified bool `json:"email_verified" toon:"email_verified"`
// Whether provisioned via SSO
IsExternal bool `json:"is_external" toon:"is_external"`
// Member's locale preference. Omitted when the member has none set.
Locale string `json:"locale" toon:"locale"`
// ID of the calling member.
MemberID uint64 `json:"member_id" toon:"member_id"`
// Member display name
MemberName string `json:"member_name" toon:"member_name"`
// Account identifier on the marketplace platform. Omitted together with `mp_plat`.
MpAccountID string `json:"mp_account_id" toon:"mp_account_id"`
// Cloud marketplace the account was provisioned from: `aws` — AWS Marketplace. Omitted when the account did not come from a marketplace.
MpPlat string `json:"mp_plat" toon:"mp_plat"`
// Masked phone number
Phone string `json:"phone" toon:"phone"`
// Whether phone is verified
PhoneVerified bool `json:"phone_verified" toon:"phone_verified"`
// Effective time zone to render times in: the member's `time_zone` if valid, otherwise the account's, otherwise `Asia/Shanghai`. Always present.
ResolvedTimeZone string `json:"resolved_time_zone" toon:"resolved_time_zone"`
// The member's own IANA time zone setting; empty string when the member follows the account's time zone. Always present.
TimeZone string `json:"time_zone" toon:"time_zone"`
}
MemberInfoResponse is generated from the Flashduty OpenAPI schema.
type MemberInviteRequest ¶
type MemberInviteRequest struct {
// Invite source. Only takes effect when the account has member invites disabled and the value is `api`: members are created directly in the enabled state with email/phone marked verified and no invitation sent. Any other value follows the normal invite flow
From string `json:"from,omitempty" toon:"from,omitempty"`
// Members to invite in one call (at least 1). Each entry needs either an `email`, or `member_name` + `phone` together.
Members []InviteMemberItem `json:"members" toon:"members"`
}
MemberInviteRequest is generated from the Flashduty OpenAPI schema.
type MemberInviteResponse ¶
type MemberInviteResponse struct {
// Members created by this call; entries skipped because they already exist are not listed. `null` when no member was created.
Items []NewMemberItem `json:"items" toon:"items"`
}
MemberInviteResponse is generated from the Flashduty OpenAPI schema.
type MemberItem ¶
type MemberItem struct {
// ID of the account the member belongs to.
AccountID uint64 `json:"account_id" toon:"account_id"`
// IDs of the roles assigned to the member: built-in `2` (Admin), `6` (Responder), `8` (Viewer), or custom role IDs from `POST /role/list`.
AccountRoleIDs []uint64 `json:"account_role_ids" toon:"account_role_ids"`
// Avatar image URL or path; empty string when unset.
Avatar string `json:"avatar" toon:"avatar"`
// ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. "CN", "US", "HK").
CountryCode string `json:"country_code" toon:"country_code"`
// Creation timestamp (Unix seconds)
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Email address in lower case; empty string when unset.
Email string `json:"email" toon:"email"`
// `true` once the member has verified the email address.
EmailVerified bool `json:"email_verified" toon:"email_verified"`
// `true` when the member was provisioned through SSO rather than invited or registered.
IsExternal bool `json:"is_external" toon:"is_external"`
// Locale preference. Not populated by `POST /member/list`, so it is always omitted there.
Locale string `json:"locale" toon:"locale"`
// Member ID; the same value is used as the person ID in other APIs (for example `person_ids`).
MemberID uint64 `json:"member_id" toon:"member_id"`
// Display name, unique in the account.
MemberName string `json:"member_name" toon:"member_name"`
// Phone number in E.164 form with the middle digits masked (for example `+86151****6519`); empty string when unset.
Phone string `json:"phone" toon:"phone"`
// `true` once the member has verified the phone number.
PhoneVerified bool `json:"phone_verified" toon:"phone_verified"`
// External reference ID (for example an employee ID in an HR system); empty string when unset.
RefID string `json:"ref_id" toon:"ref_id"`
// Member status. `enabled` — active member; `pending` — invited but has not accepted yet. Removed members are not listed.
Status string `json:"status" toon:"status"`
// The member's own IANA time zone setting (for example `Asia/Shanghai`). Omitted when unset, which means the member follows the account's time zone; `POST /member/info` returns the effective zone.
TimeZone string `json:"time_zone" toon:"time_zone"`
// Update timestamp (Unix seconds)
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
MemberItem is generated from the Flashduty OpenAPI schema.
type MemberListRequest ¶
type MemberListRequest struct {
ListOptions
// Ascending order. Default: false (descending)
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by member ID. Return only the member with this ID.
MemberID uint64 `json:"member_id,omitempty" toon:"member_id,omitempty"`
// Sort field. Default: `updated_at`
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Keyword. Matches a substring of the member name or email; a numeric keyword also matches an exact member ID, and a keyword that parses as a phone number (without `+`, parsed as a Chinese number) also matches the exact phone.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by role ID. Get role IDs from `POST /role/list` (built-in roles: 2=Admin, 6=Responder, 8=Viewer)
RoleID uint64 `json:"role_id,omitempty" toon:"role_id,omitempty"`
}
MemberListRequest is generated from the Flashduty OpenAPI schema.
type MemberListResponse ¶
type MemberListResponse struct {
ListOptions
// Members on this page; empty array when none match.
Items []MemberItem `json:"items" toon:"items"`
// Number of members matching the filters, across all pages.
Total int64 `json:"total" toon:"total"`
}
MemberListResponse is generated from the Flashduty OpenAPI schema.
type MemberNotifyRequest ¶ added in v0.15.3
type MemberNotifyRequest struct {
// Email body as an HTML fragment (no `<html>`/`<head>`/`<body>` wrapper needed); recipients receive it as the whole email body. Required, up to 102,400 bytes of raw UTF-8 input (larger messages are clipped by common email clients), and must be non-empty after sanitization. `<script>`, `<meta>`, `<link>`, and `<base>` tags and all `on*` event handlers are silently removed before sending, since email clients never execute them; inline `style` attributes are kept as written. `<style>`, `<svg>`, `<iframe>`, `<object>`, `<embed>`, `<form>`, `<input>`, and `<button>` tags, an `<img>` with a missing or non-`https` `src` (including `data:`), or an `<a>` whose href scheme is not `http`, `https`, or `mailto` are rejected instead of stripped: the request fails with `400` rather than silently changing what recipients see.
HTML string `json:"html" toon:"html"`
// Recipient member IDs. Optional, up to 20; duplicate and non-positive IDs are dropped. Omitted or empty sends to the caller only.
PersonIDs []int64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
// Email subject, used as written. Required, 1–200 characters. Line breaks are replaced with a space; leading/trailing whitespace is trimmed.
Subject string `json:"subject" toon:"subject"`
}
MemberNotifyRequest is generated from the Flashduty OpenAPI schema.
type MemberNotifyResponse ¶ added in v0.15.3
type MemberNotifyResponse struct {
// Present when the submitted HTML body does not follow the default email layout (no `max-width:600px` wrapper table): guidance telling the calling AI SRE agent how to conform. Advisory only — a format the caller deliberately chose needs no change.
AgentInstructions string `json:"agent_instructions" toon:"agent_instructions"`
// One result per resolved recipient, in the same order as the resolved recipient list.
Recipients []MemberNotifyResultItem `json:"recipients" toon:"recipients"`
}
MemberNotifyResponse is generated from the Flashduty OpenAPI schema.
type MemberNotifyResultItem ¶ added in v0.15.3
type MemberNotifyResultItem struct {
// Recipient member ID.
PersonID int64 `json:"person_id" toon:"person_id"`
// Why the recipient was skipped. Only present when `status` is `skipped`. `not_member` — not an active member of the caller's account; `no_email` — the member has no email address on file; `email_disabled` — the member's notification preferences for this kind of message exclude email; `duplicate` — this recipient already received a message from the same AI SRE session turn; `rate_limited` — this recipient has already been sent 20 emails through this endpoint within the last hour; `send_failed` — enqueueing the email failed.
Reason string `json:"reason" toon:"reason"`
// Delivery status. `accepted` — the email was queued for asynchronous delivery; `skipped` — no email was queued, see `reason`.
Status string `json:"status" toon:"status"`
}
MemberNotifyResultItem is generated from the Flashduty OpenAPI schema.
type MemberOncallInterval ¶ added in v0.15.2
type MemberOncallInterval struct {
// Unix timestamp in seconds when the shift ends. Present on `current`; omitted on `next`.
EndAt Timestamp `json:"end_at" toon:"end_at"`
// Owning schedule ID.
ScheduleID int64 `json:"schedule_id" toon:"schedule_id"`
// Owning schedule name.
ScheduleName string `json:"schedule_name" toon:"schedule_name"`
// Unix timestamp in seconds - when the shift starts.
StartAt Timestamp `json:"start_at" toon:"start_at"`
}
MemberOncallInterval is generated from the Flashduty OpenAPI schema.
type MemberResetInfoRequest ¶
type MemberResetInfoRequest struct {
// Region hint for parsing `phone` when it has no "+" prefix — an ISO 3166-1 alpha-2 code such as "CN" (the default when omitted). Legacy digit calling codes like "86" are still accepted in this parsing context.
CountryCode string `json:"country_code,omitempty" toon:"country_code,omitempty"`
// Email address used to identify the member.
Email string `json:"email,omitempty" toon:"email,omitempty"`
// Set to `api` to mark an updated phone or email as verified. Only takes effect when the account has member invites disabled and the member is not the caller; any other value is ignored.
From string `json:"from,omitempty" toon:"from,omitempty"`
// Member ID used to identify the member.
MemberID uint64 `json:"member_id,omitempty" toon:"member_id,omitempty"`
// Member name used to identify the member.
MemberName string `json:"member_name,omitempty" toon:"member_name,omitempty"`
// Phone number used to identify the member. Include country_code when the number is not in E.164 format.
Phone string `json:"phone,omitempty" toon:"phone,omitempty"`
// External reference ID used to identify the member.
RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
// New profile values to write. Must include at least one field.
Updates MemberResetInfoUpdates `json:"updates" toon:"updates"`
}
MemberResetInfoRequest is generated from the Flashduty OpenAPI schema.
type MemberResetInfoUpdates ¶ added in v0.10.0
type MemberResetInfoUpdates struct {
// New avatar URL.
Avatar *string `json:"avatar,omitempty" toon:"avatar,omitempty"`
// ISO 3166-1 alpha-2 region code (e.g. "CN", "US"). Updated independently — `phone` is not required — and also used as the parsing hint for `phone`. Invalid values are rejected with a 400; an explicit empty string is not allowed.
CountryCode *string `json:"country_code,omitempty" toon:"country_code,omitempty"`
// New email address. Must not belong to another member; the new address is marked unverified (see `from`).
Email *string `json:"email,omitempty" toon:"email,omitempty"`
// New locale preference. One of: `zh-CN` (Simplified Chinese), `en-US` (English); other values are rejected with a 400.
Locale *string `json:"locale,omitempty" toon:"locale,omitempty"`
// New display name, 2–39 characters, unique in the account.
MemberName *string `json:"member_name,omitempty" toon:"member_name,omitempty"`
// New login password in the encrypted format accepted by the backend.
Password *string `json:"password,omitempty" toon:"password,omitempty"`
// New phone number; include `country_code` when it is not in E.164 format. Must not belong to another member; the new number is marked unverified (see `from`).
Phone *string `json:"phone,omitempty" toon:"phone,omitempty"`
// New external reference ID; an empty string clears it.
RefID *string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
// New IANA time zone name such as `Asia/Shanghai`; an empty string clears it so the member follows the account's time zone. An invalid name returns `400`.
TimeZone *string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
MemberResetInfoUpdates is generated from the Flashduty OpenAPI schema.
type MemberRoleGrantRequest ¶
type MemberRoleGrantRequest struct {
// ID of the member whose roles change (from `POST /member/list`).
MemberID uint64 `json:"member_id" toon:"member_id"`
// Role IDs to grant; appended to the member's current roles (duplicates are deduplicated).
RoleIDs []uint64 `json:"role_ids" toon:"role_ids"`
}
MemberRoleGrantRequest is generated from the Flashduty OpenAPI schema.
type MemberRoleRevokeRequest ¶
type MemberRoleRevokeRequest struct {
// ID of the member whose roles change (from `POST /member/list`).
MemberID uint64 `json:"member_id" toon:"member_id"`
// Role IDs to remove from the member.
RoleIDs []uint64 `json:"role_ids" toon:"role_ids"`
}
MemberRoleRevokeRequest is generated from the Flashduty OpenAPI schema.
type MemberRoleUpdateRequest ¶
type MemberRoleUpdateRequest struct {
// ID of the member whose roles change (from `POST /member/list`).
MemberID uint64 `json:"member_id" toon:"member_id"`
// New role ID set; replaces the member's existing roles entirely (not additive). Get IDs from `POST /role/list`.
RoleIDs []uint64 `json:"role_ids,omitempty" toon:"role_ids,omitempty"`
}
MemberRoleUpdateRequest is generated from the Flashduty OpenAPI schema.
type MemberScheduleItem ¶ added in v0.15.2
type MemberScheduleItem struct {
// ID of a schedule the member participates in; pass it to `/schedule/info`.
ScheduleID int64 `json:"schedule_id" toon:"schedule_id"`
// Name of that schedule.
ScheduleName string `json:"schedule_name" toon:"schedule_name"`
}
MemberScheduleItem is generated from the Flashduty OpenAPI schema.
type MembersService ¶
type MembersService service
MembersService handles the "Platform/Members" API resource.
func (*MembersService) MemberDelete ¶
func (s *MembersService) MemberDelete(ctx context.Context, req *MemberDeleteRequest) (*Response, error)
Delete member.
Remove a member from the organization by ID, email, phone, or name.
API: POST /member/delete (memberDelete).
func (*MembersService) MemberGrantRole ¶
func (s *MembersService) MemberGrantRole(ctx context.Context, req *MemberRoleGrantRequest) (*Response, error)
Grant role to member.
Add one or more roles to a member's existing role assignments.
API: POST /member/role/grant (memberGrantRole).
func (*MembersService) MemberInfo ¶
func (s *MembersService) MemberInfo(ctx context.Context) (*MemberInfoResponse, *Response, error)
Get current member info.
Return the profile and account context of the member who owns the credential.
API: POST /member/info (memberInfo).
func (*MembersService) MemberInvite ¶
func (s *MembersService) MemberInvite(ctx context.Context, req *MemberInviteRequest) (*MemberInviteResponse, *Response, error)
Invite members.
Batch invite new members to the organization by email or phone.
API: POST /member/invite (memberInvite).
func (*MembersService) MemberList ¶
func (s *MembersService) MemberList(ctx context.Context, req *MemberListRequest) (*MemberListResponse, *Response, error)
List members.
Return a paginated list of organization members.
API: POST /member/list (memberList).
func (*MembersService) MemberNotify ¶ added in v0.15.3
func (s *MembersService) MemberNotify(ctx context.Context, req *MemberNotifyRequest) (*MemberNotifyResponse, *Response, error)
Notify members.
Email account members a message written by the calling AI SRE session.
API: POST /member/notify (memberNotify).
func (*MembersService) MemberResetInfo ¶
func (s *MembersService) MemberResetInfo(ctx context.Context, req *MemberResetInfoRequest) (*Response, error)
Reset member info.
Identify a member and reset the specified profile fields.
API: POST /member/info/reset (memberResetInfo).
func (*MembersService) MemberRevokeRole ¶
func (s *MembersService) MemberRevokeRole(ctx context.Context, req *MemberRoleRevokeRequest) (*Response, error)
Revoke role from member.
Remove one or more roles from a member's role assignments.
API: POST /member/role/revoke (memberRevokeRole).
func (*MembersService) MemberUpdateRole ¶
func (s *MembersService) MemberUpdateRole(ctx context.Context, req *MemberRoleUpdateRequest) (*Response, error)
Update member roles.
Replace a member's role assignments with the given set of roles.
API: POST /member/role/update (memberUpdateRole).
func (*MembersService) PersonInfos ¶
func (s *MembersService) PersonInfos(ctx context.Context, req *PersonInfosRequest) (*PersonInfosResponse, *Response, error)
Batch get persons.
Return profile information for a batch of person IDs (members or accounts).
API: POST /person/infos (personInfos).
type MergeIncidentsRequest ¶
type MergeIncidentsRequest struct {
// Optional comment recorded on the merge timeline entry.
Comment string `json:"comment,omitempty" toon:"comment,omitempty"`
// Accepted for compatibility but currently ignored by the server; the merge does not change the target incident owner.
OwnerID int64 `json:"owner_id,omitempty" toon:"owner_id,omitempty"`
// When true, permanently delete the source incidents after their alerts move to the target. When false, the sources are closed and kept.
RemoveSourceIncidents bool `json:"remove_source_incidents,omitempty" toon:"remove_source_incidents,omitempty"`
// Source incident IDs. The target incident is removed from this set automatically.
SourceIncidentIDs []string `json:"source_incident_ids" toon:"source_incident_ids"`
// Target incident ID of the merge; obtain it from `POST /incident/list`.
TargetIncidentID string `json:"target_incident_id" toon:"target_incident_id"`
// Optional new title for the target incident.
Title string `json:"title,omitempty" toon:"title,omitempty"`
}
MergeIncidentsRequest is generated from the Flashduty OpenAPI schema.
type MetricsBase ¶
type MetricsBase struct {
// Channel ID, returned only when aggregating by channel (`/insight/channel`).
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name, returned when aggregating by channel; omitted when the name cannot be resolved.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Hour bucket when `split_hours` is enabled. `work` is Mon–Fri 08:00–19:00, `sleep` is daily 23:00–08:00, and `off` is everything else, all evaluated in the account timezone (`sleep` takes precedence over `work`). Omitted when `split_hours` is false.
Hours string `json:"hours" toon:"hours"`
// Responder (person) ID, returned only when aggregating by responder (`/insight/responder`).
ResponderID int64 `json:"responder_id" toon:"responder_id"`
// Responder name, returned when aggregating by responder; omitted when the name cannot be resolved.
ResponderName string `json:"responder_name" toon:"responder_name"`
// Team ID, returned only by `/insight/team`. Omitted on the row that aggregates incidents without a team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Team name, returned when aggregating by team; omitted when the name cannot be resolved (e.g. team deleted).
TeamName string `json:"team_name" toon:"team_name"`
// Start of the time bucket, Unix seconds. Equals `start_time` when `aggregate_unit` is not set.
TS Timestamp `json:"ts" toon:"ts"`
}
MetricsBase is generated from the Flashduty OpenAPI schema.
type MigrateStatusPageEmailSubscribersRequest ¶
type MigrateStatusPageEmailSubscribersRequest struct {
// Atlassian Statuspage API key with access to the source page.
APIKey string `json:"api_key" toon:"api_key"`
// Atlassian Statuspage source page ID; only letters, digits, `_`, and `-` are accepted.
SourcePageID string `json:"source_page_id" toon:"source_page_id"`
// Flashduty target status page ID that will receive the imported subscribers.
TargetPageID int64 `json:"target_page_id" toon:"target_page_id"`
}
MigrateStatusPageEmailSubscribersRequest is generated from the Flashduty OpenAPI schema.
type MigrateStatusPageStructureRequest ¶
type MigrateStatusPageStructureRequest struct {
// Atlassian Statuspage API key with access to the source page.
APIKey string `json:"api_key" toon:"api_key"`
// Atlassian Statuspage source page ID; only letters, digits, `_`, and `-` are accepted.
SourcePageID string `json:"source_page_id" toon:"source_page_id"`
// Target URL name for the new status page, normalized to a URL-safe slug (max 255 characters). Omit or pass null to derive it from the source page name; an explicitly empty string is rejected.
URLName *string `json:"url_name,omitempty" toon:"url_name,omitempty"`
}
MigrateStatusPageStructureRequest is generated from the Flashduty OpenAPI schema.
type MySQLQueryParams ¶ added in v0.15.2
type MySQLQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
}
MySQLQueryParams are the params for `mysql.query`. Expr is a single read-only SQL statement. Execution.Kind must be `window`.
type NameMessage ¶
type NameMessage struct {
// Outcome for this rule. On success it is empty for `/monit/rule/update/fields` and a localized success text (`Move successfully` / `移动成功`) for `/monit/rule/move`; on failure it carries the error message.
Message string `json:"message" toon:"message"`
// Name of the rule this result belongs to; `id: <id>` when the rule ID does not exist.
Name string `json:"name" toon:"name"`
}
NameMessage is generated from the Flashduty OpenAPI schema.
type NewMemberItem ¶
type NewMemberItem struct {
// ID of the newly created member.
MemberID uint64 `json:"member_id" toon:"member_id"`
// Display name stored for the member; derived from the email prefix when `member_name` was omitted.
MemberName string `json:"member_name" toon:"member_name"`
}
NewMemberItem is generated from the Flashduty OpenAPI schema.
type NotificationTemplatesService ¶
type NotificationTemplatesService service
NotificationTemplatesService handles the "On-call/Notification templates" API resource.
func (*NotificationTemplatesService) ReadInfo ¶
func (s *NotificationTemplatesService) ReadInfo(ctx context.Context, req *TemplateIDRequest) (*TemplateItem, *Response, error)
Get template detail.
Return a single notification template by ID.
API: POST /template/info (template-read-info).
func (*NotificationTemplatesService) ReadList ¶
func (s *NotificationTemplatesService) ReadList(ctx context.Context, req *TemplateListRequest) (*TemplateListResponse, *Response, error)
List templates.
Return a paginated list of notification templates.
API: POST /template/list (template-read-list).
func (*NotificationTemplatesService) ReadPreview ¶ added in v0.4.0
func (s *NotificationTemplatesService) ReadPreview(ctx context.Context, req *PreviewTemplateRequest) (*PreviewTemplateResponse, *Response, error)
Preview template.
Render a template source against an incident or mock data and return what the channel would send.
API: POST /template/preview (template-read-preview).
func (*NotificationTemplatesService) WriteCreate ¶
func (s *NotificationTemplatesService) WriteCreate(ctx context.Context, req *TemplateCreateRequest) (*TemplateCreateResponse, *Response, error)
Create a template.
Create a notification template with per-channel message sources.
API: POST /template/create (template-write-create).
func (*NotificationTemplatesService) WriteDelete ¶
func (s *NotificationTemplatesService) WriteDelete(ctx context.Context, req *TemplateIDRequest) (*Response, error)
Delete a template.
Soft-delete a notification template by ID.
API: POST /template/delete (template-write-delete).
func (*NotificationTemplatesService) WriteUpdate ¶
func (s *NotificationTemplatesService) WriteUpdate(ctx context.Context, req *TemplateUpdateRequest) (*Response, error)
Update a template.
Update a notification template; only the fields present in the request are written.
API: POST /template/update (template-write-update).
type NotifyChat ¶
type NotifyChat struct {
// Chat group identifier.
ChatID string `json:"chat_id" toon:"chat_id"`
// Chat group display name.
ChatName string `json:"chat_name" toon:"chat_name"`
// Integration data source ID used to send the notification.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Localized, human-readable reason the delivery failed, as reported by the delivery channel; omitted when delivery succeeded or no failure was reported. The text is not a fixed code set.
FailedReason string `json:"failed_reason" toon:"failed_reason"`
}
NotifyChat is generated from the Flashduty OpenAPI schema.
type NotifyPerson ¶
type NotifyPerson struct {
// Localized, human-readable reason the delivery failed, as reported by the delivery channel; omitted when delivery succeeded or no failure was reported. The text is not a fixed code set.
FailedReason string `json:"failed_reason" toon:"failed_reason"`
// Recipient member ID.
PersonID int64 `json:"person_id" toon:"person_id"`
// SMS text delivered to the recipient; present on SMS deliveries.
SMSContent string `json:"sms_content" toon:"sms_content"`
}
NotifyPerson is generated from the Flashduty OpenAPI schema.
type NotifyRobot ¶
type NotifyRobot struct {
// Robot alias.
Alias string `json:"alias" toon:"alias"`
// Localized, human-readable reason the delivery failed, as reported by the delivery channel; omitted when delivery succeeded or no failure was reported. The text is not a fixed code set.
FailedReason string `json:"failed_reason" toon:"failed_reason"`
// Robot token or identifier.
Token string `json:"token" toon:"token"`
}
NotifyRobot is generated from the Flashduty OpenAPI schema.
type OnceTimeFilter ¶
type OnceTimeFilter struct {
// Window end, Unix timestamp in seconds. Must be greater than 0.
EndTime int64 `json:"end_time" toon:"end_time"`
// Window start, Unix timestamp in seconds. Must be greater than 0 and less than `end_time`.
StartTime int64 `json:"start_time" toon:"start_time"`
}
OnceTimeFilter is generated from the Flashduty OpenAPI schema.
type Option ¶
type Option func(*Client)
Option configures a Client during NewClient.
func WithBaseURL ¶
WithBaseURL overrides the API base URL (default https://api.flashcat.cloud). A path prefix is preserved: with "https://gateway.example.com/api", requests go to /api/<endpoint>. The path is normalized to end with "/" so that relative resolution appends endpoint paths instead of replacing the last path segment.
func WithHTTPClient ¶
WithHTTPClient supplies a custom *http.Client. Nil is ignored.
func WithRequestHeaders ¶
WithRequestHeaders sets static headers added to every request, applied after the SDK's own headers (Content-Type, Accept, User-Agent).
func WithRequestHook ¶
WithRequestHook registers a callback invoked on every outgoing request before it is sent — use it to inject per-request headers (e.g. W3C traceparent).
func WithTimeout ¶
WithTimeout sets the HTTP client timeout.
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Option
WithTransport sets a custom http.RoundTripper on the underlying client — the idiomatic seam for retry, caching, tracing, or rate-limit middleware (see the retry subpackage). Nil is ignored.
Example (Retry) ¶
ExampleWithTransport_retry composes the retry helper as the client transport.
package main
import (
"fmt"
"log"
"net/http"
flashduty "github.com/flashcatcloud/go-flashduty"
"github.com/flashcatcloud/go-flashduty/retry"
)
func main() {
// retry.New returns an http.RoundTripper that transparently
// retries safe requests on 429 and 5xx responses with backoff.
var rt http.RoundTripper = retry.New()
client, err := flashduty.NewClient(
"YOUR_APP_KEY",
flashduty.WithTransport(rt),
)
if err != nil {
log.Fatal(err)
}
_ = client
fmt.Println("client with retry transport ready")
}
Output:
func WithUserAgent ¶
WithUserAgent sets the User-Agent header sent on every request.
type OrFilterGroup ¶
type OrFilterGroup [][]FilterCondition
OrFilterGroup is a list response payload.
type OracleQueryParams ¶ added in v0.15.2
type OracleQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
}
OracleQueryParams are the params for `oracle.query`. Expr is a single read-only SQL statement. Execution.Kind must be `window`.
type PastIncidentItem ¶
type PastIncidentItem struct {
// Account ID that owns the incident.
AccountID int64 `json:"account_id" toon:"account_id"`
// Always an empty string in API responses; filled only when the incident is rendered for notifications.
AccountLocale string `json:"account_locale" toon:"account_locale"`
// Always an empty string in API responses; filled only when the incident is rendered for notifications.
AccountName string `json:"account_name" toon:"account_name"`
// Always an empty string in API responses; filled only when the incident is rendered for notifications.
AccountTimeZone string `json:"account_time_zone" toon:"account_time_zone"`
// Unix timestamp (seconds) when the incident was first acknowledged. 0 if unacknowledged.
AckTime Timestamp `json:"ack_time" toon:"ack_time"`
// Count of alerts currently in Critical/Warning/Info state.
ActiveAlertCnt int64 `json:"active_alert_cnt" toon:"active_alert_cnt"`
// Reserved; always an empty string.
AISummary string `json:"ai_summary" toon:"ai_summary"`
// Total count of alerts merged into this incident.
AlertCnt int64 `json:"alert_cnt" toon:"alert_cnt"`
// Total raw alert event count across all merged alerts.
AlertEventCnt int64 `json:"alert_event_cnt" toon:"alert_event_cnt"`
// Not returned by the incident endpoints; present only in notification template and custom action payloads.
Alerts []AlertInfo `json:"alerts" toon:"alerts"`
// Current assignment target. Always present; for an incident that was never assigned, `type` and `id` are empty and `assigned_at` is `0`.
AssignedTo AssignedTo `json:"assigned_to" toon:"assigned_to"`
// Channel ID. 0 for standalone incidents.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel display name.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Status of the channel: `enabled`, `disabled`, or `deleted`. Empty string when the record has no channel or the channel no longer exists.
ChannelStatus string `json:"channel_status" toon:"channel_status"`
// Unix timestamp (seconds) when the incident was closed. 0 if still open.
CloseTime Timestamp `json:"close_time" toon:"close_time"`
// Closer member info.
Closer PersonShort `json:"closer" toon:"closer"`
// Member ID that closed the incident. 0 if auto-closed.
CloserID int64 `json:"closer_id" toon:"closer_id"`
// Creation timestamp (seconds).
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Creator member info.
Creator PersonShort `json:"creator" toon:"creator"`
// Member ID that created the incident. 0 if auto-created by the system.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Deprecated. Use `integration_id` instead.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Deprecated. Use `integration_ids` instead.
DataSourceIDs []int64 `json:"data_source_ids" toon:"data_source_ids"`
// Deprecated; same value as `integration_type`.
DataSourceType string `json:"data_source_type" toon:"data_source_type"`
// Deprecated. Use `integration_types` instead.
DataSourceTypes []string `json:"data_source_types" toon:"data_source_types"`
// Deduplication key used to coalesce alerts.
DedupKey string `json:"dedup_key" toon:"dedup_key"`
// Soft-delete timestamp (seconds). Zero if not deleted.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Incident description.
Description string `json:"description" toon:"description"`
// Web console URL for the incident.
DetailURL string `json:"detail_url" toon:"detail_url"`
// Unix timestamp (seconds) when the incident ended. 0 if still active.
EndTime Timestamp `json:"end_time" toon:"end_time"`
// MD5 hash used for content-equality checks.
EqualsMD5 string `json:"equals_md5" toon:"equals_md5"`
// Whether the incident has ever been silenced.
EverMuted bool `json:"ever_muted" toon:"ever_muted"`
// Custom field values keyed by field name.
Fields map[string]any `json:"fields" toon:"fields"`
// Frequency bucket for recurrence analysis: `frequent` or `rare`.
Frequency string `json:"frequency" toon:"frequency"`
// Alert grouping method: `i` intelligent, `p` pattern, `n` none.
GroupMethod string `json:"group_method" toon:"group_method"`
// `true` when the incident still has at least one action item or follow-up that is neither `done` nor `cancelled`.
HasUnfinishedWorkItem bool `json:"has_unfinished_work_item" toon:"has_unfinished_work_item"`
// Images attached to the incident; `null` when there are none. Tokens starting with `img_` are returned as download URLs.
Images []Image `json:"images" toon:"images"`
// Impact description.
Impact string `json:"impact" toon:"impact"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// Configured incident severity.
IncidentSeverity string `json:"incident_severity" toon:"incident_severity"`
// Current incident status, derived from alert statuses.
IncidentStatus string `json:"incident_status" toon:"incident_status"`
// First integration associated with the incident.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// IDs of all integrations contributing alerts to this incident; `null` for incidents without integrations, such as manually created ones.
IntegrationIDs []int64 `json:"integration_ids" toon:"integration_ids"`
// Plugin type of the incident's first integration (see `integration_types` for all). Open set, for example `prometheus.alert` or `monit.alert`; `POST /integration/type/list` returns the full list. Omitted when the incident has no integration or the endpoint does not fill it.
IntegrationType string `json:"integration_type" toon:"integration_type"`
// Plugin types of all contributing integrations (see `integration_type`); `null` when there are none.
IntegrationTypes []string `json:"integration_types" toon:"integration_types"`
// Labels on the incident, propagated from alerts or set at creation.
Labels map[string]string `json:"labels" toon:"labels"`
// Unix timestamp (seconds) of the most recent update.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Channel-level link integrations rendered for this incident.
Links []LinkItem `json:"links" toon:"links"`
// Fields edited manually and therefore no longer overwritten by merged alerts: `title`, `description`, `incident_severity`. `null` when none.
ManualOverrides []string `json:"manual_overrides" toon:"manual_overrides"`
// Short display identifier; not guaranteed unique.
Num string `json:"num" toon:"num"`
// Owner member info. May be deprecated.
Owner PersonShort `json:"owner" toon:"owner"`
// Primary owner member ID. 0 if none.
OwnerID int64 `json:"owner_id" toon:"owner_id"`
// Associated post-mortem ID, if any. One incident can only link to a single post-mortem.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Incident progress. `Triggered` means fired and unacknowledged; `Processing` means acknowledged and being handled (un-acknowledging moves it back to `Triggered`); `Closed` means resolved.
Progress string `json:"progress" toon:"progress"`
// Reporter email for manually created incidents.
ReporterEmail string `json:"reporter_email" toon:"reporter_email"`
// Resolution notes.
Resolution string `json:"resolution" toon:"resolution"`
// Current responders with assignment/acknowledgement state.
Responders []Responder `json:"responders" toon:"responders"`
// Root cause analysis.
RootCause string `json:"root_cause" toon:"root_cause"`
// Similarity score from the vector search.
Score float64 `json:"score" toon:"score"`
// Quick-silence URL for this incident.
SilenceURL string `json:"silence_url" toon:"silence_url"`
// Unix timestamp (seconds) until which notifications are snoozed. 0 if not snoozed.
SnoozedBefore Timestamp `json:"snoozed_before" toon:"snoozed_before"`
// Unix timestamp (seconds) when the incident started.
StartTime Timestamp `json:"start_time" toon:"start_time"`
// ID of the team that owns the incident's channel. 0 when the channel has no team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Incident title.
Title string `json:"title" toon:"title"`
// Last update timestamp (seconds).
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
PastIncidentItem is generated from the Flashduty OpenAPI schema.
type PendingUserMessage ¶ added in v0.15.4
type PendingUserMessage struct {
// Client-supplied message ID, echoed back for de-duplication. Omitted when absent.
ClientMsgID string `json:"client_msg_id" toon:"client_msg_id"`
// Invocation ID of the queued message.
InvocationID string `json:"invocation_id" toon:"invocation_id"`
// Request parts passed through verbatim (text, file, ref, or skill entries). Omitted when the original message carried none.
Parts []map[string]any `json:"parts" toon:"parts"`
// Person ID of the sender.
PersonID int64 `json:"person_id" toon:"person_id"`
// Message text.
Query string `json:"query" toon:"query"`
// True when the message was sent as a mid-turn steering instruction. Omitted when false.
Steering bool `json:"steering" toon:"steering"`
}
PendingUserMessage is generated from the Flashduty OpenAPI schema.
type PermissionFactorItem ¶
type PermissionFactorItem struct {
// Factor identifier (e.g., 'template:read:info').
FactorName string `json:"factor_name" toon:"factor_name"`
// Factor type. `api`: backend API factor — `factor_name` is the API name (e.g. `skill:write:upload`), enforced at the gateway; `button`: UI action factor, used by the role-config page to render action toggles; `visit`: page-visit factor (custom menu pages use this type); `menu`: menu-visibility factor (legacy, no current seed data); `url`: page route-path factor (legacy, no current seed data).
FactorType string `json:"factor_type" toon:"factor_type"`
// Origin of the factor. `system` — seeded built-in factor; `account` — dynamic factor created for this account (e.g. custom menus).
Source string `json:"source" toon:"source"`
// Primary key of the source object (e.g. the custom menu ID) for account-scoped factors. Omitted when empty.
SourceRef string `json:"source_ref" toon:"source_ref"`
}
PermissionFactorItem is generated from the Flashduty OpenAPI schema.
type PermissionFactorListRequest ¶
type PermissionFactorListRequest struct {
// Filter by factor type.
FactorTypes []string `json:"factor_types,omitempty" toon:"factor_types,omitempty"`
}
PermissionFactorListRequest is generated from the Flashduty OpenAPI schema.
type PermissionFactorListResponse ¶
type PermissionFactorListResponse []PermissionFactorItem
PermissionFactorListResponse is a list response payload.
type PermissionItem ¶
type PermissionItem struct {
// Owning account ID. Omitted when 0, i.e. for system-level permissions.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Permission class (e.g., 'On-call', 'Organization').
Class string `json:"class" toon:"class"`
// Human-readable permission description.
Description string `json:"description" toon:"description"`
// Unique permission ID.
ID uint64 `json:"id" toon:"id"`
// Whether this permission is granted to the roles given in `role_ids`. Always present in this endpoint's response; `false` entries only appear when `with_all` is true.
IsGranted bool `json:"is_granted" toon:"is_granted"`
// Permission display name.
PermissionName string `json:"permission_name" toon:"permission_name"`
// Whether this is a read or manage permission. `read`: view-only permission (read/list/query); `manage`: administrative permission covering mutations (create, update, delete, configure).
PermissionType string `json:"permission_type" toon:"permission_type"`
// Functional scope the permission applies to.
//
// | value | meaning |
// | --- | --- |
// | `account` | Account settings and API keys |
// | `organization` | Members, teams, roles, audit |
// | `on-call` | On-call incident management |
// | `monit` | Monitoring |
// | `rum` | Real user monitoring |
// | `ai-sre` | AI SRE features |
// | `custom_menu` | Account-defined custom menu pages (on-premises only) |
Scope string `json:"scope" toon:"scope"`
// Origin of the permission. `system` — seeded built-in permission; `account` — dynamic permission created for this account (e.g. custom menus).
Source string `json:"source" toon:"source"`
// Primary key of the source object (e.g. the custom menu ID) for account-scoped permissions. Omitted when empty.
SourceRef string `json:"source_ref" toon:"source_ref"`
// Permission status. `enabled` — active; `deleted` — removed (deleted permissions are filtered out and never returned).
Status string `json:"status" toon:"status"`
}
PermissionItem is generated from the Flashduty OpenAPI schema.
type PersonInfosRequest ¶
type PersonInfosRequest struct {
// Person IDs to look up — these are member IDs (get them from `POST /member/list`). Passing the account ID returns the account principal; unknown IDs are ignored
PersonIDs []uint64 `json:"person_ids" toon:"person_ids"`
}
PersonInfosRequest is generated from the Flashduty OpenAPI schema.
type PersonInfosResponse ¶
type PersonInfosResponse struct {
// Person profiles
Items []PersonItem `json:"items" toon:"items"`
}
PersonInfosResponse is generated from the Flashduty OpenAPI schema.
type PersonItem ¶
type PersonItem struct {
// ID of the account the person belongs to.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Principal kind: `account` — the account owner principal; `member` — an organization member.
As string `json:"as" toon:"as"`
// Avatar URL. Omitted when empty.
Avatar string `json:"avatar" toon:"avatar"`
// Email address. Omitted when empty.
Email string `json:"email" toon:"email"`
// `true` when the email address is verified; for the account owner, `true` whenever an email is set.
EmailVerified bool `json:"email_verified" toon:"email_verified"`
// Locale preference (`zh-CN` or `en-US`). Omitted when unset.
Locale string `json:"locale" toon:"locale"`
// Person ID: the account ID for the account owner, otherwise the member ID.
PersonID uint64 `json:"person_id" toon:"person_id"`
// Display name. Omitted when empty.
PersonName string `json:"person_name" toon:"person_name"`
// Phone number. Omitted when empty — this endpoint never populates it.
Phone string `json:"phone" toon:"phone"`
// Whether the phone is verified. Always false in this endpoint's response.
PhoneVerified bool `json:"phone_verified" toon:"phone_verified"`
// Person status. `enabled` — active; `pending` — invited but not yet accepted; `deleted` — removed. Omitted when empty.
Status string `json:"status" toon:"status"`
// IANA time zone setting: the member's own setting, or the account's for the account owner. Omitted when unset (a member without a setting follows the account's time zone).
TimeZone string `json:"time_zone" toon:"time_zone"`
}
PersonItem is generated from the Flashduty OpenAPI schema.
type PersonShort ¶
type PersonShort struct {
// Role label for this member in the context of the current object.
As string `json:"as" toon:"as"`
// Member email address.
Email string `json:"email" toon:"email"`
// Member ID; the same ID that `POST /member/list` returns.
PersonID int64 `json:"person_id" toon:"person_id"`
// Member display name.
PersonName string `json:"person_name" toon:"person_name"`
}
PersonShort is generated from the Flashduty OpenAPI schema.
type PipelineStep ¶ added in v0.16.0
type PipelineStep struct {
// `condition_not_met`, `no_active_source_alert`, `inhibit_not_evaluated` or `recovery_event` for those outcomes; otherwise the resulting value or the error message.
Detail string `json:"detail" toon:"detail"`
// Zero-based position of the rule in `rules`.
Index int64 `json:"index" toon:"index"`
// Rule type that ran.
// | Value | Meaning |
// |---|---|
// | `title_reset` | Rewrote the title from the rule's template. |
// | `description_reset` | Rewrote the description from the rule's template. |
// | `severity_reset` | Reset the severity and status to the rule's `severity`. |
// | `alert_drop` | Discarded the event; no alert is created. |
// | `alert_inhibit` | Discarded the event while a matching source alert is active. |
Kind string `json:"kind" toon:"kind"`
// Outcome of the rule: `applied` (it changed the event or stopped the pipeline), `not_matched` (its `if` conditions did not all match), or `not_executed` (an earlier rule stopped the pipeline, or the event is a recovery).
Result string `json:"result" toon:"result"`
}
PipelineStep is generated from the Flashduty OpenAPI schema.
type PlatformEmptyObject ¶
type PlatformEmptyObject struct{}
PlatformEmptyObject is generated from the Flashduty OpenAPI schema.
type PostMortemContentResetResponse ¶ added in v0.5.9
type PostMortemContentResetResponse struct {
// New collaboration document generation after the reset.
Generation int64 `json:"generation" toon:"generation"`
// UTF-8 byte length of the accepted Markdown content.
MarkdownBytes int64 `json:"markdown_bytes" toon:"markdown_bytes"`
// SHA-256 hex digest of the accepted Markdown content.
MarkdownSha256 string `json:"markdown_sha256" toon:"markdown_sha256"`
// ID of the reset post-mortem report.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Collaboration document generation before the reset.
PreviousGeneration int64 `json:"previous_generation" toon:"previous_generation"`
// Content revision before the reset.
PreviousRevision int64 `json:"previous_revision" toon:"previous_revision"`
// New content revision after the reset.
Revision int64 `json:"revision" toon:"revision"`
}
PostMortemContentResetResponse is generated from the Flashduty OpenAPI schema.
type PostMortemItem ¶
type PostMortemItem struct {
// Basics aggregated automatically from the linked incidents: highest severity, earliest start / latest close time, total duration, and responders.
Basics PostMortemItemBasics `json:"basics" toon:"basics"`
// Post-mortem body; the object holds a single `content` field whose value is a BlockNote JSON string.
Content PostMortemItemContent `json:"content" toon:"content"`
// Follow-up action items rendered as a single string.
FollowUps string `json:"follow_ups" toon:"follow_ups"`
// `true` when at least one linked incident is not closed yet; follow-ups stay locked until all are closed. Computed per request.
HasActiveIncident bool `json:"has_active_incident" toon:"has_active_incident"`
Meta PostMortemMeta `json:"meta" toon:"meta"`
}
PostMortemItem is generated from the Flashduty OpenAPI schema.
type PostMortemItemBasics ¶
type PostMortemItemBasics struct {
// Earliest start time among linked incidents (Unix seconds).
IncidentsEarliestStartSeconds Timestamp `json:"incidents_earliest_start_seconds" toon:"incidents_earliest_start_seconds"`
// Highest severity among linked incidents: `Critical`, `Warning`, or `Info`; `Ok` only when it was set manually.
IncidentsHighestSeverity string `json:"incidents_highest_severity" toon:"incidents_highest_severity"`
// Latest close time among linked incidents (Unix seconds); an incident not yet closed contributes its `end_time`.
IncidentsLatestCloseSeconds Timestamp `json:"incidents_latest_close_seconds" toon:"incidents_latest_close_seconds"`
// Seconds from the earliest start to the latest close among linked incidents (not the sum of each incident's duration).
IncidentsTotalDurationSeconds int64 `json:"incidents_total_duration_seconds" toon:"incidents_total_duration_seconds"`
// Responders involved in the incident(s).
Responders []Responder `json:"responders" toon:"responders"`
}
PostMortemItemBasics is generated from the Flashduty OpenAPI schema.
type PostMortemItemContent ¶
type PostMortemItemContent struct {
// Report body content (BlockNote JSON).
Content string `json:"content" toon:"content"`
}
PostMortemItemContent is generated from the Flashduty OpenAPI schema.
type PostMortemMeta ¶
type PostMortemMeta struct {
// ID of the account that owns this record; the same for every record returned to one `app_key`.
AccountID int64 `json:"account_id" toon:"account_id"`
// Member IDs that contributed to the report.
AuthorIDs []int64 `json:"author_ids" toon:"author_ids"`
// Owning channel ID. 0 if none.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name, filled by the server.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Creation timestamp (seconds).
CreatedAtSeconds Timestamp `json:"created_at_seconds" toon:"created_at_seconds"`
// Collaboration document generation. Incremented by each full content reset; 0 for legacy documents.
Generation int64 `json:"generation" toon:"generation"`
// Linked incident IDs.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
// When true, only team members and admins can view.
IsPrivate bool `json:"is_private" toon:"is_private"`
// Number of uploaded media files.
MediaCount int64 `json:"media_count" toon:"media_count"`
// Post-mortem ID: a 32-character hex string derived from the account ID and the linked incident IDs.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Content revision for optimistic concurrency. Monotonically increases on collaborative saves and full content resets.
Revision int64 `json:"revision" toon:"revision"`
// Post-mortem status. `drafting` means still being edited; `published` means published.
Status string `json:"status" toon:"status"`
// Owning team ID. 0 if none.
TeamID int64 `json:"team_id" toon:"team_id"`
// Template used to initialize the report.
TemplateID string `json:"template_id" toon:"template_id"`
// Report title.
Title string `json:"title" toon:"title"`
// Last update timestamp (seconds).
UpdatedAtSeconds Timestamp `json:"updated_at_seconds" toon:"updated_at_seconds"`
}
PostMortemMeta is generated from the Flashduty OpenAPI schema.
type PostMortemTemplate ¶ added in v0.5.4
type PostMortemTemplate struct {
// Account ID that owns the template; 0 for the built-in template.
AccountID int64 `json:"account_id" toon:"account_id"`
// Template body as BlockNote editor JSON (an array of blocks), serialized as a string.
Content string `json:"content" toon:"content"`
// Markdown version of the template content, used by AI generation.
ContentMarkdown string `json:"content_markdown" toon:"content_markdown"`
// Creation time, Unix timestamp in seconds; 0 for the built-in template.
CreatedAtSeconds Timestamp `json:"created_at_seconds" toon:"created_at_seconds"`
// Template description.
Description string `json:"description" toon:"description"`
// Template name shown in the console.
Name string `json:"name" toon:"name"`
// Managing team ID; 0 for the built-in template.
TeamID int64 `json:"team_id" toon:"team_id"`
// Template ID: `post_mortem_default_tmpl_zh-cn` or `post_mortem_default_tmpl_en-us` for the built-in templates, a server-generated ID for custom ones.
TemplateID string `json:"template_id" toon:"template_id"`
// Last update time, Unix timestamp in seconds; 0 for the built-in template.
UpdatedAtSeconds Timestamp `json:"updated_at_seconds" toon:"updated_at_seconds"`
}
PostMortemTemplate is generated from the Flashduty OpenAPI schema.
type PostgresQueryParams ¶ added in v0.15.2
type PostgresQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
}
PostgresQueryParams are the params for `postgres.query`. Expr is a single read-only SQL statement. Execution.Kind must be `window`.
type PreflightResult ¶ added in v0.5.7
type PreflightResult struct {
// App the rule is scoped to. Currently always ai-sre; manual runs are only supported for that app.
AppName string `json:"app_name" toon:"app_name"`
// Names of the readiness checks performed, in order. Current fixed set: rule_loaded, actor_authorized, app_allowed, runtime_scope_resolved, rule_config_valid.
Checks []string `json:"checks" toon:"checks"`
// Whether all readiness checks passed. Always `true` in a 200 response; a failed preflight returns an error instead.
OK bool `json:"ok" toon:"ok"`
// Rule owner person ID.
OwnerID int64 `json:"owner_id" toon:"owner_id"`
// Resolved run scope for this run; mirrors the rule's run_scope. One of: `person` (personal rule, runs as its creator), `team` (team rule, runs under the owning team).
Scope string `json:"scope" toon:"scope"`
// Rule's scope team ID; 0 means a personal rule.
TeamID int64 `json:"team_id" toon:"team_id"`
// Non-fatal warnings from preflight. Currently never populated, so the field is omitted.
Warnings []string `json:"warnings" toon:"warnings"`
}
PreflightResult is generated from the Flashduty OpenAPI schema.
type PreviewRemoteConfigRequest ¶ added in v0.15.2
type PreviewRemoteConfigRequest struct {
// App version the simulated client reports, compared exactly with rules' `match.app_version` (no range or prefix matching). Omitted = not reported.
AppVersion string `json:"app_version,omitempty" toon:"app_version,omitempty"`
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Draft configuration to evaluate, validated like `POST /rum/application/remote-config/update`. Omit to evaluate the live configuration.
Config RemoteConfig `json:"config,omitzero" toon:"config,omitempty"`
// Environment the simulated client reports, compared exactly with rules' `match.env`. Omitted = not reported, so rules that test `env` cannot match.
Env string `json:"env,omitempty" toon:"env,omitempty"`
// SDK identifier the simulated client reports, e.g. `web@2.4.1`, compared exactly with rules' `match.sdk`. Omitted = not reported.
Sdk string `json:"sdk,omitempty" toon:"sdk,omitempty"`
}
PreviewRemoteConfigRequest is generated from the Flashduty OpenAPI schema.
type PreviewRemoteConfigResponse ¶ added in v0.15.2
type PreviewRemoteConfigResponse struct {
// 0-based index into `config.rules` of the first rule that matched, or `-1` when no rule matched (only `default` applied) or the configuration is disabled or absent.
HitRuleIndex int64 `json:"hit_rule_index" toon:"hit_rule_index"`
// `default` merged with the matching rule's `set`. Fields set by neither are omitted; an empty object means the client keeps all its init values.
Values RemoteConfigValues `json:"values" toon:"values"`
}
PreviewRemoteConfigResponse is generated from the Flashduty OpenAPI schema.
type PreviewTemplateRequest ¶ added in v0.4.0
type PreviewTemplateRequest struct {
// Template source to render for the channel `type`. Empty or omitted previews the channel's built-in preset content. Ignored for `push`.
Content string `json:"content,omitempty" toon:"content,omitempty"`
// Keep blank lines in the body of the Feishu app card v2 preview.
FeishuAppCardV2PreserveBlankLines bool `json:"feishu_app_card_v2_preserve_blank_lines,omitempty" toon:"feishu_app_card_v2_preserve_blank_lines,omitempty"`
// Render Markdown tables in `feishu_app` content as native Feishu card tables, as the template setting of the same name does.
FeishuAppCardV2TableEnabled bool `json:"feishu_app_card_v2_table_enabled,omitempty" toon:"feishu_app_card_v2_table_enabled,omitempty"`
// Incident card fields to hide per IM app when previewing.
IncidentCardHiddenFields IncidentCardHiddenFields `json:"incident_card_hidden_fields,omitempty" toon:"incident_card_hidden_fields,omitempty"`
// Incident whose data is rendered (24-character hex ID from `/incident/list`); must exist in the account, otherwise `InvalidParameter`. When omitted a mock incident is used.
IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
// Channel to preview; other values return `InvalidParameter`.
// - `email`: email body (HTML template).
// - `sms`, `voice`: SMS text and voice call script.
// - `push`: mobile app push (fixed content; `content` is ignored).
// - `dingtalk`, `wecom`, `feishu`, `zoom`, `telegram`, `slack`: robot (webhook) messages.
// - `feishu_app`, `dingtalk_app`, `wecom_app`, `slack_app`, `teams_app`: IM app cards.
Type string `json:"type" toon:"type"`
// Preview `wecom` content as a `markdown_v2` message, as the template setting of the same name does (size limit 4,096 bytes).
WecomMarkdownV2Enabled bool `json:"wecom_markdown_v2_enabled,omitempty" toon:"wecom_markdown_v2_enabled,omitempty"`
}
PreviewTemplateRequest is generated from the Flashduty OpenAPI schema.
type PreviewTemplateResponse ¶ added in v0.4.0
type PreviewTemplateResponse struct {
// How the recipient's client shows `content`, split into blocks. Omitted for channels that show the text as is.
Blocks []PreviewTemplateResponseBlocksItem `json:"blocks" toon:"blocks"`
// Message frame around the rendered template, in the account language. Returned for `email`, `feishu_app`, `dingtalk_app`, `wecom_app`, `slack_app` and `teams_app`; omitted otherwise.
Card PreviewTemplateResponseCard `json:"card" toon:"card"`
// Rendered template output; an empty string when `success` is `false`.
Content string `json:"content" toon:"content"`
// Why rendering failed, in the caller's language; an empty string when `success` is `true`.
Message string `json:"message" toon:"message"`
// Warnings about how the content will be delivered. Omitted when there are none.
Notices []PreviewTemplateResponseNoticesItem `json:"notices" toon:"notices"`
// Size of the rendered content in bytes, measured before any truncation.
SizeBytes int64 `json:"size_bytes" toon:"size_bytes"`
// Size limit the channel applies in bytes: 4,000 for the `dingtalk`, `telegram` and `slack` robots (and `wecom` without `markdown_v2`), 4,096 for `wecom` with `markdown_v2`, 15,000 for `slack_app`, 30,720 for `feishu_app`; `0` when the channel has no limit.
SizeLimitBytes int64 `json:"size_limit_bytes" toon:"size_limit_bytes"`
// Whether the template rendered without errors.
Success bool `json:"success" toon:"success"`
}
PreviewTemplateResponse is generated from the Flashduty OpenAPI schema.
type PreviewTemplateResponseBlocksItem ¶ added in v0.16.0
type PreviewTemplateResponseBlocksItem struct {
// Column headers of a `table` block.
Columns []string `json:"columns" toon:"columns"`
// Text of a `markdown` block.
Content string `json:"content" toon:"content"`
// `true` when a `table` block is shown as a native card table; omitted otherwise.
Native bool `json:"native" toon:"native"`
// Rows shown per page in a native table; omitted when not set.
PageSize int64 `json:"page_size" toon:"page_size"`
// Cell values of a `table` block, one array per row.
Rows [][]string `json:"rows" toon:"rows"`
// Block kind: `markdown` (text in `content`) or `table` (a table in `columns`/`rows`).
Type string `json:"type" toon:"type"`
}
PreviewTemplateResponseBlocksItem is generated from the Flashduty OpenAPI schema.
type PreviewTemplateResponseCard ¶ added in v0.16.0
type PreviewTemplateResponseCard struct {
// Card elements in display order.
Elements []PreviewTemplateResponseCardElementsItem `json:"elements" toon:"elements"`
// Email subject or card title.
Title string `json:"title" toon:"title"`
}
PreviewTemplateResponseCard is generated from the Flashduty OpenAPI schema.
type PreviewTemplateResponseCardElementsItem ¶ added in v0.16.0
type PreviewTemplateResponseCardElementsItem struct {
// Buttons of an `actions` element; omitted for other kinds.
Actions []PreviewTemplateResponseCardElementsItemActionsItem `json:"actions" toon:"actions"`
// Markdown text of a `markdown` element; omitted for other kinds.
Content string `json:"content" toon:"content"`
// Element kind.
// - `template`: where the rendered template (`content`) appears.
// - `markdown`: fixed text in the channel's Markdown, in `content`.
// - `divider`: a horizontal rule.
// - `actions`: a row of buttons, in `actions`.
Type string `json:"type" toon:"type"`
}
PreviewTemplateResponseCardElementsItem is generated from the Flashduty OpenAPI schema.
type PreviewTemplateResponseCardElementsItemActionsItem ¶ added in v0.16.0
type PreviewTemplateResponseCardElementsItemActionsItem struct {
// Button style: `primary` (highlighted), `danger` (destructive), `select` (a drop-down menu). Omitted for a plain button.
Style string `json:"style" toon:"style"`
// Button label.
Text string `json:"text" toon:"text"`
}
PreviewTemplateResponseCardElementsItemActionsItem is generated from the Flashduty OpenAPI schema.
type PreviewTemplateResponseNoticesItem ¶ added in v0.16.0
type PreviewTemplateResponseNoticesItem struct {
// Warning kind.
// - `table_not_rendered`: the channel cannot show Markdown tables; they are sent as text.
// - `markdown_table_limit`: one Markdown block of a `feishu_app` card holds more than 4 tables.
// - `native_table_fallback`: a table cannot be a native card table and is sent as Markdown; `reason` says why (`too_many_tables`, `too_many_columns`, `too_many_rows`, `cell_too_long`, `unsupported_cell`, `card_too_large`).
// - `content_too_large`: the content exceeds `size_limit_bytes`; `reason` is `truncated` (cut to fit), `compact_fallback` (sent in a compact form) or `rejected` (the channel will refuse it).
Code string `json:"code" toon:"code"`
// Detail for `code`, as listed there; omitted for `table_not_rendered`.
Reason string `json:"reason" toon:"reason"`
}
PreviewTemplateResponseNoticesItem is generated from the Flashduty OpenAPI schema.
type PrometheusLabelValuesResponse ¶ added in v0.15.3
type PrometheusLabelValuesResponse struct {
// Label values, present when `status` is `success`.
Data []string `json:"data" toon:"data"`
// Human-readable Prometheus error message, present when `status` is `error`.
Error string `json:"error" toon:"error"`
// Prometheus error class, present when `status` is `error`.
ErrorType string `json:"errorType" toon:"errorType"`
// Prometheus result status. `success` carries `data`; `error` carries `errorType` and `error`.
Status string `json:"status" toon:"status"`
}
PrometheusLabelValuesResponse is generated from the Flashduty OpenAPI schema.
type PrometheusQueryParams ¶ added in v0.15.2
type PrometheusQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
}
PrometheusQueryParams are the params for `prometheus.query`. Expr is PromQL. Execution.Kind must be `instant` or `range`; `instant` accepts only ToMS.
type PublishedArtifactItem ¶ added in v0.14.5
type PublishedArtifactItem struct {
// Artifact ID (`art_` prefix). Also the key of the public-share link.
ArtifactID string `json:"artifact_id" toon:"artifact_id"`
// Whether the caller may manage this artifact (rename, transfer, delete, share): the creator, any member of the owning team, or a manager of the source session.
CanEdit bool `json:"can_edit" toon:"can_edit"`
// MIME type, derived from the file-name extension when the file was produced: `text/html` (.html/.htm), `text/markdown` (.md), `text/plain` (.txt/.log), `text/csv`, `text/yaml` (.yaml/.yml), `text/x-python`, `text/x-go`, `text/x-sh`, `application/json`, `application/xml`, `application/pdf`, `image/png`, `image/jpeg`, `image/gif`, `image/svg+xml`, `image/webp`, `application/zip`, `application/gzip` (.tar/.gz/.tgz); any other extension is `application/octet-stream`. Empty when the underlying file record is missing.
ContentType string `json:"content_type" toon:"content_type"`
// Unix timestamp in milliseconds when the artifact was published.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Creator's display name.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Presented-file ID (`pf_` prefix) currently holding the artifact's bytes. Changes on every republish.
FileID string `json:"file_id" toon:"file_id"`
// `true` when the caller (for an `app_key` call, the key owner) is the creator, i.e. `person_id` equals the caller's person ID.
IsMine bool `json:"is_mine" toon:"is_mine"`
// Underlying file name including extension. Empty when the underlying file record is missing.
Name string `json:"name" toon:"name"`
// Person ID of the artifact's creator: the owner of the source session at first publish. It never changes on republish or scope transfer.
PersonID int64 `json:"person_id" toon:"person_id"`
// Unix timestamp in milliseconds when the caller pinned this artifact in the console gallery. Pins are per member; omitted when the caller has not pinned it. Pinned artifacts are listed first by `/safari/artifact/gallery/list`.
PinnedAt TimestampMilli `json:"pinned_at" toon:"pinned_at"`
// Anonymous public link — a console `/share/artifact/<artifact_id>` page served entirely from CDN. Present only while shared; anyone with the link can view it, no login required.
PublicURL string `json:"public_url" toon:"public_url"`
// Source session ID (`sess_` prefix) that produced the file.
SessionID string `json:"session_id" toon:"session_id"`
// Source session's title. Omitted when the session has been deleted.
SessionTitle string `json:"session_title" toon:"session_title"`
ShareEnabled bool `json:"share_enabled" toon:"share_enabled"`
ShareFileID string `json:"share_file_id" toon:"share_file_id"`
SharedAt TimestampMilli `json:"shared_at" toon:"shared_at"`
SharedBy int64 `json:"shared_by" toon:"shared_by"`
// File size in bytes.
Size int64 `json:"size" toon:"size"`
// Owning scope. `0` means a personal artifact: it appears only in its creator's list, and can be managed by the creator or by anyone who can manage the source session. A positive value is the owning team ID: the artifact appears in that team's members' lists and any team member can manage it. Set from the source session at first publish; change it with `/safari/artifact/gallery/update`.
TeamID int64 `json:"team_id" toon:"team_id"`
// Owning team's display name. Omitted for personal artifacts.
TeamName string `json:"team_name" toon:"team_name"`
// Display title in the gallery.
Title string `json:"title" toon:"title"`
// Unix timestamp in milliseconds of the last change to the artifact row (rename, transfer, republish, or share state change).
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}
PublishedArtifactItem is generated from the Flashduty OpenAPI schema.
type QueryDataRequest ¶ added in v0.13.1
type QueryDataRequest struct {
// Optional consistency check. When supplied it must equal the authenticated account, otherwise the request fails with `AccessDenied`. The query always runs as the authenticated account.
AccountID int64 `json:"account_id,omitempty" toon:"account_id,omitempty"`
// Extra query parameters as string key/value pairs; keys are namespaced by data source (for example `sls.project`, `loki.type`). At most 128 entries, keys up to 256 bytes, values up to 64 KiB, and 128 KiB in total. What is accepted depends on `ds_type`:
//
// - `prometheus`: optional `prometheus.time`, the evaluation time as Unix seconds, not in the future.
// - `loki`, `victorialogs`: `<source>.type` is `stats` (default) or `raw`. `stats` accepts an optional `<source>.time` (Unix seconds, not in the future). `raw` requires a time range, either `<source>.start` + `<source>.end` (Unix seconds) or `<source>.timespan.value` + `<source>.timespan.unit` (`s`, `m`, `h`, or `d`), spanning at most 6 hours, and accepts `<source>.limit` from 1 to 1001.
// - `sls`: `sls.project` and `sls.logstore` are required. Optional: `sls.lines` (1 to 100), `sls.offset` (0 or more), and a time range of at most 6 hours given as `sls.from` + `sls.to` (Unix seconds) or `sls.timespan.value` + `sls.timespan.unit`.
// - `tencent_cls`: `tencent_cls.region`, `tencent_cls.topic_id`, `tencent_cls.query_mode` (`raw` or `analysis`), and `tencent_cls.syntax` (`cql` or `lucene`) are required. Optional: `tencent_cls.limit` (1 to 100, `raw` mode only, needs monit-edge v0.67.0 or later) and a time range given as `tencent_cls.from` + `tencent_cls.to` (Unix seconds) or `tencent_cls.timespan.value` + `tencent_cls.timespan.unit`, at most 6 hours in `raw` mode and 24 hours in `analysis` mode. Any other key is rejected.
// - `elasticsearch`: `es.type` may be `sql` or omitted; any other value is rejected.
// - `mysql`, `postgres`, `oracle`, `clickhouse`: no arguments are defined.
//
// An absolute `<source>.time` is only valid for its own data source type. Edges older than v0.74.0 approximate it with a look-back offset and accept only times within the last 86,400 seconds.
Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
// Look-back offset in seconds, from 0 to 86400. Applied to point-in-time queries (Prometheus, Loki stats, VictoriaLogs stats); ignored for raw and detail queries. When `args` carries an absolute `<source>.time` and the Edge is v0.74.0 or later, the absolute time takes precedence and this offset is not applied.
DelaySeconds int64 `json:"delay_seconds,omitempty" toon:"delay_seconds,omitempty"`
// Data source name, as returned by `/monit/datasource/list`. The data source must be enabled; a name that matches no data source of the account returns HTTP 400.
DsName string `json:"ds_name" toon:"ds_name"`
// Data source type. Together with `ds_name` it must match an enabled data source of the account.
//
// - `prometheus`: Prometheus-compatible data source; `expr` is PromQL.
// - `loki`: Grafana Loki; `expr` is LogQL.
// - `victorialogs`: VictoriaLogs.
// - `sls`: Alibaba Cloud Log Service (SLS).
// - `tencent_cls`: Tencent Cloud Log Service (CLS); requires monit-edge v0.66.0 or later.
// - `elasticsearch`: Elasticsearch.
// - `mysql`: MySQL; `expr` is SQL.
// - `postgres`: PostgreSQL; `expr` is SQL.
// - `oracle`: Oracle Database; `expr` is SQL.
// - `clickhouse`: ClickHouse; `expr` is SQL.
//
// Other data source types (for example MongoDB, Redis, or Kafka) are rejected.
DsType string `json:"ds_type" toon:"ds_type"`
// Query expression in the language of `ds_type` (PromQL for `prometheus`, LogQL for `loki`, SQL for SQL sources, and so on). Required, at most 64 KiB (12 KiB for `tencent_cls`). Loki's `$__auto` is not supported here; use a fixed duration such as `[5m]`. Prometheus expressions are syntax-checked before dispatch.
Expr string `json:"expr" toon:"expr"`
}
QueryDataRequest is generated from the Flashduty OpenAPI schema.
type QueryDataResponse ¶ added in v0.13.1
type QueryDataResponse struct {
// Public result-contract version. It is independent of the internal monit-edge query protocol version. Fixed at `query_result.v1`, which defines the structure of the `result` field.
Format string `json:"format" toon:"format"`
Result QueryResult `json:"result" toon:"result"`
}
QueryDataResponse is generated from the Flashduty OpenAPI schema.
type QueryExploreExecution ¶ added in v0.15.3
type QueryExploreExecution struct {
// Start of the interval as a Unix timestamp in milliseconds; non-negative and less than `to_ms`. Required for `range` and `window`; optional for `instant`.
FromMs int64 `json:"from_ms,omitempty" toon:"from_ms,omitempty"`
// Execution kind.
//
// - `instant`: evaluate at a single point in time.
// - `range`: evaluate a series over `from_ms` to `to_ms`, with a step derived from `max_data_points` and `min_step_seconds`.
// - `window`: query the interval from `from_ms` to `to_ms` with no step.
Kind string `json:"kind" toon:"kind"`
// Maximum number of points to return. Required for `range` and rejected for `instant` and `window`.
MaxDataPoints int64 `json:"max_data_points,omitempty" toon:"max_data_points,omitempty"`
// Lower bound, in seconds, for the step derived from `max_data_points`. Optional and only accepted for `range`.
MinStepSeconds int64 `json:"min_step_seconds,omitempty" toon:"min_step_seconds,omitempty"`
// End of the interval (or the evaluation time for `instant`) as a Unix timestamp in milliseconds; non-negative. Required for every execution kind.
ToMs int64 `json:"to_ms,omitempty" toon:"to_ms,omitempty"`
}
QueryExploreExecution is generated from the Flashduty OpenAPI schema.
type QueryExploreRequest ¶ added in v0.15.3
type QueryExploreRequest struct {
// Macro substitutions keyed by variable name, used for Grafana-style variables. Keys are at most 256 bytes, values at most 64 KiB, with a 128 KiB total budget.
Args map[string]string `json:"args" toon:"args"`
// Data source ID from `/monit/datasource/list`. Must be a positive JavaScript-safe integer for an enabled data source of the authenticated account that the caller may query.
DatasourceID int64 `json:"datasource_id" toon:"datasource_id"`
Execution QueryExploreExecution `json:"execution" toon:"execution"`
// Query expression in the data source's native language (PromQL, LogsQL, SQL, and so on). Non-empty UTF-8 of at most 64 KiB; `mysql` allows at most 16 KiB and `tencent_cls` at most 12 KiB.
Expr string `json:"expr" toon:"expr"`
}
QueryExploreRequest is generated from the Flashduty OpenAPI schema.
type QueryField ¶ added in v0.13.1
type QueryField struct {
// Series labels. Present on the float field of a time-series frame.
Labels map[string]string `json:"labels" toon:"labels"`
// Column name; on a time-series float field, series are distinguished by `labels` and `name` is usually the metric name.
Name string `json:"name" toon:"name"`
// Value type governing `values` encoding: `string` = strings or null, `float` = numbers or `NaN`/`±Inf` strings or null, `time` = RFC 3339 Nano strings or null.
Type string `json:"type" toon:"type"`
// All values of this column in row order; length matches the other fields in the frame.
Values []any `json:"values" toon:"values"`
}
QueryField is generated from the Flashduty OpenAPI schema.
type QueryFrame ¶ added in v0.13.1
type QueryFrame struct {
// Columns of the frame; all fields share the same `values` length and row i is composed of each field's `values[i]`.
Fields []QueryField `json:"fields" toon:"fields"`
// Frame type: `table` for a generic table, `time_series` for a series (exactly one time field and one float field).
Kind string `json:"kind" toon:"kind"`
}
QueryFrame is generated from the Flashduty OpenAPI schema.
type QueryFramesResult ¶ added in v0.13.1
type QueryFramesResult struct {
// Typed table or time-series frames. A response can contain more than one frame.
Frames []QueryFrame `json:"frames" toon:"frames"`
// Result-kind discriminator, always `frames`, indicating the `frames` payload of typed table/time-series frames.
Kind string `json:"kind" toon:"kind"`
}
QueryFramesResult is generated from the Flashduty OpenAPI schema.
type QueryInvestigationTarget ¶ added in v0.15.4
type QueryInvestigationTarget struct {
// Data source the query runs against. Omit (or set 0) to run on the alert event's own datasource.
DatasourceID int64 `json:"datasource_id,omitempty" toon:"datasource_id,omitempty"`
// Query payload.
Query DashboardQuery `json:"query" toon:"query"`
}
QueryInvestigationTarget is generated from the Flashduty OpenAPI schema.
type QueryRecordsResult ¶ added in v0.13.1
type QueryRecordsResult struct {
// Result-kind discriminator, always `records`, indicating the `records` payload of schemaless record objects.
Kind string `json:"kind" toon:"kind"`
// Schema-flexible records. Records may have different fields, contain nested JSON, or be null. Integers outside JavaScript's safe range are encoded as decimal strings.
Records []map[string]any `json:"records" toon:"records"`
}
QueryRecordsResult is generated from the Flashduty OpenAPI schema.
type QueryResult ¶ added in v0.13.1
type QueryResult struct {
// Typed table or time-series frames. A response can contain more than one frame.
Frames *[]QueryFrame `json:"frames,omitempty" toon:"frames,omitempty"`
// Result-kind discriminator, always `samples`, indicating the `samples` payload of labeled instant samples.
Kind string `json:"kind" toon:"kind"`
// Schema-flexible records. Records may have different fields, contain nested JSON, or be null. Integers outside JavaScript's safe range are encoded as decimal strings.
Records *[]map[string]any `json:"records,omitempty" toon:"records,omitempty"`
// Instant samples with their complete label sets.
Samples *[]QuerySample `json:"samples,omitempty" toon:"samples,omitempty"`
}
QueryResult is generated from the Flashduty OpenAPI schema.
type QueryRowsRequest ¶
type QueryRowsRequest struct {
// Optional consistency check. When supplied it must equal the authenticated account, otherwise the request fails with `AccessDenied`. The query always runs as the authenticated account.
AccountID int64 `json:"account_id,omitempty" toon:"account_id,omitempty"`
// Extra query parameters as string key/value pairs; keys are namespaced by data source (for example `sls.project`, `loki.type`). At most 128 entries, keys up to 256 bytes, values up to 64 KiB, and 128 KiB in total. What is accepted depends on `ds_type`:
//
// - `prometheus`: optional `prometheus.time`, the evaluation time as Unix seconds, not in the future.
// - `loki`, `victorialogs`: `<source>.type` is `stats` (default) or `raw`. `stats` accepts an optional `<source>.time` (Unix seconds, not in the future). `raw` requires a time range, either `<source>.start` + `<source>.end` (Unix seconds) or `<source>.timespan.value` + `<source>.timespan.unit` (`s`, `m`, `h`, or `d`), spanning at most 6 hours, and accepts `<source>.limit` from 1 to 1001.
// - `sls`: `sls.project` and `sls.logstore` are required. Optional: `sls.lines` (1 to 100), `sls.offset` (0 or more), and a time range of at most 6 hours given as `sls.from` + `sls.to` (Unix seconds) or `sls.timespan.value` + `sls.timespan.unit`.
// - `tencent_cls`: `tencent_cls.region`, `tencent_cls.topic_id`, `tencent_cls.query_mode` (`raw` or `analysis`), and `tencent_cls.syntax` (`cql` or `lucene`) are required. Optional: `tencent_cls.limit` (1 to 100, `raw` mode only, needs monit-edge v0.67.0 or later) and a time range given as `tencent_cls.from` + `tencent_cls.to` (Unix seconds) or `tencent_cls.timespan.value` + `tencent_cls.timespan.unit`, at most 6 hours in `raw` mode and 24 hours in `analysis` mode. Any other key is rejected.
// - `elasticsearch`: `es.type` may be `sql` or omitted; any other value is rejected.
// - `mysql`, `postgres`, `oracle`, `clickhouse`: no arguments are defined.
//
// An absolute `<source>.time` is only valid for its own data source type. Edges older than v0.74.0 approximate it with a look-back offset and accept only times within the last 86,400 seconds.
Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
// Look-back offset in seconds, from 0 to 86400. Applied to point-in-time queries (Prometheus, Loki stats, VictoriaLogs stats); ignored for raw and detail queries. When `args` carries an absolute `<source>.time` and the Edge is v0.74.0 or later, the absolute time takes precedence and this offset is not applied.
DelaySeconds int64 `json:"delay_seconds,omitempty" toon:"delay_seconds,omitempty"`
// Data source name, as returned by `/monit/datasource/list`. The data source must be enabled; a name that matches no data source of the account returns HTTP 400.
DsName string `json:"ds_name" toon:"ds_name"`
// Data source type. Together with `ds_name` it must match an enabled data source of the account.
//
// - `prometheus`: Prometheus-compatible data source; `expr` is PromQL.
// - `loki`: Grafana Loki; `expr` is LogQL.
// - `victorialogs`: VictoriaLogs.
// - `sls`: Alibaba Cloud Log Service (SLS).
// - `tencent_cls`: Tencent Cloud Log Service (CLS); requires monit-edge v0.66.0 or later.
// - `elasticsearch`: Elasticsearch.
// - `mysql`: MySQL; `expr` is SQL.
// - `postgres`: PostgreSQL; `expr` is SQL.
// - `oracle`: Oracle Database; `expr` is SQL.
// - `clickhouse`: ClickHouse; `expr` is SQL.
//
// Other data source types (for example MongoDB, Redis, or Kafka) are rejected.
DsType string `json:"ds_type" toon:"ds_type"`
// Query expression in the language of `ds_type` (PromQL for `prometheus`, LogQL for `loki`, SQL for SQL sources, and so on). Required, at most 64 KiB (12 KiB for `tencent_cls`). Loki's `$__auto` is not supported here; use a fixed duration such as `[5m]`. Prometheus expressions are syntax-checked before dispatch.
Expr string `json:"expr" toon:"expr"`
}
QueryRowsRequest is generated from the Flashduty OpenAPI schema.
type QuerySample ¶ added in v0.13.1
type QuerySample struct {
// The sample's full label set; may be an empty object but is always present.
Labels map[string]string `json:"labels" toon:"labels"`
// Finite numeric value or a JSON-safe representation of a non-finite float.
Value any `json:"value" toon:"value"`
}
QuerySample is generated from the Flashduty OpenAPI schema.
type QuerySamplesResult ¶ added in v0.13.1
type QuerySamplesResult struct {
// Result-kind discriminator, always `samples`, indicating the `samples` payload of labeled instant samples.
Kind string `json:"kind" toon:"kind"`
// Instant samples with their complete label sets.
Samples []QuerySample `json:"samples" toon:"samples"`
}
QuerySamplesResult is generated from the Flashduty OpenAPI schema.
type RUMApplicationAlerting ¶
type RUMApplicationAlerting struct {
// On-call channel IDs that receive the alerts; used only when `delivery_mode` is `oncall`. Kept as a draft in `webhook` mode. Can be `null` when never set.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Alert delivery channel: `oncall` routes alert events through Flashduty On-call, `webhook` POSTs them directly to `webhook_url`. An empty value is treated as `oncall`, and on create/update it is persisted as the deployment default (`webhook` on RUM-only on-premises deployments, `oncall` otherwise). Omitted when empty (legacy rows).
DeliveryMode string `json:"delivery_mode,omitempty" toon:"delivery_mode,omitempty"`
// Whether alerting is on. `false` turns alerting off; with `false`, `webhook_url` is not checked.
Enabled bool `json:"enabled" toon:"enabled"`
// Associated on-call integration ID (read-only, auto-assigned on save when `delivery_mode` is `oncall`).
IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
// URL that receives alert events when `delivery_mode` is `webhook`. Required in that mode while `enabled` is `true`; must use `http` or `https`, and on Flashduty cloud must not resolve to a private, loopback, link-local or reserved address. Ignored in `oncall` mode. Omitted from responses when empty.
WebhookURL string `json:"webhook_url,omitempty" toon:"webhook_url,omitempty"`
}
RUMApplicationAlerting is generated from the Flashduty OpenAPI schema.
type RUMApplicationCreateRequest ¶
type RUMApplicationCreateRequest struct {
// Alerting configuration; defaults to disabled (`enabled: false`) when omitted.
Alerting RUMApplicationAlerting `json:"alerting,omitzero" toon:"alerting,omitempty"`
// Application name. 1–40 characters.
ApplicationName string `json:"application_name" toon:"application_name"`
// If `true`, only the account owner, account admins, the creator and members of the owning team can see or edit the application. Default `false`.
IsPrivate bool `json:"is_private,omitempty" toon:"is_private,omitempty"`
// Optional external-link integration configuration.
Links RUMApplicationLinks `json:"links,omitzero" toon:"links,omitempty"`
// If `true`, geographic location is not inferred from the client IP. Default `false`.
NoGeo bool `json:"no_geo,omitempty" toon:"no_geo,omitempty"`
// If `true`, client IP addresses are not collected. Default `false`.
NoIP bool `json:"no_ip,omitempty" toon:"no_ip,omitempty"`
// Source code repositories to link, in order; the first entry is the primary repository. At most 10 entries.
Repositories []RUMApplicationRepository `json:"repositories,omitempty" toon:"repositories,omitempty"`
// Owning team ID. Get team IDs via `POST /team/list`.
TeamID int64 `json:"team_id" toon:"team_id"`
// Optional APM tracing integration configuration. Stored as empty (`enabled: false`, empty `open_type` and `endpoint`) when omitted.
Tracing RUMApplicationTracing `json:"tracing,omitzero" toon:"tracing,omitempty"`
// Platform identifier:
//
// | Value | Meaning |
// |---|---|
// | `browser` | Web browser application (JavaScript SDK) |
// | `ios` | Apple iOS application |
// | `android` | Android application |
// | `react-native` | React Native application |
// | `flutter` | Flutter application |
// | `kotlin-multiplatform` | Kotlin Multiplatform application |
// | `roku` | Roku channel application |
// | `unity` | Unity application |
// | `miniprogram` | WeChat mini program |
// | `harmony` | HarmonyOS application |
// | `electron` | Electron desktop application |
Type string `json:"type" toon:"type"`
}
RUMApplicationCreateRequest is generated from the Flashduty OpenAPI schema.
type RUMApplicationCreateResponse ¶
type RUMApplicationCreateResponse struct {
// Server-generated application ID (22-character short UUID); pass it as `application_id` to the other application operations.
ApplicationID string `json:"application_id" toon:"application_id"`
// Application display name.
ApplicationName string `json:"application_name" toon:"application_name"`
// Token used to initialize the RUM SDK. Also returned by `POST /rum/application/info`.
ClientToken string `json:"client_token" toon:"client_token"`
}
RUMApplicationCreateResponse is generated from the Flashduty OpenAPI schema.
type RUMApplicationIDRequest ¶
type RUMApplicationIDRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
}
RUMApplicationIDRequest is generated from the Flashduty OpenAPI schema.
type RUMApplicationInfosRequest ¶
type RUMApplicationInfosRequest struct {
// Up to 200 application IDs. Duplicates are collapsed, and unknown or deleted IDs are skipped. Get IDs via `POST /rum/application/list`.
ApplicationIDs []string `json:"application_ids" toon:"application_ids"`
}
RUMApplicationInfosRequest is generated from the Flashduty OpenAPI schema.
type RUMApplicationInfosResponse ¶
type RUMApplicationInfosResponse struct {
// Applications found among the requested `application_ids`, in no guaranteed order. Empty array when none match.
Items []RUMApplicationItem `json:"items" toon:"items"`
}
RUMApplicationInfosResponse is generated from the Flashduty OpenAPI schema.
type RUMApplicationItem ¶
type RUMApplicationItem struct {
// ID of the Flashduty account that owns the application.
AccountID int64 `json:"account_id" toon:"account_id"`
// Alerting configuration of the application. Always an object.
Alerting RUMApplicationAlerting `json:"alerting" toon:"alerting"`
// Unique application ID.
ApplicationID string `json:"application_id" toon:"application_id"`
// Application display name.
ApplicationName string `json:"application_name" toon:"application_name"`
// Token used to initialize the RUM SDK.
ClientToken string `json:"client_token" toon:"client_token"`
// Creation timestamp, Unix epoch milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Member ID of the creator. The creator can always edit the application.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// If `true`, only the account owner, account admins, the creator and members of the owning team can see or edit the application.
IsPrivate bool `json:"is_private" toon:"is_private"`
// External-link integration configuration. Always an object; `systems` can be `null` when no system was ever saved.
Links RUMApplicationLinks `json:"links" toon:"links"`
// If `true`, geographic location is not inferred from IP.
NoGeo bool `json:"no_geo" toon:"no_geo"`
// If `true`, IP addresses are not collected.
NoIP bool `json:"no_ip" toon:"no_ip"`
// Linked source code repositories, in order; the first entry is the primary repository. Empty array when none are linked. Linking grants no access by itself: AI sessions can only read repositories granted to the account's GitHub App installations.
Repositories []RUMApplicationRepository `json:"repositories" toon:"repositories"`
// Application status:
//
// - `enabled`: the SDK `client_token` is accepted and data is collected. Every application created through the API starts in this state.
// - `disabled`: the `client_token` is rejected, so no new data is collected. No public operation sets this status.
// - `deleted`: soft-delete marker; deleted applications are filtered out of every response, so this value is never returned.
Status string `json:"status" toon:"status"`
// Owning team ID. Members of this team can edit the application and, when it is private, see it.
TeamID int64 `json:"team_id" toon:"team_id"`
// APM tracing integration configuration. Always an object; when tracing was never configured it is `enabled: false` with empty `open_type` and `endpoint`.
Tracing RUMApplicationTracing `json:"tracing" toon:"tracing"`
// Platform identifier:
//
// | Value | Meaning |
// |---|---|
// | `browser` | Web browser application (JavaScript SDK) |
// | `ios` | Apple iOS application |
// | `android` | Android application |
// | `react-native` | React Native application |
// | `flutter` | Flutter application |
// | `kotlin-multiplatform` | Kotlin Multiplatform application |
// | `roku` | Roku channel application |
// | `unity` | Unity application |
// | `miniprogram` | WeChat mini program |
// | `harmony` | HarmonyOS application |
// | `electron` | Electron desktop application |
Type string `json:"type" toon:"type"`
// Last update timestamp, Unix epoch milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Last updater member ID.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
RUMApplicationItem is generated from the Flashduty OpenAPI schema.
type RUMApplicationLink ¶ added in v0.5.4
type RUMApplicationLink struct {
// Whether this external system link is shown. Treated as `false` when omitted.
Enabled bool `json:"enabled" toon:"enabled"`
// RUM event types where this external system link is shown; at least one is required.
//
// | Value | Meaning |
// |---|---|
// | `crash` | Crash events (errors flagged `is_crash`) |
// | `error` | Error events |
// | `view` | Page/screen view events |
// | `action` | User action events |
// | `resource` | Resource load events |
// | `session` | Session events |
// | `all` | All event types |
EventTypes []string `json:"event_types" toon:"event_types"`
// Display color for the link icon, e.g. `#0F766E`. Omitted from responses when empty.
IconColor string `json:"icon_color,omitempty" toon:"icon_color,omitempty"`
// Short text shown in the link icon, e.g. `S3`. Omitted from responses when empty.
IconText string `json:"icon_text,omitempty" toon:"icon_text,omitempty"`
// Client-chosen identifier for this external system, kept as sent; the server does not validate it.
ID string `json:"id,omitempty" toon:"id,omitempty"`
// Display name of the external system.
Name string `json:"name" toon:"name"`
// HTTP or HTTPS URL template. `${var}` tokens are resolved from the RUM event context.
URL string `json:"url" toon:"url"`
}
RUMApplicationLink is generated from the Flashduty OpenAPI schema.
type RUMApplicationLinks ¶ added in v0.5.4
type RUMApplicationLinks struct {
// Master switch for the external-link integration. Treated as `false` when omitted.
Enabled bool `json:"enabled" toon:"enabled"`
// External systems whose URL templates can be opened from matching RUM events.
Systems []RUMApplicationLink `json:"systems,omitempty" toon:"systems,omitempty"`
}
RUMApplicationLinks is generated from the Flashduty OpenAPI schema.
type RUMApplicationListRequest ¶
type RUMApplicationListRequest struct {
ListOptions
// Sort ascending if `true`; default `false` (descending).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// If `true`, return only applications owned by teams the caller belongs to. When the caller belongs to no team, the list is empty.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Sort field: `created_at` (creation time) or `updated_at` (last update time); defaults to `updated_at` when omitted.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Substring match on the application name (SQL `LIKE`, so `%` and `_` act as wildcards).
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by team ID. Get team IDs via `POST /team/list`.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
RUMApplicationListRequest is generated from the Flashduty OpenAPI schema.
type RUMApplicationListResponse ¶
type RUMApplicationListResponse struct {
// Whether more pages exist; `true` when matching records remain beyond the current page.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// RUM applications on the current page. Empty array when nothing matches.
Items []RUMApplicationItem `json:"items" toon:"items"`
// Total number of applications matching the filter conditions.
Total int64 `json:"total" toon:"total"`
}
RUMApplicationListResponse is generated from the Flashduty OpenAPI schema.
type RUMApplicationRepository ¶ added in v0.15.4
type RUMApplicationRepository struct {
// GitHub repository in `owner/name` form.
Repo string `json:"repo" toon:"repo"`
// Directory holding the application inside the repository, relative to the repository root. `.` is the repository root; an empty value is saved as `.`.
Subdir string `json:"subdir,omitempty" toon:"subdir,omitempty"`
}
RUMApplicationRepository is generated from the Flashduty OpenAPI schema.
type RUMApplicationTracing ¶
type RUMApplicationTracing struct {
// Whether trace links are shown on RUM events.
Enabled bool `json:"enabled" toon:"enabled"`
// Trace endpoint URL; must start with `http` or `https`. Required whenever `tracing` is sent, even with `enabled: false`. Empty in responses when tracing was never configured.
Endpoint string `json:"endpoint" toon:"endpoint"`
// How the trace link opens:
//
// - `popup`: open trace details in a popup.
// - `tab`: open them in a new browser tab.
// - `""` (empty): returned only when tracing was never configured; rejected in requests.
OpenType string `json:"open_type" toon:"open_type"`
}
RUMApplicationTracing is generated from the Flashduty OpenAPI schema.
type RUMApplicationUpdateRequest ¶
type RUMApplicationUpdateRequest struct {
// Alerting configuration. When sent, it replaces the stored alerting object (except `integration_id`, which the server manages). Omit to leave unchanged.
Alerting *RUMApplicationAlerting `json:"alerting,omitempty" toon:"alerting,omitempty"`
// Application ID to update. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// New application name, 1–40 characters. Omit to leave unchanged.
ApplicationName *string `json:"application_name,omitempty" toon:"application_name,omitempty"`
// `true` limits access to the account owner, account admins, the creator and members of the owning team; `false` makes the application visible to everyone in the account. Omit to leave unchanged.
IsPrivate *bool `json:"is_private,omitempty" toon:"is_private,omitempty"`
// External-link integration configuration. When sent, it replaces the stored object, including the whole `systems` list. Omit to leave unchanged.
Links *RUMApplicationLinks `json:"links,omitempty" toon:"links,omitempty"`
// When `true`, stop inferring geographic location from IP; when `false`, resume inferring it. Omit to leave unchanged.
NoGeo *bool `json:"no_geo,omitempty" toon:"no_geo,omitempty"`
// When `true`, stop collecting user IP addresses; when `false`, resume collecting them. Omit to leave unchanged.
NoIP *bool `json:"no_ip,omitempty" toon:"no_ip,omitempty"`
// Replaces the linked source code repositories when present; an empty array removes all links, and omitting the field leaves them unchanged. At most 10 entries.
Repositories []RUMApplicationRepository `json:"repositories,omitzero" toon:"repositories,omitempty"`
// New owning team ID. Get team IDs via `POST /team/list`. Omit to leave unchanged. Moving the application to another team changes who can edit it.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// APM tracing integration configuration. When sent, it replaces the stored object and must carry a valid `open_type` and `endpoint`. Omit to leave unchanged.
Tracing RUMApplicationTracing `json:"tracing,omitzero" toon:"tracing,omitempty"`
// Application type. Omit to leave unchanged. Platform identifier:
//
// | Value | Meaning |
// |---|---|
// | `browser` | Web browser application (JavaScript SDK) |
// | `ios` | Apple iOS application |
// | `android` | Android application |
// | `react-native` | React Native application |
// | `flutter` | Flutter application |
// | `kotlin-multiplatform` | Kotlin Multiplatform application |
// | `roku` | Roku channel application |
// | `unity` | Unity application |
// | `miniprogram` | WeChat mini program |
// | `harmony` | HarmonyOS application |
// | `electron` | Electron desktop application |
Type *string `json:"type,omitempty" toon:"type,omitempty"`
}
RUMApplicationUpdateRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardActor ¶ added in v0.16.0
type RUMDashboardActor struct {
// Person ID.
ID int64 `json:"id" toon:"id"`
// Person name.
Name string `json:"name" toon:"name"`
}
RUMDashboardActor is generated from the Flashduty OpenAPI schema.
type RUMDashboardBarViz ¶ added in v0.16.0
type RUMDashboardBarViz struct {
// Field key that supplies the category axis.
CategoryField string `json:"category_field" toon:"category_field"`
DataLink RUMDashboardDataLink `json:"data_link,omitzero" toon:"data_link,omitempty"`
// Number of decimal places to show.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Panel kind. Always `bar`.
Kind string `json:"kind" toon:"kind"`
// Free-form display options stored with the panel; not validated.
Options map[string]any `json:"options" toon:"options"`
Threshold RUMDashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit of the panel value. One of `unitless`, `ratio`, `percent`, `milliseconds`, `seconds`, `bytes`, `bits`, `count_per_second`, `bytes_per_second`, `bits_per_second`.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Field keys plotted as bars. Must be non-empty with unique names; `frame_index` and `field_index` are not allowed.
ValueFields []string `json:"value_fields" toon:"value_fields"`
}
RUMDashboardBarViz is generated from the Flashduty OpenAPI schema.
type RUMDashboardCandidate ¶ added in v0.16.0
type RUMDashboardCandidate struct {
// Label shown in the variable bar. Defaults to `value` when empty. At most 1024 characters.
Text string `json:"text,omitempty" toon:"text,omitempty"`
// Value substituted into the query, 1-1024 characters. Cannot be `$__all`.
Value string `json:"value" toon:"value"`
}
RUMDashboardCandidate is generated from the Flashduty OpenAPI schema.
type RUMDashboardColumnOption ¶ added in v0.16.0
type RUMDashboardColumnOption struct {
DataLink RUMDashboardDataLink `json:"data_link,omitzero" toon:"data_link,omitempty"`
// Column header. Defaults to the field key when empty.
DisplayName string `json:"display_name,omitempty" toon:"display_name,omitempty"`
// Whether the column is hidden. `false` hides nothing; omit to inherit.
Hidden *bool `json:"hidden,omitempty" toon:"hidden,omitempty"`
Threshold RUMDashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// How the threshold is drawn: `text` colours the value, `background` colours the cell.
ThresholdDisplay string `json:"threshold_display,omitempty" toon:"threshold_display,omitempty"`
// Display unit of the panel value. One of `unitless`, `ratio`, `percent`, `milliseconds`, `seconds`, `bytes`, `bits`, `count_per_second`, `bytes_per_second`, `bits_per_second`.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Column width in pixels, 80-1200.
WidthPx *int64 `json:"width_px,omitempty" toon:"width_px,omitempty"`
}
RUMDashboardColumnOption is generated from the Flashduty OpenAPI schema.
type RUMDashboardCreateRequest ¶ added in v0.16.0
type RUMDashboardCreateRequest struct {
// Application the dashboard belongs to. Every query in `definition` must read this same application. 1 to 64 bytes.
ApplicationID string `json:"application_id" toon:"application_id"`
// Dashboard ID to create, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition RUMDashboardDefinition `json:"definition" toon:"definition"`
// Wire schema of the definition. Must be `dashboard.v1`.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
}
RUMDashboardCreateRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardCustomVariable ¶ added in v0.16.0
type RUMDashboardCustomVariable struct {
Default RUMDashboardSelection `json:"default,omitzero" toon:"default,omitempty"`
// Variable kind. Always `custom`.
Kind string `json:"kind" toon:"kind"`
// Label shown in the variable bar, 1-189 characters when set.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Variable name, referenced as `${name}` in panel queries. 1–64 characters starting with a letter or underscore. `app` and names starting with `__` are reserved; names must be unique.
Name string `json:"name" toon:"name"`
// Fixed list of options, 1–1000 entries with unique `value`s.
Options []RUMDashboardCandidate `json:"options" toon:"options"`
Selection RUMDashboardSelectionConfig `json:"selection" toon:"selection"`
}
RUMDashboardCustomVariable is generated from the Flashduty OpenAPI schema.
type RUMDashboardDataLink ¶ added in v0.16.0
type RUMDashboardDataLink struct {
// Target dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Whether the current time range is forwarded.
PassTime bool `json:"pass_time" toon:"pass_time"`
// Target tab or panel ID inside the dashboard, a canonical UUIDv7 when set.
TargetID string `json:"target_id,omitempty" toon:"target_id,omitempty"`
// Target variable name to its mapping.
VariableMappings map[string]RUMDashboardLinkMapping `json:"variable_mappings" toon:"variable_mappings"`
}
RUMDashboardDataLink is generated from the Flashduty OpenAPI schema.
type RUMDashboardDatasourceRef ¶ added in v0.16.0
type RUMDashboardDatasourceRef struct {
// Reserved, and always `0` for the built-in RUM datasource.
DatasourceID int64 `json:"datasource_id,omitempty" toon:"datasource_id,omitempty"`
// Datasource type. Always `rum`.
DatasourceType string `json:"datasource_type" toon:"datasource_type"`
// Reference kind. Always `fixed`.
Kind string `json:"kind" toon:"kind"`
}
RUMDashboardDatasourceRef is generated from the Flashduty OpenAPI schema.
type RUMDashboardDefinition ¶ added in v0.16.0
type RUMDashboardDefinition struct {
DefaultTimeRange RUMDashboardRelativeTimeRange `json:"default_time_range" toon:"default_time_range"`
// Dashboard description, at most 1024 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Auto-refresh interval of the dashboard. One of `off`, `30s`, `1m`, `5m`.
RefreshInterval string `json:"refresh_interval" toon:"refresh_interval"`
// Tabs of the dashboard, 1–10.
Tabs []RUMDashboardTab `json:"tabs" toon:"tabs"`
// Dashboard title, 1–189 characters.
Title string `json:"title" toon:"title"`
// Variable bar entries, at most 20. The built-in `app` switch is not declared here.
Variables []RUMDashboardVariable `json:"variables" toon:"variables"`
}
RUMDashboardDefinition is generated from the Flashduty OpenAPI schema.
type RUMDashboardDeleteResponse ¶ added in v0.16.0
type RUMDashboardDeleteResponse struct {
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision created by the deletion. Pass it as `expected_revision` to restore the dashboard.
Revision int64 `json:"revision" toon:"revision"`
}
RUMDashboardDeleteResponse is generated from the Flashduty OpenAPI schema.
type RUMDashboardFieldSort ¶ added in v0.16.0
type RUMDashboardFieldSort struct {
// Sort direction: `asc` or `desc`.
Direction string `json:"direction" toon:"direction"`
// Field key to sort by.
Field string `json:"field" toon:"field"`
}
RUMDashboardFieldSort is generated from the Flashduty OpenAPI schema.
type RUMDashboardGridPosition ¶ added in v0.16.0
type RUMDashboardGridPosition struct {
// Height in rows, 1–100.
H int64 `json:"h" toon:"h"`
// Width in columns, 1–24.
W int64 `json:"w" toon:"w"`
// Zero-based column of the left edge, 0–23.
X int64 `json:"x" toon:"x"`
// Zero-based row of the top edge.
Y int64 `json:"y" toon:"y"`
}
RUMDashboardGridPosition is generated from the Flashduty OpenAPI schema.
type RUMDashboardIDRequest ¶ added in v0.16.0
type RUMDashboardIDRequest struct {
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
}
RUMDashboardIDRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardLinkMapping ¶ added in v0.16.0
type RUMDashboardLinkMapping struct {
// Column of a `row_column` source. At most 1024 characters.
Column string `json:"column,omitempty" toon:"column,omitempty"`
// Variable name of a `variable` source. 1–64 characters starting with a letter or underscore.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Where the value comes from: `variable` (another variable), `row_column` (the clicked row's column), or for bar panels `category`, `series`, `value`.
Source string `json:"source" toon:"source"`
}
RUMDashboardLinkMapping is generated from the Flashduty OpenAPI schema.
type RUMDashboardListItem ¶ added in v0.16.0
type RUMDashboardListItem struct {
// Application the dashboard belongs to.
ApplicationID string `json:"application_id" toon:"application_id"`
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Dashboard description.
Description string `json:"description" toon:"description"`
// Current revision number.
Revision int64 `json:"revision" toon:"revision"`
// Dashboard title.
Title string `json:"title" toon:"title"`
// Last change time as a Unix timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
UpdatedBy RUMDashboardActor `json:"updated_by" toon:"updated_by"`
}
RUMDashboardListItem is generated from the Flashduty OpenAPI schema.
type RUMDashboardListRequest ¶ added in v0.16.0
type RUMDashboardListRequest struct {
ListOptions
// Keep only the dashboards of this application. Omit to list the dashboards of every application.
ApplicationID string `json:"application_id,omitempty" toon:"application_id,omitempty"`
// Search text, at most 128 characters. Split on spaces; each word must appear in the title or the description.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Sort order, at most two unique fields; defaults to `updated_at` descending.
Sort []RUMDashboardListSort `json:"sort,omitempty" toon:"sort,omitempty"`
}
RUMDashboardListRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardListResponse ¶ added in v0.16.0
type RUMDashboardListResponse struct {
// Dashboards on this page.
Items []RUMDashboardListItem `json:"items" toon:"items"`
// Total number of dashboards matching the query.
Total int64 `json:"total" toon:"total"`
}
RUMDashboardListResponse is generated from the Flashduty OpenAPI schema.
type RUMDashboardListSort ¶ added in v0.16.0
type RUMDashboardListSort struct {
// `asc` or `desc`.
Direction string `json:"direction" toon:"direction"`
// `title` or `updated_at`.
Field string `json:"field" toon:"field"`
}
RUMDashboardListSort is generated from the Flashduty OpenAPI schema.
type RUMDashboardMutationRequest ¶ added in v0.16.0
type RUMDashboardMutationRequest struct {
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision the caller last read. Must be at least 1.
ExpectedRevision int64 `json:"expected_revision" toon:"expected_revision"`
}
RUMDashboardMutationRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardPanel ¶ added in v0.16.0
type RUMDashboardPanel struct {
// Required for every panel kind except `text`, which must omit it.
DatasourceRef RUMDashboardDatasourceRef `json:"datasource_ref,omitzero" toon:"datasource_ref,omitempty"`
// Panel description, at most 1024 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
Grid RUMDashboardGridPosition `json:"grid" toon:"grid"`
// Panel ID, a canonical UUIDv7, unique in the dashboard.
ID string `json:"id" toon:"id"`
// Queries of the panel, each with a unique `ref_id`. `time_series` and `top_list` take 1-26 queries, `table`, `stat` and `bar` exactly 1, `text` none.
Queries []RUMDashboardPanelQuery `json:"queries" toon:"queries"`
// Panel title, 1–189 characters.
Title string `json:"title" toon:"title"`
VizConfig RUMDashboardVizConfig `json:"viz_config" toon:"viz_config"`
}
RUMDashboardPanel is generated from the Flashduty OpenAPI schema.
type RUMDashboardPanelQuery ¶ added in v0.16.0
type RUMDashboardPanelQuery struct {
// Legend label for the query's series. At most 1024 characters.
LegendAlias string `json:"legend_alias,omitempty" toon:"legend_alias,omitempty"`
Query RUMDashboardQuery `json:"query" toon:"query"`
// Query reference, a single uppercase letter `A`–`Z`, unique within the panel.
RefID string `json:"ref_id" toon:"ref_id"`
}
RUMDashboardPanelQuery is generated from the Flashduty OpenAPI schema.
type RUMDashboardQuery ¶ added in v0.16.0
type RUMDashboardQuery struct {
Args RUMDashboardQueryArgs `json:"args" toon:"args"`
// DQL filter over the RUM events of the scope. At most 16 KiB. `${name}` must name a variable declared in the dashboard; formatters such as `${name:fmt}` and a bare `$name` are rejected.
Expr string `json:"expr" toon:"expr"`
// Minimum step of the series in seconds; a duration, not a timestamp.
MinStepSeconds *int64 `json:"min_step_seconds,omitempty" toon:"min_step_seconds,omitempty"`
// Query mode. Always `range`.
Mode string `json:"mode" toon:"mode"`
}
RUMDashboardQuery is generated from the Flashduty OpenAPI schema.
type RUMDashboardQueryArgs ¶ added in v0.16.0
type RUMDashboardQueryArgs struct {
// Aggregation applied to the scope. One of `count`, `count_distinct`, `avg`, `sum`, `min`, `max`, `p50`, `p75`, `p90`, `p95`, `p99`.
Agg string `json:"agg" toon:"agg"`
// Application the query reads: a concrete application ID, or `$app` to follow the application selected on the dashboard. Required, at most 64 characters. Saving fails if the application does not exist or you cannot read it.
ApplicationID string `json:"application_id" toon:"application_id"`
// How the series is drawn: `line` or `bar`.
DrawStyle string `json:"draw_style,omitempty" toon:"draw_style,omitempty"`
// Field key the aggregation reads. Required unless `agg` is `count`.
Field string `json:"field,omitempty" toon:"field,omitempty"`
// Field key to group by, 1-255 characters. Cannot be an event ID such as `session_id` or `view_id`. For a high-cardinality field, `agg` must be `count` or `sum`.
GroupBy string `json:"group_by,omitempty" toon:"group_by,omitempty"`
// Maximum number of series returned. One of `5`, `10`, `20`, `50`.
Limit string `json:"limit,omitempty" toon:"limit,omitempty"`
// RUM explorer scope the query reads. One of `session`, `view`, `resource`, `action`, `error`, `long_task`, `vital`.
Scope string `json:"scope" toon:"scope"`
}
RUMDashboardQueryArgs is generated from the Flashduty OpenAPI schema.
type RUMDashboardQueryVariable ¶ added in v0.16.0
type RUMDashboardQueryVariable struct {
DatasourceRef RUMDashboardDatasourceRef `json:"datasource_ref" toon:"datasource_ref"`
Default RUMDashboardSelection `json:"default,omitzero" toon:"default,omitempty"`
// Variable kind. Always `query`.
Kind string `json:"kind" toon:"kind"`
// Label shown in the variable bar, 1-189 characters when set. When omitted, the console shows the field's display name.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Variable name, referenced as `${name}` in panel queries. 1–64 characters starting with a letter or underscore. `app` and names starting with `__` are reserved; names must be unique.
Name string `json:"name" toon:"name"`
// When the candidates are re-read: `on_dashboard_load` or `on_time_range_change`.
Refresh string `json:"refresh" toon:"refresh"`
Selection RUMDashboardSelectionConfig `json:"selection" toon:"selection"`
VariableQuery RUMDashboardVariableQuery `json:"variable_query" toon:"variable_query"`
}
RUMDashboardQueryVariable is generated from the Flashduty OpenAPI schema.
type RUMDashboardRelativeTimeRange ¶ added in v0.16.0
type RUMDashboardRelativeTimeRange struct {
// Relative start of the default time range. One of `now-15m`, `now-30m`, `now-1h`, `now-3h`, `now-6h`, `now-12h`, `now-24h`, `now-7d`.
From string `json:"from" toon:"from"`
// End of the range. Always `now`.
To string `json:"to" toon:"to"`
}
RUMDashboardRelativeTimeRange is generated from the Flashduty OpenAPI schema.
type RUMDashboardResource ¶ added in v0.16.0
type RUMDashboardResource struct {
// Application the dashboard belongs to. Fixed at creation.
ApplicationID string `json:"application_id" toon:"application_id"`
// Creation time as a Unix timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
CreatedBy RUMDashboardActor `json:"created_by" toon:"created_by"`
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition RUMDashboardDefinition `json:"definition" toon:"definition"`
// Revision number, starting at 1 and incremented on every change.
Revision int64 `json:"revision" toon:"revision"`
// Wire schema of the definition. Always `dashboard.v1`.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
// Last change time as a Unix timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
UpdatedBy RUMDashboardActor `json:"updated_by" toon:"updated_by"`
}
RUMDashboardResource is generated from the Flashduty OpenAPI schema.
type RUMDashboardRevisionGetRequest ¶ added in v0.16.0
type RUMDashboardRevisionGetRequest struct {
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Revision number to read. Must be at least 1.
Revision int64 `json:"revision" toon:"revision"`
}
RUMDashboardRevisionGetRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardRevisionItem ¶ added in v0.16.0
type RUMDashboardRevisionItem struct {
Actor RUMDashboardActor `json:"actor" toon:"actor"`
// Creation time of this revision as a Unix timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Change message supplied with the update, at most 1024 characters.
Message string `json:"message" toon:"message"`
// Revision number.
Revision int64 `json:"revision" toon:"revision"`
}
RUMDashboardRevisionItem is generated from the Flashduty OpenAPI schema.
type RUMDashboardRevisionListResponse ¶ added in v0.16.0
type RUMDashboardRevisionListResponse struct {
// Revisions of the dashboard.
Items []RUMDashboardRevisionItem `json:"items" toon:"items"`
}
RUMDashboardRevisionListResponse is generated from the Flashduty OpenAPI schema.
type RUMDashboardRevisionResource ¶ added in v0.16.0
type RUMDashboardRevisionResource struct {
Actor RUMDashboardActor `json:"actor" toon:"actor"`
// Creation time of this revision as a Unix timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition RUMDashboardDefinition `json:"definition" toon:"definition"`
// Change message supplied with the update, at most 1024 characters.
Message string `json:"message" toon:"message"`
// Revision number.
Revision int64 `json:"revision" toon:"revision"`
// Wire schema of the definition. Always `dashboard.v1`.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
}
RUMDashboardRevisionResource is generated from the Flashduty OpenAPI schema.
type RUMDashboardSection ¶ added in v0.16.0
type RUMDashboardSection struct {
// Whether the section starts collapsed.
Collapsed bool `json:"collapsed" toon:"collapsed"`
// Section description, at most 1024 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Section ID, a canonical UUIDv7, unique in the dashboard.
ID string `json:"id" toon:"id"`
// Panels of the section.
Panels []RUMDashboardPanel `json:"panels" toon:"panels"`
// Section title, 1–189 characters.
Title string `json:"title" toon:"title"`
}
RUMDashboardSection is generated from the Flashduty OpenAPI schema.
type RUMDashboardSelection ¶ added in v0.16.0
type RUMDashboardSelection struct {
// `values` selects the listed values; `all` selects everything and must carry no values.
Kind string `json:"kind" toon:"kind"`
// Selected values. Required for kind `values`, forbidden for kind `all`. Must be non-empty and unique, and none may equal `$__all`. With selection `mode` `single`, exactly one value.
Values []string `json:"values,omitempty" toon:"values,omitempty"`
}
RUMDashboardSelection is generated from the Flashduty OpenAPI schema.
type RUMDashboardSelectionConfig ¶ added in v0.16.0
type RUMDashboardSelectionConfig struct {
// Whether an `All` entry is offered, which a selection of kind `all` requires.
IncludeAll bool `json:"include_all,omitempty" toon:"include_all,omitempty"`
// `single` allows one value, `multi` allows several.
Mode string `json:"mode" toon:"mode"`
}
RUMDashboardSelectionConfig is generated from the Flashduty OpenAPI schema.
type RUMDashboardStatViz ¶ added in v0.16.0
type RUMDashboardStatViz struct {
// Number of decimal places to show.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Panel kind. Always `stat`.
Kind string `json:"kind" toon:"kind"`
// Free-form display options stored with the panel; not validated.
Options map[string]any `json:"options" toon:"options"`
// How the series are reduced to one value. One of `last_non_null`, `min`, `max`, `mean`, `sum`.
Reducer string `json:"reducer" toon:"reducer"`
Threshold RUMDashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit of the panel value. One of `unitless`, `ratio`, `percent`, `milliseconds`, `seconds`, `bytes`, `bits`, `count_per_second`, `bytes_per_second`, `bits_per_second`.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Field keys whose values are reduced into the displayed number. Must be non-empty with unique names; `frame_index` and `field_index` are not allowed.
ValueFields []string `json:"value_fields" toon:"value_fields"`
}
RUMDashboardStatViz is generated from the Flashduty OpenAPI schema.
type RUMDashboardTab ¶ added in v0.16.0
type RUMDashboardTab struct {
// Tab description, at most 1024 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Tab ID, a canonical UUIDv7, unique in the dashboard.
ID string `json:"id" toon:"id"`
// Sections of the tab, at most 10.
Sections []RUMDashboardSection `json:"sections" toon:"sections"`
// Tab title, 1–189 characters.
Title string `json:"title" toon:"title"`
// Panels pinned above the sections.
TopPanels []RUMDashboardPanel `json:"top_panels" toon:"top_panels"`
}
RUMDashboardTab is generated from the Flashduty OpenAPI schema.
type RUMDashboardTableViz ¶ added in v0.16.0
type RUMDashboardTableViz struct {
// Per-column presentation, keyed by column name. At most 100 columns.
ColumnOptions map[string]RUMDashboardColumnOption `json:"column_options,omitempty" toon:"column_options,omitempty"`
// Panel kind. Always `table`.
Kind string `json:"kind" toon:"kind"`
// Data links rendered as extra columns. Together with the `data_link`s in `column_options`, at most 5 per table.
LinkColumns []RUMDashboardDataLink `json:"link_columns,omitempty" toon:"link_columns,omitempty"`
// Free-form display options stored with the panel; not validated.
Options map[string]any `json:"options" toon:"options"`
// Initial sort order of the table.
Sort []RUMDashboardFieldSort `json:"sort,omitempty" toon:"sort,omitempty"`
}
RUMDashboardTableViz is generated from the Flashduty OpenAPI schema.
type RUMDashboardTextViz ¶ added in v0.16.0
type RUMDashboardTextViz struct {
// Panel kind. Always `text`.
Kind string `json:"kind" toon:"kind"`
// Markdown body, at most 64 KiB. Text panels take no datasource or query. Images, raw HTML and `${` templates are rejected; links must be HTTPS or start with `/`.
Markdown string `json:"markdown" toon:"markdown"`
// Free-form display options stored with the panel; not validated.
Options map[string]any `json:"options" toon:"options"`
}
RUMDashboardTextViz is generated from the Flashduty OpenAPI schema.
type RUMDashboardThreshold ¶ added in v0.16.0
type RUMDashboardThreshold struct {
// Critical threshold.
Critical *float64 `json:"critical,omitempty" toon:"critical,omitempty"`
// Which direction is worse: `higher_is_worse` or `lower_is_worse`.
Mode string `json:"mode" toon:"mode"`
// Warning threshold. Not above `critical` when `mode` is `higher_is_worse`, not below it otherwise.
Warning *float64 `json:"warning,omitempty" toon:"warning,omitempty"`
}
RUMDashboardThreshold is generated from the Flashduty OpenAPI schema.
type RUMDashboardTimeSeriesViz ¶ added in v0.16.0
type RUMDashboardTimeSeriesViz struct {
// Number of decimal places to show.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Panel kind. Always `time_series`.
Kind string `json:"kind" toon:"kind"`
// Free-form display options stored with the panel; not validated.
Options map[string]any `json:"options" toon:"options"`
Threshold RUMDashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit of the panel value. One of `unitless`, `ratio`, `percent`, `milliseconds`, `seconds`, `bytes`, `bits`, `count_per_second`, `bytes_per_second`, `bits_per_second`.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
}
RUMDashboardTimeSeriesViz is generated from the Flashduty OpenAPI schema.
type RUMDashboardTopListViz ¶ added in v0.16.0
type RUMDashboardTopListViz struct {
// Number of decimal places to show.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Panel kind. Always `top_list`.
Kind string `json:"kind" toon:"kind"`
// Number of entries shown, 1–100. Omit to show all.
Limit *int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Free-form display options stored with the panel; not validated.
Options map[string]any `json:"options" toon:"options"`
// How the series are reduced to one value. One of `last_non_null`, `min`, `max`, `mean`, `sum`.
Reducer string `json:"reducer" toon:"reducer"`
// Ranking direction: `asc` or `desc`.
Sort string `json:"sort" toon:"sort"`
Threshold RUMDashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit of the panel value. One of `unitless`, `ratio`, `percent`, `milliseconds`, `seconds`, `bytes`, `bits`, `count_per_second`, `bytes_per_second`, `bits_per_second`.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
}
RUMDashboardTopListViz is generated from the Flashduty OpenAPI schema.
type RUMDashboardTrashItem ¶ added in v0.16.0
type RUMDashboardTrashItem struct {
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
// Deletion time as a Unix timestamp in milliseconds.
DeletedAt TimestampMilli `json:"deleted_at" toon:"deleted_at"`
DeletedBy RUMDashboardActor `json:"deleted_by" toon:"deleted_by"`
// Dashboard description.
Description string `json:"description" toon:"description"`
// Revision created by the deletion. Pass it as `expected_revision` to restore the dashboard.
Revision int64 `json:"revision" toon:"revision"`
// Dashboard title.
Title string `json:"title" toon:"title"`
}
RUMDashboardTrashItem is generated from the Flashduty OpenAPI schema.
type RUMDashboardTrashListRequest ¶ added in v0.16.0
type RUMDashboardTrashListRequest struct {
ListOptions
// Sort order, at most two unique fields; defaults to `deleted_at` descending.
Sort []RUMDashboardTrashListSort `json:"sort,omitempty" toon:"sort,omitempty"`
}
RUMDashboardTrashListRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardTrashListResponse ¶ added in v0.16.0
type RUMDashboardTrashListResponse struct {
// Deleted dashboards on this page.
Items []RUMDashboardTrashItem `json:"items" toon:"items"`
// Total number of dashboards in the trash.
Total int64 `json:"total" toon:"total"`
}
RUMDashboardTrashListResponse is generated from the Flashduty OpenAPI schema.
type RUMDashboardTrashListSort ¶ added in v0.16.0
type RUMDashboardTrashListSort struct {
// `asc` or `desc`.
Direction string `json:"direction" toon:"direction"`
// `title` or `deleted_at`.
Field string `json:"field" toon:"field"`
}
RUMDashboardTrashListSort is generated from the Flashduty OpenAPI schema.
type RUMDashboardUnitFields ¶ added in v0.16.0
type RUMDashboardUnitFields struct {
// Number of decimal places to show.
Decimals int64 `json:"decimals" toon:"decimals"`
Threshold RUMDashboardThreshold `json:"threshold" toon:"threshold"`
// Display unit of the panel value. One of `unitless`, `ratio`, `percent`, `milliseconds`, `seconds`, `bytes`, `bits`, `count_per_second`, `bytes_per_second`, `bits_per_second`.
Unit string `json:"unit" toon:"unit"`
}
RUMDashboardUnitFields is generated from the Flashduty OpenAPI schema.
type RUMDashboardUpdateRequest ¶ added in v0.16.0
type RUMDashboardUpdateRequest struct {
// Dashboard ID, a canonical UUIDv7.
DashboardID string `json:"dashboard_id" toon:"dashboard_id"`
Definition RUMDashboardDefinition `json:"definition" toon:"definition"`
// Revision the caller last read. Must be at least 1.
ExpectedRevision int64 `json:"expected_revision" toon:"expected_revision"`
// Optional change message stored with the revision, at most 1024 characters.
Message string `json:"message,omitempty" toon:"message,omitempty"`
// Wire schema of the definition. Must be `dashboard.v1`.
SchemaVersion string `json:"schema_version" toon:"schema_version"`
}
RUMDashboardUpdateRequest is generated from the Flashduty OpenAPI schema.
type RUMDashboardUpdateResponse ¶ added in v0.16.0
type RUMDashboardUpdateResponse struct {
// Whether the stored definition actually changed.
Changed bool `json:"changed" toon:"changed"`
Resource RUMDashboardResource `json:"resource" toon:"resource"`
}
RUMDashboardUpdateResponse is generated from the Flashduty OpenAPI schema.
type RUMDashboardVariable ¶ added in v0.16.0
type RUMDashboardVariable struct {
DatasourceRef RUMDashboardDatasourceRef `json:"datasource_ref,omitzero" toon:"datasource_ref,omitempty"`
Default RUMDashboardSelection `json:"default,omitzero" toon:"default,omitempty"`
// Variable kind. Always `query`.
Kind string `json:"kind" toon:"kind"`
// Label shown in the variable bar, 1-189 characters when set. When omitted, the console shows the field's display name.
Label string `json:"label,omitempty" toon:"label,omitempty"`
// Variable name, referenced as `${name}` in panel queries. 1–64 characters starting with a letter or underscore. `app` and names starting with `__` are reserved; names must be unique.
Name string `json:"name" toon:"name"`
// Fixed list of options, 1–1000 entries with unique `value`s.
Options []RUMDashboardCandidate `json:"options,omitempty" toon:"options,omitempty"`
// When the candidates are re-read: `on_dashboard_load` or `on_time_range_change`.
Refresh string `json:"refresh,omitempty" toon:"refresh,omitempty"`
Selection RUMDashboardSelectionConfig `json:"selection" toon:"selection"`
VariableQuery RUMDashboardVariableQuery `json:"variable_query,omitzero" toon:"variable_query,omitempty"`
}
RUMDashboardVariable is generated from the Flashduty OpenAPI schema.
type RUMDashboardVariableQuery ¶ added in v0.16.0
type RUMDashboardVariableQuery struct {
// RUM field key whose values become the candidates.
Field string `json:"field" toon:"field"`
// Query kind. Always `rum_field`.
Kind string `json:"kind" toon:"kind"`
}
RUMDashboardVariableQuery is generated from the Flashduty OpenAPI schema.
type RUMDashboardVizConfig ¶ added in v0.16.0
type RUMDashboardVizConfig struct {
// Field key that supplies the category axis.
CategoryField string `json:"category_field,omitempty" toon:"category_field,omitempty"`
// Per-column presentation, keyed by column name. At most 100 columns.
ColumnOptions map[string]RUMDashboardColumnOption `json:"column_options,omitempty" toon:"column_options,omitempty"`
DataLink RUMDashboardDataLink `json:"data_link,omitzero" toon:"data_link,omitempty"`
// Number of decimal places to show.
Decimals *int64 `json:"decimals,omitempty" toon:"decimals,omitempty"`
// Panel kind. Always `text`.
Kind string `json:"kind" toon:"kind"`
// Number of entries shown, 1–100. Omit to show all.
Limit *int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Data links rendered as extra columns. Together with the `data_link`s in `column_options`, at most 5 per table.
LinkColumns []RUMDashboardDataLink `json:"link_columns,omitempty" toon:"link_columns,omitempty"`
// Markdown body, at most 64 KiB. Text panels take no datasource or query. Images, raw HTML and `${` templates are rejected; links must be HTTPS or start with `/`.
Markdown string `json:"markdown,omitempty" toon:"markdown,omitempty"`
// Free-form display options stored with the panel; not validated.
Options map[string]any `json:"options" toon:"options"`
// How the series are reduced to one value. One of `last_non_null`, `min`, `max`, `mean`, `sum`.
Reducer string `json:"reducer,omitempty" toon:"reducer,omitempty"`
// Ranking direction: `asc` or `desc`.
Sort any `json:"sort,omitempty" toon:"sort,omitempty"`
Threshold RUMDashboardThreshold `json:"threshold,omitzero" toon:"threshold,omitempty"`
// Display unit of the panel value. One of `unitless`, `ratio`, `percent`, `milliseconds`, `seconds`, `bytes`, `bits`, `count_per_second`, `bytes_per_second`, `bits_per_second`.
Unit string `json:"unit,omitempty" toon:"unit,omitempty"`
// Field keys plotted as bars. Must be non-empty with unique names; `frame_index` and `field_index` are not allowed.
ValueFields []string `json:"value_fields,omitempty" toon:"value_fields,omitempty"`
}
RUMDashboardVizConfig is generated from the Flashduty OpenAPI schema.
type RUMDataFieldMeta ¶ added in v0.5.4
type RUMDataFieldMeta struct {
// Column name or alias as written in `sql`; `ts` for the bucket column of `time_series` queries.
Name string `json:"name" toon:"name"`
// Whether values in this column may be `null`. `true` when the driver cannot tell.
Nullable bool `json:"nullable" toon:"nullable"`
// Column type name as reported by the database driver, such as `VARCHAR`, `BIGINT`, `DOUBLE` or `DATETIME`. It depends on the selected column or expression, so the set is open; use it as a hint for parsing `values`.
Type string `json:"type" toon:"type"`
}
RUMDataFieldMeta is generated from the Flashduty OpenAPI schema.
type RUMDataQueryDefinition ¶ added in v0.5.4
type RUMDataQueryDefinition struct {
// When `true`, the query always runs on the full data and the response never carries `sampling`. When `false` (default), the server may sample aggregate queries over large time windows.
DisableSampling bool `json:"disable_sampling,omitempty" toon:"disable_sampling,omitempty"`
// Optional RUM DQL filter. It is translated and `AND`-ed into the `WHERE` clause of `sql`. A DQL parse error is reported in this query's `error` entry.
Dql string `json:"dql,omitempty" toon:"dql,omitempty"`
// Output format. `table` returns rows; `time_series` returns bucketed time-series rows.
Format string `json:"format" toon:"format"`
// Client-supplied query ID. The same value is used as the key in the response object.
ID string `json:"id" toon:"id"`
// Minimum time-bucket width in **milliseconds** for `time_series` queries. Default 3600 (3.6 seconds). The effective width is the smallest step of a fixed ladder that is at least this value and at least the window length divided by `max_points`; it is returned as `interval`. Ignored for `table` queries.
Interval int64 `json:"interval,omitempty" toon:"interval,omitempty"`
// Upper bound on the number of buckets for `time_series` queries. Default 1226. The bucket width grows so that the window holds at most this many buckets. Ignored for `table` queries.
MaxPoints int64 `json:"max_points,omitempty" toon:"max_points,omitempty"`
// Cursor from a previous response's `search_after_ctx`, to fetch the next page of the same `table` query. Only used by non-aggregate queries with `ORDER BY` and no `OFFSET`. An invalid value makes this query fail.
SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
// RUM SQL `SELECT` statement. `FROM` names a scope table (`sessions`, `views`, `actions`, `errors`, `resources`, `long_tasks`, `vitals`, `issues`, `sourcemaps`); columns are `field_key` values from `POST /rum/field/list`. The server adds the account and time-range filters.
Sql string `json:"sql" toon:"sql"`
// IANA time zone name, such as `Asia/Shanghai`, used to align `time_series` bucket boundaries to local time. Defaults to UTC alignment. Ignored for `table` queries; an unknown name fails the request with `InvalidParameter`.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
RUMDataQueryDefinition is generated from the Flashduty OpenAPI schema.
type RUMDataQueryOutput ¶ added in v0.5.4
type RUMDataQueryOutput struct {
// Query result. Omitted when the query failed.
Data RUMDataQueryResult `json:"data" toon:"data"`
// Set when this query failed after request validation (unknown table or column, invalid `dql` or `search_after_ctx`, database error). The code is always `InternalError`. Omitted when the query succeeded.
Error any `json:"error" toon:"error"`
}
RUMDataQueryOutput is generated from the Flashduty OpenAPI schema.
type RUMDataQueryRequest ¶ added in v0.5.4
type RUMDataQueryRequest struct {
// End of the query window, Unix epoch milliseconds. Maximum 31-day span.
EndTime int64 `json:"end_time" toon:"end_time"`
// Queries to execute concurrently. 1 to 10 queries are allowed.
Queries []RUMDataQueryDefinition `json:"queries" toon:"queries"`
// Start of the query window, Unix epoch milliseconds.
StartTime int64 `json:"start_time" toon:"start_time"`
}
RUMDataQueryRequest is generated from the Flashduty OpenAPI schema.
type RUMDataQueryResponse ¶ added in v0.5.4
type RUMDataQueryResponse map[string]RUMDataQueryOutput
RUMDataQueryResponse is a map response payload.
type RUMDataQueryResult ¶ added in v0.5.4
type RUMDataQueryResult struct {
// Column metadata, one entry per returned column, in the same order as `values`. For `time_series` queries the first column is `ts`.
Fields []RUMDataFieldMeta `json:"fields" toon:"fields"`
// Effective time-bucket width in **milliseconds** used by a `time_series` query. Omitted for `table` queries.
Interval int64 `json:"interval" toon:"interval"`
// Sampling metadata. Omitted when the query did not use sampling.
Sampling RUMDataSamplingDecision `json:"sampling" toon:"sampling"`
// Cursor for the next page of a non-aggregate `table` query with `ORDER BY` and no `OFFSET`. Present only when this page returned as many rows as the `LIMIT`; omitted otherwise.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Result values in column-major order: `values[i]` is the list of every row's value for column `fields[i]`. A column is `null` when the query returned no rows. Datetime values are returned as RFC 3339 strings.
Values [][]any `json:"values" toon:"values"`
}
RUMDataQueryResult is generated from the Flashduty OpenAPI schema.
type RUMDataSamplingDecision ¶ added in v0.5.4
type RUMDataSamplingDecision struct {
// Whether sampling was applied. Always `true` here — the `sampling` object is omitted entirely when sampling was not used.
Enabled bool `json:"enabled" toon:"enabled"`
// Multiplier applied to scale sampled results back to estimated full values. `COUNT`, `SUM` and `COUNT(DISTINCT)` columns in `values` are already multiplied by it; other aggregates are returned as computed on the sample.
ScaleFactor float64 `json:"scale_factor" toon:"scale_factor"`
}
RUMDataSamplingDecision is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionCreateRequest ¶ added in v0.10.0
type RUMErrorIngestionCreateRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Rule description, up to 512 characters. Defaults to an empty string.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Conditions (OR-of-ANDs) that select errors. A matched error is still stored but is not grouped into any issue.
Filters RUMErrorIngestionOrFilters `json:"filters" toon:"filters"`
// Rule name, 1-128 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
}
RUMErrorIngestionCreateRequest is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionCreateResponse ¶ added in v0.10.0
type RUMErrorIngestionCreateResponse struct {
// ID assigned to the new rule.
RuleID string `json:"rule_id" toon:"rule_id"`
// Echo of the created rule's name.
RuleName string `json:"rule_name" toon:"rule_name"`
}
RUMErrorIngestionCreateResponse is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionEmptyResponse ¶ added in v0.10.0
type RUMErrorIngestionEmptyResponse struct{}
RUMErrorIngestionEmptyResponse is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionFilterCondition ¶ added in v0.10.0
type RUMErrorIngestionFilterCondition struct {
// Field to match. One of `error.usr_id`, `error.usr_email`, `error.error_type`, `error.error_message`, `error.error_stack`, `error.view_url`, `error.env`, `error.version`, `error.service`, `error.browser_name`, `error.browser_version`, `error.fingerprint`, `error.is_crash` (value `true` or `false`), or a `context.`-prefixed path into the error's custom context. Context objects are flattened with dots up to 3 levels (`context.a.b.c`); a deeper object is compared as its JSON text, and array values can't be matched.
Key string `json:"key" toon:"key"`
// Match mode:
// - `IN`: matches when the field value matches any entry in `vals`. A context field the error doesn't carry never matches.
// - `NOTIN`: matches when the field value matches none of `vals`. A context field the error doesn't carry always matches.
Oper string `json:"oper" toon:"oper"`
// Values to match against, at least 1 entry. Each entry is one of: an exact, case-sensitive string; a wildcard pattern using `*`/`?` that must match the whole value; a regexp wrapped in `/` (matches anywhere in the value unless anchored); `cidr:<range>` (the value is parsed as an IP); or `num:lt|le|gt|ge:<number>` (the value is parsed as a number, non-numeric values don't match).
Vals []string `json:"vals" toon:"vals"`
}
RUMErrorIngestionFilterCondition is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionHistoryItem ¶ added in v0.10.0
type RUMErrorIngestionHistoryItem struct {
// The application's complete non-deleted rule list as it was just before the change that created this version. Empty for the version created by the application's first rule.
Rules []RUMErrorIngestionRuleSnapshotItem `json:"rules" toon:"rules"`
// Time of the change that created this version, as a Unix timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Member ID of the person who made the change that created this version.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Display name of that member at the time of the change.
UpdatedByName string `json:"updated_by_name" toon:"updated_by_name"`
// History version number, starting at 1 and incremented by every write. Pass it to `POST /rum/error-ingestion/rules/history/revert`.
Version int64 `json:"version" toon:"version"`
}
RUMErrorIngestionHistoryItem is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionHistoryListRequest ¶ added in v0.10.0
type RUMErrorIngestionHistoryListRequest struct {
ListOptions
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// `true` sorts ascending; `false` (default) sorts descending, newest first.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Sort column:
// - `updated_at`: time of the change that created the version (default).
// - `version`: version number.
// Any other value falls back to `updated_at`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
}
RUMErrorIngestionHistoryListRequest is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionHistoryListResponse ¶ added in v0.10.0
type RUMErrorIngestionHistoryListResponse struct {
// `true` when more versions exist after this page.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// History snapshots, ordered by `orderby`/`asc`.
Items []RUMErrorIngestionHistoryItem `json:"items" toon:"items"`
// Total number of history versions for the application, across all pages.
Total int64 `json:"total" toon:"total"`
}
RUMErrorIngestionHistoryListResponse is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionListRequest ¶ added in v0.10.0
type RUMErrorIngestionListRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
}
RUMErrorIngestionListRequest is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionListResponse ¶ added in v0.10.0
type RUMErrorIngestionListResponse struct {
// Rules, newest-created first.
Items []RUMErrorIngestionRule `json:"items" toon:"items"`
}
RUMErrorIngestionListResponse is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionOrFilters ¶ added in v0.10.0
type RUMErrorIngestionOrFilters [][]RUMErrorIngestionFilterCondition
RUMErrorIngestionOrFilters is a list response payload.
type RUMErrorIngestionRevertRequest ¶ added in v0.10.0
type RUMErrorIngestionRevertRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// History version number to revert to. Get versions via `POST /rum/error-ingestion/rules/history/list`.
Version int64 `json:"version" toon:"version"`
}
RUMErrorIngestionRevertRequest is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionRule ¶ added in v0.10.0
type RUMErrorIngestionRule struct {
// Unix timestamp in milliseconds when the rule was created; reset to the revert time when the rule is restored by a history revert.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Rule description, up to 512 characters; empty string when none was given.
Description string `json:"description" toon:"description"`
// The rule's conditions. An error that matches them is stored but not grouped into any issue.
Filters RUMErrorIngestionOrFilters `json:"filters" toon:"filters"`
// Rule ID, generated by the server on `create`. It stays the same across updates and history reverts.
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name, 1-128 characters. Not required to be unique within the application.
RuleName string `json:"rule_name" toon:"rule_name"`
// Rule status:
// - `enabled`: the rule is applied to newly ingested errors.
// - `disabled`: the rule is kept but not applied.
Status string `json:"status" toon:"status"`
// Unix timestamp in milliseconds of the last update, enable, or disable; reset to the revert time when the rule is restored by a history revert.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}
RUMErrorIngestionRule is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionRuleIDRequest ¶ added in v0.10.0
type RUMErrorIngestionRuleIDRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Rule ID. Get rule IDs via `POST /rum/error-ingestion/rules/list`.
RuleID string `json:"rule_id" toon:"rule_id"`
}
RUMErrorIngestionRuleIDRequest is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionRuleSnapshotItem ¶ added in v0.10.0
type RUMErrorIngestionRuleSnapshotItem struct {
// ID of the account that owns the rule.
AccountID int64 `json:"account_id" toon:"account_id"`
// RUM application ID the rule belongs to.
ApplicationID string `json:"application_id" toon:"application_id"`
// Unix timestamp in milliseconds when the row was created.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Member ID who created the rule.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// Soft-delete time as a Unix timestamp in milliseconds. Always `0` here, because snapshots contain only non-deleted rules.
DeletedAt TimestampMilli `json:"deleted_at" toon:"deleted_at"`
// Rule description as of this snapshot version; empty string when none was given.
Description string `json:"description" toon:"description"`
// The rule's filter conditions as of this snapshot version.
Filters RUMErrorIngestionOrFilters `json:"filters" toon:"filters"`
// Internal storage row ID. Not accepted by any endpoint; use `rule_id` instead. Changes when the rule is restored by a history revert.
ID int64 `json:"id" toon:"id"`
// Rule ID, the same value `list` returns for this rule.
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name as of this snapshot version.
RuleName string `json:"rule_name" toon:"rule_name"`
// The rule's status as of this snapshot version:
// - `enabled`: applied to newly ingested errors.
// - `disabled`: kept but not applied.
Status string `json:"status" toon:"status"`
// Unix timestamp in milliseconds when the row was last updated.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Member ID who last updated the rule before this snapshot.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
RUMErrorIngestionRuleSnapshotItem is generated from the Flashduty OpenAPI schema.
type RUMErrorIngestionUpdateRequest ¶ added in v0.10.0
type RUMErrorIngestionUpdateRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// New rule description, up to 512 characters. Omit to leave unchanged.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// New filter conditions. Omit to leave unchanged.
Filters RUMErrorIngestionOrFilters `json:"filters,omitempty" toon:"filters,omitempty"`
// Rule ID to update. Get rule IDs via `POST /rum/error-ingestion/rules/list`.
RuleID string `json:"rule_id" toon:"rule_id"`
// New rule name, 1-128 characters. Omit to leave unchanged.
RuleName *string `json:"rule_name,omitempty" toon:"rule_name,omitempty"`
}
RUMErrorIngestionUpdateRequest is generated from the Flashduty OpenAPI schema.
type RUMFacetCountRequest ¶ added in v0.5.4
type RUMFacetCountRequest struct {
// RUM DQL filter expression applied before counting. Fields in it are validated against the `scope`.
Dql string `json:"dql,omitempty" toon:"dql,omitempty"`
// End of the time range, Unix epoch milliseconds. Maximum 31-day span.
EndTime int64 `json:"end_time" toon:"end_time"`
// Field key whose value distribution to count, such as `error_type`. Must be a facet field of the given `scope` with `show_type: list` and a non-array `value_type`. List candidates with `POST /rum/field/list`.
FacetKey string `json:"facet_key" toon:"facet_key"`
// When set, count only events whose `facet_key` equals this value. The JSON type must match the field's `value_type` (string, number or boolean); a mismatch returns `InvalidParameter`. When omitted, events with a `null` value are excluded.
FacetValue any `json:"facet_value,omitempty" toon:"facet_value,omitempty"`
// Symbol kind, used only when `scope` is `sourcemap` and only meaningful for `android`/`harmony`: `mapping` (default) selects ProGuard/R8 mappings or ArkTS sourcemaps, `native` selects native .so symbols.
Kind string `json:"kind,omitempty" toon:"kind,omitempty"`
// Maximum number of top values to return. Default 100, maximum 100.
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// RUM data scope to query. One of:
//
// | Value | Meaning |
// |---|---|
// | `session` | User sessions |
// | `view` | Page views |
// | `action` | User actions |
// | `error` | Error events |
// | `resource` | Resource loads |
// | `long_task` | Long tasks |
// | `vital` | Performance vitals (Web Vitals, etc.) |
// | `issue` | Aggregated error-tracking issues |
// | `sourcemap` | Sourcemap / symbol files |
Scope string `json:"scope" toon:"scope"`
// Bare SQL `WHERE` condition (without the `WHERE` keyword) for extra filtering, such as `env = 'prod'`. Any occurrence of `SELECT` is rejected.
Sql string `json:"sql,omitempty" toon:"sql,omitempty"`
// Start of the time range, Unix epoch milliseconds.
StartTime int64 `json:"start_time" toon:"start_time"`
// Symbol-store platform, used only when `scope` is `sourcemap`. Defaults to `browser` when omitted; `web` and `javascript` are accepted aliases of `browser`.
//
// | Value | Store queried |
// |---|---|
// | `browser` / `web` / `javascript` | JavaScript sourcemaps (excluding HarmonyOS ArkTS and React Native rows) |
// | `android` | Android ProGuard/R8 mappings; with `kind=native`, Android NDK .so symbols |
// | `ios` | iOS dSYM symbols |
// | `miniprogram` | WeChat mini program sourcemaps |
// | `harmony` | HarmonyOS ArkTS sourcemaps; with `kind=native`, HarmonyOS .so symbols |
// | `flutter` | Flutter Dart AOT symbols |
// | `electron` | Electron Breakpad symbols |
// | `react-native` | React Native JS sourcemaps |
Type string `json:"type,omitempty" toon:"type,omitempty"`
}
RUMFacetCountRequest is generated from the Flashduty OpenAPI schema.
type RUMFacetCountResponse ¶ added in v0.5.4
type RUMFacetCountResponse struct {
// Facet values with their occurrence counts, sorted by count descending, capped at `limit` (max 100).
Items []FacetCountItem `json:"items" toon:"items"`
}
RUMFacetCountResponse is generated from the Flashduty OpenAPI schema.
type RUMFieldItem ¶ added in v0.5.4
type RUMFieldItem struct {
// Account ID. 0 for built-in fields.
AccountID int64 `json:"account_id" toon:"account_id"`
// Description of what this field captures.
Description string `json:"description" toon:"description"`
// True if this is a custom field that can be edited by the user.
EditAble bool `json:"edit_able" toon:"edit_able"`
// Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values.
EnumValues []any `json:"enum_values" toon:"enum_values"`
// Unique field key, e.g. `error.type`.
FieldKey string `json:"field_key" toon:"field_key"`
// Human-readable field name.
FieldName string `json:"field_name" toon:"field_name"`
// Display group used to cluster fields in the console, such as `error`, `action` or `device`. Empty when the field has no group.
Group string `json:"group" toon:"group"`
// True when grouping by this field is restricted: event ID fields cannot be grouped at all, other high-cardinality fields only with count or sum.
HighCardinality bool `json:"high_cardinality" toon:"high_cardinality"`
// True if value distribution counting is supported for this field.
IsFacet bool `json:"is_facet" toon:"is_facet"`
// True if this field can be used in DQL/SQL queries.
Queryable bool `json:"queryable" toon:"queryable"`
// RUM scopes this field appears in, using the same values as the request `scopes` (for example `error`, `issue`).
Scopes []string `json:"scopes" toon:"scopes"`
// Display type in the analytics UI. One of `list` (shown as an enumerated value list; only this type supports facet counting) or `range` (filtered and shown as a numeric/time range).
ShowType string `json:"show_type" toon:"show_type"`
// Field status. `enabled`: the field is in use. `disabled`: the field is defined but switched off. Deleted fields are never returned.
Status string `json:"status" toon:"status"`
// Measurement unit family. `time`: a duration or timestamp (see `unit_name`). `bytes`: a size in bytes. Empty string for dimensionless fields.
UnitFamily string `json:"unit_family" toon:"unit_family"`
// Unit of the stored value. Durations: `nanosecond`, `microsecond`, `millisecond`, `second`. Timestamps: `unix_millisecond`, `unix_second`. Sizes: `byte`. Empty string for dimensionless fields. Most built-in duration fields are in `nanosecond`.
UnitName string `json:"unit_name" toon:"unit_name"`
// Data type of the field value. One of:
//
// | Value | Meaning |
// |---|---|
// | `string` | String |
// | `number` | Numeric |
// | `boolean` | Boolean |
// | `array<string>` | Array of strings |
// | `array<number>` | Array of numbers |
// | `array<boolean>` | Array of booleans |
ValueType string `json:"value_type" toon:"value_type"`
}
RUMFieldItem is generated from the Flashduty OpenAPI schema.
type RUMFieldListRequest ¶ added in v0.5.4
type RUMFieldListRequest struct {
// When omitted or `null`, return all fields. When `true`, return only facet-enabled fields. When `false`, return only fields that are not facet-enabled.
IsFacet *bool `json:"is_facet,omitempty" toon:"is_facet,omitempty"`
// Filter by RUM data scopes; unknown values are rejected with a parameter error. Omit to list fields of all scopes.
//
// | Value | Meaning |
// |---|---|
// | `session` | User sessions |
// | `view` | Page views |
// | `action` | User actions |
// | `error` | Error events |
// | `resource` | Resource loads |
// | `long_task` | Long tasks |
// | `vital` | Performance vitals (Web Vitals, etc.) |
// | `issue` | Aggregated error-tracking issues |
// | `sourcemap` | Sourcemap / symbol files |
Scopes []string `json:"scopes,omitempty" toon:"scopes,omitempty"`
}
RUMFieldListRequest is generated from the Flashduty OpenAPI schema.
type RUMFieldListResponse ¶ added in v0.5.4
type RUMFieldListResponse struct {
// RUM field definitions matching the `scopes` / `is_facet` filters, with names and descriptions localized to the request locale.
Items []RUMFieldItem `json:"items" toon:"items"`
}
RUMFieldListResponse is generated from the Flashduty OpenAPI schema.
type RUMIssueExportRequest ¶ added in v0.14.3
type RUMIssueExportRequest struct {
ListOptions
// Filter by application IDs. Get IDs via `POST /rum/application/list`.
ApplicationIDs []string `json:"application_ids,omitempty" toon:"application_ids,omitempty"`
// Sort ascending when `true`; descending by default.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// When `true`, match by time-range overlap: export issues still active within the window (`last_seen_timestamp` >= `start_time`) even if created before it. Default `false` exports only issues created inside the window.
ByIntersection bool `json:"by_intersection,omitempty" toon:"by_intersection,omitempty"`
// Console origin used to build the `issue_url` column, e.g. `https://console.flashcat.cloud`; a trailing `/` is trimmed. The service cannot infer it. When omitted, `issue_url` holds only the path `/rum/error-tracking/issue/<issue_id>`.
ConsoleOrigin string `json:"console_origin,omitempty" toon:"console_origin,omitempty"`
// DQL query for advanced filtering. Field names must be fields of the `issue` scope (see `POST /rum/field/list` with `scopes: ["issue"]`); a bare full-text term searches the error message. Cannot be used with `sql`.
Dql string `json:"dql,omitempty" toon:"dql,omitempty"`
// End of the time range, Unix epoch milliseconds. Must be greater than `start_time`; maximum range: 183 days.
EndTime int64 `json:"end_time" toon:"end_time"`
// If `true`, only export issues with at least one associated error event.
ErrorRequired bool `json:"error_required,omitempty" toon:"error_required,omitempty"`
// CSV columns to export, in the order they appear. Unknown keys are rejected with a parameter error and duplicates are dropped. Empty or omitted: every column below except the `sample_first_*` group.
//
// | Value | Column content |
// |---|---|
// | `issue_id` | Issue ID |
// | `issue_url` | Console URL of the issue detail page (built from `console_origin`) |
// | `application_name` | Owning application name |
// | `service` | Service name |
// | `error_type` | Error type |
// | `error_message` | Error message |
// | `status` | Triage status |
// | `severity` | Severity |
// | `is_crash` | Whether the error caused a crash |
// | `error_count` | Error occurrence count |
// | `session_count` | Affected session count |
// | `first_seen_at` | First occurrence time (rendered in `time_zone`) |
// | `first_seen_version` | Application version at first occurrence |
// | `last_seen_at` | Most recent occurrence time (rendered in `time_zone`) |
// | `last_seen_version` | Application version at the most recent occurrence |
// | `versions` | All affected versions |
// | `suspected_cause` | Suspected cause category |
// | `resolved_at` | Resolution time (rendered in `time_zone`); empty while unresolved |
// | `sample_time` | Latest error event in the time window: time of the event (rendered in `time_zone`) |
// | `sample_version` | Latest error event in the time window: application version |
// | `sample_view` | Latest error event in the time window: view name, or the view URL when the name is empty |
// | `sample_session_id` | Latest error event in the time window: session ID |
// | `sample_device` | Latest error event in the time window: device brand and model |
// | `sample_os` | Latest error event in the time window: OS name and version |
// | `sample_browser` | Latest error event in the time window: browser name and version |
// | `sample_stack` | Latest error event in the time window: error stack, truncated to the first 20 lines |
// | `sample_first_time` | Earliest error event in the time window: time of the event (rendered in `time_zone`) |
// | `sample_first_version` | Earliest error event in the time window: application version |
// | `sample_first_view` | Earliest error event in the time window: view name, or the view URL when the name is empty |
// | `sample_first_session_id` | Earliest error event in the time window: session ID |
// | `sample_first_device` | Earliest error event in the time window: device brand and model |
// | `sample_first_os` | Earliest error event in the time window: OS name and version |
// | `sample_first_browser` | Earliest error event in the time window: browser name and version |
// | `sample_first_stack` | Earliest error event in the time window: error stack, truncated to the first 20 lines |
ExportFields []string `json:"export_fields,omitempty" toon:"export_fields,omitempty"`
// Sort field; defaults to `updated_at` when omitted.
//
// | Value | Meaning |
// |---|---|
// | `created_at` | Issue creation time |
// | `updated_at` | Last update time |
// | `session_count` | Affected session count |
// | `error_count` | Error occurrence count |
// | `severity` | Severity rank (`Critical` > `Warning` > `Info`) |
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// SQL-style WHERE condition for advanced filtering, without the `WHERE` keyword (for example `error_count > 100`). Field names must be fields of the `issue` scope; any text containing `SELECT` is rejected. Cannot be used with `dql`.
Sql string `json:"sql,omitempty" toon:"sql,omitempty"`
// Start of the time range, Unix timestamp in milliseconds (a value that looks like seconds is rejected). Issues are matched by creation time unless `by_intersection` is `true`.
StartTime int64 `json:"start_time" toon:"start_time"`
// Filter by triage status; any other value is rejected with a parameter error.
//
// | Value | Meaning |
// |---|---|
// | `for_review` | Pending triage |
// | `reviewed` | Reviewed |
// | `ignored` | Ignored |
// | `resolved` | Resolved |
Statuses []string `json:"statuses,omitempty" toon:"statuses,omitempty"`
// Filter by suspected cause category.
//
// | Value | Meaning |
// |---|---|
// | `api.failed_request` | API request failure (e.g. HTTP 4xx/5xx responses) |
// | `network.error` | Network connectivity error (offline, aborted requests, etc.) |
// | `code.exception` | Code exception (Syntax/Reference/Range and similar runtime errors) |
// | `code.invalid_object_access` | Invalid object access (e.g. reading a property of `undefined`/`null`) |
// | `code.invalid_argument` | Invalid argument passed to a function |
// | `unknown` | Cause could not be determined |
SuspectedCauses []string `json:"suspected_causes,omitempty" toon:"suspected_causes,omitempty"`
// Filter by team IDs. Get team IDs via `POST /team/list`.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
// IANA time zone used to render the CSV time columns and the file name, e.g. `Asia/Shanghai` or `UTC`. Default: `Asia/Shanghai`. An unknown zone name returns `InvalidParameter`.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
RUMIssueExportRequest is generated from the Flashduty OpenAPI schema.
type RUMIssueIDRequest ¶
type RUMIssueIDRequest struct {
// Issue ID. Get issue IDs via `POST /rum/issue/list`.
IssueID string `json:"issue_id" toon:"issue_id"`
}
RUMIssueIDRequest is generated from the Flashduty OpenAPI schema.
type RUMIssueItem ¶
type RUMIssueItem struct {
// Time span between the first and most recent occurrence, in seconds.
Age int64 `json:"age" toon:"age"`
// ID of the RUM application this issue belongs to.
ApplicationID string `json:"application_id" toon:"application_id"`
// Name of the owning application, resolved by `application_id` at query time (reflects the application's current name).
ApplicationName string `json:"application_name" toon:"application_name"`
// Issue creation time (client time of the first error event), Unix timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Representative error of this issue, taken from the error event that created it.
Error RUMIssueItemError `json:"error" toon:"error"`
// Total error occurrences.
ErrorCount int64 `json:"error_count" toon:"error_count"`
// Information about the issue's first occurrence (time and application version).
FirstSeen RUMIssueItemFirstSeen `json:"first_seen" toon:"first_seen"`
// Whether the error caused an app crash.
IsCrash bool `json:"is_crash" toon:"is_crash"`
// Unique issue ID.
IssueID string `json:"issue_id" toon:"issue_id"`
// Information about the issue's most recent occurrence (time and application version).
LastSeen RUMIssueItemLastSeen `json:"last_seen" toon:"last_seen"`
// Regression record. Present only after a resolved issue was reopened because its error recurred; cleared when the issue is resolved again.
Regression RUMIssueItemRegression `json:"regression" toon:"regression"`
// How the issue reacts when its error recurs after being resolved: `any` reopens it on any recurrence; `version` reopens it only when the error recurs in an application version the issue has not been seen in (errors without a version always reopen it). New issues and automatic resolution use `version`; resolving through `POST /rum/issue/update` without `resolve_mode` sets `any`.
ResolveMode string `json:"resolve_mode" toon:"resolve_mode"`
// Time the issue was marked resolved (by a user or automatically), Unix timestamp in milliseconds; `0` while unresolved.
ResolvedAt TimestampMilli `json:"resolved_at" toon:"resolved_at"`
// Person ID of the user who marked the issue resolved; `0` while unresolved or when the issue was resolved automatically.
ResolvedBy int64 `json:"resolved_by" toon:"resolved_by"`
// Name of the service that produced this issue, taken from the error event's `service` field.
Service string `json:"service" toon:"service"`
// Affected user sessions.
SessionCount int64 `json:"session_count" toon:"session_count"`
// Issue severity, fixed when the issue is created: the first matching enabled preset severity rule (see `POST /rum/issue/preset-severity/rules/list`) decides it, otherwise a built-in rule (crashes are `Critical`; other errors are scored by environment and message keywords). An error only joins an existing issue of equal or higher severity, so the same error can produce separate issues per severity. Empty string on legacy issues created before severity existed.
Severity string `json:"severity" toon:"severity"`
// Triage status of the issue; soft-deleted (`deleted`) issues are never returned. The system resolves an issue automatically when its error has not been seen for 14 days, or when a newer application version reports no such error, and reopens a resolved issue as `for_review` when the error recurs (see `resolve_mode`).
//
// | Value | Meaning |
// |---|---|
// | `for_review` | Pending triage |
// | `reviewed` | Reviewed |
// | `ignored` | Ignored |
// | `resolved` | Resolved |
Status string `json:"status" toon:"status"`
// Suspected root cause analysis, determined automatically (rules or AI) or set manually by a user.
SuspectedCause RUMIssueItemSuspectedCause `json:"suspected_cause" toon:"suspected_cause"`
// ID of the team owning this issue. For `POST /rum/issue/info` this is the owning application's current `team_id`; `POST /rum/issue/list` and `POST /rum/issue/export` report the team recorded when the issue was first seen, which differs once the application moves to another team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Time the issue was last updated, Unix timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Deduplicated list of application versions in which this issue has occurred; may contain an empty string for events without version info. `null` on issues that never recorded a version list.
Versions []string `json:"versions" toon:"versions"`
}
RUMIssueItem is generated from the Flashduty OpenAPI schema.
type RUMIssueItemError ¶
type RUMIssueItemError struct {
// Normalized error message, truncated to at most 512 characters.
Message string `json:"message" toon:"message"`
// Error type reported by the SDK in the error event's `error_type` field — free-form, not a fixed set. Browser errors carry the JavaScript exception name, e.g. `Error`, `TypeError`, `ReferenceError`.
Type string `json:"type" toon:"type"`
}
RUMIssueItemError is generated from the Flashduty OpenAPI schema.
type RUMIssueItemFirstSeen ¶
type RUMIssueItemFirstSeen struct {
// Client time of the first error event, Unix timestamp in milliseconds.
Timestamp TimestampMilli `json:"timestamp" toon:"timestamp"`
// Application version at first occurrence; empty string when the event carries no version.
Version string `json:"version" toon:"version"`
}
RUMIssueItemFirstSeen is generated from the Flashduty OpenAPI schema.
type RUMIssueItemLastSeen ¶
type RUMIssueItemLastSeen struct {
// Client time of the most recent error event, Unix timestamp in milliseconds.
Timestamp TimestampMilli `json:"timestamp" toon:"timestamp"`
// Application version at the most recent occurrence; empty string when the event carries no version.
Version string `json:"version" toon:"version"`
}
RUMIssueItemLastSeen is generated from the Flashduty OpenAPI schema.
type RUMIssueItemRegression ¶
type RUMIssueItemRegression struct {
// Time the regression was detected, Unix timestamp in milliseconds.
RegressedAt TimestampMilli `json:"regressed_at" toon:"regressed_at"`
// Application version in which the regression was observed.
RegressedAtVersion string `json:"regressed_at_version" toon:"regressed_at_version"`
// When the issue was resolved before this regression, as a Unix timestamp in milliseconds.
ResolvedAt TimestampMilli `json:"resolved_at" toon:"resolved_at"`
}
RUMIssueItemRegression is generated from the Flashduty OpenAPI schema.
type RUMIssueItemSuspectedCause ¶
type RUMIssueItemSuspectedCause struct {
// Person ID of the user who manually set the cause; 0 when `source` is `auto`.
PersonID int64 `json:"person_id" toon:"person_id"`
// Free-text explanation of the cause, written only by AI analysis; empty string when AI analysis is disabled, has not run yet, or the cause was set by a user.
Reason string `json:"reason" toon:"reason"`
// Origin of the cause: `auto` for system-determined, `user` for manually set.
Source string `json:"source" toon:"source"`
// Suspected cause category. One of:
//
// | Value | Meaning |
// |---|---|
// | `api.failed_request` | API request failure (e.g. HTTP 4xx/5xx responses) |
// | `network.error` | Network connectivity error (offline, aborted requests, etc.) |
// | `code.exception` | Code exception (Syntax/Reference/Range and similar runtime errors) |
// | `code.invalid_object_access` | Invalid object access (e.g. reading a property of `undefined`/`null`) |
// | `code.invalid_argument` | Invalid argument passed to a function |
// | `unknown` | Cause could not be determined |
Value string `json:"value" toon:"value"`
}
RUMIssueItemSuspectedCause is generated from the Flashduty OpenAPI schema.
type RUMIssueListRequest ¶
type RUMIssueListRequest struct {
ListOptions
// Filter by application IDs. Get IDs via `POST /rum/application/list`.
ApplicationIDs []string `json:"application_ids,omitempty" toon:"application_ids,omitempty"`
// Sort ascending when `true`; descending by default.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// When `true`, match by time-range overlap: return issues still active within the window (`last_seen_timestamp` >= `start_time`) even if created before it. Default `false` returns only issues created inside the window.
ByIntersection bool `json:"by_intersection,omitempty" toon:"by_intersection,omitempty"`
// DQL query for advanced filtering. Field names must be fields of the `issue` scope (see `POST /rum/field/list` with `scopes: ["issue"]`); a bare full-text term searches the error message. Cannot be used with `sql`.
Dql string `json:"dql,omitempty" toon:"dql,omitempty"`
// End of the time range, Unix epoch milliseconds. Must be greater than `start_time`; maximum range: 183 days.
EndTime int64 `json:"end_time" toon:"end_time"`
// If `true`, only return issues with at least one associated error event.
ErrorRequired bool `json:"error_required,omitempty" toon:"error_required,omitempty"`
// Sort field; defaults to `updated_at` when omitted.
//
// | Value | Meaning |
// |---|---|
// | `created_at` | Issue creation time |
// | `updated_at` | Last update time |
// | `session_count` | Affected session count |
// | `error_count` | Error occurrence count |
// | `severity` | Severity rank (`Critical` > `Warning` > `Info`) |
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// SQL-style WHERE condition for advanced filtering, without the `WHERE` keyword (for example `error_count > 100`). Field names must be fields of the `issue` scope; any text containing `SELECT` is rejected. Cannot be used with `dql`.
Sql string `json:"sql,omitempty" toon:"sql,omitempty"`
// Start of the time range, Unix timestamp in milliseconds (a value that looks like seconds is rejected). Issues are matched by creation time unless `by_intersection` is `true`.
StartTime int64 `json:"start_time" toon:"start_time"`
// Filter by triage status; any other value is rejected with a parameter error.
//
// | Value | Meaning |
// |---|---|
// | `for_review` | Pending triage |
// | `reviewed` | Reviewed |
// | `ignored` | Ignored |
// | `resolved` | Resolved |
Statuses []string `json:"statuses,omitempty" toon:"statuses,omitempty"`
// Filter by suspected cause category.
//
// | Value | Meaning |
// |---|---|
// | `api.failed_request` | API request failure (e.g. HTTP 4xx/5xx responses) |
// | `network.error` | Network connectivity error (offline, aborted requests, etc.) |
// | `code.exception` | Code exception (Syntax/Reference/Range and similar runtime errors) |
// | `code.invalid_object_access` | Invalid object access (e.g. reading a property of `undefined`/`null`) |
// | `code.invalid_argument` | Invalid argument passed to a function |
// | `unknown` | Cause could not be determined |
SuspectedCauses []string `json:"suspected_causes,omitempty" toon:"suspected_causes,omitempty"`
// Filter by team IDs. Get team IDs via `POST /team/list`.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
RUMIssueListRequest is generated from the Flashduty OpenAPI schema.
type RUMIssueListResponse ¶
type RUMIssueListResponse struct {
// Whether more pages exist; `true` when matching records remain beyond the current page.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Issues of the current page.
Items []RUMIssueItem `json:"items" toon:"items"`
// Total number of issues matching the filter conditions.
Total int64 `json:"total" toon:"total"`
}
RUMIssueListResponse is generated from the Flashduty OpenAPI schema.
type RUMIssueUpdateRequest ¶
type RUMIssueUpdateRequest struct {
// Issue ID to update. Get issue IDs via `POST /rum/issue/list`.
IssueID string `json:"issue_id" toon:"issue_id"`
// How the issue reacts when its error recurs after being resolved. Applied only together with `status: resolved`; defaults to `any` there when omitted, and is ignored with any other status.
//
// | Value | Meaning |
// |---|---|
// | `any` | Reopen the issue on any recurrence |
// | `version` | Reopen only when the error recurs in an application version the issue has not been seen in; errors without a version always reopen it |
ResolveMode string `json:"resolve_mode,omitempty" toon:"resolve_mode,omitempty"`
// New status. Setting `resolved` on an unresolved issue records the resolution time and operator and clears `regression`; switching away from `resolved` clears the resolution time and operator. Omit to keep the current status.
//
// | Value | Meaning |
// |---|---|
// | `for_review` | Pending triage |
// | `reviewed` | Reviewed |
// | `ignored` | Ignored |
// | `resolved` | Resolved |
Status string `json:"status,omitempty" toon:"status,omitempty"`
// New suspected cause; setting it marks the cause source as `user`, overriding the automatic classification. One of:
//
// | Value | Meaning |
// |---|---|
// | `api.failed_request` | API request failure |
// | `network.error` | Network connectivity error |
// | `code.exception` | Code exception |
// | `code.invalid_object_access` | Invalid object access |
// | `code.invalid_argument` | Invalid argument |
// | `unknown` | Unknown cause |
SuspectedCause string `json:"suspected_cause,omitempty" toon:"suspected_cause,omitempty"`
}
RUMIssueUpdateRequest is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleCreateRequest ¶ added in v0.10.0
type RUMPresetSeverityRuleCreateRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Optional description, up to 512 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches. An empty outer array never matches; an empty inner group matches every error.
Filters [][]RUMPresetSeverityRuleFilterCondition `json:"filters" toon:"filters"`
// Rule display name, 1-128 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Severity to assign to errors matching this rule.
Severity string `json:"severity" toon:"severity"`
}
RUMPresetSeverityRuleCreateRequest is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleCreateResponse ¶ added in v0.10.0
type RUMPresetSeverityRuleCreateResponse struct {
// Evaluation order assigned to the new rule (always the current lowest precedence, i.e. current max + 1).
Priority int64 `json:"priority" toon:"priority"`
// ID of the newly created rule.
RuleID string `json:"rule_id" toon:"rule_id"`
// Echo of the rule's display name.
RuleName string `json:"rule_name" toon:"rule_name"`
}
RUMPresetSeverityRuleCreateResponse is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleFilterCondition ¶ added in v0.10.0
type RUMPresetSeverityRuleFilterCondition struct {
// Filter attribute key. Only these Error-level attributes are supported for preset severity rules.
//
// | Value | Meaning |
// |---|---|
// | `error.usr_id` | User ID |
// | `error.usr_email` | User email |
// | `error.view_url` | Full URL of the page where the error occurred |
// | `error.view_url_path` | URL path of the page where the error occurred |
// | `error.error_type` | Error type |
// | `error.error_message` | Error message |
// | `error.env` | Environment (e.g. production/staging) |
// | `error.service` | Service name |
// | `error.device_type` | Device type |
// | `error.os_name` | Operating system name |
// | `error.browser_name` | Browser name |
// | `error.is_crash` | Whether the error is a crash, compared as the string `true` or `false` |
Key string `json:"key" toon:"key"`
// Match semantics: `IN` matches when the attribute value matches any of `vals`; `NOTIN` matches when it matches none of them. An attribute the error does not carry is compared as an empty string.
Oper string `json:"oper" toon:"oper"`
// Values to match against; at least one, none empty. Each entry is one of: an exact, case-sensitive whole-value match; a wildcard pattern with `*`/`?` (whole value); a regular expression wrapped in `/.../` (matches anywhere in the value unless anchored with `^`/`$`); `cidr:<network>` for IP-shaped values, e.g. `cidr:10.0.0.0/8`; or a numeric comparison `num:<op>:<number>` with `op` one of `lt`, `le`, `gt`, `ge`, e.g. `num:gt:100`. For `error.is_crash`, use `true` or `false`.
Vals []string `json:"vals" toon:"vals"`
}
RUMPresetSeverityRuleFilterCondition is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleHistoryItem ¶ added in v0.10.0
type RUMPresetSeverityRuleHistoryItem struct {
// Full rule set captured immediately before the mutation that produced this snapshot. Empty for the very first snapshot.
Rules []RUMPresetSeverityRuleHistorySnapshotRule `json:"rules" toon:"rules"`
// Unix timestamp in milliseconds when the snapshot was written.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Member ID who triggered the mutation this snapshot precedes.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Display name of `updated_by` at the time of the change.
UpdatedByName string `json:"updated_by_name" toon:"updated_by_name"`
// Monotonically increasing snapshot version number, starting at 1.
Version int64 `json:"version" toon:"version"`
}
RUMPresetSeverityRuleHistoryItem is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleHistoryListRequest ¶ added in v0.10.0
type RUMPresetSeverityRuleHistoryListRequest struct {
ListOptions
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Sort ascending when true; results are descending by default.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Sort column. Any other value (including omitted) falls back to `updated_at`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
}
RUMPresetSeverityRuleHistoryListRequest is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleHistoryListResponse ¶ added in v0.10.0
type RUMPresetSeverityRuleHistoryListResponse struct {
// Whether another page is available after this one.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Preset severity rule history snapshots of the current page.
Items []RUMPresetSeverityRuleHistoryItem `json:"items" toon:"items"`
// Total number of history snapshots for the application.
Total int64 `json:"total" toon:"total"`
}
RUMPresetSeverityRuleHistoryListResponse is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleHistoryRevertRequest ¶ added in v0.10.0
type RUMPresetSeverityRuleHistoryRevertRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Snapshot version number to revert to. Get versions via `POST /rum/issue/preset-severity/rules/history/list`.
Version int64 `json:"version" toon:"version"`
}
RUMPresetSeverityRuleHistoryRevertRequest is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleHistorySnapshotRule ¶ added in v0.10.0
type RUMPresetSeverityRuleHistorySnapshotRule struct {
// Account ID the rule belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// RUM application ID the rule belongs to.
ApplicationID string `json:"application_id" toon:"application_id"`
// Unix timestamp in milliseconds when the rule was created.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Member ID who originally created the rule.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// Unix timestamp in milliseconds the rule was soft-deleted; `0` means not deleted. Always `0` in practice, since deleted rules are excluded before a snapshot is taken.
DeletedAt TimestampMilli `json:"deleted_at" toon:"deleted_at"`
// Rule description. May be empty.
Description string `json:"description" toon:"description"`
// OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches. An empty outer array never matches; an empty inner group matches every error.
Filters [][]RUMPresetSeverityRuleFilterCondition `json:"filters" toon:"filters"`
// Internal auto-increment row ID. Not stable across a history revert — reverting reinserts rows with new IDs.
ID int64 `json:"id" toon:"id"`
// Evaluation order at snapshot time; `1` is highest precedence.
Priority int64 `json:"priority" toon:"priority"`
// Unique rule ID.
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule display name.
RuleName string `json:"rule_name" toon:"rule_name"`
// Severity assigned to errors matching this rule.
Severity string `json:"severity" toon:"severity"`
// Rule status at snapshot time.
Status string `json:"status" toon:"status"`
// Unix timestamp in milliseconds when the rule was last updated.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Member ID who last updated the rule as of snapshot time.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
RUMPresetSeverityRuleHistorySnapshotRule is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleIDRequest ¶ added in v0.10.0
type RUMPresetSeverityRuleIDRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Rule ID. Get rule IDs via `POST /rum/issue/preset-severity/rules/list`.
RuleID string `json:"rule_id" toon:"rule_id"`
}
RUMPresetSeverityRuleIDRequest is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleItem ¶ added in v0.10.0
type RUMPresetSeverityRuleItem struct {
// Unix timestamp in milliseconds when the rule was created.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Rule description. May be empty.
Description string `json:"description" toon:"description"`
// OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches. An empty outer array never matches; an empty inner group matches every error.
Filters [][]RUMPresetSeverityRuleFilterCondition `json:"filters" toon:"filters"`
// Evaluation order among the application's rules. `1` is evaluated first (highest precedence); the first enabled rule whose filters match wins.
Priority int64 `json:"priority" toon:"priority"`
// Unique rule ID.
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule display name.
RuleName string `json:"rule_name" toon:"rule_name"`
// Severity assigned to errors matching this rule.
Severity string `json:"severity" toon:"severity"`
// Only enabled rules are evaluated against incoming errors.
Status string `json:"status" toon:"status"`
// Unix timestamp in milliseconds when the rule was last updated.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}
RUMPresetSeverityRuleItem is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleListRequest ¶ added in v0.10.0
type RUMPresetSeverityRuleListRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
}
RUMPresetSeverityRuleListRequest is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleListResponse ¶ added in v0.10.0
type RUMPresetSeverityRuleListResponse struct {
// Rules ordered by evaluation order (`priority` ascending, then `created_at` ascending).
Items []RUMPresetSeverityRuleItem `json:"items" toon:"items"`
}
RUMPresetSeverityRuleListResponse is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleReorderRequest ¶ added in v0.10.0
type RUMPresetSeverityRuleReorderRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// ID of the rule being moved. Get rule IDs via `POST /rum/issue/preset-severity/rules/list`.
DragRuleID string `json:"drag_rule_id" toon:"drag_rule_id"`
// ID of the rule whose evaluation position `drag_rule_id` moves to.
TargetRuleID string `json:"target_rule_id" toon:"target_rule_id"`
}
RUMPresetSeverityRuleReorderRequest is generated from the Flashduty OpenAPI schema.
type RUMPresetSeverityRuleUpdateRequest ¶ added in v0.10.0
type RUMPresetSeverityRuleUpdateRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// New description, up to 512 characters. Omit to leave unchanged.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// New OR-of-ANDs filter structure; replaces the whole current structure. Omit or pass `null` to leave unchanged. The outer array is OR'd, each inner array is AND'd; an empty outer array never matches, an empty inner group matches every error.
Filters [][]RUMPresetSeverityRuleFilterCondition `json:"filters,omitempty" toon:"filters,omitempty"`
// Rule ID to update. Get rule IDs via `POST /rum/issue/preset-severity/rules/list`.
RuleID string `json:"rule_id" toon:"rule_id"`
// New display name, 1-128 characters. Omit to leave unchanged.
RuleName *string `json:"rule_name,omitempty" toon:"rule_name,omitempty"`
// New severity. Omit to leave unchanged.
Severity *string `json:"severity,omitempty" toon:"severity,omitempty"`
}
RUMPresetSeverityRuleUpdateRequest is generated from the Flashduty OpenAPI schema.
type RUMReplayApplication ¶ added in v0.5.7
type RUMReplayApplication struct {
// RUM application ID the session belongs to.
ID string `json:"id" toon:"id"`
}
RUMReplayApplication is generated from the Flashduty OpenAPI schema.
type RUMReplayDevice ¶ added in v0.5.7
type RUMReplayDevice struct {
// Device type recorded for the session, e.g. `desktop`, `mobile`, `tablet`.
Type string `json:"type" toon:"type"`
}
RUMReplayDevice is generated from the Flashduty OpenAPI schema.
type RUMReplayForegroundPeriod ¶ added in v0.5.7
type RUMReplayForegroundPeriod struct {
// End of the foreground period, in **nanoseconds** since the start of the view identified by `view_id` (not a Unix timestamp).
End Timestamp `json:"end" toon:"end"`
// Start of the foreground period, in **nanoseconds** since the start of the view identified by `view_id` (not a Unix timestamp).
Start Timestamp `json:"start" toon:"start"`
// View ID active during this foreground period.
ViewID string `json:"view_id" toon:"view_id"`
}
RUMReplayForegroundPeriod is generated from the Flashduty OpenAPI schema.
type RUMReplaySession ¶ added in v0.5.7
type RUMReplaySession struct {
// Unix timestamp in milliseconds of the session end: the later of the session's recorded end and the end of its last returned view.
End TimestampMilli `json:"end" toon:"end"`
// Whether the session was still active as of the last recorded event.
IsActive bool `json:"is_active" toon:"is_active"`
// Always `0`: timestamps are returned as recorded by the client, without clock-skew correction.
ServerTimeDelta int64 `json:"server_time_delta" toon:"server_time_delta"`
// SDK platform that recorded the session. Platform identifier:
//
// | Value | Meaning |
// |---|---|
// | `browser` | Web browser application (JavaScript SDK) |
// | `ios` | Apple iOS application |
// | `android` | Android application |
// | `react-native` | React Native application |
// | `flutter` | Flutter application |
// | `kotlin-multiplatform` | Kotlin Multiplatform application |
// | `roku` | Roku channel application |
// | `unity` | Unity application |
// | `miniprogram` | WeChat mini program |
// | `harmony` | HarmonyOS application |
// | `electron` | Electron desktop application |
Source string `json:"source" toon:"source"`
// Unix timestamp in milliseconds when the session started.
Start TimestampMilli `json:"start" toon:"start"`
}
RUMReplaySession is generated from the Flashduty OpenAPI schema.
type RUMReplayView ¶ added in v0.5.7
type RUMReplayView struct {
// SDK platform of the app that embeds this view (for example a WebView inside a native app). Omitted when the view is not embedded.
//
// | Value | Meaning |
// |---|---|
// | `browser` | Web browser application |
// | `ios` | Apple iOS application |
// | `android` | Android application |
// | `react-native` | React Native application |
// | `flutter` | Flutter application |
// | `kotlin-multiplatform` | Kotlin Multiplatform application |
// | `roku` | Roku channel application |
// | `unity` | Unity application |
// | `miniprogram` | WeChat mini program |
// | `harmony` | HarmonyOS application |
// | `electron` | Electron desktop application |
ContainerSource string `json:"container_source" toon:"container_source"`
// View ID of the containing view, when this view is embedded. Omitted when the view is not embedded.
ContainerViewID string `json:"container_view_id" toon:"container_view_id"`
// Unix timestamp in milliseconds when the view ended.
End TimestampMilli `json:"end" toon:"end"`
// Whether the view was still active as of the last recorded event.
IsActive bool `json:"is_active" toon:"is_active"`
// How the view was entered, as reported by the SDK. Web: `initial_load`, `route_change`. Mobile: `activity_display`, `activity_redisplay`, `fragment_display`, `fragment_redisplay`, `view_controller_display`, `view_controller_redisplay`. Empty when not reported.
LoadingType string `json:"loading_type" toon:"loading_type"`
// View name, typically the route or screen name.
Name string `json:"name" toon:"name"`
// Always `0`: timestamps are returned as recorded by the client, without clock-skew correction.
ServerTimeDelta int64 `json:"server_time_delta" toon:"server_time_delta"`
// SDK platform that recorded the view. Platform identifier:
//
// | Value | Meaning |
// |---|---|
// | `browser` | Web browser application (JavaScript SDK) |
// | `ios` | Apple iOS application |
// | `android` | Android application |
// | `react-native` | React Native application |
// | `flutter` | Flutter application |
// | `kotlin-multiplatform` | Kotlin Multiplatform application |
// | `roku` | Roku channel application |
// | `unity` | Unity application |
// | `miniprogram` | WeChat mini program |
// | `harmony` | HarmonyOS application |
// | `electron` | Electron desktop application |
Source string `json:"source" toon:"source"`
// Unix timestamp in milliseconds when the view started.
Start TimestampMilli `json:"start" toon:"start"`
// URL (web) or screen identifier (mobile) associated with the view.
URL string `json:"url" toon:"url"`
// Unique ID of the view within the session.
ViewID string `json:"view_id" toon:"view_id"`
}
RUMReplayView is generated from the Flashduty OpenAPI schema.
type RUMResourceInfoRequest ¶ added in v0.10.0
type RUMResourceInfoRequest struct {
// Bypass the short-lived cache of the resource record (plan version, quotas, status) and read it from source. Does not refresh the usage counts. Default `false`.
NoCache bool `json:"no_cache,omitempty" toon:"no_cache,omitempty"`
}
RUMResourceInfoRequest is generated from the Flashduty OpenAPI schema.
type RUMResourceItem ¶ added in v0.10.0
type RUMResourceItem struct {
// Account ID that owns this resource.
AccountID int64 `json:"account_id" toon:"account_id"`
// Retention period in days for action (user interaction) data.
ActionDays int64 `json:"action.days" toon:"action.days"`
// Unix timestamp in seconds when the resource was created. Also anchors the start of the first billing window.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Retention period in days for error data.
ErrorDays int64 `json:"error.days" toon:"error.days"`
// Unix timestamp in seconds when the on-premises license expires. Only present on on-premises deployments; omitted entirely for SaaS accounts.
ExpiredAt Timestamp `json:"expired_at" toon:"expired_at"`
// Retention period in days for long-task data.
LongTaskDays int64 `json:"long_task.days" toon:"long_task.days"`
// ID of the offering (SKU) this resource was provisioned from.
OfferingID int64 `json:"offering_id" toon:"offering_id"`
// ID of the order that provisioned this resource. Empty for resources provisioned outside the order flow (e.g. on-premises).
OrderID string `json:"order_id" toon:"order_id"`
// Product code for this resource. Always `rum` for this endpoint.
Product string `json:"product" toon:"product"`
// Retention period in days for resource (network request) data.
ResourceDays int64 `json:"resource.days" toon:"resource.days"`
// Unique resource identifier for the account's RUM resource.
ResourceID string `json:"resource_id" toon:"resource_id"`
// Display name of the resource.
ResourceName string `json:"resource_name" toon:"resource_name"`
// Retention period in days for session data.
SessionDays int64 `json:"session.days" toon:"session.days"`
// Free quota of investigate (error tracking) sessions per application, per billing window. A negative value means unlimited.
SessionInvestigateFreeCnt int64 `json:"session_investigate.free_cnt" toon:"session_investigate.free_cnt"`
// Number of investigate (error tracking) sessions used in the current billing window.
SessionInvestigateUsedCnt int64 `json:"session_investigate.used_cnt" toon:"session_investigate.used_cnt"`
// `true` when a `version=free` account's investigate or replay sessions in the current window have reached the per-application free quota multiplied by the number of applications. Always `false` for non-free plans and for accounts without applications.
SessionLimitReached bool `json:"session_limit_reached" toon:"session_limit_reached"`
// Free quota of measure (performance) sessions per application, per billing window. A negative value means unlimited.
SessionMeasureFreeCnt int64 `json:"session_measure.free_cnt" toon:"session_measure.free_cnt"`
// Number of measure (performance) sessions used in the current billing window.
SessionMeasureUsedCnt int64 `json:"session_measure.used_cnt" toon:"session_measure.used_cnt"`
// Free quota of session-replay sessions per application, per billing window. A negative value means unlimited.
SessionReplayFreeCnt int64 `json:"session_replay.free_cnt" toon:"session_replay.free_cnt"`
// Number of session-replay sessions used in the current billing window.
SessionReplayUsedCnt int64 `json:"session_replay.used_cnt" toon:"session_replay.used_cnt"`
// Status of the resource. A resource with status `deleted` or `destroyed` never reaches this field — the operation returns `ResourceNotFound` for those instead.
Status string `json:"status" toon:"status"`
// Unix timestamp in seconds when the resource was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Plan version of this resource. One of `free` (free plan) or `professional` (professional plan).
Version string `json:"version" toon:"version"`
// Retention period in days for view (page/screen) data.
ViewDays int64 `json:"view.days" toon:"view.days"`
// Unix timestamp in seconds for the end of the current 30-day billing window.
WindowEndTime Timestamp `json:"window_end_time" toon:"window_end_time"`
// Unix timestamp in seconds for the start of the current 30-day billing window.
WindowStartTime Timestamp `json:"window_start_time" toon:"window_start_time"`
}
RUMResourceItem is generated from the Flashduty OpenAPI schema.
type RUMSessionReplayMetaItem ¶ added in v0.5.7
type RUMSessionReplayMetaItem struct {
// Application the session belongs to.
Application RUMReplayApplication `json:"application" toon:"application"`
// Device that recorded the session.
Device RUMReplayDevice `json:"device" toon:"device"`
// Periods during which a view was in the foreground (focused), collected from every returned view. Empty when the SDK reported none.
ForegroundPeriods []RUMReplayForegroundPeriod `json:"foreground_periods" toon:"foreground_periods"`
// Session bounds and state.
Session RUMReplaySession `json:"session" toon:"session"`
// Views of the session that carry replay data, ordered by start time.
Views []RUMReplayView `json:"views" toon:"views"`
}
RUMSessionReplayMetaItem is generated from the Flashduty OpenAPI schema.
type RUMSessionReplayMetaRequest ¶ added in v0.5.7
type RUMSessionReplayMetaRequest struct {
// RUM session ID (the `session.id` attribute on RUM events).
SessionID string `json:"session_id" toon:"session_id"`
// Session start time, Unix milliseconds. Optional. When set, it must match the session's start exactly; use it to pick one session when a `session_id` was reused.
TS int64 `json:"ts,omitempty" toon:"ts,omitempty"`
}
RUMSessionReplayMetaRequest is generated from the Flashduty OpenAPI schema.
type RUMSessionReplaySegmentsRequest ¶ added in v0.5.7
type RUMSessionReplaySegmentsRequest struct {
// Maximum number of segments to return. 1-99, default 20.
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Pagination cursor from a previous call. Take it from the `search_after_ctx` field (URL mode) or the `X-Search-After-Ctx` response header (streaming mode).
SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
// RUM session ID (the `session.id` attribute on RUM events).
SessionID string `json:"session_id" toon:"session_id"`
// Unix timestamp in milliseconds. When set and `search_after_ctx` is empty, paging starts at the last full-snapshot segment at or before this time (searching up to 4 hours back); if none is found, paging starts from the beginning.
TS int64 `json:"ts,omitempty" toon:"ts,omitempty"`
// When `true`, return presigned download URLs as a JSON envelope instead of streaming segment bytes. Defaults to `false`.
URLMode bool `json:"url_mode,omitempty" toon:"url_mode,omitempty"`
// Restrict results to segments belonging to this view. Omit to page through the entire session.
ViewID string `json:"view_id,omitempty" toon:"view_id,omitempty"`
}
RUMSessionReplaySegmentsRequest is generated from the Flashduty OpenAPI schema.
type RUMSessionReplaySegmentsResult ¶ added in v0.5.7
type RUMSessionReplaySegmentsResult struct {
// Presigned URLs (valid 1 hour) for downloading each segment object. The object body is zlib-compressed; decompress it to get the segment JSON.
Items []string `json:"items" toon:"items"`
// Cursor to pass as `search_after_ctx` on the next call. Set whenever this page returned `limit` segments (the next page may then be empty); empty string when fewer were returned.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
}
RUMSessionReplaySegmentsResult is generated from the Flashduty OpenAPI schema.
type RUMWebhookTestRequest ¶ added in v0.5.4
type RUMWebhookTestRequest struct {
// RUM application whose name is put in the sample event's `labels.application_name`. The caller must be able to edit it. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Webhook URL to receive the sample alert event; must use `http` or `https`. Not saved: use `POST /rum/application/update` with `alerting.webhook_url` to store it.
WebhookURL string `json:"webhook_url" toon:"webhook_url"`
}
RUMWebhookTestRequest is generated from the Flashduty OpenAPI schema.
type RUMWebhookTestResponse ¶ added in v0.5.4
type RUMWebhookTestResponse struct {
// `ok` on success. Otherwise `unexpected status <code>` when the endpoint answered with an error status, or `request failed: <error>` when no response was received.
Message string `json:"message" toon:"message"`
// `true` when the endpoint answered with a status below 400 (after following redirects); `false` otherwise.
OK bool `json:"ok" toon:"ok"`
// HTTP status code of the last delivery attempt. `0` when no response was received (connection error or timeout).
StatusCode int64 `json:"status_code" toon:"status_code"`
}
RUMWebhookTestResponse is generated from the Flashduty OpenAPI schema.
type RateLimit ¶
type RateLimit struct {
Limit int // X-RateLimit-Limit, if present
Remaining int // X-RateLimit-Remaining, if present
Reset time.Time // X-RateLimit-Reset (unix seconds), if present
RetryAfter time.Duration // Retry-After (delta-seconds), if present
}
RateLimit captures rate-limit signals parsed from a response, best-effort. Each field is zero when the server did not send the corresponding header.
type RateLimitError ¶
type RateLimitError struct {
*ErrorResponse
RetryAfter time.Duration
}
RateLimitError is returned when the API responds 429. It embeds the standard *ErrorResponse (so errors.As(err, &target) for a *ErrorResponse still works) and adds the Retry-After hint. Inspect it with errors.As(err, &target) for a *RateLimitError.
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
func (*RateLimitError) Unwrap ¶
func (e *RateLimitError) Unwrap() error
Unwrap lets errors.As reach the embedded *ErrorResponse.
type RemoteConfig ¶ added in v0.15.2
type RemoteConfig struct {
// How a change lands on a client that is already running: `next_session` (the default, and what an empty value means) leaves running sessions untouched and applies the change to new sessions; `immediate` ends the running session as soon as the change arrives so a new session starts under the new configuration.
Activation string `json:"activation,omitempty" toon:"activation,omitempty"`
// Free-form key/value map that SDKs hand to the host app verbatim; the platform does not interpret it. At most 5 keys, each key 1–64 bytes, each value valid JSON of at most 4 KB nested at most 3 levels, 16 KB in total. Anyone holding the public client token can read it. Omitted from responses when empty.
Custom map[string]any `json:"custom,omitempty" toon:"custom,omitempty"`
// Values every client receives unless a matching rule overrides them.
Default RemoteConfigValues `json:"default,omitzero" toon:"default,omitempty"`
// Kill switch. When `false` the SDK config endpoint returns no values and SDKs fall back to their init values; `default` and `rules` are kept. Treated as `false` when omitted.
Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// If `true`, clients re-check the configuration when they return to the foreground instead of waiting for the next poll. Default `false`; omitted from responses when `false`.
RefreshOnForeground bool `json:"refresh_on_foreground,omitempty" toon:"refresh_on_foreground,omitempty"`
// Targeting rules, evaluated in order; the first match wins. At most 20. Can be `null` when the configuration was saved without rules.
Rules []RemoteConfigRule `json:"rules,omitempty" toon:"rules,omitempty"`
}
RemoteConfig is generated from the Flashduty OpenAPI schema.
type RemoteConfigHistoryItem ¶ added in v0.15.2
type RemoteConfigHistoryItem struct {
// The configuration content that went live under this version.
Config RemoteConfig `json:"config" toon:"config"`
// Fingerprint of the stored configuration: the first 16 hex characters of its SHA-256. Versions with equal hashes have identical content. Can be empty for older versions.
ContentHash string `json:"content_hash" toon:"content_hash"`
// Earliest retained version with the same `content_hash`, e.g. the version a revert restored. Omitted when this version is itself the earliest.
EquivalentTo int64 `json:"equivalent_to" toon:"equivalent_to"`
// Free-text note (not an enum) sent as `reason` when the version was published or reverted; `""` when none was given.
Reason string `json:"reason" toon:"reason"`
// Unix timestamp in milliseconds - when the version was published.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// ID of the member who published the version.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Name of the member who published the version at publish time, truncated to 128 characters.
UpdatedByName string `json:"updated_by_name" toon:"updated_by_name"`
// Version number, unique within the application.
Version int64 `json:"version" toon:"version"`
}
RemoteConfigHistoryItem is generated from the Flashduty OpenAPI schema.
type RemoteConfigRule ¶ added in v0.15.2
type RemoteConfigRule struct {
// Conditions on what the SDK reports in its config request, combined with AND and compared as exact strings. Keys are limited to `env`, `app_version` and `sdk`; values are 1–256 bytes. A key the SDK does not report never matches.
Match map[string]string `json:"match" toon:"match"`
Set RemoteConfigValues `json:"set" toon:"set"`
}
RemoteConfigRule is generated from the Flashduty OpenAPI schema.
type RemoteConfigValues ¶ added in v0.15.2
type RemoteConfigValues struct {
// How Session Replay masks a page by default:
//
// - `mask`: replaces text and hides input values.
// - `mask-user-input`: keeps page text but hides what users type.
// - `allow`: records the page as it is; content already uploaded cannot be masked later.
DefaultPrivacyLevel *string `json:"defaultPrivacyLevel,omitempty" toon:"defaultPrivacyLevel,omitempty"`
// Keep sessions the session sample rate did not draw when they report an error; applies only to sessions that rate missed, so it does nothing alongside a rate of 100.
SessionOnError *bool `json:"sessionOnError,omitempty" toon:"sessionOnError,omitempty"`
// The same switch for Session Replay: un-sampled sessions still record and upload their recording only when the session errors.
SessionReplayOnError *bool `json:"sessionReplayOnError,omitempty" toon:"sessionReplayOnError,omitempty"`
// Percentage of sessions that record Session Replay (0–100).
SessionReplaySampleRate *int64 `json:"sessionReplaySampleRate,omitempty" toon:"sessionReplaySampleRate,omitempty"`
// Percentage of sessions collected (0–100).
SessionSampleRate *int64 `json:"sessionSampleRate,omitempty" toon:"sessionSampleRate,omitempty"`
// Percentage of sessions that inject trace headers into their requests (0–100). Decided per session: a session traces all of its requests or none.
TraceSampleRate *int64 `json:"traceSampleRate,omitempty" toon:"traceSampleRate,omitempty"`
}
RemoteConfigValues is generated from the Flashduty OpenAPI schema.
type RemoveIncidentRequest ¶
type RemoveIncidentRequest struct {
// Incident IDs to remove. At most 100 per call. The caller must have access to every channel the incidents belong to.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
}
RemoveIncidentRequest is generated from the Flashduty OpenAPI schema.
type ReopenIncidentRequest ¶
type ReopenIncidentRequest struct {
// Incident IDs to reopen. At most 100 per call.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
// Optional free-text reason, recorded on the `i_reopen` timeline entry. At most 1,024 characters.
Reason string `json:"reason,omitempty" toon:"reason,omitempty"`
}
ReopenIncidentRequest is generated from the Flashduty OpenAPI schema.
type ReorderEscalationRulesRequest ¶ added in v0.15.19
type ReorderEscalationRulesRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// ID of the rule being dragged (24-character hex), as returned in `rule_id` by the create or list endpoint.
DragRuleID string `json:"drag_rule_id" toon:"drag_rule_id"`
// ID of the rule whose slot the dragged rule moves into (24-character hex).
TargetRuleID string `json:"target_rule_id" toon:"target_rule_id"`
}
ReorderEscalationRulesRequest is generated from the Flashduty OpenAPI schema.
type ReorderIncidentCommentTypesRequest ¶ added in v0.8.0
type ReorderIncidentCommentTypesRequest struct {
// IDs of every comment type of the account in the desired order (24-character hex ObjectIDs).
CommentTypeIDs []string `json:"comment_type_ids" toon:"comment_type_ids"`
}
ReorderIncidentCommentTypesRequest is generated from the Flashduty OpenAPI schema.
type ResetIncidentFieldRequest ¶
type ResetIncidentFieldRequest struct {
// Custom field name (the field's `field_name`, not its display name). The field must exist and be enabled; list fields with `POST /field/list`.
FieldName string `json:"field_name" toon:"field_name"`
// New value. Its type must match the field: `checkbox` takes a boolean, `single_select` one of the options, `multi_select` an array of options, `text` a string. Omit it or send `null` to clear the field.
FieldValue any `json:"field_value,omitempty" toon:"field_value,omitempty"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
}
ResetIncidentFieldRequest is generated from the Flashduty OpenAPI schema.
type ResetPostMortemBasicsRequest ¶ added in v0.5.4
type ResetPostMortemBasicsRequest struct {
// Unix timestamp in seconds for the earliest linked incident start time.
IncidentsEarliestStartSeconds int64 `json:"incidents_earliest_start_seconds" toon:"incidents_earliest_start_seconds"`
// Highest severity among the linked incidents.
// - `Critical`: critical.
// - `Warning`: warning.
// - `Info`: informational.
// - `Ok`: recovered.
IncidentsHighestSeverity string `json:"incidents_highest_severity" toon:"incidents_highest_severity"`
// Latest close time among the linked incidents, Unix timestamp in seconds. 0 (also when omitted) means still open.
IncidentsLatestCloseSeconds int64 `json:"incidents_latest_close_seconds,omitempty" toon:"incidents_latest_close_seconds,omitempty"`
// Total incident duration in seconds; 0 when omitted.
IncidentsTotalDurationSeconds int64 `json:"incidents_total_duration_seconds,omitempty" toon:"incidents_total_duration_seconds,omitempty"`
// Post-mortem ID; obtain it from `POST /incident/post-mortem/list`.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Member IDs to store as the report's responders. Replaces the stored list; omit or send `[]` to clear it. IDs that do not resolve to a person are dropped.
ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
}
ResetPostMortemBasicsRequest is generated from the Flashduty OpenAPI schema.
type ResetPostMortemContentRequest ¶ added in v0.5.9
type ResetPostMortemContentRequest struct {
// Current content revision expected by the caller. Pass 0 for the first write to a document that has never been saved.
ExpectedRevision *int64 `json:"expected_revision,omitempty" toon:"expected_revision,omitempty"`
// Non-blank key for safely retrying this exact reset request.
IdempotencyKey string `json:"idempotency_key" toon:"idempotency_key"`
// Replacement Markdown content. Limited to 4 MiB.
Markdown string `json:"markdown" toon:"markdown"`
// ID of the post-mortem to reset; obtain it from `POST /incident/post-mortem/list`.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
}
ResetPostMortemContentRequest is generated from the Flashduty OpenAPI schema.
type ResetPostMortemFollowUpsRequest ¶ added in v0.5.4
type ResetPostMortemFollowUpsRequest struct {
// Follow-ups as free text, replacing the stored string. A JSON array in the console's follow-up format (objects with `title`, `status`, `priority`, `assignee_ids`, …) is also synced into structured follow-up work items.
FollowUps string `json:"follow_ups,omitempty" toon:"follow_ups,omitempty"`
// Post-mortem ID; obtain it from `POST /incident/post-mortem/list`.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
}
ResetPostMortemFollowUpsRequest is generated from the Flashduty OpenAPI schema.
type ResetPostMortemStatusRequest ¶ added in v0.5.4
type ResetPostMortemStatusRequest struct {
// Post-mortem ID; obtain it from `POST /incident/post-mortem/list`.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Target report status.
// - `drafting`: being edited; the body can still be replaced with a content reset.
// - `published`: published; media files no longer referenced by the body are deleted.
Status string `json:"status" toon:"status"`
}
ResetPostMortemStatusRequest is generated from the Flashduty OpenAPI schema.
type ResetPostMortemTitleRequest ¶ added in v0.5.4
type ResetPostMortemTitleRequest struct {
// Post-mortem ID; obtain it from `POST /incident/post-mortem/list`.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// New report title, at most 256 characters.
Title string `json:"title" toon:"title"`
}
ResetPostMortemTitleRequest is generated from the Flashduty OpenAPI schema.
type ResetWorkItemAssigneesRequest ¶ added in v0.8.0
type ResetWorkItemAssigneesRequest struct {
// Legacy alias for the replacement assignee set. Equivalent to `assignees` with every entry `type` `person`. Mutually exclusive with `assignees`: sending both returns an error. An empty array clears all assignees.
AssigneeIDs []int64 `json:"assignee_ids,omitempty" toon:"assignee_ids,omitempty"`
// Replacement assignee set. Each entry is `{type, id?}`. `type` is `person` or `ai_sre`; an `ai_sre` entry omits `id`. Mutually exclusive with `assignee_ids`: sending both returns an error. `assignee_ids` is the legacy alias and is equivalent to an all-`person` list. At most 20 entries. An empty array clears all assignees.
Assignees []WorkItemAssignee `json:"assignees,omitempty" toon:"assignees,omitempty"`
// The item's current `version` (≥ 1) for optimistic locking.
Version int64 `json:"version" toon:"version"`
// Work item ID (opaque string, max 128 characters).
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
ResetWorkItemAssigneesRequest is generated from the Flashduty OpenAPI schema.
type ResolveIncidentRequest ¶
type ResolveIncidentRequest struct {
// Custom field values for the resolution form. Allowed keys and values depend on the incident's visible form.
CustomFields CustomFieldValues `json:"custom_fields,omitempty" toon:"custom_fields,omitempty"`
// New incident description, up to 6,144 characters. When set, it replaces the current description before the incident closes.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Images attached to the resolution timeline entry.
Images []IncidentActionImage `json:"images,omitempty" toon:"images,omitempty"`
// Incident IDs to resolve. At most 100 per call.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
// Optional resolution note applied to every resolved incident.
Resolution *string `json:"resolution,omitempty" toon:"resolution,omitempty"`
// Optional root cause note applied to every resolved incident.
RootCause *string `json:"root_cause,omitempty" toon:"root_cause,omitempty"`
// Form summary recorded as a timeline comment. Accepted only when the resolution form contains a summary element.
Summary string `json:"summary,omitempty" toon:"summary,omitempty"`
}
ResolveIncidentRequest is generated from the Flashduty OpenAPI schema.
type ResourcesService ¶ added in v0.10.0
type ResourcesService service
ResourcesService handles the "RUM/Resources" API resource.
func (*ResourcesService) Info ¶ added in v0.10.0
func (s *ResourcesService) Info(ctx context.Context, req *RUMResourceInfoRequest) (*RUMResourceItem, *Response, error)
Get RUM resource info.
Return the account's RUM resource record and its current session usage.
API: POST /rum/resource/info (rum-resource-read-info).
type Responder ¶
type Responder struct {
// Unix timestamp (seconds) when the member acknowledged. 0 if not yet acknowledged.
AcknowledgedAt Timestamp `json:"acknowledged_at" toon:"acknowledged_at"`
// Role label of this responder.
As string `json:"as" toon:"as"`
// Unix timestamp (seconds) when the member was assigned.
AssignedAt Timestamp `json:"assigned_at" toon:"assigned_at"`
// Member email, filled by the server.
Email string `json:"email" toon:"email"`
// Responder member ID.
PersonID int64 `json:"person_id" toon:"person_id"`
// Member display name, filled by the server.
PersonName string `json:"person_name" toon:"person_name"`
}
Responder is generated from the Flashduty OpenAPI schema.
type ResponderInsightItem ¶
type ResponderInsightItem struct {
// This responder's acknowledgement rate (%): acknowledged incidents ÷ involved incidents × 100, rounded to two decimals and capped at 100; 0 when the responder has no incidents.
AcknowledgementPct float64 `json:"acknowledgement_pct" toon:"acknowledgement_pct"`
// Channel ID, returned only when aggregating by channel (`/insight/channel`).
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name, returned when aggregating by channel; omitted when the name cannot be resolved.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Hour bucket when `split_hours` is enabled. `work` is Mon–Fri 08:00–19:00, `sleep` is daily 23:00–08:00, and `off` is everything else, all evaluated in the account timezone (`sleep` takes precedence over `work`). Omitted when `split_hours` is false.
Hours string `json:"hours" toon:"hours"`
// This responder's mean time to acknowledgement in seconds; 0 when the responder acknowledged nothing.
MeanSecondsToAck float64 `json:"mean_seconds_to_ack" toon:"mean_seconds_to_ack"`
// Responder (person) ID, returned only when aggregating by responder (`/insight/responder`).
ResponderID int64 `json:"responder_id" toon:"responder_id"`
// Responder name, returned when aggregating by responder; omitted when the name cannot be resolved.
ResponderName string `json:"responder_name" toon:"responder_name"`
// Team ID, returned only by `/insight/team`. Omitted on the row that aggregates incidents without a team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Team name, returned when aggregating by team; omitted when the name cannot be resolved (e.g. team deleted).
TeamName string `json:"team_name" toon:"team_name"`
// This responder's total engaged time in seconds: each incident contributes close time minus their acknowledgement time.
TotalEngagedSeconds int64 `json:"total_engaged_seconds" toon:"total_engaged_seconds"`
// Incidents this responder was involved in.
TotalIncidentCnt int64 `json:"total_incident_cnt" toon:"total_incident_cnt"`
// Incidents acknowledged by this responder.
TotalIncidentsAcknowledged int64 `json:"total_incidents_acknowledged" toon:"total_incidents_acknowledged"`
// This responder's incidents that were escalated at least once.
TotalIncidentsEscalated int64 `json:"total_incidents_escalated" toon:"total_incidents_escalated"`
// This responder's incidents escalated manually.
TotalIncidentsManuallyEscalated int64 `json:"total_incidents_manually_escalated" toon:"total_incidents_manually_escalated"`
// Incidents reassigned away from this responder.
TotalIncidentsReassigned int64 `json:"total_incidents_reassigned" toon:"total_incidents_reassigned"`
// This responder's incidents escalated on timeout.
TotalIncidentsTimeoutEscalated int64 `json:"total_incidents_timeout_escalated" toon:"total_incidents_timeout_escalated"`
// Interruptions for this responder: notifications sent via app push, SMS, or voice call; consecutive notifications within 60 seconds count as one.
TotalInterruptions int64 `json:"total_interruptions" toon:"total_interruptions"`
// Total notifications sent to this responder.
TotalNotifications int64 `json:"total_notifications" toon:"total_notifications"`
// This responder's total time to acknowledgement in seconds: each incident contributes acknowledgement time minus assignment time.
TotalSecondsToAck int64 `json:"total_seconds_to_ack" toon:"total_seconds_to_ack"`
// Start of the time bucket, Unix seconds. Equals `start_time` when `aggregate_unit` is not set.
TS Timestamp `json:"ts" toon:"ts"`
}
ResponderInsightItem is generated from the Flashduty OpenAPI schema.
type ResponderInsightResponse ¶
type ResponderInsightResponse struct {
// Per-responder metric rows, newest bucket first. Responders without incidents in a bucket produce no row.
Items []ResponderInsightItem `json:"items" toon:"items"`
}
ResponderInsightResponse is generated from the Flashduty OpenAPI schema.
type Response ¶
type Response struct {
*http.Response
RequestID string
Total int
HasNextPage bool
SearchAfterCtx string
RateLimit RateLimit
// Raw holds the response body for endpoints that return a non-JSON payload
// on success (e.g. CSV/file downloads from the *export endpoints). It is nil
// for normal JSON responses; the typed return value is then the zero value.
Raw []byte
}
Response wraps http.Response and surfaces Flashduty envelope metadata: the request id (for support), pagination fields when the endpoint returns them, and best-effort rate-limit signals.
type ResponseEnvelope ¶ added in v0.4.0
type ResponseEnvelope struct {
// Operation-specific payload, documented in each operation's 200 response. Operations without a payload return `{}` or omit `data` entirely.
Data any `json:"data" toon:"data"`
Error any `json:"error" toon:"error"`
// Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.
RequestID string `json:"request_id" toon:"request_id"`
}
ResponseEnvelope is generated from the Flashduty OpenAPI schema.
type RevertRemoteConfigRequest ¶ added in v0.15.2
type RevertRemoteConfigRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// Optional free-text note (not an enum), at most 255 characters, stored verbatim and returned as `reason` by `POST /rum/application/remote-config/history/list`. The server does not fill it in when omitted.
Reason string `json:"reason,omitempty" toon:"reason,omitempty"`
// Version to restore. Must be one of the retained versions listed by `POST /rum/application/remote-config/history/list`.
Version int64 `json:"version" toon:"version"`
}
RevertRemoteConfigRequest is generated from the Flashduty OpenAPI schema.
type RevertRemoteConfigResponse ¶ added in v0.15.2
type RevertRemoteConfigResponse struct {
// New version number created by the revert (previous highest version + 1).
Version int64 `json:"version" toon:"version"`
}
RevertRemoteConfigResponse is generated from the Flashduty OpenAPI schema.
type RoleDeleteRequest ¶ added in v0.14.3
type RoleDeleteRequest struct {
// When false (default), deletion fails with `ReferenceExist` while members still hold the role, listing them in `data.refs`. When true, the role is first revoked from all holders and then deleted. Does not bypass the SSO default-role check.
IsForce bool `json:"is_force,omitempty" toon:"is_force,omitempty"`
// Role ID to delete. Get IDs from `POST /role/list` (built-in roles: 2=Admin, 6=Responder, 8=Viewer).
RoleID uint64 `json:"role_id" toon:"role_id"`
}
RoleDeleteRequest is generated from the Flashduty OpenAPI schema.
type RoleGrantRequest ¶
type RoleGrantRequest struct {
// IDs of the members to grant the role to or revoke it from (from `POST /member/list`). All must be members of the account; duplicates are rejected.
MemberIDs []uint64 `json:"member_ids" toon:"member_ids"`
// Role ID to grant or revoke. Get IDs from `POST /role/list`.
RoleID uint64 `json:"role_id" toon:"role_id"`
}
RoleGrantRequest is generated from the Flashduty OpenAPI schema.
type RoleIDRequest ¶
type RoleIDRequest struct {
// Role ID to operate on. Get IDs from `POST /role/list` (built-in roles: 2=Admin, 6=Responder, 8=Viewer).
RoleID uint64 `json:"role_id" toon:"role_id"`
}
RoleIDRequest is generated from the Flashduty OpenAPI schema.
type RoleInfoRequest ¶
type RoleInfoRequest struct {
// Role ID to query. Get IDs from `POST /role/list` (built-in roles: 2=Admin, 6=Responder, 8=Viewer).
RoleID uint64 `json:"role_id" toon:"role_id"`
}
RoleInfoRequest is generated from the Flashduty OpenAPI schema.
type RoleItem ¶
type RoleItem struct {
// Time the role was created, Unix timestamp in seconds. Built-in roles carry a fixed timestamp.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Role description. For built-in roles it is localized by the request language.
Description string `json:"description" toon:"description"`
// `false` for the built-in roles (Admin, Responder, Viewer); `true` for custom roles.
Editable bool `json:"editable" toon:"editable"`
// IDs of the permissions the role grants, in ascending order; resolve them with `POST /role/permission/list`. Empty array when none.
PermissionIDs []uint64 `json:"permission_ids" toon:"permission_ids"`
// Role ID. Built-in roles use the fixed IDs `2` (Admin), `6` (Responder), and `8` (Viewer).
RoleID uint64 `json:"role_id" toon:"role_id"`
// Role name, unique in the account. The built-in roles are named `Admin`, `Responder`, and `Viewer` in every language.
RoleName string `json:"role_name" toon:"role_name"`
// Role status. `enabled` — active; `disabled` — turned off with `POST /role/disable`; it grants no permissions to the members who hold it. Built-in roles are always `enabled`; deleted roles are never returned.
Status string `json:"status" toon:"status"`
// Unix epoch seconds the role was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
RoleItem is generated from the Flashduty OpenAPI schema.
type RoleListRequest ¶
type RoleListRequest struct {
// Ascending sort order. Default: false (descending).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// When true, exclude the built-in global roles (Admin, Responder, Viewer) and return only custom roles. Default: false.
NoGlobal bool `json:"no_global,omitempty" toon:"no_global,omitempty"`
// Sort field. Default: `updated_at`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
}
RoleListRequest is generated from the Flashduty OpenAPI schema.
type RoleListResponse ¶
type RoleListResponse struct {
// Array of roles; includes account roles plus built-in global roles unless `no_global=true`; empty array when no results.
Items []RoleItem `json:"items" toon:"items"`
// Number of roles returned: custom roles plus the 3 built-in roles unless `no_global` is true.
Total int64 `json:"total" toon:"total"`
}
RoleListResponse is generated from the Flashduty OpenAPI schema.
type RolePermissionListRequest ¶
type RolePermissionListRequest struct {
// Role IDs (built-in or custom) whose granted permissions to return or mark. IDs that do not exist are ignored.
RoleIDs []uint64 `json:"role_ids,omitempty" toon:"role_ids,omitempty"`
// When true, return every permission and use `is_granted` to mark the ones granted by `role_ids`. When false (default), return only the granted permissions.
WithAll bool `json:"with_all,omitempty" toon:"with_all,omitempty"`
}
RolePermissionListRequest is generated from the Flashduty OpenAPI schema.
type RolePermissionListResponse ¶
type RolePermissionListResponse struct {
// Array of permission items: system-level permissions plus the caller's account-scoped custom-menu permissions (never other tenants' rows).
Items []PermissionItem `json:"items" toon:"items"`
}
RolePermissionListResponse is generated from the Flashduty OpenAPI schema.
type RoleUpsertRequest ¶
type RoleUpsertRequest struct {
// Role description, up to 499 characters. Omitting it on update clears the stored description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// IDs of the permissions the role grants (from `POST /role/permission/list`). Replaces the existing set; omitting it or sending an empty array leaves the role with no permissions.
PermissionIDs []uint64 `json:"permission_ids,omitempty" toon:"permission_ids,omitempty"`
// ID of the custom role to update. Omit or set to 0 to create a new role. Do not pass the built-in role IDs `2`, `6`, or `8`.
RoleID uint64 `json:"role_id,omitempty" toon:"role_id,omitempty"`
// Role display name. 1–39 characters.
RoleName string `json:"role_name" toon:"role_name"`
}
RoleUpsertRequest is generated from the Flashduty OpenAPI schema.
type RoleUpsertResponse ¶
type RoleUpsertResponse struct {
// Created or updated role ID.
RoleID uint64 `json:"role_id" toon:"role_id"`
// Role name echoed from the request.
RoleName string `json:"role_name" toon:"role_name"`
}
RoleUpsertResponse is generated from the Flashduty OpenAPI schema.
type RolesPermissionsService ¶
type RolesPermissionsService service
RolesPermissionsService handles the "Platform/Roles & permissions" API resource.
func (*RolesPermissionsService) ReadInfo ¶
func (s *RolesPermissionsService) ReadInfo(ctx context.Context, req *RoleInfoRequest) (*RoleItem, *Response, error)
Get role detail.
Return the detail of a single role by its ID.
API: POST /role/info (role-read-info).
func (*RolesPermissionsService) ReadList ¶
func (s *RolesPermissionsService) ReadList(ctx context.Context, req *RoleListRequest) (*RoleListResponse, *Response, error)
List roles.
Return all custom and built-in roles for the current account.
API: POST /role/list (role-read-list).
func (*RolesPermissionsService) ReadListPermission ¶
func (s *RolesPermissionsService) ReadListPermission(ctx context.Context, req *RolePermissionListRequest) (*RolePermissionListResponse, *Response, error)
List permissions.
List permission entries and mark which of them the given roles grant.
API: POST /role/permission/list (role-read-list-permission).
func (*RolesPermissionsService) ReadListPermissionFactor ¶
func (s *RolesPermissionsService) ReadListPermissionFactor(ctx context.Context, req *PermissionFactorListRequest) (*PermissionFactorListResponse, *Response, error)
List permission factors.
List the permission factors granted to the calling member through their roles.
API: POST /role/permission/factor/list (role-read-list-permission-factor).
func (*RolesPermissionsService) WriteDelete ¶
func (s *RolesPermissionsService) WriteDelete(ctx context.Context, req *RoleDeleteRequest) (*Response, error)
Delete a role.
Delete a custom role, optionally revoking it from every member who still holds it.
API: POST /role/delete (role-write-delete).
func (*RolesPermissionsService) WriteDisable ¶
func (s *RolesPermissionsService) WriteDisable(ctx context.Context, req *RoleIDRequest) (*Response, error)
Disable a role.
Set a custom role's status to disabled without deleting it.
API: POST /role/disable (role-write-disable).
func (*RolesPermissionsService) WriteEnable ¶
func (s *RolesPermissionsService) WriteEnable(ctx context.Context, req *RoleIDRequest) (*Response, error)
Enable a role.
Re-enable a previously disabled custom role.
API: POST /role/enable (role-write-enable).
func (*RolesPermissionsService) WriteGrantRole ¶
func (s *RolesPermissionsService) WriteGrantRole(ctx context.Context, req *RoleGrantRequest) (*Response, error)
Grant role to members.
Assign a role to one or more members, giving them its permissions.
API: POST /role/member/grant (role-write-grant-role).
func (*RolesPermissionsService) WriteRevokeRole ¶
func (s *RolesPermissionsService) WriteRevokeRole(ctx context.Context, req *RoleGrantRequest) (*Response, error)
Revoke role from members.
Remove a role from one or more members, revoking the permissions it granted.
API: POST /role/member/revoke (role-write-revoke-role).
func (*RolesPermissionsService) WriteUpsert ¶
func (s *RolesPermissionsService) WriteUpsert(ctx context.Context, req *RoleUpsertRequest) (*RoleUpsertResponse, *Response, error)
Create or update a role.
Create a new custom role or update an existing one. Pass `role_id` to update.
API: POST /role/upsert (role-write-upsert).
type RotateIntegrationKeyResponse ¶ added in v0.15.9
type RotateIntegrationKeyResponse struct {
// New integration key; the previous key stops working immediately.
IntegrationKey string `json:"integration_key" toon:"integration_key"`
}
RotateIntegrationKeyResponse is generated from the Flashduty OpenAPI schema.
type RouteCase ¶
type RouteCase struct {
// Target channel IDs. Required when `routing_mode` is `standard` (or empty); returned as `null` for `name_mapping`.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// When `true`, evaluation continues with the next case after this one matches and the channels of all matched cases are combined; when `false`, evaluation stops at this case.
Fallthrough bool `json:"fallthrough,omitempty" toon:"fallthrough,omitempty"`
// Conditions joined with AND; an empty list matches every event. Required.
If []RouteMatchCondition `json:"if" toon:"if"`
// Event field whose value is used as the target channel name, for example `labels.service`. Required when `routing_mode` is `name_mapping`; if no enabled channel has that name, the case adds no channel.
NameMappingLabel string `json:"name_mapping_label,omitempty" toon:"name_mapping_label,omitempty"`
// Routing mode. `standard` routes to the fixed `channel_ids`; `name_mapping` routes to the enabled channel whose name equals the value of `name_mapping_label` on the event. An empty value is treated as `standard` and is omitted in responses.
RoutingMode string `json:"routing_mode,omitempty" toon:"routing_mode,omitempty"`
}
RouteCase is generated from the Flashduty OpenAPI schema.
type RouteDefault ¶
type RouteDefault struct {
// Channels used when no case yields a channel. An empty list is treated as no default branch.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
}
RouteDefault is generated from the Flashduty OpenAPI schema.
type RouteInfoRequest ¶
type RouteInfoRequest struct {
// Shared integration ID, greater than 0; obtain it from `POST /integration/list`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
RouteInfoRequest is generated from the Flashduty OpenAPI schema.
type RouteItem ¶
type RouteItem struct {
// Ordered list of case branches.
Cases []RouteCase `json:"cases" toon:"cases"`
// Creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// ID of the person who created the rule.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
Default RouteDefault `json:"default" toon:"default"`
// Soft-delete time, Unix timestamp in seconds. Not returned by these endpoints, which return only active rules.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Integration the rule belongs to.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Optional sections that visually group cases.
Sections []RouteSection `json:"sections" toon:"sections"`
// Rule status. These endpoints return only `enabled` rules; `deleted` rules (for example of a deleted integration) are not returned.
Status string `json:"status" toon:"status"`
// Last update time, Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the person who performed the last update.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Version number, increased on every `POST /route/upsert`. The server does not use it for concurrency checks.
Version int64 `json:"version" toon:"version"`
}
RouteItem is generated from the Flashduty OpenAPI schema.
type RouteMatchCondition ¶
type RouteMatchCondition struct {
// Alert or change event field to match: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `change_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`. An unknown key returns `InvalidParameter`.
Key string `json:"key" toon:"key"`
// Match operator. `IN` matches when the field value matches any entry in `vals`; `NOTIN` matches when it matches none. A missing field never matches `IN` and always matches `NOTIN`.
Oper string `json:"oper" toon:"oper"`
// Values to compare, at least one. Each entry is matched as: an exact string; a wildcard pattern when it contains `*` or `?` (must match the whole value); a regular expression when wrapped in slashes, such as `/^db-/` (may match anywhere in the value); an IP range written `cidr:<network>`, such as `cidr:203.0.113.0/24`; or a numeric comparison `num:<op>:<number>` with `lt`, `le`, `gt` or `ge`, such as `num:gt:90`.
Vals []string `json:"vals" toon:"vals"`
}
RouteMatchCondition is generated from the Flashduty OpenAPI schema.
type RouteSection ¶
type RouteSection struct {
// Section name. Must be unique within the rule.
Name string `json:"name" toon:"name"`
// Index in `cases` where this section starts. Must be between 0 and the length of `cases`. Two sections cannot share a position; a duplicate returns `InvalidParameter`.
Position int64 `json:"position" toon:"position"`
}
RouteSection is generated from the Flashduty OpenAPI schema.
type RuleAuditListResponse ¶
type RuleAuditListResponse []AlertRuleAudit
RuleAuditListResponse is a list response payload.
type RuleBasicListResponse ¶
type RuleBasicListResponse []AlertRuleBasic
RuleBasicListResponse is a list response payload.
type RuleConfigs ¶
type RuleConfigs struct {
// Any-data check configuration. Fires when the query returns any data rows.
CheckAnydata RuleConfigsCheckAnydata `json:"check_anydata" toon:"check_anydata"`
// No-data check configuration.
CheckNodata RuleConfigsCheckNodata `json:"check_nodata" toon:"check_nodata"`
// Threshold check configuration.
CheckThreshold RuleConfigsCheckThreshold `json:"check_threshold" toon:"check_threshold"`
// Query list with at least one entry; each needs a unique `name` (`R` and `__all__` are reserved) and a non-empty, non-duplicate `expr`.
Queries []RuleConfigsQueriesItem `json:"queries" toon:"queries"`
// Optional auxiliary queries whose results are attached to alert events as context. Each entry must have a unique `name` (not duplicating any query name) and a non-empty `expr`.
RelateQueries []RuleConfigsRelateQueriesItem `json:"relate_queries" toon:"relate_queries"`
}
RuleConfigs is generated from the Flashduty OpenAPI schema.
type RuleConfigsCheckAnydata ¶
type RuleConfigsCheckAnydata struct {
// Number of consecutive evaluations that must satisfy the condition before alerting; minimum 1.
AlertingCheckTimes int64 `json:"alerting_check_times" toon:"alerting_check_times"`
// Whether any-data checking is enabled: any returned data row triggers an alert.
Enabled bool `json:"enabled" toon:"enabled"`
// Whether to push a recovery event notification when the alert resolves.
PushRecoveryEvent bool `json:"push_recovery_event" toon:"push_recovery_event"`
// Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.
Recovery RuleConfigsCheckAnydataRecovery `json:"recovery" toon:"recovery"`
// Number of consecutive evaluations that must satisfy the recovery condition before resolving; minimum 1.
RecoveryCheckTimes int64 `json:"recovery_check_times" toon:"recovery_check_times"`
// Severity of any-data alert events; case-sensitive.
Severity string `json:"severity" toon:"severity"`
}
RuleConfigsCheckAnydata is generated from the Flashduty OpenAPI schema.
type RuleConfigsCheckAnydataRecovery ¶
type RuleConfigsCheckAnydataRecovery struct {
// Datasource-specific options for the recovery query, same convention as `queries[].args`; required for Elasticsearch datasources when `mode` is `ql`.
Args map[string]string `json:"args" toon:"args"`
// Recovery expression. Required when `mode` is `ql`.
Condition string `json:"condition" toon:"condition"`
// `nodata` = recover when the query returns no data; `ql` = recover when the `condition` expression evaluates to true. When `mode` is `ql`, only a single query (`name=A`) is permitted.
Mode string `json:"mode" toon:"mode"`
}
RuleConfigsCheckAnydataRecovery is generated from the Flashduty OpenAPI schema.
type RuleConfigsCheckNodata ¶
type RuleConfigsCheckNodata struct {
// Whether to trigger an alert when every query returns an empty result.
AlertOnEmptyResult bool `json:"alert_on_empty_result" toon:"alert_on_empty_result"`
// Severity of empty-result alerts, case-sensitive; only effective when `alert_on_empty_result` is enabled.
AlertOnEmptyResultSeverity string `json:"alert_on_empty_result_severity" toon:"alert_on_empty_result_severity"`
// Number of consecutive evaluations that must satisfy the condition before alerting; minimum 1.
AlertingCheckTimes int64 `json:"alerting_check_times" toon:"alerting_check_times"`
// Whether no-data checking is enabled: a previously-seen series that stops returning data triggers an alert.
Enabled bool `json:"enabled" toon:"enabled"`
// Whether to push a recovery event notification when the alert resolves.
PushRecoveryEvent bool `json:"push_recovery_event" toon:"push_recovery_event"`
// Number of consecutive evaluations that must satisfy the recovery condition before resolving; minimum 1.
RecoveryCheckTimes int64 `json:"recovery_check_times" toon:"recovery_check_times"`
// Auto-resolve after N seconds.
ResolveTimeout int64 `json:"resolve_timeout" toon:"resolve_timeout"`
// Severity of no-data alert events; case-sensitive.
Severity string `json:"severity" toon:"severity"`
}
RuleConfigsCheckNodata is generated from the Flashduty OpenAPI schema.
type RuleConfigsCheckThreshold ¶
type RuleConfigsCheckThreshold struct {
// Number of consecutive evaluations that must satisfy the condition before alerting; minimum 1.
AlertingCheckTimes int64 `json:"alerting_check_times" toon:"alerting_check_times"`
// Critical threshold expression referencing query results via `$<query>` or `$<query>.<value_field>`, e.g. `$A > 90`; at least one severity must be configured.
Critical string `json:"critical" toon:"critical"`
// Whether threshold checking is enabled.
Enabled bool `json:"enabled" toon:"enabled"`
// Info threshold expression, same syntax as `critical`.
Info string `json:"info" toon:"info"`
// Whether to push a recovery event notification when the alert resolves.
PushRecoveryEvent bool `json:"push_recovery_event" toon:"push_recovery_event"`
// Recovery evaluation configuration for threshold checks.
Recovery RuleConfigsCheckThresholdRecovery `json:"recovery" toon:"recovery"`
// Number of consecutive evaluations that must satisfy the recovery condition before resolving; minimum 1.
RecoveryCheckTimes int64 `json:"recovery_check_times" toon:"recovery_check_times"`
// Warning threshold expression, same syntax as `critical`.
Warning string `json:"warning" toon:"warning"`
}
RuleConfigsCheckThreshold is generated from the Flashduty OpenAPI schema.
type RuleConfigsCheckThresholdRecovery ¶
type RuleConfigsCheckThresholdRecovery struct {
// Datasource-specific extra parameters for the recovery query, using the same `<datasource>.<param>` key convention as query `args`. Omitted when empty.
Args map[string]string `json:"args" toon:"args"`
// Recovery condition expression; required when `mode` is `threshold` or `ql`, and must be empty for `invert`.
Condition string `json:"condition" toon:"condition"`
// Recovery mode: `invert` = resolve when the alert expression no longer holds (`condition` stays empty); `threshold` = resolve when the `condition` threshold expression holds; `ql` = resolve when the `condition` query expression evaluates true.
Mode string `json:"mode" toon:"mode"`
// Numeric result fields the recovery `condition` references as `$A.<field>`; same semantics as the query's `value_fields`. Omitted when empty.
ValueFields []string `json:"value_fields" toon:"value_fields"`
}
RuleConfigsCheckThresholdRecovery is generated from the Flashduty OpenAPI schema.
type RuleConfigsQueriesItem ¶
type RuleConfigsQueriesItem struct {
// Datasource-specific query options keyed by the `<datasource>.<option>` convention (e.g. `es.type`, `tencent_cls.limit`); most datasources need none.
Args map[string]string `json:"args" toon:"args"`
// Query expression.
Expr string `json:"expr" toon:"expr"`
// Result fields that become alert event labels — identical label sets collapse into one alert; must not overlap `value_fields`; applies to table-shaped results (SQL/ES-style datasources).
LabelFields []string `json:"label_fields" toon:"label_fields"`
// Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.
Name string `json:"name" toon:"name"`
// Numeric result fields used in threshold evaluation (referenced as `$A.<field>` in threshold expressions); required for threshold checks unless the datasource is `prometheus`/`loki`/`victorialogs`; field names must not contain `.`.
ValueFields []string `json:"value_fields" toon:"value_fields"`
}
RuleConfigsQueriesItem is generated from the Flashduty OpenAPI schema.
type RuleConfigsRelateQueriesItem ¶
type RuleConfigsRelateQueriesItem struct {
// Datasource-specific options for the auxiliary query, same convention as `queries[].args`.
Args map[string]string `json:"args" toon:"args"`
// Query expression.
Expr string `json:"expr" toon:"expr"`
// Relate-query identifier.
Name string `json:"name" toon:"name"`
}
RuleConfigsRelateQueriesItem is generated from the Flashduty OpenAPI schema.
type RuleCounterChannelResponse ¶
RuleCounterChannelResponse is a map response payload.
type RuleCounterTotalResponse ¶
type RuleCounterTotalResponse []AlertRuleCounter
RuleCounterTotalResponse is a list response payload.
type RuleCreateResponse ¶
type RuleCreateResponse struct {
// Newly created rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name echoed back from the request.
RuleName string `json:"rule_name" toon:"rule_name"`
}
RuleCreateResponse is generated from the Flashduty OpenAPI schema.
type RuleEmptyRequest ¶
type RuleEmptyRequest struct{}
RuleEmptyRequest is generated from the Flashduty OpenAPI schema.
type RuleEmptyResponse ¶
type RuleEmptyResponse struct{}
RuleEmptyResponse is generated from the Flashduty OpenAPI schema.
type RuleFieldsUpdateRequest ¶
type RuleFieldsUpdateRequest struct {
// Annotation key-value pairs delivered with alert events; replaces existing annotations as a whole, and keys must not start with `$` (reserved for query fields). Effective only when `fields` includes `annotations`; cannot be sent together with `annotations_patch`.
Annotations map[string]string `json:"annotations,omitempty" toon:"annotations,omitempty"`
// Partial annotation update that keeps unmentioned annotations. Requires `annotations` in `fields` and cannot be sent together with `annotations`; otherwise the call returns `InvalidParameter`.
AnnotationsPatch StringMapPatch `json:"annotations_patch,omitzero" toon:"annotations_patch,omitempty"`
// IDs of the collaboration spaces alerts are sent to; may be empty. Effective only when `fields` includes `channel_ids`.
ChannelIDs []uint64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Schedule expression: a 6-field cron (with seconds) or an `@every 30s` interval descriptor; `CRON_TZ=`/`TZ=` prefixes are not allowed. Effective only when `fields` includes `cron_pattern`.
CronPattern string `json:"cron_pattern,omitempty" toon:"cron_pattern,omitempty"`
// Whether to enable debug logging; the edge emits detailed evaluation logs for troubleshooting. Effective only when `fields` includes `debug_log_enabled`.
DebugLogEnabled bool `json:"debug_log_enabled,omitempty" toon:"debug_log_enabled,omitempty"`
// Seconds to shift the evaluation query window backward, compensating for data ingestion latency. Effective only when `fields` includes `delay_seconds`.
DelaySeconds int64 `json:"delay_seconds,omitempty" toon:"delay_seconds,omitempty"`
// Rule description, rendered according to the rule's existing `description_type` (which this endpoint cannot change). Effective only when `fields` includes `description`.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Datasource IDs, merged with `ds_list` to decide which datasources the rule monitors; IDs survive datasource renames. Effective only when `fields` includes `ds_ids`.
DsIDs []uint64 `json:"ds_ids,omitempty" toon:"ds_ids,omitempty"`
// Datasource name match patterns; wildcards supported. Effective only when `fields` includes `ds_list`.
DsList []string `json:"ds_list,omitempty" toon:"ds_list,omitempty"`
// Datasource type identifier. Enabled rules must use a type that supports alerting: `prometheus`, `elasticsearch`, `loki`, `clickhouse`, `mysql`, `oracle`, `postgres`, `sls`, `tencent_cls`, `victorialogs`. Effective only when `fields` includes `ds_type`.
DsType string `json:"ds_type,omitempty" toon:"ds_type,omitempty"`
// Whether the rule is enabled. Setting it to `false` makes the server clean up the rule's active alerts. Effective only when `fields` includes `enabled`.
Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
// Time windows during which the rule is in effect; element structure see `EnabledTime`. Effective only when `fields` includes `enabled_times`.
EnabledTimes []EnabledTime `json:"enabled_times,omitempty" toon:"enabled_times,omitempty"`
// Names of the fields to update. Each listed field takes the value of the same-named request field, and is set to its zero value when that value is omitted; values sent for unlisted fields are ignored. An unknown name fails the whole call with `InvalidParameter`.
Fields []string `json:"fields" toon:"fields"`
// IDs of the rules to update; must contain at least one ID.
IDs []uint64 `json:"ids" toon:"ids"`
// Custom label key-value pairs; replaces existing labels as a whole. Effective only when `fields` includes `labels`; cannot be sent together with `labels_patch`.
Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
// Partial label update that keeps unmentioned labels. Requires `labels` in `fields` and cannot be sent together with `labels`; otherwise the call returns `InvalidParameter`.
LabelsPatch StringMapPatch `json:"labels_patch,omitzero" toon:"labels_patch,omitempty"`
// Interval in seconds between repeated alert notifications; values below 1 fall back to 3600, maximum 2147483647. Effective only when `fields` includes `repeat_interval`.
RepeatInterval int64 `json:"repeat_interval,omitempty" toon:"repeat_interval,omitempty"`
// Maximum number of repeated notifications; values below 1 fall back to 3, maximum 2147483647. Effective only when `fields` includes `repeat_total`.
RepeatTotal int64 `json:"repeat_total,omitempty" toon:"repeat_total,omitempty"`
// Timezone the rule runs in, as an IANA name (e.g. `Asia/Shanghai`, `UTC`); empty falls back to `Asia/Shanghai`. Effective only when `fields` includes `timezone`.
Timezone string `json:"timezone,omitempty" toon:"timezone,omitempty"`
}
RuleFieldsUpdateRequest is generated from the Flashduty OpenAPI schema.
type RuleFoldersService ¶ added in v0.15.9
type RuleFoldersService service
RuleFoldersService handles the "Monitors/Rule folders" API resource.
func (*RuleFoldersService) List ¶ added in v0.15.9
func (s *RuleFoldersService) List(ctx context.Context) (*[]FolderItem, *Response, error)
List lists monitor folders. It preserves the original SDK method name.
func (*RuleFoldersService) ReadHealth ¶ added in v0.15.18
func (s *RuleFoldersService) ReadHealth(ctx context.Context) (*FolderHealthOutput, *Response, error)
Get monitor folder health.
Get issue flags for the visible monitor folders, including issues in their descendants.
API: POST /monit/folder/health (monit-folder-read-health).
func (*RuleFoldersService) ReadList ¶ added in v0.15.18
func (s *RuleFoldersService) ReadList(ctx context.Context) (*[]FolderItem, *Response, error)
List monitor folders.
List every monitor folder the caller can read.
API: POST /monit/folder/list (monit-folder-read-list).
func (*RuleFoldersService) WriteCreate ¶ added in v0.15.18
func (s *RuleFoldersService) WriteCreate(ctx context.Context, req *FolderCreateRequest) (*FolderItem, *Response, error)
Create monitor folder.
Create a monitor folder at the root or under a parent folder the caller may modify.
API: POST /monit/folder/create (monit-folder-write-create).
func (*RuleFoldersService) WriteDelete ¶ added in v0.15.18
func (s *RuleFoldersService) WriteDelete(ctx context.Context, req *FolderDeleteRequest) (*Response, error)
Delete monitor folder.
Delete an empty monitor folder that the caller may modify.
API: POST /monit/folder/delete (monit-folder-write-delete).
func (*RuleFoldersService) WriteMove ¶ added in v0.15.18
func (s *RuleFoldersService) WriteMove(ctx context.Context, req *FolderMoveRequest) (*Response, error)
Move monitor folder.
Move a monitor folder and its descendants under another folder or to the root.
API: POST /monit/folder/move (monit-folder-write-move).
func (*RuleFoldersService) WriteUpdate ¶ added in v0.15.18
func (s *RuleFoldersService) WriteUpdate(ctx context.Context, req *FolderUpdateRequest) (*FolderItem, *Response, error)
Update monitor folder.
Replace the name, note, and team assignment of a monitor folder the caller may modify.
API: POST /monit/folder/update (monit-folder-write-update).
type RuleIDRequest ¶
type RuleIDRequest struct {
// Alert rule ID. Obtainable per folder via `POST /monit/rule/list/basic`.
ID uint64 `json:"id" toon:"id"`
}
RuleIDRequest is generated from the Flashduty OpenAPI schema.
type RuleIDsRequest ¶
type RuleIDsRequest struct {
// IDs of the alert rules to delete; must contain at least one ID. Get them from `POST /monit/rule/list/basic`.
IDs []uint64 `json:"ids" toon:"ids"`
}
RuleIDsRequest is generated from the Flashduty OpenAPI schema.
type RuleImportRequest ¶
type RuleImportRequest []AlertRule
RuleImportRequest is a list response payload.
type RuleImportResponse ¶
type RuleImportResponse []NameMessage
RuleImportResponse is a list response payload.
type RuleListRequest ¶
type RuleListRequest struct {
// ID of the folder to list. Must be an existing folder the caller can manage; `0` or an unknown ID returns `InvalidParameter`.
FolderID uint64 `json:"folder_id,omitempty" toon:"folder_id,omitempty"`
// Also search all descendant folders. When `true`, results are sorted by name, capped by `limit`, and each item fills only `id`, `folder_id` and `name` (other fields carry zero values); combine with `query` for rule-picker scenarios.
IncludeDescendants bool `json:"include_descendants,omitempty" toon:"include_descendants,omitempty"`
// Max number of rules returned; only effective when `include_descendants` is `true`. Defaults to 50, capped at 100.
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Filter by rule name substring; a numeric value also matches the rule with that ID. Only effective when `include_descendants` is `true`.
Query string `json:"query,omitempty" toon:"query,omitempty"`
}
RuleListRequest is generated from the Flashduty OpenAPI schema.
type RuleMoveRequest ¶
type RuleMoveRequest struct {
// Destination folder ID, from `POST /monit/folder/list`. Must be non-zero; a folder that does not exist or that the caller cannot manage fails the whole call with `AccessDenied`.
DestFolderID uint64 `json:"dest_folder_id" toon:"dest_folder_id"`
// IDs of the rules to move; must contain at least one ID.
IDs []uint64 `json:"ids" toon:"ids"`
}
RuleMoveRequest is generated from the Flashduty OpenAPI schema.
type RuleNameMessageListResponse ¶
type RuleNameMessageListResponse []NameMessage
RuleNameMessageListResponse is a list response payload.
type RumDashboardsService ¶ added in v0.16.0
type RumDashboardsService service
RumDashboardsService handles the "RUM/Dashboards" API resource.
func (*RumDashboardsService) ReadGet ¶ added in v0.16.0
func (s *RumDashboardsService) ReadGet(ctx context.Context, req *RUMDashboardIDRequest) (*RUMDashboardResource, *Response, error)
Get dashboard detail.
Get one dashboard with its current definition and revision.
API: POST /rum/dashboard/get (rum-dashboard-read-get).
func (*RumDashboardsService) ReadList ¶ added in v0.16.0
func (s *RumDashboardsService) ReadList(ctx context.Context, req *RUMDashboardListRequest) (*RUMDashboardListResponse, *Response, error)
List dashboards.
List the account's dashboards, newest change first by default.
API: POST /rum/dashboard/list (rum-dashboard-read-list).
func (*RumDashboardsService) ReadRevisionGet ¶ added in v0.16.0
func (s *RumDashboardsService) ReadRevisionGet(ctx context.Context, req *RUMDashboardRevisionGetRequest) (*RUMDashboardRevisionResource, *Response, error)
Get dashboard revision.
Get one revision of a dashboard with its full definition.
API: POST /rum/dashboard/revisions/get (rum-dashboard-read-revision-get).
func (*RumDashboardsService) ReadRevisionList ¶ added in v0.16.0
func (s *RumDashboardsService) ReadRevisionList(ctx context.Context, req *RUMDashboardIDRequest) (*RUMDashboardRevisionListResponse, *Response, error)
List dashboard revisions.
List a dashboard's revision history, newest first.
API: POST /rum/dashboard/revisions/list (rum-dashboard-read-revision-list).
func (*RumDashboardsService) ReadTrashList ¶ added in v0.16.0
func (s *RumDashboardsService) ReadTrashList(ctx context.Context, req *RUMDashboardTrashListRequest) (*RUMDashboardTrashListResponse, *Response, error)
List deleted dashboards.
List the deleted dashboards, newest deletion first by default.
API: POST /rum/dashboard/trash/list (rum-dashboard-read-trash-list).
func (*RumDashboardsService) WriteCreate ¶ added in v0.16.0
func (s *RumDashboardsService) WriteCreate(ctx context.Context, req *RUMDashboardCreateRequest) (*RUMDashboardResource, *Response, error)
Create dashboard.
Create a RUM custom dashboard from a full definition.
API: POST /rum/dashboard/create (rum-dashboard-write-create).
func (*RumDashboardsService) WriteDelete ¶ added in v0.16.0
func (s *RumDashboardsService) WriteDelete(ctx context.Context, req *RUMDashboardMutationRequest) (*RUMDashboardDeleteResponse, *Response, error)
Delete dashboard.
Move a dashboard to the trash under an expected-revision check.
API: POST /rum/dashboard/delete (rum-dashboard-write-delete).
func (*RumDashboardsService) WriteRestore ¶ added in v0.16.0
func (s *RumDashboardsService) WriteRestore(ctx context.Context, req *RUMDashboardMutationRequest) (*RUMDashboardResource, *Response, error)
Restore dashboard.
Restore a dashboard from the trash as a new revision.
API: POST /rum/dashboard/restore (rum-dashboard-write-restore).
func (*RumDashboardsService) WriteUpdate ¶ added in v0.16.0
func (s *RumDashboardsService) WriteUpdate(ctx context.Context, req *RUMDashboardUpdateRequest) (*RUMDashboardUpdateResponse, *Response, error)
Update dashboard.
Replace a dashboard's definition under an expected-revision check.
API: POST /rum/dashboard/update (rum-dashboard-write-update).
type SLSLogstoresRequest ¶
type SLSLogstoresRequest struct {
// ID of an SLS-type datasource. Obtainable via `POST /monit/datasource/list`.
ID uint64 `json:"id" toon:"id"`
// Pagination offset.
Offset int64 `json:"offset,omitempty" toon:"offset,omitempty"`
// SLS project name. Obtainable via `POST /monit/datasource/sls/projects`.
Project string `json:"project,omitempty" toon:"project,omitempty"`
// Page size. Defaults to 200 server-side when 0.
Size int64 `json:"size,omitempty" toon:"size,omitempty"`
}
SLSLogstoresRequest is generated from the Flashduty OpenAPI schema.
type SLSLogstoresResponse ¶
type SLSLogstoresResponse []string
SLSLogstoresResponse is a list response payload.
type SLSProject ¶ added in v0.14.3
type SLSProject struct {
// Creation time, Unix seconds rendered as a string, e.g. `"1524539357"`.
CreateTime string `json:"createTime" toon:"createTime"`
// Data redundancy type: `LRS` = locally redundant storage, `ZRS` = zone-redundant storage. Omitted when not set.
DataRedundancyType string `json:"dataRedundancyType" toon:"dataRedundancyType"`
// Project description.
Description string `json:"description" toon:"description"`
// Last modification time, Unix seconds rendered as a string.
LastModifyTime string `json:"lastModifyTime" toon:"lastModifyTime"`
// Storage location, e.g. `cn-beijing-b`. Omitted when not set.
Location string `json:"location" toon:"location"`
// Owner Aliyun account ID; empty when not returned by SLS.
Owner string `json:"owner" toon:"owner"`
// Project name.
ProjectName string `json:"projectName" toon:"projectName"`
// Region ID, e.g. `cn-shanghai`.
Region string `json:"region" toon:"region"`
// Project status, e.g. `Normal`.
Status string `json:"status" toon:"status"`
}
SLSProject is generated from the Flashduty OpenAPI schema.
type SLSProjectsRequest ¶
type SLSProjectsRequest struct {
// ID of an SLS-type datasource. Obtainable via `POST /monit/datasource/list`.
ID uint64 `json:"id" toon:"id"`
// Pagination offset.
Offset int64 `json:"offset,omitempty" toon:"offset,omitempty"`
// Fuzzy filter on project name or description; name matches come first. Leave empty to return all.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Page size. Defaults to 200 server-side when 0.
Size int64 `json:"size,omitempty" toon:"size,omitempty"`
}
SLSProjectsRequest is generated from the Flashduty OpenAPI schema.
type SLSProjectsResponse ¶
type SLSProjectsResponse struct {
// Number of projects in this page.
Count int64 `json:"count" toon:"count"`
// Projects in the current page.
Projects []SLSProject `json:"projects" toon:"projects"`
// Number of projects matching `query`, independent of pagination. A lower bound when `query` is set.
Total int64 `json:"total" toon:"total"`
}
SLSProjectsResponse is generated from the Flashduty OpenAPI schema.
type SLSQueryParams ¶ added in v0.15.2
type SLSQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
// SLS project name.
Project string `json:"project"`
// SLS logstore name.
Logstore string `json:"logstore"`
// Whether to run the query with SLS PowerSQL. A pointer because explicit
// false is a real value distinct from the executor default.
PowerSQL *bool `json:"powersql,omitempty"`
// Maximum raw-log entries to return (1–100); only bounds raw logs, not
// SQL rows or scanned data.
Limit *int64 `json:"limit,omitempty"`
// Raw-log retrieval order: `latest` or `earliest`.
Direction *string `json:"direction,omitempty"`
}
SLSQueryParams are the params for `sls.query` on Alibaba Cloud SLS. Execution.Kind must be `window`.
type ScheduleByPersonRequest ¶ added in v0.15.2
type ScheduleByPersonRequest struct {
// Member ID whose on-call status is returned.
PersonID int64 `json:"person_id" toon:"person_id"`
}
ScheduleByPersonRequest is generated from the Flashduty OpenAPI schema.
type ScheduleByPersonResponse ¶ added in v0.15.2
type ScheduleByPersonResponse struct {
// Shift in progress now; `null` when the member is not on call.
Current *MemberOncallInterval `json:"current" toon:"current"`
// Next upcoming shift (without `end_at`); `null` when none within 45 days.
Next *MemberOncallInterval `json:"next" toon:"next"`
// All enabled schedules the member participates in.
Schedules []MemberScheduleItem `json:"schedules" toon:"schedules"`
}
ScheduleByPersonResponse is generated from the Flashduty OpenAPI schema.
type ScheduleCalculatedLayer ¶
type ScheduleCalculatedLayer struct {
// Layer name; empty string in `final_schedule`.
LayerName string `json:"layer_name" toon:"layer_name"`
// Type of the source layer: `0` = rotation layer, `1` = override layer. Always `0` in `final_schedule`.
Mode int64 `json:"mode" toon:"mode"`
// Same as `layer_name`.
Name string `json:"name" toon:"name"`
// Computed shifts; null when the layer produces none.
Schedules []ScheduleCalculatedSchedule `json:"schedules" toon:"schedules"`
}
ScheduleCalculatedLayer is generated from the Flashduty OpenAPI schema.
type ScheduleCalculatedSchedule ¶
type ScheduleCalculatedSchedule struct {
// Shift end timestamp (Unix seconds).
End Timestamp `json:"end" toon:"end"`
// Group on call during the shift; `null` marks a gap with nobody on call.
Group *ScheduleGroup `json:"group" toon:"group"`
// Zero-based position, in the schedule's layer list, of the layer the shift comes from.
Index int64 `json:"index" toon:"index"`
// Shift start timestamp (Unix seconds).
Start Timestamp `json:"start" toon:"start"`
}
ScheduleCalculatedSchedule is generated from the Flashduty OpenAPI schema.
type ScheduleDayMask ¶
type ScheduleDayMask struct {
// Weekdays on which the layer is on call: `0` = Sunday … `6` = Saturday, in the schedule's time zone. Empty or all seven days means every day. Cannot be combined with `restrict_mode` 2.
Repeat []int64 `json:"repeat,omitempty" toon:"repeat,omitempty"`
}
ScheduleDayMask is generated from the Flashduty OpenAPI schema.
type ScheduleEmptyObject ¶
type ScheduleEmptyObject struct{}
ScheduleEmptyObject is generated from the Flashduty OpenAPI schema.
type ScheduleFixedTimeNotifyInfo ¶
type ScheduleFixedTimeNotifyInfo struct {
// Notification cycle: `day` sends every day; `week` sends on the weekdays listed in `days`; `month` sends on the day-of-month values listed in `days`.
Cycle string `json:"cycle" toon:"cycle"`
// Days the notification fires on, read in the schedule's timezone. For `week`, weekday numbers 0-6 (0 = Sunday); for `month`, day-of-month numbers 1-31, and a month without that date is skipped. Required when `cycle` is `week` or `month`; ignored when `cycle` is `day`.
Days []int64 `json:"days,omitempty" toon:"days,omitempty"`
// Time of day to send, format `HH:MM` (24-hour).
Start string `json:"start" toon:"start"`
}
ScheduleFixedTimeNotifyInfo is generated from the Flashduty OpenAPI schema.
type ScheduleGroup ¶
type ScheduleGroup struct {
// End of the group's shift (Unix seconds) in computed results; `0` in layer definitions and ignored on input.
End int64 `json:"end" toon:"end"`
// Group display name. Null when only the legacy name is set.
GroupName *string `json:"group_name,omitempty" toon:"group_name,omitempty"`
// Members of this group.
Members []ScheduleMember `json:"members" toon:"members"`
// Legacy group name.
Name string `json:"name" toon:"name"`
// Start of the group's shift (Unix seconds) in computed results; `0` in layer definitions and ignored on input.
Start int64 `json:"start" toon:"start"`
}
ScheduleGroup is generated from the Flashduty OpenAPI schema.
type ScheduleIDResponse ¶
type ScheduleIDResponse struct {
// ID of the newly created schedule.
ScheduleID int64 `json:"schedule_id" toon:"schedule_id"`
}
ScheduleIDResponse is generated from the Flashduty OpenAPI schema.
type ScheduleIDsBodyRequest ¶
type ScheduleIDsBodyRequest struct {
// Schedule IDs to operate on; obtain them from `POST /schedule/list`.
ScheduleIDs []int64 `json:"schedule_ids" toon:"schedule_ids"`
}
ScheduleIDsBodyRequest is generated from the Flashduty OpenAPI schema.
type ScheduleIDsRequest ¶
type ScheduleIDsRequest struct {
// Schedule ID list; obtain IDs from `POST /schedule/list`.
ScheduleIDs []int64 `json:"schedule_ids" toon:"schedule_ids"`
}
ScheduleIDsRequest is generated from the Flashduty OpenAPI schema.
type ScheduleImNotify ¶
type ScheduleImNotify struct {
// Webhook channel settings.
Settings ScheduleImNotifySettings `json:"settings" toon:"settings"`
// Where the notification goes:
// - `feishu`, `dingtalk`, `wecom`, `slack`: group robot webhook given by `settings.token`.
// - `telegram`: bot `settings.token` posting to `settings.chat_ids`.
// - `zoom`: Zoom robot with `settings.token` and `settings.verify_token`.
// - `feishu_app`, `dingtalk_app`, `slack_app`, `teams_app`: an IM integration (`settings.data_source_id`) posting to the group chats in `settings.chat_ids`.
// Other values are stored but never sent.
Type string `json:"type" toon:"type"`
}
ScheduleImNotify is generated from the Flashduty OpenAPI schema.
type ScheduleImNotifySettings ¶
type ScheduleImNotifySettings struct {
// Display alias for the entry; not used when sending.
Alias string `json:"alias" toon:"alias"`
// Target chat IDs: group chats of the IM integration for `*_app` types, or Telegram chat IDs for `telegram`.
ChatIDs []string `json:"chat_ids" toon:"chat_ids"`
// ID of the IM integration used by the `*_app` types; `0` for robot types.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Turn @-mentions off for this robot: `true` disables them, `false` forces them on. Omitted keeps the legacy behaviour — on for WeCom, and for other robot types only when `user_schema_id` is set.
DisableAt bool `json:"disable_at,omitempty" toon:"disable_at,omitempty"`
// Robot signing secret. Stored with the entry. Returned as an empty string when the caller cannot edit the schedule.
SignSecret string `json:"sign_secret" toon:"sign_secret"`
// Robot webhook token for `feishu`, `dingtalk`, `wecom`, `slack`, `telegram` and `zoom`; empty for the `*_app` types. Returned as an empty string when the caller cannot edit the schedule.
Token string `json:"token" toon:"token"`
// ID of the user mapping schema (24-character ObjectID hex) the robot resolves @-mentions through. Required by Feishu robots that mention users; stored lowercased.
UserSchemaID string `json:"user_schema_id,omitempty" toon:"user_schema_id,omitempty"`
// Verification token, used by the `zoom` type. Returned as an empty string when the caller cannot edit the schedule.
VerifyToken string `json:"verify_token" toon:"verify_token"`
}
ScheduleImNotifySettings is generated from the Flashduty OpenAPI schema.
type ScheduleInfoRequest ¶
type ScheduleInfoRequest struct {
// Preview end timestamp (Unix seconds, 10 digits).
End int64 `json:"end" toon:"end"`
// Schedule ID; obtain it from `POST /schedule/list`.
ScheduleID int64 `json:"schedule_id" toon:"schedule_id"`
// Preview start timestamp (Unix seconds, 10 digits).
Start int64 `json:"start" toon:"start"`
}
ScheduleInfoRequest is generated from the Flashduty OpenAPI schema.
type ScheduleItem ¶
type ScheduleItem struct {
// ID of the account that owns the schedule.
AccountID int64 `json:"account_id" toon:"account_id"`
// Creation timestamp (Unix seconds).
CreateAt Timestamp `json:"create_at" toon:"create_at"`
// Creator person ID.
CreateBy int64 `json:"create_by" toon:"create_by"`
// The shift in progress now; `null` when nobody is on call, or when the endpoint does not compute it (`/schedule/infos`, `/schedule/self`, `/schedule/list` without a window).
CurOncall *ScheduleOncallGroup `json:"cur_oncall" toon:"cur_oncall"`
// Schedule description. null when returned from /schedule/preview.
Description string `json:"description" toon:"description"`
// Whether the schedule is disabled: `0` = enabled, `1` = disabled (disabled schedules send no shift notifications and are skipped by `/schedule/self` and `/schedule/by-person`). Same value as `status`. `null` in `/schedule/preview` unless sent.
Disabled int64 `json:"disabled" toon:"disabled"`
// Window end (Unix seconds). Only echoed by `/schedule/preview`; omitted elsewhere.
End Timestamp `json:"end" toon:"end"`
// All layers merged into one timeline for the window: where layers overlap, override layers win over rotation layers and later layers win over earlier ones. In `/schedule/self` it keeps only the caller's shifts. Empty (`schedules` is `null`) when nothing was computed.
FinalSchedule ScheduleCalculatedLayer `json:"final_schedule" toon:"final_schedule"`
// Legacy team/group ID. null when returned from /schedule/preview.
GroupID int64 `json:"group_id" toon:"group_id"`
// Schedule ID. null when returned from /schedule/preview.
ID int64 `json:"id" toon:"id"`
// Same content as `schedule_layers`, filled by `/schedule/info` and `/schedule/preview` only; `null` elsewhere.
LayerSchedules []ScheduleCalculatedLayer `json:"layer_schedules" toon:"layer_schedules"`
// Rotation layers defined on the schedule. Null when layers were not loaded (for example by `/schedule/infos`, or by `/schedule/list` without start/end).
Layers []ScheduleLayer `json:"layers" toon:"layers"`
// Schedule name (legacy field; mirrors schedule_name). null when returned from /schedule/preview.
Name string `json:"name" toon:"name"`
// The next shift with someone on duty after the current one; `null` when none is found within 45 days or the endpoint does not compute it.
NextOncall *ScheduleOncallGroup `json:"next_oncall" toon:"next_oncall"`
// Shift notification configuration; `null` when the schedule has none.
Notify *ScheduleNotify `json:"notify" toon:"notify"`
// Schedule ID. Null when returned from `/schedule/preview`.
ScheduleID int64 `json:"schedule_id" toon:"schedule_id"`
// Shifts of each visible (non-hidden) layer in the requested window. `null` when no window was computed (`/schedule/infos`, `/schedule/self`, `/schedule/list` without `start`/`end`).
ScheduleLayers []ScheduleCalculatedLayer `json:"schedule_layers" toon:"schedule_layers"`
// Schedule display name. null when returned from /schedule/preview.
ScheduleName string `json:"schedule_name" toon:"schedule_name"`
// Window start (Unix seconds). Only echoed by `/schedule/preview`; omitted elsewhere.
Start Timestamp `json:"start" toon:"start"`
// Mirror of `disabled`: `0` = enabled, `1` = disabled. Send it on `/schedule/update` to enable or disable a schedule. `null` in `/schedule/preview` unless sent.
Status int64 `json:"status" toon:"status"`
// Owning team ID. null when returned from /schedule/preview.
TeamID int64 `json:"team_id" toon:"team_id"`
// IANA time zone (for example `Asia/Shanghai`) in which the schedule's handoffs, restriction windows, weekdays and fixed-time notifications are evaluated. Set at creation and immutable. An empty string means none was set and the schedule is evaluated in `Asia/Shanghai`.
TimeZone string `json:"time_zone" toon:"time_zone"`
// Last update timestamp (Unix seconds).
UpdateAt Timestamp `json:"update_at" toon:"update_at"`
// Last updater person ID.
UpdateBy int64 `json:"update_by" toon:"update_by"`
}
ScheduleItem is generated from the Flashduty OpenAPI schema.
type ScheduleLayer ¶
type ScheduleLayer struct {
// ID of the account that owns the layer. Set by the server.
AccountID int64 `json:"account_id" toon:"account_id"`
// Creation timestamp (Unix seconds).
CreateAt int64 `json:"create_at" toon:"create_at"`
// Creator person ID.
CreateBy int64 `json:"create_by" toon:"create_by"`
// Weekdays on which the rotation layer is on call.
DayMask ScheduleDayMask `json:"day_mask" toon:"day_mask"`
// When the layer takes effect (Unix seconds). For rotations its time of day is also the daily handoff time. `layer_start` overrides it when sent.
EnableTime int64 `json:"enable_time" toon:"enable_time"`
// Request only. Layer end as a wall-clock date and time in the schedule's time zone; overrides `layer_end`/`expire_time`. Send `{"date": ""}` to make the layer never end.
EndsAt ScheduleLayerEndsAt `json:"ends_at,omitzero" toon:"ends_at,omitempty"`
// When the layer stops (Unix seconds); `0` = never. Must not be earlier than `enable_time`. `layer_end` overrides it when sent.
ExpireTime int64 `json:"expire_time" toon:"expire_time"`
// When `true`, the group that starts each full round shifts by one, so that no group is always first. `false` (default) always restarts from the first group.
FairRotation bool `json:"fair_rotation" toon:"fair_rotation"`
// On-call groups of the layer, in rotation order. Each group needs `group_name` (or `name`) and members with at least one person. `start`/`end` are ignored on input.
Groups []ScheduleGroup `json:"groups" toon:"groups"`
// Request only. Handoff weekday and time in the schedule's time zone; sets `handoff_time` and the time of day of `enable_time`.
Handoff ScheduleLayerHandoff `json:"handoff,omitzero" toon:"handoff,omitempty"`
// Weekly handoff point for weekly rotations, as seconds from Monday 00:00 in the schedule's time zone (`weekday × 86400 + seconds of day`, Monday = 0 … Sunday = 6). Not a Unix timestamp. Easier to set with `handoff`.
HandoffTime int64 `json:"handoff_time" toon:"handoff_time"`
// `1` leaves the layer out of `schedule_layers`; its shifts still feed `final_schedule`. `0` (default) shows it.
Hidden int64 `json:"hidden" toon:"hidden"`
// Same as `expire_time`; takes precedence over it in requests. `null` means the layer never ends.
LayerEnd *int64 `json:"layer_end,omitempty" toon:"layer_end,omitempty"`
// Layer name shown in the console; same value as `name` in responses.
LayerName *string `json:"layer_name,omitempty" toon:"layer_name,omitempty"`
// Same as `enable_time`; takes precedence over it in requests. `null` when `enable_time` is 0.
LayerStart *int64 `json:"layer_start,omitempty" toon:"layer_start,omitempty"`
// Only applies when `day_mask` selects 1–6 weekdays. When `true`, each on-call day runs from the layer's start time of day to the same time the next day instead of midnight to midnight.
MaskContinuousEnabled bool `json:"mask_continuous_enabled" toon:"mask_continuous_enabled"`
// Layer type:
// - `0`: rotation layer — groups take turns according to `rotation_unit`/`rotation_value`.
// - `1`: override layer — the first group in `groups` is on call for the whole `layer_start`–`layer_end` period and takes precedence over rotation layers.
Mode int64 `json:"mode" toon:"mode"`
// Layer name. Either `name` or `layer_name` is required; `layer_name` wins when both are set.
Name string `json:"name" toon:"name"`
// Legacy single-window end offset in seconds; prefer `restrict_periods`.
RestrictEnd int64 `json:"restrict_end" toon:"restrict_end"`
// Restricts the layer to time windows given in `restrict_periods`:
// - `0`: no restriction.
// - `1`: daily windows; offsets are seconds from 00:00 (0–86400).
// - `2`: weekly windows; offsets are seconds from Monday 00:00 (0–604800). Cannot be combined with `day_mask`.
// Windows use the schedule's time zone.
RestrictMode int64 `json:"restrict_mode" toon:"restrict_mode"`
// Time windows in which the layer is on call, interpreted by `restrict_mode`. Outside them the layer has nobody on call. `null` when not set.
RestrictPeriods []ScheduleRestrictPeriod `json:"restrict_periods" toon:"restrict_periods"`
// Legacy single-window start offset in seconds; prefer `restrict_periods`.
RestrictStart int64 `json:"restrict_start" toon:"restrict_start"`
// Request only. Restriction windows as wall-clock times in the schedule's time zone; replaces `restrict_periods`. With `restrict_mode` 1 use `from`/`to` (`to` = `00:00` means end of day); with `restrict_mode` 2 also set `from_day`/`to_day`. Rejected when `restrict_mode` is 0.
RestrictsWall []ScheduleLayerRestrictsWallItem `json:"restricts_wall,omitempty" toon:"restricts_wall,omitempty"`
// Rotation length in seconds. Legacy alternative to `rotation_unit` + `rotation_value`: when only this is set, the server derives them (whole weeks, days or hours), and when only those are set, it fills this in (a month counts as 30 days).
RotationDuration int64 `json:"rotation_duration" toon:"rotation_duration"`
// Rotation unit. On-call assignees rotate in turn by this unit.
// | Value | Meaning |
// |---|---|
// | `hour` | Rotates hourly. |
// | `day` | Rotates daily. |
// | `week` | Rotates weekly. |
// | `month` | Rotates monthly. |
RotationUnit string `json:"rotation_unit" toon:"rotation_unit"`
// Number of `rotation_unit`s each group stays on call before handing off. A rotation layer needs either this (with `rotation_unit`) or `rotation_duration`.
RotationValue int64 `json:"rotation_value" toon:"rotation_value"`
// ID of the schedule the layer belongs to. Set by the server.
ScheduleID int64 `json:"schedule_id" toon:"schedule_id"`
// Request only. Layer start as a wall-clock date and time in the schedule's time zone; overrides `layer_start`/`enable_time`.
StartsAt ScheduleLayerStartsAt `json:"starts_at,omitzero" toon:"starts_at,omitempty"`
// Last update timestamp (Unix seconds).
UpdateAt int64 `json:"update_at" toon:"update_at"`
// Last updater person ID.
UpdateBy int64 `json:"update_by" toon:"update_by"`
// Stored as sent; not used when computing shifts.
Weight int64 `json:"weight" toon:"weight"`
}
ScheduleLayer is generated from the Flashduty OpenAPI schema.
type ScheduleLayerEndsAt ¶ added in v0.16.0
type ScheduleLayerEndsAt struct {
// Calendar date, `YYYY-MM-DD`.
Date string `json:"date,omitempty" toon:"date,omitempty"`
// Time of day, `HH:MM` (24-hour); defaults to `00:00`.
Time string `json:"time,omitempty" toon:"time,omitempty"`
}
ScheduleLayerEndsAt is generated from the Flashduty OpenAPI schema.
type ScheduleLayerHandoff ¶ added in v0.16.0
type ScheduleLayerHandoff struct {
// Time of day, `HH:MM` (24-hour).
Time string `json:"time" toon:"time"`
// ISO weekday: `1` = Monday … `7` = Sunday.
Weekday int64 `json:"weekday" toon:"weekday"`
}
ScheduleLayerHandoff is generated from the Flashduty OpenAPI schema.
type ScheduleLayerRestrictsWallItem ¶ added in v0.16.0
type ScheduleLayerRestrictsWallItem struct {
// Window start, `HH:MM`.
From string `json:"from,omitempty" toon:"from,omitempty"`
// ISO weekday the window starts on (`restrict_mode` 2 only): `1` = Monday … `7` = Sunday.
FromDay int64 `json:"from_day,omitempty" toon:"from_day,omitempty"`
// Window end, `HH:MM`.
To string `json:"to,omitempty" toon:"to,omitempty"`
// ISO weekday the window ends on (`restrict_mode` 2 only).
ToDay int64 `json:"to_day,omitempty" toon:"to_day,omitempty"`
}
ScheduleLayerRestrictsWallItem is generated from the Flashduty OpenAPI schema.
type ScheduleLayerStartsAt ¶ added in v0.16.0
type ScheduleLayerStartsAt struct {
// Calendar date, `YYYY-MM-DD`.
Date string `json:"date" toon:"date"`
// Time of day, `HH:MM` (24-hour); defaults to `00:00`.
Time string `json:"time,omitempty" toon:"time,omitempty"`
}
ScheduleLayerStartsAt is generated from the Flashduty OpenAPI schema.
type ScheduleListRequest ¶
type ScheduleListRequest struct {
ListOptions
// Window end, 10-digit Unix seconds, after `start` and at most 45 days later. Sending `end` without `start` is rejected.
End int64 `json:"end,omitempty" toon:"end,omitempty"`
// Only schedules owned by the caller's teams or created by the caller. `team_ids` narrows the team part; team IDs outside the caller's teams are ignored.
IsMyManage bool `json:"is_my_manage,omitempty" toon:"is_my_manage,omitempty"`
// Only schedules owned by the caller's teams. When `team_ids` shares no team with the caller, or the caller belongs to no team, the list is empty.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Substring matched against the schedule name or description.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Window start, 10-digit Unix seconds. Send together with `end` to compute layers and shifts.
Start int64 `json:"start,omitempty" toon:"start,omitempty"`
// Only schedules owned by these teams. With `is_my_team` or `is_my_manage`, only the teams the caller belongs to are kept.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
ScheduleListRequest is generated from the Flashduty OpenAPI schema.
type ScheduleListResponse ¶
type ScheduleListResponse struct {
// Schedules on this page; an empty array when none match.
Items []ScheduleItem `json:"items" toon:"items"`
// Total number of schedules matching the filters.
Total int64 `json:"total" toon:"total"`
}
ScheduleListResponse is generated from the Flashduty OpenAPI schema.
type ScheduleMember ¶
type ScheduleMember struct {
// Member IDs in this slot; at least one.
PersonIDs []int64 `json:"person_ids" toon:"person_ids"`
// On-call role assigned to the people in this slot; `0` = no role.
RoleID int64 `json:"role_id" toon:"role_id"`
}
ScheduleMember is generated from the Flashduty OpenAPI schema.
type ScheduleNotify ¶
type ScheduleNotify struct {
// Lead time in seconds for the shift-change notification: `0` notifies at the start of the shift, `300` five minutes before. Omitted or `null` disables shift-change notifications.
AdvanceInTime *int64 `json:"advance_in_time,omitempty" toon:"advance_in_time,omitempty"`
// Personal notifications sent to the people on call; `null` when not configured.
By *ScheduleNotifyBy `json:"by,omitempty" toon:"by,omitempty"`
// Send a shift summary at a fixed time; `null` when not configured.
FixedTime *ScheduleFixedTimeNotifyInfo `json:"fixed_time,omitempty" toon:"fixed_time,omitempty"`
// Legacy map of robot type to webhook token. Entries not already in `webhooks` are added to `webhooks` when read; use `webhooks` instead. Values are returned as empty strings when the caller cannot edit the schedule.
Im map[string]string `json:"im,omitempty" toon:"im,omitempty"`
// Group chats or robots that receive shift-change notifications; `null` when not configured.
Webhooks []ScheduleImNotify `json:"webhooks" toon:"webhooks"`
}
ScheduleNotify is generated from the Flashduty OpenAPI schema.
type ScheduleNotifyBy ¶
type ScheduleNotifyBy struct {
// `true`: notify each person through the channels in their own shift-notification preference, ignoring `personal_channels`. `false`: use `personal_channels`.
FollowPreference bool `json:"follow_preference" toon:"follow_preference"`
// Channels used when `follow_preference` is `false`: `email`, `sms`, `push` (mobile app), and the IM apps `feishu_app`, `dingtalk_app`, `wecom_app`, `teams_app`, `slack_app`. An IM app value may carry the integration ID as `<type>:<integration ID>` (for example `feishu_app:5427276014131`). Unknown values are stored but never used. `null` when not set.
PersonalChannels []string `json:"personal_channels" toon:"personal_channels"`
}
ScheduleNotifyBy is generated from the Flashduty OpenAPI schema.
type ScheduleOncallGroup ¶
type ScheduleOncallGroup struct {
// Shift end timestamp (Unix seconds).
End Timestamp `json:"end" toon:"end"`
// Oncall group on duty for the shift.
Group ScheduleGroup `json:"group" toon:"group"`
// Always `0` in these responses.
Index int64 `json:"index" toon:"index"`
// Shift start timestamp (Unix seconds).
Start Timestamp `json:"start" toon:"start"`
// Update time as a Unix timestamp in seconds; always `0` in these responses.
UpdateAt Timestamp `json:"update_at" toon:"update_at"`
// Always `0` in these responses.
Weight int64 `json:"weight" toon:"weight"`
}
ScheduleOncallGroup is generated from the Flashduty OpenAPI schema.
type ScheduleRestrictPeriod ¶
type ScheduleRestrictPeriod struct {
// Window end in seconds, same reference point as `restrict_start`.
RestrictEnd int64 `json:"restrict_end" toon:"restrict_end"`
// Window start in seconds: from 00:00 when `restrict_mode` is 1, from Monday 00:00 when it is 2.
RestrictStart int64 `json:"restrict_start" toon:"restrict_start"`
}
ScheduleRestrictPeriod is generated from the Flashduty OpenAPI schema.
type ScheduleSelfRequest ¶
type ScheduleSelfRequest struct {
// Window end (Unix seconds, 10 digits). Required. Must be within 45 days of start.
End int64 `json:"end" toon:"end"`
// Window start (Unix seconds, 10 digits). Required.
Start int64 `json:"start" toon:"start"`
}
ScheduleSelfRequest is generated from the Flashduty OpenAPI schema.
type ScheduleSelfResponse ¶
type ScheduleSelfResponse struct {
// Matching schedules; an empty array when none match.
Items []ScheduleItem `json:"items" toon:"items"`
}
ScheduleSelfResponse is generated from the Flashduty OpenAPI schema.
type ScheduleUpsertRequest ¶
type ScheduleUpsertRequest struct {
// Schedule description, at most 500 characters. On update, omitting it keeps the current text and an empty string clears it.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Create only: `0` = enabled (default), `1` = disabled. Ignored on update — use `status` instead.
Disabled *int64 `json:"disabled,omitempty" toon:"disabled,omitempty"`
// Preview window end, 10-digit Unix seconds, after `start` and at most 45 days later. Required for `/schedule/preview`; ignored by create and update.
End int64 `json:"end,omitempty" toon:"end,omitempty"`
// Rotation layers. Required in practice: on update the list replaces all existing layers, so omitting it deletes every layer.
Layers []ScheduleLayer `json:"layers,omitempty" toon:"layers,omitempty"`
// Legacy name field, used on create only when `schedule_name` is empty. Ignored on update.
Name *string `json:"name,omitempty" toon:"name,omitempty"`
// Shift notification configuration. On update, omitting it keeps the current configuration; a sent object replaces it entirely.
Notify *ScheduleNotify `json:"notify,omitempty" toon:"notify,omitempty"`
// Schedule ID, required on update; obtain it from `POST /schedule/list`.
ScheduleID *int64 `json:"schedule_id,omitempty" toon:"schedule_id,omitempty"`
// Schedule name, at most 40 characters, unique within the account. On update, omitting it keeps the current name.
ScheduleName *string `json:"schedule_name,omitempty" toon:"schedule_name,omitempty"`
// Preview window start, 10-digit Unix seconds. Required for `/schedule/preview`; ignored by create and update.
Start int64 `json:"start,omitempty" toon:"start,omitempty"`
// `0` = enabled, `1` = disabled. On update, omitting it keeps the current state. On create it takes precedence over `disabled`.
Status *int64 `json:"status,omitempty" toon:"status,omitempty"`
// ID of the owning team; obtain it from `POST /team/list`. On create, omitting it leaves the schedule without a team (`0`); on update, omitting it keeps the current team.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// IANA time zone in which the schedule's wall-clock rules are evaluated, for example `Asia/Shanghai` or `UTC`; abbreviations such as `EST` and `Etc/GMT±N` are rejected. Set on create (default: evaluated in `Asia/Shanghai`); immutable afterwards — on update send nothing or the current value. On preview it sets the evaluation time zone.
TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}
ScheduleUpsertRequest is generated from the Flashduty OpenAPI schema.
type SchedulesService ¶
type SchedulesService service
SchedulesService handles the "On-call/Schedules" API resource.
func (*SchedulesService) ByPerson ¶ added in v0.15.2
func (s *SchedulesService) ByPerson(ctx context.Context, req *ScheduleByPersonRequest) (*ScheduleByPersonResponse, *Response, error)
Get member on-call status.
Get a member's current and next on-call shifts and every enabled schedule they participate in.
API: POST /schedule/by-person (scheduleByPerson).
func (*SchedulesService) Create ¶
func (s *SchedulesService) Create(ctx context.Context, req *ScheduleUpsertRequest) (*ScheduleIDResponse, *Response, error)
Create schedule.
Create an on-call schedule with its rotation layers and shift notification settings.
API: POST /schedule/create (scheduleCreate).
func (*SchedulesService) Delete ¶
func (s *SchedulesService) Delete(ctx context.Context, req *ScheduleIDsBodyRequest) (*Response, error)
Delete schedules.
Delete one or more on-call schedules by ID, together with their layers.
API: POST /schedule/delete (scheduleDelete).
func (*SchedulesService) Info ¶
func (s *SchedulesService) Info(ctx context.Context, req *ScheduleInfoRequest) (*ScheduleItem, *Response, error)
Get schedule info.
Return one on-call schedule with its layers and the shifts computed for a time window of up to 45 days.
API: POST /schedule/info (scheduleInfo).
func (*SchedulesService) Infos ¶
func (s *SchedulesService) Infos(ctx context.Context, req *ScheduleIDsRequest) (*ScheduleSelfResponse, *Response, error)
Batch get schedules.
Return the basic configuration of several on-call schedules by ID, without layers or computed shifts.
API: POST /schedule/infos (scheduleInfos).
func (*SchedulesService) List ¶
func (s *SchedulesService) List(ctx context.Context, req *ScheduleListRequest) (*ScheduleListResponse, *Response, error)
List schedules.
List on-call schedules with filters and pagination; pass `start` and `end` to also compute shifts.
API: POST /schedule/list (scheduleList).
func (*SchedulesService) Preview ¶
func (s *SchedulesService) Preview(ctx context.Context, req *ScheduleUpsertRequest) (*ScheduleItem, *Response, error)
Preview schedule.
Preview the coverage generated by a schedule configuration without persisting it. The request accepts the same body as create/update plus a required start/end window (max 45 days).
API: POST /schedule/preview (schedulePreview).
func (*SchedulesService) Self ¶
func (s *SchedulesService) Self(ctx context.Context, req *ScheduleSelfRequest) (*ScheduleSelfResponse, *Response, error)
List my schedules.
List the enabled on-call schedules the calling member belongs to, with the member's own shifts in the window.
API: POST /schedule/self (scheduleSelf).
func (*SchedulesService) Update ¶
func (s *SchedulesService) Update(ctx context.Context, req *ScheduleUpsertRequest) (*Response, error)
Update schedule.
Update an on-call schedule identified by `schedule_id`; the layer list is replaced as a whole.
API: POST /schedule/update (scheduleUpdate).
type ServiceDeskPlusRequestListRequest ¶ added in v0.5.8
type ServiceDeskPlusRequestListRequest struct {
ListOptions
// When `true`, sort by internal record ID ascending; otherwise descending.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Channel IDs to filter by.
ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
// Window end, Unix seconds. Must be greater than or equal to `start_time`. Optional when `incident_id` is provided.
EndTime int64 `json:"end_time,omitempty" toon:"end_time,omitempty"`
// Flashduty incident ID. When set, the time window can be omitted.
IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
// ServiceDeskPlus integration ID.
IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
// ServiceDeskPlus request ID.
RequestID string `json:"request_id,omitempty" toon:"request_id,omitempty"`
// Window start, Unix seconds. Optional when `incident_id` is provided.
StartTime int64 `json:"start_time,omitempty" toon:"start_time,omitempty"`
// Filter by sync status: `success` or `failed`.
Status string `json:"status,omitempty" toon:"status,omitempty"`
}
ServiceDeskPlusRequestListRequest is generated from the Flashduty OpenAPI schema.
type ServiceDeskPlusRequestListResponse ¶ added in v0.5.8
type ServiceDeskPlusRequestListResponse struct {
// True when more results are available.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Synchronization records on the current page.
Items []ServiceDeskPlusRequestMappingItem `json:"items" toon:"items"`
// Cursor for the next page. Empty when no more data is available.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
// Total number of matching records, capped at 1,000 for counting.
Total int64 `json:"total" toon:"total"`
}
ServiceDeskPlusRequestListResponse is generated from the Flashduty OpenAPI schema.
type ServiceDeskPlusRequestMappingItem ¶ added in v0.5.8
type ServiceDeskPlusRequestMappingItem struct {
// Channel ID for the incident.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Channel name for the incident.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Mapping record creation time, Unix seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Error message when synchronization failed. Usually absent on successful records.
ErrorMessage string `json:"error_message" toon:"error_message"`
// Associated Flashduty incident ID.
IncidentID string `json:"incident_id" toon:"incident_id"`
// Associated incident title.
IncidentTitle string `json:"incident_title" toon:"incident_title"`
// ServiceDeskPlus integration ID.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// ServiceDeskPlus request ID.
RequestID string `json:"request_id" toon:"request_id"`
// ServiceDeskPlus request detail URL.
RequestLink string `json:"request_link" toon:"request_link"`
// Synchronization status.
Status string `json:"status" toon:"status"`
}
ServiceDeskPlusRequestMappingItem is generated from the Flashduty OpenAPI schema.
type SessionAttachment ¶ added in v0.15.21
type SessionAttachment struct {
ObjectKey string `json:"object_key"`
Mime string `json:"mime"`
Filename string `json:"filename"`
Size int64 `json:"size"`
URL string `json:"url"`
ExpiresIn int `json:"expires_in"`
AttachmentID string `json:"attachment_id"`
}
SessionAttachment describes a stored attachment.
func (*SessionAttachment) FilePart ¶ added in v0.15.21
func (a *SessionAttachment) FilePart() SessionMessagePart
FilePart converts the stored attachment into a message part for SessionMessageRequest.Parts.
type SessionAttachmentUploadRequest ¶ added in v0.15.21
type SessionAttachmentUploadRequest struct {
// SessionID is the existing session the file belongs to. Required.
SessionID string
// File is the file content. Required. Max 50 MB.
File io.Reader
// Filename is the multipart file name. Required.
Filename string
}
SessionAttachmentUploadRequest carries one file to store under a session.
type SessionCreateRequest ¶ added in v0.15.21
type SessionCreateRequest struct {
// AppName is the agent app, e.g. "ai-sre". Required.
AppName string `json:"app_name"`
// EntryKind is how the session was initiated: web, im, api or automation.
EntryKind string `json:"entry_kind,omitempty"`
// TeamID binds the session to a team (0 = account scope). Immutable.
TeamID int64 `json:"team_id,omitempty"`
}
SessionCreateRequest creates an empty session. It is needed before the first message when attachments must be uploaded first, because an attachment is stored under an existing session.
type SessionCreateResponse ¶ added in v0.15.21
type SessionCreateResponse struct {
SessionID string `json:"session_id"`
AppName string `json:"app_name"`
EntryKind string `json:"entry_kind"`
}
SessionCreateResponse is the created session.
type SessionDeleteRequest ¶ added in v0.5.4
type SessionDeleteRequest struct {
// Target session ID, from the list returned by `POST /safari/session/list`.
SessionID string `json:"session_id" toon:"session_id"`
}
SessionDeleteRequest is generated from the Flashduty OpenAPI schema.
type SessionEventFrame ¶ added in v0.15.21
type SessionEventFrame struct {
EventID string `json:"event_id,omitempty"`
CreatedAt int64 `json:"created_at"`
Type string `json:"type"`
AgentPath string `json:"agent_path,omitempty"`
Payload json.RawMessage `json:"payload"`
InvocationID string `json:"invocation_id,omitempty"`
RootInvocationID string `json:"root_invocation_id,omitempty"`
DeliveryMode string `json:"delivery_mode,omitempty"`
IsError bool `json:"is_error,omitempty"`
ErrorCode string `json:"error_code,omitempty"`
}
SessionEventFrame is one frame of a session event stream. Persisted events carry EventID and CreatedAt, with Type set to the event author ("user", "assistant", ...); ephemeral frames (turn_complete, assistant_token, ...) carry no EventID and Type is the frame type. Payload is the frame-specific JSON.
type SessionExportRequest ¶ added in v0.5.4
type SessionExportRequest struct {
// When true, each subagent_dispatch line is followed by the child session's full event stream, bracketed by its own session_meta. Defaults to false.
IncludeSubagents bool `json:"include_subagents,omitempty" toon:"include_subagents,omitempty"`
// Target session ID, from the list returned by `POST /safari/session/list`.
SessionID string `json:"session_id" toon:"session_id"`
}
SessionExportRequest is generated from the Flashduty OpenAPI schema.
type SessionFilePart ¶ added in v0.15.21
type SessionFilePart struct {
Mime string `json:"mime"`
Filename string `json:"filename,omitempty"`
ObjectKey string `json:"object_key"`
Size int64 `json:"size,omitempty"`
}
SessionFilePart references a file already stored by UploadAttachment.
type SessionFrameReader ¶ added in v0.15.21
type SessionFrameReader struct {
// contains filtered or unexported fields
}
SessionFrameReader decodes the SSE stream returned by Subscribe into frames.
func NewSessionFrameReader ¶ added in v0.15.21
func NewSessionFrameReader(r io.Reader) *SessionFrameReader
NewSessionFrameReader wraps a Subscribe stream. Heartbeat comments and undecodable records are skipped.
rc, _, err := client.Sessions.Subscribe(ctx, req)
if err != nil { return err }
defer rc.Close()
fr := flashduty.NewSessionFrameReader(rc)
for {
frame, err := fr.Next()
if err == io.EOF { break } // server finished the stream
if err != nil { return err }
// ... handle frame ...
}
func (*SessionFrameReader) Next ¶ added in v0.15.21
func (r *SessionFrameReader) Next() (*SessionEventFrame, error)
Next returns the next frame. It returns io.EOF when the server ends the stream (the "[DONE]" sentinel or a clean close), a *SessionStreamError for an in-band error record, and the transport error (including context cancellation) otherwise.
type SessionGetRequest ¶ added in v0.5.4
type SessionGetRequest struct {
// Page size for events; takes precedence over `num_recent_events`. 0 uses the server default (100).
Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
// Legacy page size: number of most-recent events to return. Superseded by `limit` when both are set; 0 uses the server default (100).
NumRecentEvents int64 `json:"num_recent_events,omitempty" toon:"num_recent_events,omitempty"`
// Opaque keyset cursor from a previous response; pass it back to fetch the next older page.
SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
// Target session ID, from the list returned by `POST /safari/session/list`.
SessionID string `json:"session_id" toon:"session_id"`
ShareToken string `json:"share_token,omitempty" toon:"share_token,omitempty"`
}
SessionGetRequest is generated from the Flashduty OpenAPI schema.
type SessionGetResponse ¶ added in v0.5.4
type SessionGetResponse struct {
// The newest page of events (older pages via `search_after_ctx`), ascending by (`created_at`, `event_id`). Internal control events are excluded. Always an array.
Events []EventItem `json:"events" toon:"events"`
// True when older events remain beyond this page.
HasMoreOlder bool `json:"has_more_older" toon:"has_more_older"`
// Human messages queued but not yet picked up by the agent, in execution order. Always an array — empty when nothing is queued.
PendingMessages []PendingUserMessage `json:"pending_messages" toon:"pending_messages"`
// Opaque keyset cursor; pass back as search_after_ctx to fetch the next older page. Omitted when has_more_older is false.
SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
Session SessionItem `json:"session" toon:"session"`
}
SessionGetResponse is generated from the Flashduty OpenAPI schema.
type SessionItem ¶ added in v0.5.4
type SessionItem struct {
// How the caller obtained access. Omitted when the caller has no access. One of:
// | Value | Meaning |
// | --- | --- |
// | `owner` | Caller created the session (full access) |
// | `team_member` | Caller belongs to the session's team (full access) |
// | `manager` | Reserved; not produced by the current version |
// | `share_link` | Granted by a valid share link (view and fork only; view only for subagent child sessions) |
// | `participant` | Another member of the same account on a team session (view, continue, fork; no manage) |
AccessSource string `json:"access_source" toon:"access_source"`
// Agent app that owns the session.
AppName string `json:"app_name" toon:"app_name"`
// Unix timestamp in milliseconds when archived; 0 means not archived.
ArchivedAt TimestampMilli `json:"archived_at" toon:"archived_at"`
// Automation rule that produced this session. Returned by `POST /safari/session/get` only, for sessions started by an automation rule.
Automation SessionItemAutomation `json:"automation" toon:"automation"`
BoundEnvironment EnvironmentBinding `json:"bound_environment" toon:"bound_environment"`
// True when the caller can add a new turn to this session.
CanContinue bool `json:"can_continue" toon:"can_continue"`
// True when the caller can fork this session.
CanFork bool `json:"can_fork" toon:"can_fork"`
// True when the caller may rename, archive, or delete the session: the creator of a personal session, or the creator or a member of the owning team for a team session. Account owners and admins get no exemption.
CanManage bool `json:"can_manage" toon:"can_manage"`
// True when the caller can read this session: always true for the creator, team members, and other members of the same account on a team session; true through a valid share link otherwise.
CanView bool `json:"can_view" toon:"can_view"`
ContextResolved ContextResolvedItem `json:"context_resolved" toon:"context_resolved"`
// Maximum context size of the session's model, in tokens. Computed by `POST /safari/session/get` only; always 0 in list responses and when the lookup fails.
ContextWindow int64 `json:"context_window" toon:"context_window"`
// Unix timestamp in milliseconds when the session was created.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Display name of the session creator. Returned by `POST /safari/session/list` only; omitted when the name lookup fails.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Size in tokens of the LLM context window as of the most recent turn. 0 means no turn has completed.
CurrentContextTokens int64 `json:"current_context_tokens" toon:"current_context_tokens"`
// Active working duration in milliseconds for the current or most recent round, excluding time spent waiting on ask_user; resets to 0 at the start of each new round.
CurrentTurnActiveMs int64 `json:"current_turn_active_ms" toon:"current_turn_active_ms"`
// Unix timestamp in milliseconds when the current or most recent round started; 0 if no round has started yet.
CurrentTurnStartedAt TimestampMilli `json:"current_turn_started_at" toon:"current_turn_started_at"`
// Total tokens (input+output+reasoning) for the in-flight round across the parent and its subagents; only computed by session/get while the session is running, always 0 in session/list responses and when idle.
CurrentTurnTokens int64 `json:"current_turn_tokens" toon:"current_turn_tokens"`
// Accumulated ask_user human-wait duration in milliseconds for the current round; resets to 0 at the start of each new round.
CurrentTurnWaitMs int64 `json:"current_turn_wait_ms" toon:"current_turn_wait_ms"`
// Surface that created the session:
// - `web`: web console (also returned for subagent child sessions and for sessions that predate this field)
// - `im`: IM bot or IM H5 client
// - `api`: public API
// - `automation`: automation rule (unattended run)
EntryKind string `json:"entry_kind" toon:"entry_kind"`
// True when the session still has open tasks (for example running subagents or background processes), which tells a handed-off turn apart from a settled session. Returned by `POST /safari/session/get` only; omitted when false or when the lookup fails, so treat absence as unknown rather than idle.
HasOpenTasks bool `json:"has_open_tasks" toon:"has_open_tasks"`
// True when assistant output exists that the caller has not viewed yet; always false while `is_running` is true. Computed by `POST /safari/session/list` only; always false in `POST /safari/session/get`.
HasUnread bool `json:"has_unread" toon:"has_unread"`
// True for incognito (non-persisted-memory) sessions.
Incognito bool `json:"incognito" toon:"incognito"`
// True when the caller created this session.
IsMine bool `json:"is_mine" toon:"is_mine"`
// True when an agent turn is currently in flight for this session.
IsRunning bool `json:"is_running" toon:"is_running"`
// Unix timestamp in milliseconds of the latest assistant-side event; user messages alone do not advance it. Omitted when 0.
LastEventAt TimestampMilli `json:"last_event_at" toon:"last_event_at"`
// Parent session id for subagent (child) sessions; empty otherwise.
ParentSessionID string `json:"parent_session_id" toon:"parent_session_id"`
// Creator person id.
PersonID string `json:"person_id" toon:"person_id"`
// When the caller pinned this session, as a Unix timestamp in milliseconds; 0 when not pinned. Pins are per user. Filled by `POST /safari/session/list` only; always 0 in `POST /safari/session/get`.
PinnedAt TimestampMilli `json:"pinned_at" toon:"pinned_at"`
// Business object the session is about, as a prefixed reference (for example an incident reference). Omitted when the session is not bound to one.
Ref string `json:"ref" toon:"ref"`
// Session identifier.
SessionID string `json:"session_id" toon:"session_id"`
// Session title; may be empty for untitled sessions.
SessionName string `json:"session_name" toon:"session_name"`
ShareEnabled bool `json:"share_enabled" toon:"share_enabled"`
ShareVersion int64 `json:"share_version" toon:"share_version"`
SharedAt TimestampMilli `json:"shared_at" toon:"shared_at"`
SharedBy int64 `json:"shared_by" toon:"shared_by"`
// Number of the session's process-type tasks (background shell commands or monitors) still alive when the response was built; 0 when none or when the count cannot be read.
StandingTasks int64 `json:"standing_tasks" toon:"standing_tasks"`
// Raw session-state key/value map. Returned by `POST /safari/session/get` only; omitted when empty.
State map[string]any `json:"state" toon:"state"`
// Lifecycle status. Always `enabled` in responses: deleted sessions are never returned.
Status string `json:"status" toon:"status"`
// Owning team id; 0 means no team is bound. Immutable after create.
TeamID int64 `json:"team_id" toon:"team_id"`
// Resolved team name; empty for unbound rows or deleted teams.
TeamName string `json:"team_name" toon:"team_name"`
// Current save→validate round id (template-assistant only); empty otherwise.
TemplateStagingRoundID string `json:"template_staging_round_id" toon:"template_staging_round_id"`
TokenUsage SessionTokenUsage `json:"token_usage" toon:"token_usage"`
// `true` while a turn is executing. `is_running` additionally covers dispatched sub-task rounds that are still open.
TurnInFlight bool `json:"turn_in_flight" toon:"turn_in_flight"`
// Unix timestamp in milliseconds of the last session update.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}
SessionItem is generated from the Flashduty OpenAPI schema.
type SessionItemAutomation ¶ added in v0.16.0
type SessionItemAutomation struct {
// True when the caller may open and manage the rule; false when the rule has been deleted.
CanEdit bool `json:"can_edit" toon:"can_edit"`
// ID of the automation rule.
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name; empty when the rule has since been deleted.
RuleName string `json:"rule_name" toon:"rule_name"`
// How this run was triggered:
// - `schedule`: the rule's schedule fired
// - `manual`: run on demand (console or `POST /safari/automation/rule/run`)
// - `http_post`: the rule's HTTP trigger URL was called
// - `oncall_incident`: an On-call incident event matched the rule
// - `war_room_created`: a war room was created
// - `""`: the run record no longer exists
TriggerKind string `json:"trigger_kind" toon:"trigger_kind"`
}
SessionItemAutomation is generated from the Flashduty OpenAPI schema.
type SessionListRequest ¶ added in v0.5.4
type SessionListRequest struct {
ListOptions
// Agent app whose sessions to list. One of:
// | Value | Meaning |
// | --- | --- |
// | `ask-ai` | Ask AI assistant |
// | `support` | Customer-support agent |
// | `support-website` | Website support agent (exposed over A2A, not built into the console) |
// | `support-flashcat` | Flashcat-site support agent (exposed over A2A) |
// | `ai-sre` | The AI SRE main app |
// | `template-assistant` | Notification-template assistant (template editing/validation) |
// | `query-assistant` | Monitors query-writing assistant |
// | `swe` | Software-engineering agent app (not offered in the console) |
AppName string `json:"app_name" toon:"app_name"`
// Ascending order when true, descending when false. Only honored together with `orderby`; when `orderby` is omitted the sort is always `updated_at` descending.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Restrict to sessions created from these surfaces: `web` (console), `im` (IM bot or IM H5), `api` (public API), `automation` (automation rule). Empty returns every kind.
EntryKinds []string `json:"entry_kinds,omitempty" toon:"entry_kinds,omitempty"`
// When true, also list child sessions spawned by subagent dispatch. Defaults to false (top-level sessions only).
IncludeSubagentSessions bool `json:"include_subagent_sessions,omitempty" toon:"include_subagent_sessions,omitempty"`
// Return only sessions whose `session_name` contains this text; leading and trailing spaces are ignored.
Keyword string `json:"keyword,omitempty" toon:"keyword,omitempty"`
// Sort field: `created_at` by creation time, `updated_at` by last update; defaults to `updated_at` when omitted.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Filter by who started the session: returns only sessions started by these members (a session is kept when `person_id` matches any of them). Intersects with `scope` and `team_ids`, so it never widens what the caller is allowed to see.
PersonIDs []int64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
// Visibility scope:
// - `all` (default): sessions the caller created plus sessions bound to teams the caller belongs to
// - `personal`: the caller's own sessions with no team (`team_id` = 0)
// - `team`: sessions bound to teams the caller belongs to; empty when the caller is in no team
Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
// Archive filter:
// - `active` (default): sessions that are not archived
// - `archived`: archived sessions only
// - `all`: both
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Optional explicit team filter; intersects with `scope` and never expands access.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
SessionListRequest is generated from the Flashduty OpenAPI schema.
type SessionListResponse ¶ added in v0.5.4
type SessionListResponse struct {
// The page of sessions: on page 1, the caller's matching pinned sessions (newest pin first) followed by up to `limit` other sessions in the requested order.
Sessions []SessionItem `json:"sessions" toon:"sessions"`
// Number of matching sessions, ignoring pagination. Pinned sessions prepended on page 1 are not counted.
Total int64 `json:"total" toon:"total"`
}
SessionListResponse is generated from the Flashduty OpenAPI schema.
type SessionMessageAck ¶ added in v0.15.21
type SessionMessageAck struct {
SessionID string `json:"session_id"`
InvocationID string `json:"invocation_id"`
RootInvocationID string `json:"root_invocation_id"`
// DeliveryMode is the mode the server actually accepted. It is empty when
// the requested mode was not granted.
DeliveryMode string `json:"delivery_mode,omitempty"`
}
SessionMessageAck is the acknowledgement of an accepted message. The turn runs asynchronously; follow it with Subscribe.
type SessionMessagePart ¶ added in v0.15.21
type SessionMessagePart struct {
// Type is "text" or "file".
Type string `json:"type"`
// Text is set when Type is "text".
Text string `json:"text,omitempty"`
// File is set when Type is "file".
File *SessionFilePart `json:"file,omitempty"`
}
SessionMessagePart is one part of a message: text or a stored file.
type SessionMessageRequest ¶ added in v0.15.21
type SessionMessageRequest struct {
// SessionID continues an existing session. Omit it to start a new one, in
// which case AppName and EntryKind are required.
SessionID string `json:"session_id,omitempty"`
// AppName is the agent app ("ai-sre"); required when SessionID is empty.
AppName string `json:"app_name,omitempty"`
// EntryKind is how the run was initiated (web, im, api); required when
// SessionID is empty.
EntryKind string `json:"entry_kind,omitempty"`
// Query is the message text (max 32000 characters).
Query string `json:"query,omitempty"`
// Parts carries additional message parts, such as uploaded files.
Parts []SessionMessagePart `json:"parts,omitempty"`
// Surface tags where this turn originated, e.g. "cli".
Surface string `json:"surface,omitempty"`
// DeliveryMode negotiates how replies are delivered. "reply_only" makes the
// agent answer through its reply tool only; check the ack to see whether
// the server accepted it.
DeliveryMode string `json:"delivery_mode,omitempty"`
// TeamID binds a new session to a team (0 = account scope).
TeamID int64 `json:"team_id,omitempty"`
// EnvironmentKind selects the execution environment: "cloud" or "byoc".
EnvironmentKind string `json:"environment_kind,omitempty"`
// EnvironmentID selects a specific environment of that kind.
EnvironmentID string `json:"environment_id,omitempty"`
}
SessionMessageRequest is one user turn sent to a session.
type SessionReplayService ¶ added in v0.5.7
type SessionReplayService service
SessionReplayService handles the "RUM/Session replay" API resource.
func (*SessionReplayService) Metadata ¶ added in v0.5.7
func (s *SessionReplayService) Metadata(ctx context.Context, req *RUMSessionReplayMetaRequest) (*RUMSessionReplayMetaItem, *Response, error)
Get session replay metadata.
Return the application, device, session bounds, and views recorded for a replayable session.
API: POST /rum/session-replay/metadata (rum-session-replay-read-metadata).
func (*SessionReplayService) Segments ¶ added in v0.5.7
func (s *SessionReplayService) Segments(ctx context.Context, req *RUMSessionReplaySegmentsRequest) (*RUMSessionReplaySegmentsResult, *Response, error)
List session replay segments.
Page through the recorded replay segments of a session, as presigned URLs or a raw stream.
API: POST /rum/session-replay/segments (rum-session-replay-read-segments).
type SessionStreamError ¶ added in v0.15.21
type SessionStreamError struct {
Message string
}
SessionStreamError is a server-reported error carried in-band on the stream as an "event: error" record.
func (*SessionStreamError) Error ¶ added in v0.15.21
func (e *SessionStreamError) Error() string
type SessionSubscribeRequest ¶ added in v0.15.21
type SessionSubscribeRequest struct {
SessionID string `json:"session_id"`
// LastEventAt is the resume cursor: a Unix-millisecond timestamp. 0 replays
// from the start of the session.
LastEventAt int64 `json:"last_event_at,omitempty"`
// LastEventID breaks ties between events sharing LastEventAt.
LastEventID string `json:"last_event_id,omitempty"`
}
SessionSubscribeRequest opens a session event stream. The stream first replays persisted events strictly newer than the (LastEventAt, LastEventID) cursor, then tails live frames.
type SessionTokenUsage ¶ added in v0.5.4
type SessionTokenUsage struct {
// Portion of input_tokens served from the prompt cache.
CachedTokens int64 `json:"cached_tokens" toon:"cached_tokens"`
// Total prompt (input) tokens, including the cached portion.
InputTokens int64 `json:"input_tokens" toon:"input_tokens"`
// Total generated (output) tokens.
OutputTokens int64 `json:"output_tokens" toon:"output_tokens"`
// Total reasoning/thinking tokens.
ReasoningTokens int64 `json:"reasoning_tokens" toon:"reasoning_tokens"`
}
SessionTokenUsage is generated from the Flashduty OpenAPI schema.
type SessionsService ¶ added in v0.5.4
type SessionsService service
SessionsService handles the "AI SRE/Sessions" API resource.
func (*SessionsService) Export ¶ added in v0.5.4
func (s *SessionsService) Export(ctx context.Context, req *SessionExportRequest) (io.ReadCloser, *Response, error)
Export streams a session's full event transcript as newline-delimited JSON (application/x-ndjson). The first line is always a session_meta envelope; subsequent lines are session events. When req.IncludeSubagents is true, each subagent_dispatch line is followed by the child session's own stream.
Unlike the generated typed endpoints, the success body is NOT a JSON envelope: it is a potentially large line-delimited stream meant to be written straight to a file. The returned io.ReadCloser is the live HTTP response body — the caller owns it and MUST Close it (a deferred close is correct). Parse it line-by-line (see NewExportScanner / DecodeExportLine); do not buffer the whole transcript into memory.
On any non-2xx status the body is the usual JSON error envelope: Export reads and closes it and returns a typed error (*ErrorResponse, or *RateLimitError on 429) with a nil ReadCloser, matching the generated endpoints.
API: POST /safari/session/export (session-read-export).
func (*SessionsService) ReadInfo ¶ added in v0.5.4
func (s *SessionsService) ReadInfo(ctx context.Context, req *SessionGetRequest) (*SessionGetResponse, *Response, error)
Get session detail.
Fetch one session plus a backward-paged window of its most recent events.
API: POST /safari/session/get (session-read-info).
func (*SessionsService) ReadList ¶ added in v0.5.4
func (s *SessionsService) ReadList(ctx context.Context, req *SessionListRequest) (*SessionListResponse, *Response, error)
List sessions.
List agent sessions visible to the caller, filtered by app, entry surface, archive status, and team.
API: POST /safari/session/list (session-read-list).
func (*SessionsService) Subscribe ¶ added in v0.15.21
func (s *SessionsService) Subscribe(ctx context.Context, req *SessionSubscribeRequest) (io.ReadCloser, *Response, error)
Subscribe opens POST /safari/session/subscribe and returns the live SSE response body. The caller owns it and MUST Close it; read frames with NewSessionFrameReader. The stream is unbounded in time (the server closes it after an idle period), so it is served by a client with no overall timeout: bound its lifetime with ctx.
On any non-2xx status the body is the usual JSON error envelope: Subscribe reads and closes it and returns a typed error with a nil ReadCloser.
API: POST /safari/session/subscribe.
func (*SessionsService) UploadAttachment ¶ added in v0.15.21
func (s *SessionsService) UploadAttachment(ctx context.Context, req *SessionAttachmentUploadRequest) (*SessionAttachment, *Response, error)
UploadAttachment stores a file under a session as a multipart upload.
API: POST /safari/attachment/upload.
func (*SessionsService) WriteCreate ¶ added in v0.15.21
func (s *SessionsService) WriteCreate(ctx context.Context, req *SessionCreateRequest) (*SessionCreateResponse, *Response, error)
WriteCreate creates a session.
API: POST /safari/session/create.
func (*SessionsService) WriteDelete ¶ added in v0.5.4
func (s *SessionsService) WriteDelete(ctx context.Context, req *SessionDeleteRequest) (*any, *Response, error)
Delete session.
Soft-delete a session together with its subagent sessions and the files it presented.
API: POST /safari/session/delete (session-write-delete).
func (*SessionsService) WriteMessage ¶ added in v0.15.21
func (s *SessionsService) WriteMessage(ctx context.Context, req *SessionMessageRequest) (*SessionMessageAck, *Response, error)
WriteMessage sends a user turn and returns once the server has durably queued it (HTTP 202). Replies are not in the ack; read them from Subscribe.
API: POST /safari/session/message.
type SignedUrLs ¶ added in v0.14.5
type SignedUrLs struct {
// MIME type, derived from the file-name extension when the file was produced: `text/html` (.html/.htm), `text/markdown` (.md), `text/plain` (.txt/.log), `text/csv`, `text/yaml` (.yaml/.yml), `text/x-python`, `text/x-go`, `text/x-sh`, `application/json`, `application/xml`, `application/pdf`, `image/png`, `image/jpeg`, `image/gif`, `image/svg+xml`, `image/webp`, `application/zip`, `application/gzip` (.tar/.gz/.tgz); any other extension is `application/octet-stream`.
ContentType string `json:"content_type" toon:"content_type"`
// Relative URL (`/safari/artifact/stream?...`) that serves the file as an attachment. Prepend the API base `https://api.flashcat.cloud` before use; expires with `expires_in`.
DownloadURL string `json:"download_url" toon:"download_url"`
// Validity of both URLs in seconds. Always `300`.
ExpiresIn int64 `json:"expires_in" toon:"expires_in"`
// Frame URL directory of this artifact version, ending with `/`; append a file's relative path to load any file of a multi-file version. Empty, and therefore omitted, for single-object rows, whose frame route resolves only the file's own name.
FrameBase string `json:"frame_base" toon:"frame_base"`
// Validity of `frame_url` and `frame_base` in seconds. Always `43200` (12 hours).
FrameExpiresIn int64 `json:"frame_expires_in" toon:"frame_expires_in"`
// Sandboxed iframe URL (`/safari/artifact/f/<token>/<file name>`) that serves this file for an embedded preview. The token in the path is its only credential; it expires with `frame_expires_in`.
FrameURL string `json:"frame_url" toon:"frame_url"`
// File name including extension.
Name string `json:"name" toon:"name"`
// Same as `download_url` but served inline for browser preview.
PreviewURL string `json:"preview_url" toon:"preview_url"`
// File size in bytes.
Size int64 `json:"size" toon:"size"`
}
SignedUrLs is generated from the Flashduty OpenAPI schema.
type SilenceRuleItem ¶
type SilenceRuleItem struct {
// ID of the account the rule belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// ID of the channel the rule belongs to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Deletion time, Unix timestamp in seconds. Omitted unless the rule is soft-deleted; deleted rules are excluded from list responses.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Rule description.
Description string `json:"description" toon:"description"`
// Alert event conditions (OR of AND groups); matching events are silenced while the time window is active.
Filters FilterGroup `json:"filters" toon:"filters"`
// Incident the rule is attached to. Always present; the zero ObjectID `000000000000000000000000` means the rule was not created from an incident.
FromIncidentID string `json:"from_incident_id" toon:"from_incident_id"`
// When true, the rule is permanently removed about 24 hours after its one-off window ends; rules with recurring windows are never removed. Returned only when `true`.
IsAutoDelete bool `json:"is_auto_delete" toon:"is_auto_delete"`
// When true, matching alert events are discarded entirely; when false, alerts are still recorded but marked as silenced by this rule.
IsDirectlyDiscard bool `json:"is_directly_discard" toon:"is_directly_discard"`
// Whether the rule's time window covers the current moment, evaluated at response time.
IsEffective bool `json:"is_effective" toon:"is_effective"`
// Rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Silence rule name, 1–39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Rule status: `enabled` or `disabled`; deleted rules never appear in the list.
Status string `json:"status" toon:"status"`
// One-off silence window. Present with zero values when the rule uses recurring `time_filters` instead.
TimeFilter OnceTimeFilter `json:"time_filter" toon:"time_filter"`
// Recurring silence windows. Empty when the rule uses a one-off `time_filter`.
TimeFilters []TimeFilter `json:"time_filters" toon:"time_filters"`
// Last update time, Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the user who last updated the rule.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
SilenceRuleItem is generated from the Flashduty OpenAPI schema.
type SkillDeleteRequest ¶ added in v0.4.0
type SkillDeleteRequest struct {
// Target skill ID, from the list returned by `POST /safari/skill/list`.
SkillID string `json:"skill_id" toon:"skill_id"`
}
SkillDeleteRequest is generated from the Flashduty OpenAPI schema.
type SkillGetRequest ¶ added in v0.4.0
type SkillGetRequest struct {
// Target skill ID, from the list returned by `POST /safari/skill/list`.
SkillID string `json:"skill_id" toon:"skill_id"`
}
SkillGetRequest is generated from the Flashduty OpenAPI schema.
type SkillItem ¶ added in v0.4.0
type SkillItem struct {
// Owning account ID.
AccountID int64 `json:"account_id" toon:"account_id"`
// Skill author.
Author string `json:"author" toon:"author"`
// True when the caller may change this skill: account owners and admins for account-scope skills, team members for team skills.
CanEdit bool `json:"can_edit" toon:"can_edit"`
// SHA-256 checksum of the skill zip.
Checksum string `json:"checksum" toon:"checksum"`
// Full SKILL.md content. Omitted in list responses.
Content string `json:"content" toon:"content"`
// Not returned by these endpoints; it is set only by the install-from-session flow.
Created bool `json:"created" toon:"created"`
// Creation time. Unix timestamp in milliseconds.
CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
// Member ID that created the skill.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// Human-readable description from the SKILL.md frontmatter.
Description string `json:"description" toon:"description"`
// Optional English description. English-locale UI responses prefer this over `description`; the skill catalog also uses it as a stable selection signal when `description` is localized for display.
DescriptionEn string `json:"description_en" toon:"description_en"`
// Example prompts declared in the SKILL.md frontmatter (up to 10), shown as suggested questions. Omitted when none.
Examples []SkillItemExamplesItem `json:"examples" toon:"examples"`
// True when a marketplace-installed skill was changed locally (for example by uploading a new archive); automatic marketplace updates skip it.
IsModified bool `json:"is_modified" toon:"is_modified"`
// Skill license.
License string `json:"license" toon:"license"`
// Object-storage key of the skill zip.
S3Key string `json:"s3_key" toon:"s3_key"`
// Unique skill ID (prefix `skill_`).
SkillID string `json:"skill_id" toon:"skill_id"`
// Skill name, unique within its scope (account-wide or within one team).
SkillName string `json:"skill_name" toon:"skill_name"`
// Marketplace template this skill was installed from; empty for user-authored.
SourceTemplateName string `json:"source_template_name" toon:"source_template_name"`
// Template version at install time.
SourceTemplateVersion string `json:"source_template_version" toon:"source_template_version"`
// Skill status: `enabled` (agents load it) or `disabled` (kept but not loaded). Deleted skills never appear in responses.
Status string `json:"status" toon:"status"`
// Tags parsed from the frontmatter.
Tags []string `json:"tags" toon:"tags"`
// Team scope: 0 = account-wide; >0 = the owning team.
TeamID int64 `json:"team_id" toon:"team_id"`
// Required tools (builtin or `mcp:server/tool`).
Tools []string `json:"tools" toon:"tools"`
// True when the marketplace template this skill was installed from has a newer version. Computed by `POST /safari/skill/list` only; always false in other responses.
UpdateAvailable bool `json:"update_available" toon:"update_available"`
// Last update time. Unix timestamp in milliseconds.
UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
// Execution environments the skill is restricted to: `cloud` (managed sandbox) and/or `byoc` (self-hosted runner). Omitted when empty, which means every environment.
Venues []string `json:"venues" toon:"venues"`
// Skill version from the frontmatter.
Version string `json:"version" toon:"version"`
}
SkillItem is generated from the Flashduty OpenAPI schema.
type SkillItemExamplesItem ¶ added in v0.16.0
type SkillItemExamplesItem struct {
// English prompt text.
En string `json:"en" toon:"en"`
// Chinese prompt text.
Zh string `json:"zh" toon:"zh"`
}
SkillItemExamplesItem is generated from the Flashduty OpenAPI schema.
type SkillListRequest ¶ added in v0.4.0
type SkillListRequest struct {
ListOptions
// Include account-scoped (team_id=0) rows. Defaults to true. Ignored when `scope` is `account` or `team`.
IncludeAccount *bool `json:"include_account,omitempty" toon:"include_account,omitempty"`
// Free-text search across skill name, description, English description, skill ID, marketplace source template name, and author.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Which skills to return; overrides `include_account` when set:
// - `all` (default): account-scope skills (unless `include_account` is false) plus the caller's team skills
// - `account`: account-scope skills only (`team_id` = 0)
// - `team`: the caller's team skills only
Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
// Limit team-scope results to these team IDs; IDs of teams the caller does not belong to are dropped. Empty = all of the caller's teams.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
SkillListRequest is generated from the Flashduty OpenAPI schema.
type SkillListResponse ¶ added in v0.4.0
type SkillListResponse struct {
// Skills on this page.
Skills []SkillItem `json:"skills" toon:"skills"`
// Total number of matching skills.
Total int64 `json:"total" toon:"total"`
}
SkillListResponse is generated from the Flashduty OpenAPI schema.
type SkillStatusRequest ¶ added in v0.4.0
type SkillStatusRequest struct {
// Target skill ID, from the list returned by `POST /safari/skill/list`.
SkillID string `json:"skill_id" toon:"skill_id"`
}
SkillStatusRequest is generated from the Flashduty OpenAPI schema.
type SkillUpdateRequest ¶ added in v0.4.0
type SkillUpdateRequest struct {
// New description. Cannot contain `<` or `>`. Sending an empty string leaves the current value unchanged — there is no way to clear it via this field.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// New English description. Cannot contain `<` or `>`. Omit to leave unchanged; send an empty string to explicitly clear it.
DescriptionEn *string `json:"description_en,omitempty" toon:"description_en,omitempty"`
// Target skill ID, from the list returned by `POST /safari/skill/list`.
SkillID string `json:"skill_id" toon:"skill_id"`
// Reassign team scope: 0 = account-wide; >0 = team. Omit to leave unchanged.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
SkillUpdateRequest is generated from the Flashduty OpenAPI schema.
type SkillUploadRequest ¶ added in v0.5.4
type SkillUploadRequest struct {
// File is the skill archive (.skill / .zip / .tar.gz / .tgz). Required.
// Max 100 MB; oversized files are rejected before the body is read.
File io.Reader
// Filename is the multipart file name; defaults to "skill.zip".
Filename string
// TeamID scopes the created/upserted skill: 0 (default) = account-wide.
// Ignored when replacing a specific skill via SkillID.
TeamID int64
// Replace overwrites an existing skill instead of failing on a name
// collision — matched by SkillID if provided, otherwise by skill name.
Replace bool
// SkillID targets an existing skill when replacing (requires Replace).
SkillID string
}
SkillUploadRequest carries the skill archive and options for WriteUpload. It is hand-written rather than generated because the endpoint consumes multipart/form-data, which the generated JSON request path cannot encode.
type SkillsService ¶ added in v0.4.0
type SkillsService service
SkillsService handles the "AI SRE/Skills" API resource.
func (*SkillsService) ReadEnable ¶ added in v0.4.0
func (s *SkillsService) ReadEnable(ctx context.Context, req *SkillStatusRequest) (*any, *Response, error)
Enable skill.
Enable a disabled skill so the agent can load it.
API: POST /safari/skill/enable (skill-read-enable).
func (*SkillsService) ReadGet ¶ added in v0.4.0
func (s *SkillsService) ReadGet(ctx context.Context, req *SkillGetRequest) (*SkillItem, *Response, error)
Get skill detail.
Get one skill including its full SKILL.md content.
API: POST /safari/skill/get (skill-read-get).
func (*SkillsService) ReadList ¶ added in v0.4.0
func (s *SkillsService) ReadList(ctx context.Context, req *SkillListRequest) (*SkillListResponse, *Response, error)
List skills.
List AI SRE skills visible to the caller across account and team scopes, with pagination.
API: POST /safari/skill/list (skill-read-list).
func (*SkillsService) WriteDelete ¶ added in v0.4.0
func (s *SkillsService) WriteDelete(ctx context.Context, req *SkillDeleteRequest) (*any, *Response, error)
Delete skill.
Soft-delete a skill so agents stop loading it and its name can be reused.
API: POST /safari/skill/delete (skill-write-delete).
func (*SkillsService) WriteDisable ¶ added in v0.4.0
func (s *SkillsService) WriteDisable(ctx context.Context, req *SkillStatusRequest) (*any, *Response, error)
Disable skill.
Disable an enabled skill so the agent stops loading it.
API: POST /safari/skill/disable (skill-write-disable).
func (*SkillsService) WriteUpdate ¶ added in v0.4.0
func (s *SkillsService) WriteUpdate(ctx context.Context, req *SkillUpdateRequest) (*SkillItem, *Response, error)
Update skill.
Update a skill's descriptions or reassign its team scope.
API: POST /safari/skill/update (skill-write-update).
func (*SkillsService) WriteUpload ¶ added in v0.4.0
func (s *SkillsService) WriteUpload(ctx context.Context, req *SkillUploadRequest) (*SkillItem, *Response, error)
WriteUpload uploads a skill archive to create or replace a skill.
API: POST /safari/skill/upload (skill-write-upload).
type SnoozeIncidentRequest ¶
type SnoozeIncidentRequest struct {
// Incident IDs to snooze. At most 100 per call.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
// Duration in minutes. Must be greater than 0 and at most 43,200 (30 days).
Minutes int64 `json:"minutes" toon:"minutes"`
}
SnoozeIncidentRequest is generated from the Flashduty OpenAPI schema.
type SourcemapBinaryImage ¶ added in v0.5.4
type SourcemapBinaryImage struct {
// CPU architecture for this binary image.
Arch string `json:"arch,omitempty" toon:"arch,omitempty"`
// Whether this binary belongs to the operating system.
IsSystem bool `json:"is_system,omitempty" toon:"is_system,omitempty"`
// Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer.
LoadAddress any `json:"load_address,omitempty" toon:"load_address,omitempty"`
// Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer.
MaxAddress any `json:"max_address,omitempty" toon:"max_address,omitempty"`
// Binary image name.
Name string `json:"name,omitempty" toon:"name,omitempty"`
// Build UUID identifying the binary or dSYM.
Uuid string `json:"uuid,omitempty" toon:"uuid,omitempty"`
}
SourcemapBinaryImage is generated from the Flashduty OpenAPI schema.
type SourcemapCodeSnippet ¶ added in v0.5.4
type SourcemapCodeSnippet struct {
// Source code on that line.
Code string `json:"code" toon:"code"`
// Source line number.
Line int64 `json:"line" toon:"line"`
}
SourcemapCodeSnippet is generated from the Flashduty OpenAPI schema.
type SourcemapEnrichedFrame ¶ added in v0.5.4
type SourcemapEnrichedFrame struct {
// iOS or native memory address.
Address string `json:"address" toon:"address"`
// Android Java/Kotlin class name.
ClassName string `json:"class_name" toon:"class_name"`
// Source-code snippets around this frame. Omitted when no snippet was extracted (for example the source content was unavailable or `near` was not requested).
CodeSnippets []SourcemapCodeSnippet `json:"code_snippets" toon:"code_snippets"`
// Column number for JavaScript or Flutter frames.
Column int64 `json:"column" toon:"column"`
// Whether the frame was successfully symbolicated or deobfuscated.
Converted bool `json:"converted" toon:"converted"`
// Source file, URL, or module path.
File string `json:"file" toon:"file"`
// Function or method name.
Function string `json:"function" toon:"function"`
// Line number.
Line int64 `json:"line" toon:"line"`
// Android Java/Kotlin method name without class prefix.
MethodName string `json:"method_name" toon:"method_name"`
// iOS Swift/Objective-C module name.
Module string `json:"module" toon:"module"`
// Unity IL native address.
NativeAddress string `json:"native_address" toon:"native_address"`
// Symbol offset from function start.
Offset int64 `json:"offset" toon:"offset"`
// The original minified/obfuscated frame before enrichment. Omitted when the processor did not retain one.
OriginalFrame SourcemapStackFrame `json:"original_frame" toon:"original_frame"`
// Whether the frame is from third-party or system libraries (Android and native symbolication only). Omitted when `false`.
ThirdParty bool `json:"third_party" toon:"third_party"`
}
SourcemapEnrichedFrame is generated from the Flashduty OpenAPI schema.
type SourcemapItem ¶
type SourcemapItem struct {
// Upload timestamp, Unix epoch seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Git commit SHA for this build.
GitCommitSHA string `json:"git_commit_sha" toon:"git_commit_sha"`
// Git repository URL associated with this build.
GitRepositoryURL string `json:"git_repository_url" toon:"git_repository_url"`
// Record identifier: a 32-character MD5 hex digest derived from the uploaded file's identity (storage path, or service/version/build identifiers for native symbols).
Key string `json:"key" toon:"key"`
// Platform-specific metadata: `minified_url` (browser/react-native/harmony/miniprogram); `build_id`, `variant`, `version_code` (android mappings), plus `arch`, `lib_name`, `code_id` (android/harmony/electron native symbols); `uuid` (ios); `build_id`, `platform`, `arch`, `flavor`, `code_id`, `debug_id` (flutter); `subpackage`, `minified_url` (miniprogram). Omitted when empty.
Metadata map[string]any `json:"metadata" toon:"metadata"`
// Deprecated. Storage path of the minified file; present only on JavaScript records.
MinifiedPath string `json:"minified_path" toon:"minified_path"`
// Deprecated. URL of the minified file; present only on JavaScript and miniprogram records. New integrations should read `metadata.minified_url`.
MinifiedURL string `json:"minified_url" toon:"minified_url"`
// Application or service name.
Service string `json:"service" toon:"service"`
// File size in bytes.
Size int64 `json:"size" toon:"size"`
// Deprecated. Storage path of the sourcemap file; present only on JavaScript and miniprogram records.
SourcemapPath string `json:"sourcemap_path" toon:"sourcemap_path"`
// Platform store this record belongs to. JavaScript rows always report `browser` (including HarmonyOS ArkTS and React Native uploads); native-symbol rows always report `android` (including HarmonyOS native and Electron uploads).
//
// | Value | Store |
// |---|---|
// | `browser` | JavaScript sourcemap store |
// | `android` | Android mapping store, or the shared native symbol store |
// | `ios` | iOS dSYM store |
// | `miniprogram` | WeChat mini program sourcemap store |
// | `flutter` | Flutter Dart AOT symbol store |
Type string `json:"type" toon:"type"`
// Last update timestamp, Unix epoch seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Application version string.
Version string `json:"version" toon:"version"`
}
SourcemapItem is generated from the Flashduty OpenAPI schema.
type SourcemapListRequest ¶
type SourcemapListRequest struct {
ListOptions
// Sort ascending. Default false (descending).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Substring filter on the build ID (Android Gradle plugin build identifier, or the build ID of native symbols). Max 200 characters.
BuildID string `json:"build_id,omitempty" toon:"build_id,omitempty"`
// End of upload time range, Unix epoch milliseconds. Maximum window: 365 days.
EndTime int64 `json:"end_time" toon:"end_time"`
// Symbol type filter, Android and HarmonyOS only (ignored for other platforms): `mapping` (default) lists ProGuard/R8 mappings or ArkTS sourcemaps, `native` lists native .so symbols.
Kind string `json:"kind,omitempty" toon:"kind,omitempty"`
// Sort field; defaults to `created_at` descending when omitted.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Free-text substring match. Matches `minified_url` for the JS stores (browser/react-native/harmony/miniprogram), `build_id` for android/flutter/electron and harmony with `kind=native`, or `uuid` for ios (case-insensitive, hyphens ignored).
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Filter by service names. Up to 100 values.
Services []string `json:"services,omitempty" toon:"services,omitempty"`
// Start of upload time range, Unix epoch milliseconds. Must be > 0 and before `end_time`.
StartTime int64 `json:"start_time" toon:"start_time"`
// Platform whose symbol store to list. Defaults to `browser` when omitted; any other value returns an empty list.
//
// | Value | Store listed |
// |---|---|
// | `browser` | JavaScript sourcemaps (shared store; excludes HarmonyOS ArkTS and React Native rows) |
// | `android` | ProGuard/R8 mapping files; with `kind=native`, Android NDK .so symbols |
// | `ios` | iOS dSYM symbol files |
// | `miniprogram` | WeChat mini program sourcemaps |
// | `react-native` | React Native JS sourcemaps |
// | `harmony` | HarmonyOS ArkTS sourcemaps; with `kind=native`, HarmonyOS .so symbols |
// | `flutter` | Flutter Dart AOT symbols |
// | `electron` | Electron Breakpad symbols |
Type string `json:"type,omitempty" toon:"type,omitempty"`
// iOS only. Substring filter on the dSYM UUID; upper-cased and stripped of hyphens before matching. Max 200 characters.
Uuid string `json:"uuid,omitempty" toon:"uuid,omitempty"`
// Filter by version strings. Up to 100 values.
Versions []string `json:"versions,omitempty" toon:"versions,omitempty"`
}
SourcemapListRequest is generated from the Flashduty OpenAPI schema.
type SourcemapListResponse ¶
type SourcemapListResponse struct {
// Sourcemap records of the current page. Omitted when empty.
Items []SourcemapItem `json:"items" toon:"items"`
// Total number of matching records. Omitted when 0.
Total int64 `json:"total" toon:"total"`
}
SourcemapListResponse is generated from the Flashduty OpenAPI schema.
type SourcemapStackEnrichRequest ¶ added in v0.5.4
type SourcemapStackEnrichRequest struct {
// Native CPU architecture, such as `arm`, `arm64`, `x86` or `x64`. With `type: android` and an empty `source_type`, sending `arch` selects NDK native symbolication.
Arch string `json:"arch,omitempty" toon:"arch,omitempty"`
// Loaded binary images from an iOS crash report.
BinaryImages []SourcemapBinaryImage `json:"binary_images,omitempty" toon:"binary_images,omitempty"`
// Android build ID for Gradle plugin 1.13.0 and later.
BuildID string `json:"build_id,omitempty" toon:"build_id,omitempty"`
// Number of nearby meaningful source lines to return around converted frames.
Near int64 `json:"near,omitempty" toon:"near,omitempty"`
// Skip cached enrich results. Intended for debugging.
NoCache bool `json:"no_cache,omitempty" toon:"no_cache,omitempty"`
// Narrows a `react-native` enrich to the app's native platform: `ios` for the iOS native layer, `android` for the Android native layer (the console derives it from the event's OS). Ignored for other `type` values.
Platform string `json:"platform,omitempty" toon:"platform,omitempty"`
// Application or service name used when the sourcemap was uploaded.
Service string `json:"service" toon:"service"`
// The error's `error.source_type` as reported by the SDK. It reroutes symbolication: for `android`, a value containing `ndk` selects NDK native symbols; for `flutter` and `react-native`, `ios` selects dSYM and `android`/`ndk` selects Android symbols; for `electron`, `macos`, `windows` or `linux` selects Breakpad symbols. Ignored for other types.
SourceType string `json:"source_type,omitempty" toon:"source_type,omitempty"`
// Raw stack trace to parse and enrich.
Stack string `json:"stack,omitempty" toon:"stack,omitempty"`
// Source platform whose symbol store is used. Defaults to `browser` when omitted.
//
// | Value | Symbolication |
// |---|---|
// | `browser` | JavaScript stacks via sourcemaps |
// | `android` | Java/Kotlin stacks via ProGuard/R8 mappings; native stacks via NDK symbols (send `source_type=ndk` with `arch`) |
// | `ios` | iOS crash stacks via dSYM (send `binary_images`) |
// | `miniprogram` | WeChat mini program stacks via sourcemaps |
// | `harmony` | HarmonyOS stacks via ArkTS sourcemaps or native symbols |
// | `flutter` | Flutter/Dart stacks via Dart AOT symbols |
// | `electron` | Electron JavaScript stacks via sourcemaps; minidump native frames via Breakpad symbols (derived from `source_type`) |
// | `react-native` | React Native JS stacks via sourcemaps; narrow the lookup with `platform` |
Type string `json:"type,omitempty" toon:"type,omitempty"`
// Android build variant used by older Gradle plugin versions.
Variant string `json:"variant,omitempty" toon:"variant,omitempty"`
// Application version used when the sourcemap was uploaded.
Version string `json:"version" toon:"version"`
}
SourcemapStackEnrichRequest is generated from the Flashduty OpenAPI schema.
type SourcemapStackEnrichResponse ¶ added in v0.5.4
type SourcemapStackEnrichResponse struct {
// Error stack frames after symbolication (via sourcemap, dSYM, NDK symbol tables, etc.).
Frames []SourcemapEnrichedFrame `json:"frames" toon:"frames"`
}
SourcemapStackEnrichResponse is generated from the Flashduty OpenAPI schema.
type SourcemapStackFrame ¶ added in v0.5.4
type SourcemapStackFrame struct {
// iOS or native memory address.
Address string `json:"address" toon:"address"`
// Android Java/Kotlin class name.
ClassName string `json:"class_name" toon:"class_name"`
// Column number for JavaScript or Flutter frames.
Column int64 `json:"column" toon:"column"`
// Source file, URL, or module path.
File string `json:"file" toon:"file"`
// Function or method name.
Function string `json:"function" toon:"function"`
// Line number.
Line int64 `json:"line" toon:"line"`
// Android Java/Kotlin method name without class prefix.
MethodName string `json:"method_name" toon:"method_name"`
// iOS Swift/Objective-C module name.
Module string `json:"module" toon:"module"`
// Unity IL native address.
NativeAddress string `json:"native_address" toon:"native_address"`
// Symbol offset from function start.
Offset int64 `json:"offset" toon:"offset"`
}
SourcemapStackFrame is generated from the Flashduty OpenAPI schema.
type SourcemapsService ¶
type SourcemapsService service
SourcemapsService handles the "RUM/Sourcemaps" API resource.
func (*SourcemapsService) List ¶
func (s *SourcemapsService) List(ctx context.Context, req *SourcemapListRequest) (*SourcemapListResponse, *Response, error)
List sourcemaps.
Return a paginated list of uploaded sourcemap files filtered by platform type, service, and version.
API: POST /sourcemap/list (sourcemap-read-list).
func (*SourcemapsService) StackEnrich ¶ added in v0.5.4
func (s *SourcemapsService) StackEnrich(ctx context.Context, req *SourcemapStackEnrichRequest) (*SourcemapStackEnrichResponse, *Response, error)
Enrich a stack trace.
Symbolicate or deobfuscate a stack trace with the sourcemaps or symbol files uploaded for a service version.
API: POST /sourcemap/stack/enrich (sourcemap-read-stack-enrich).
type StatusPageChangeCreateResponse ¶
type StatusPageChangeCreateResponse struct {
// Newly created event ID.
ChangeID int64 `json:"change_id" toon:"change_id"`
// Event title (echoed from the request).
ChangeName string `json:"change_name" toon:"change_name"`
}
StatusPageChangeCreateResponse is generated from the Flashduty OpenAPI schema.
type StatusPageChangeItem ¶
type StatusPageChangeItem struct {
// Components currently affected by this event, with their resulting status. Omitted when no components are affected.
AffectedComponents []AffectedStatusPageComponentItem `json:"affected_components" toon:"affected_components"`
// Maintenance only: whether the status advances automatically based on the scheduled window. Omitted when false.
AutoUpdateBySchedule bool `json:"auto_update_by_schedule" toon:"auto_update_by_schedule"`
// Event ID, returned by `POST /status-page/change/create`; pass it as `change_id` to the other event endpoints.
ChangeID int64 `json:"change_id" toon:"change_id"`
// Event close time in Unix seconds. For maintenances this is the scheduled end time; for closed events, the time the event reached its terminal status (`resolved`/`completed`). Omitted when not set.
CloseAtSeconds Timestamp `json:"close_at_seconds" toon:"close_at_seconds"`
// Event description (Markdown). Omitted when empty.
Description string `json:"description" toon:"description"`
// Whether this event is a retrospective (historical) one. Omitted when false.
IsRetrospective bool `json:"is_retrospective" toon:"is_retrospective"`
// Linked event IDs (related incidents, deployments, etc.). Omitted when empty.
LinkedChangeIDs []string `json:"linked_change_ids" toon:"linked_change_ids"`
// Whether subscribers were notified about this event. Omitted when false.
NotifySubscribers bool `json:"notify_subscribers" toon:"notify_subscribers"`
// Parent status page ID. Omitted when 0 (never for stored events).
PageID int64 `json:"page_id" toon:"page_id"`
// Member IDs responsible for this event. Omitted when no responders are assigned.
ResponderIDs []int64 `json:"responder_ids" toon:"responder_ids"`
// Event start time in Unix seconds. For incidents it is the time of the first timeline entry; for maintenances it is the scheduled start given at creation, or the first entry's time when none was given. Omitted when 0.
StartAtSeconds Timestamp `json:"start_at_seconds" toon:"start_at_seconds"`
// Current event status. Incident statuses: `investigating`/`identified`/`monitoring`/`resolved`. Maintenance statuses: `scheduled`/`ongoing`/`completed`. Omitted when empty (never for stored events).
Status string `json:"status" toon:"status"`
// Event title.
Title string `json:"title" toon:"title"`
// Change type. `incident` is an unplanned outage; `maintenance` is a planned maintenance. The type determines which status values are valid.
Type string `json:"type" toon:"type"`
// Timeline updates attached to this event, ordered by time. Omitted when the event has no timeline updates.
Updates []StatusPageChangeUpdateItem `json:"updates" toon:"updates"`
}
StatusPageChangeItem is generated from the Flashduty OpenAPI schema.
type StatusPageChangeListResponse ¶
type StatusPageChangeListResponse struct {
// Status page changes (incidents/maintenances) matching the filters.
Items []StatusPageChangeItem `json:"items" toon:"items"`
}
StatusPageChangeListResponse is generated from the Flashduty OpenAPI schema.
type StatusPageChangeTimelineCreateResponse ¶
type StatusPageChangeTimelineCreateResponse struct {
// Newly created update ID.
UpdateID string `json:"update_id" toon:"update_id"`
}
StatusPageChangeTimelineCreateResponse is generated from the Flashduty OpenAPI schema.
type StatusPageChangeUpdateItem ¶
type StatusPageChangeUpdateItem struct {
// Update timestamp in Unix seconds.
AtSeconds Timestamp `json:"at_seconds" toon:"at_seconds"`
// Component status transitions applied by this update. Omitted when the update changes no component statuses.
ComponentChanges []StatusPageComponentChangeItem `json:"component_changes" toon:"component_changes"`
// Update description (Markdown). Omitted when empty.
Description string `json:"description" toon:"description"`
// Change status after this update. Omitted when the update does not change the overall status. The first four values apply to incident-type changes, the last three to maintenance-type changes.
// | Value | Meaning |
// |---|---|
// | `investigating` | Investigating (incident). |
// | `identified` | Root cause identified (incident). |
// | `monitoring` | Fix deployed, monitoring (incident). |
// | `resolved` | Resolved (incident). |
// | `scheduled` | Scheduled (maintenance). |
// | `ongoing` | In progress (maintenance). |
// | `completed` | Completed (maintenance). |
Status string `json:"status" toon:"status"`
// Timeline entry ID (a ULID string), assigned by the server; pass it as `update_id` to edit or delete the entry.
UpdateID string `json:"update_id" toon:"update_id"`
}
StatusPageChangeUpdateItem is generated from the Flashduty OpenAPI schema.
type StatusPageComponentChangeItem ¶
type StatusPageComponentChangeItem struct {
// ID of the component whose status changes; matches `component_id` in `GET /status-page/info`.
ComponentID string `json:"component_id" toon:"component_id"`
// Component display name. Populated by the backend on read; ignored on write. Omitted when empty.
ComponentName string `json:"component_name" toon:"component_name"`
// New component status. Incidents support `operational`/`degraded`/`partial_outage`/`full_outage`; maintenances support `operational`/`under_maintenance`.
Status string `json:"status" toon:"status"`
}
StatusPageComponentChangeItem is generated from the Flashduty OpenAPI schema.
type StatusPageComponentItem ¶
type StatusPageComponentItem struct {
// Time the component became available, as a Unix timestamp in seconds. Omitted when 0.
AvailableSinceSeconds Timestamp `json:"available_since_seconds" toon:"available_since_seconds"`
// Component ID. Omitted when empty.
ComponentID string `json:"component_id" toon:"component_id"`
// Component description. Omitted when empty.
Description string `json:"description" toon:"description"`
// When true, the component is hidden entirely from summary endpoints. Omitted when false.
HideAll bool `json:"hide_all" toon:"hide_all"`
// When true, uptime data is hidden from summary responses. Omitted when false.
HideUptime bool `json:"hide_uptime" toon:"hide_uptime"`
// Component display name.
Name string `json:"name" toon:"name"`
// Display order within its section. Omitted when 0.
OrderID int64 `json:"order_id" toon:"order_id"`
// Parent section ID. Omitted when the component sits at the top level.
SectionID string `json:"section_id" toon:"section_id"`
}
StatusPageComponentItem is generated from the Flashduty OpenAPI schema.
type StatusPageDraftCreateResponse ¶ added in v0.14.5
type StatusPageDraftCreateResponse struct {
// Creation time in Unix epoch seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Draft ID matching `draft_[A-Za-z0-9]{22}`; pass it as `draft_id` to `POST /status-page/change/create` or `POST /status-page/change/timeline/create` to publish.
DraftID string `json:"draft_id" toon:"draft_id"`
}
StatusPageDraftCreateResponse is generated from the Flashduty OpenAPI schema.
type StatusPageInfoResponse ¶ added in v0.14.3
type StatusPageInfoResponse struct {
// Components tracked on the status page.
Components []StatusPageComponentItem `json:"components" toon:"components"`
// Get-in-touch contact, a mailto or website URL. Omitted when not set.
ContactInfo string `json:"contact_info" toon:"contact_info"`
// Custom domain pointing to the status page. Omitted when not set.
CustomDomain string `json:"custom_domain" toon:"custom_domain"`
// Custom navigation links shown on the status page. Omitted when not set.
CustomLinks []map[string]string `json:"custom_links" toon:"custom_links"`
// Dark-mode logo image of the status page. Omitted when not set.
DarkLogo string `json:"dark_logo" toon:"dark_logo"`
// How the timeline displays change dates. `calendar` uses a calendar view; `list` uses a list view. Omitted when not set.
DateView string `json:"date_view" toon:"date_view"`
// How uptime is displayed. `chart_and_percentage` shows both the uptime chart and the percentage figure; `chart` shows only the chart; `none` hides uptime entirely. Omitted when not set.
DisplayUptimeMode string `json:"display_uptime_mode" toon:"display_uptime_mode"`
// Favicon of the status page. Omitted when not set.
Favicon string `json:"favicon" toon:"favicon"`
// Logo image of the status page. Omitted when not set.
Logo string `json:"logo" toon:"logo"`
// URL opened when the logo is clicked. Omitted when not set.
LogoURL string `json:"logo_url" toon:"logo_url"`
// Whether the managed custom-domain feature is enabled for this page. `true` for public pages, always `false` for internal pages.
ManagedDomainFeatureEnabled bool `json:"managed_domain_feature_enabled" toon:"managed_domain_feature_enabled"`
// Display name of the status page.
Name string `json:"name" toon:"name"`
PageFooter string `json:"page_footer" toon:"page_footer"`
// Header content of the status page. Omitted when not set.
PageHeader string `json:"page_header" toon:"page_header"`
// Status page ID.
PageID int64 `json:"page_id" toon:"page_id"`
// Sections grouping the components.
Sections []StatusPageSectionItem `json:"sections" toon:"sections"`
// Subscription channel toggles.
Subscription StatusPageSubscriptionItem `json:"subscription" toon:"subscription"`
// Event template mode used when publishing events in the console: `message` (status descriptions: per-status texts) or `pre_defined` (full status updates: complete examples with title, status, and description). Omitted when never set; the console then uses `message`.
TemplatePreference string `json:"template_preference" toon:"template_preference"`
// Page visibility type. `public` pages are accessible to anyone and use email subscriptions; `internal` pages are restricted to account members and use IM subscriptions.
Type string `json:"type" toon:"type"`
// URL-safe slug of the page, unique among the account's pages of the same type.
URLName string `json:"url_name" toon:"url_name"`
}
StatusPageInfoResponse is generated from the Flashduty OpenAPI schema.
type StatusPageItem ¶ added in v0.4.0
type StatusPageItem struct {
// Components tracked on the status page.
Components []StatusPageComponentItem `json:"components" toon:"components"`
// Get-in-touch contact, a mailto or website URL. Omitted when not set.
ContactInfo string `json:"contact_info" toon:"contact_info"`
// Custom domain pointing to the status page. Omitted when not set.
CustomDomain string `json:"custom_domain" toon:"custom_domain"`
// Custom navigation links shown on the status page. Omitted when not set.
CustomLinks []map[string]string `json:"custom_links" toon:"custom_links"`
// Dark-mode logo image of the status page. Omitted when not set.
DarkLogo string `json:"dark_logo" toon:"dark_logo"`
// How the timeline displays change dates. `calendar` uses a calendar view; `list` uses a list view. Omitted when not set.
DateView string `json:"date_view" toon:"date_view"`
// How uptime is displayed. `chart_and_percentage` shows both the uptime chart and the percentage figure; `chart` shows only the chart; `none` hides uptime entirely. Omitted when not set.
DisplayUptimeMode string `json:"display_uptime_mode" toon:"display_uptime_mode"`
// Favicon of the status page. Omitted when not set.
Favicon string `json:"favicon" toon:"favicon"`
// Logo image of the status page. Omitted when not set.
Logo string `json:"logo" toon:"logo"`
// URL opened when the logo is clicked. Omitted when not set.
LogoURL string `json:"logo_url" toon:"logo_url"`
// Display name of the status page.
Name string `json:"name" toon:"name"`
PageFooter string `json:"page_footer" toon:"page_footer"`
// Header content of the status page. Omitted when not set.
PageHeader string `json:"page_header" toon:"page_header"`
// Status page ID.
PageID int64 `json:"page_id" toon:"page_id"`
// Sections grouping the components.
Sections []StatusPageSectionItem `json:"sections" toon:"sections"`
// Subscription channel toggles.
Subscription StatusPageSubscriptionItem `json:"subscription" toon:"subscription"`
// Event template mode used when publishing events in the console: `message` (status descriptions: per-status texts) or `pre_defined` (full status updates: complete examples with title, status, and description). Omitted when never set; the console then uses `message`.
TemplatePreference string `json:"template_preference" toon:"template_preference"`
// Page visibility type. `public` pages are accessible to anyone and use email subscriptions; `internal` pages are restricted to account members and use IM subscriptions.
Type string `json:"type" toon:"type"`
// URL-safe slug of the page, unique among the account's pages of the same type.
URLName string `json:"url_name" toon:"url_name"`
}
StatusPageItem is generated from the Flashduty OpenAPI schema.
type StatusPageMessageTemplate ¶ added in v0.14.3
type StatusPageMessageTemplate struct {
// Notification text (Markdown) per event status. Keys are change statuses valid for the template's `type` (for example `investigating` or `resolved` for incidents); the value is the text used when the event reaches that status.
Messages map[string]string `json:"messages,omitempty" toon:"messages,omitempty"`
// Template ID. Omit to create a new template; supply to update an existing one.
TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
// Template title.
Title string `json:"title,omitempty" toon:"title,omitempty"`
// Change type the template applies to: `incident` unplanned incident, `maintenance` planned maintenance.
Type string `json:"type,omitempty" toon:"type,omitempty"`
}
StatusPageMessageTemplate is generated from the Flashduty OpenAPI schema.
type StatusPageMigrationJob ¶
type StatusPageMigrationJob struct {
// Owner account ID.
AccountID int64 `json:"account_id" toon:"account_id"`
// Job creation time as a Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Terminal error message when `status` is `failed`. Omitted when the job has not failed.
Error string `json:"error" toon:"error"`
// Migration job ID.
JobID string `json:"job_id" toon:"job_id"`
// Current migration phase. `structure` imports the page structure (sections and components); `history` imports historical incidents, maintenances, and incident templates; `subscribers` imports email subscribers.
Phase string `json:"phase" toon:"phase"`
// Per-entity progress counters.
Progress StatusPageMigrationProgress `json:"progress" toon:"progress"`
// Atlassian Statuspage source page ID.
SourcePageID string `json:"source_page_id" toon:"source_page_id"`
// Current job status.
// | Value | Meaning |
// |---|---|
// | `running` | In progress. |
// | `completed` | Finished successfully. |
// | `failed` | Failed; the `error` field holds the reason. |
// | `cancelled` | Canceled by request. |
Status string `json:"status" toon:"status"`
// Flashduty target status page ID. For a structure migration it is 0 until the page is created or reused; for a subscriber migration it is the `target_page_id` from the request.
TargetPageID int64 `json:"target_page_id" toon:"target_page_id"`
// Last status update time as a Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}
StatusPageMigrationJob is generated from the Flashduty OpenAPI schema.
type StatusPageMigrationProgress ¶
type StatusPageMigrationProgress struct {
// Steps completed so far.
CompletedSteps int64 `json:"completed_steps" toon:"completed_steps"`
// Number of components imported from the source status page.
ComponentsImported int64 `json:"components_imported" toon:"components_imported"`
// Number of historical incidents imported.
IncidentsImported int64 `json:"incidents_imported" toon:"incidents_imported"`
// Number of scheduled maintenances imported.
MaintenancesImported int64 `json:"maintenances_imported" toon:"maintenances_imported"`
// Number of sections (Atlassian component groups) imported from the source status page.
SectionsImported int64 `json:"sections_imported" toon:"sections_imported"`
// Number of email subscribers successfully imported.
SubscribersImported int64 `json:"subscribers_imported" toon:"subscribers_imported"`
// Number of source subscribers skipped because they are not email subscribers, have no email address, or are quarantined. Recipients already subscribed on the target page are not counted here.
SubscribersSkipped int64 `json:"subscribers_skipped" toon:"subscribers_skipped"`
// Number of incident templates successfully imported; templates that fail are skipped and recorded in `warnings`.
TemplatesImported int64 `json:"templates_imported" toon:"templates_imported"`
// Total steps of the job: 5 for a structure migration (page, sections, components, incidents and maintenances, templates) and 1 for a subscriber migration.
TotalSteps int64 `json:"total_steps" toon:"total_steps"`
// Non-fatal warnings recorded during the job. Omitted when empty.
Warnings []string `json:"warnings" toon:"warnings"`
}
StatusPageMigrationProgress is generated from the Flashduty OpenAPI schema.
type StatusPageMigrationStartResponse ¶
type StatusPageMigrationStartResponse struct {
// Migration job ID. Use this to poll status or request cancellation.
JobID string `json:"job_id" toon:"job_id"`
}
StatusPageMigrationStartResponse is generated from the Flashduty OpenAPI schema.
type StatusPagePreDefinedTemplate ¶ added in v0.14.3
type StatusPagePreDefinedTemplate struct {
// Template body text (Markdown).
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Change status the template maps to. Incidents use `investigating`/`identified`/`monitoring`/`resolved`; maintenances use `scheduled`/`ongoing`/`completed`.
Status string `json:"status,omitempty" toon:"status,omitempty"`
// Template ID. Omit to create a new template; supply to update an existing one.
TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
// Template title.
Title string `json:"title,omitempty" toon:"title,omitempty"`
// Change type the template applies to: `incident` unplanned incident, `maintenance` planned maintenance. Set on create; ignored on update.
Type string `json:"type,omitempty" toon:"type,omitempty"`
}
StatusPagePreDefinedTemplate is generated from the Flashduty OpenAPI schema.
type StatusPageSectionItem ¶ added in v0.4.0
type StatusPageSectionItem struct {
// Section description.
Description string `json:"description" toon:"description"`
// Whether the section and its components are hidden from summary endpoints.
HideAll bool `json:"hide_all" toon:"hide_all"`
// Whether uptime data is hidden from summary responses.
HideUptime bool `json:"hide_uptime" toon:"hide_uptime"`
// Section name.
Name string `json:"name" toon:"name"`
// Display order of the section. Omitted when 0.
OrderID int64 `json:"order_id" toon:"order_id"`
// Section ID. Omitted when empty.
SectionID string `json:"section_id" toon:"section_id"`
}
StatusPageSectionItem is generated from the Flashduty OpenAPI schema.
type StatusPageSubscriberExportResponse ¶
type StatusPageSubscriberExportResponse string
func (StatusPageSubscriberExportResponse) String ¶ added in v0.5.2
func (e StatusPageSubscriberExportResponse) String() string
String returns the underlying string value, implementing fmt.Stringer.
type StatusPageSubscriberListResponse ¶
type StatusPageSubscriberListResponse struct {
// Whether there is at least one more page after the current one.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Subscribers on the current page.
Items []ExportedStatusPageSubscriberItem `json:"items" toon:"items"`
// Total matching subscribers.
Total int64 `json:"total" toon:"total"`
}
StatusPageSubscriberListResponse is generated from the Flashduty OpenAPI schema.
type StatusPageSubscriptionItem ¶ added in v0.4.0
type StatusPageSubscriptionItem struct {
// Whether email subscription is enabled.
Email bool `json:"email" toon:"email"`
// Whether IM subscription is enabled.
Im bool `json:"im" toon:"im"`
}
StatusPageSubscriptionItem is generated from the Flashduty OpenAPI schema.
type StatusPagesChangeActiveListRequest ¶ added in v0.4.1
type StatusPagesChangeActiveListRequest struct {
// Status page ID.
PageID int64 `url:"page_id"`
// Event type filter. Required. Returns only in-progress (non-terminal) events — `investigating`/`identified`/`monitoring` for `incident`, `scheduled`/`ongoing` for `maintenance`.
Type string `url:"type"`
}
StatusPagesChangeActiveListRequest holds the query parameters for List active status page events.
type StatusPagesChangeInfoRequest ¶
type StatusPagesChangeInfoRequest struct {
// Status page ID.
PageID int64 `url:"page_id"`
// Event (change) ID.
ChangeID int64 `url:"change_id"`
}
StatusPagesChangeInfoRequest holds the query parameters for Get status page event detail.
type StatusPagesChangeListRequest ¶
type StatusPagesChangeListRequest struct {
// Status page ID.
PageID int64 `url:"page_id"`
// Lower bound of the event activity window: only events still open at, or closed at or after, this Unix timestamp (seconds) are returned.
StartAtSeconds int64 `url:"start_at_seconds,omitempty"`
// Upper bound of the event activity window: only events started at or before this Unix timestamp (seconds) are returned.
EndAtSeconds int64 `url:"end_at_seconds,omitempty"`
// Event type filter. Required.
Type string `url:"type"`
// Event status filter. Required. Must be a status valid for the given `type` (`investigating`/`identified`/`monitoring`/`resolved` for `incident`; `scheduled`/`ongoing`/`completed` for `maintenance`).
Status string `url:"status"`
}
StatusPagesChangeListRequest holds the query parameters for List status page events.
type StatusPagesInfoRequest ¶ added in v0.5.4
type StatusPagesInfoRequest struct {
// Status page ID.
PageID int64 `url:"page_id"`
}
StatusPagesInfoRequest holds the query parameters for Get status page detail.
type StatusPagesMigrationStatusRequest ¶
type StatusPagesMigrationStatusRequest struct {
// Migration job ID returned by `migrate-structure` or `migrate-email-subscribers`.
JobID string `url:"job_id"`
}
StatusPagesMigrationStatusRequest holds the query parameters for Get migration status.
type StatusPagesService ¶
type StatusPagesService service
StatusPagesService handles the "On-call/Status pages" API resource.
func (*StatusPagesService) ChangeActiveList ¶ added in v0.4.1
func (s *StatusPagesService) ChangeActiveList(ctx context.Context, req *StatusPagesChangeActiveListRequest) (*StatusPageChangeListResponse, *Response, error)
List active status page events.
List in-progress (non-terminal) events of a given type for a status page.
API: GET /status-page/change/active/list (statusPageChangeActiveList).
func (*StatusPagesService) ChangeCreate ¶
func (s *StatusPagesService) ChangeCreate(ctx context.Context, req *CreateStatusPageChangeRequest) (*StatusPageChangeCreateResponse, *Response, error)
Create status page event.
Create a new incident or maintenance event on a status page.
API: POST /status-page/change/create (statusPageChangeCreate).
func (*StatusPagesService) ChangeDelete ¶
func (s *StatusPagesService) ChangeDelete(ctx context.Context, req *DeleteStatusPageChangeRequest) (*Response, error)
Delete status page event.
Delete an incident or maintenance event from a status page.
API: POST /status-page/change/delete (statusPageChangeDelete).
func (*StatusPagesService) ChangeInfo ¶
func (s *StatusPagesService) ChangeInfo(ctx context.Context, req *StatusPagesChangeInfoRequest) (*StatusPageChangeItem, *Response, error)
Get status page event detail.
Retrieve details of a specific status page event (incident or maintenance).
API: GET /status-page/change/info (statusPageChangeInfo).
func (*StatusPagesService) ChangeList ¶
func (s *StatusPagesService) ChangeList(ctx context.Context, req *StatusPagesChangeListRequest) (*StatusPageChangeListResponse, *Response, error)
List status page events.
List the incidents or maintenances of a status page by status and time window, including hidden components.
API: GET /status-page/change/list (statusPageChangeList).
func (*StatusPagesService) ChangeTimelineCreate ¶
func (s *StatusPagesService) ChangeTimelineCreate(ctx context.Context, req *CreateStatusPageChangeTimelineRequest) (*StatusPageChangeTimelineCreateResponse, *Response, error)
Create event timeline entry.
Add a timeline update to a status page event.
API: POST /status-page/change/timeline/create (statusPageChangeTimelineCreate).
func (*StatusPagesService) ChangeTimelineDelete ¶
func (s *StatusPagesService) ChangeTimelineDelete(ctx context.Context, req *DeleteStatusPageChangeTimelineRequest) (*Response, error)
Delete event timeline entry.
Delete a timeline entry from a status page event.
API: POST /status-page/change/timeline/delete (statusPageChangeTimelineDelete).
func (*StatusPagesService) ChangeTimelineUpdate ¶
func (s *StatusPagesService) ChangeTimelineUpdate(ctx context.Context, req *UpdateStatusPageChangeTimelineRequest) (*Response, error)
Update event timeline entry.
Edit the time or description of a status page event timeline entry.
API: POST /status-page/change/timeline/update (statusPageChangeTimelineUpdate).
func (*StatusPagesService) ChangeUpdate ¶
func (s *StatusPagesService) ChangeUpdate(ctx context.Context, req *UpdateStatusPageChangeRequest) (*Response, error)
Update status page event.
Update the title, responders, or linked events of a status page event.
API: POST /status-page/change/update (statusPageChangeUpdate).
func (*StatusPagesService) ComponentDelete ¶ added in v0.5.4
func (s *StatusPagesService) ComponentDelete(ctx context.Context, req *DeleteStatusPageComponentRequest) (*Response, error)
Delete status page component.
Delete one or more service components from a status page.
API: POST /status-page/component/delete (statusPageComponentDelete).
func (*StatusPagesService) ComponentUpsert ¶ added in v0.5.4
func (s *StatusPagesService) ComponentUpsert(ctx context.Context, req *UpsertStatusPageComponentRequest) (*UpsertStatusPageComponentResponse, *Response, error)
Upsert status page component.
Create or update one or more service components on a status page.
API: POST /status-page/component/upsert (statusPageComponentUpsert).
func (*StatusPagesService) Create ¶ added in v0.5.4
func (s *StatusPagesService) Create(ctx context.Context, req *CreateStatusPageRequest) (*CreateStatusPageResponse, *Response, error)
Create status page.
Create a public or internal status page for the account.
API: POST /status-page/create (statusPageCreate).
func (*StatusPagesService) Delete ¶ added in v0.5.4
func (s *StatusPagesService) Delete(ctx context.Context, req *DeleteStatusPageRequest) (*Response, error)
Delete status page.
Delete a status page together with its events and subscriptions.
API: POST /status-page/delete (statusPageDelete).
func (*StatusPagesService) DraftCreate ¶ added in v0.14.5
func (s *StatusPagesService) DraftCreate(ctx context.Context, req *CreateStatusPageDraftRequest) (*StatusPageDraftCreateResponse, *Response, error)
Create status page draft.
Store a status page event draft so a human can review and publish it from the console.
API: POST /status-page/draft/create (statusPageDraftCreate).
func (*StatusPagesService) Info ¶ added in v0.5.4
func (s *StatusPagesService) Info(ctx context.Context, req *StatusPagesInfoRequest) (*StatusPageInfoResponse, *Response, error)
Get status page detail.
Retrieve detailed configuration for a specific status page.
API: GET /status-page/info (statusPageInfo).
func (*StatusPagesService) MigrateEmailSubscribers ¶
func (s *StatusPagesService) MigrateEmailSubscribers(ctx context.Context, req *MigrateStatusPageEmailSubscribersRequest) (*StatusPageMigrationStartResponse, *Response, error)
Migrate email subscribers.
Start a migration job that imports email subscribers from an Atlassian Statuspage into an existing Flashduty status page.
API: POST /status-page/migrate-email-subscribers (statusPageMigrateEmailSubscribers).
func (*StatusPagesService) MigrateStructure ¶
func (s *StatusPagesService) MigrateStructure(ctx context.Context, req *MigrateStatusPageStructureRequest) (*StatusPageMigrationStartResponse, *Response, error)
Migrate status page structure.
Start a migration job that imports the structure and historical events of an Atlassian Statuspage into a new Flashduty status page.
API: POST /status-page/migrate-structure (statusPageMigrateStructure).
func (*StatusPagesService) MigrationCancel ¶
func (s *StatusPagesService) MigrationCancel(ctx context.Context, req *CancelStatusPageMigrationRequest) (*Response, error)
Cancel status page migration.
Cancel a running Atlassian Statuspage migration job.
API: POST /status-page/migration/cancel (statusPageMigrationCancel).
func (*StatusPagesService) MigrationStatus ¶
func (s *StatusPagesService) MigrationStatus(ctx context.Context, req *StatusPagesMigrationStatusRequest) (*StatusPageMigrationJob, *Response, error)
Get migration status.
Get the current status and progress of a status page migration job.
API: GET /status-page/migration/status (statusPageMigrationStatus).
func (*StatusPagesService) ReadPageList ¶ added in v0.4.0
func (s *StatusPagesService) ReadPageList(ctx context.Context) (*ListStatusPageResponse, *Response, error)
List status pages.
List all status pages owned by the account, including their components and sections.
API: GET /status-page/list (status-page-read-page-list).
func (*StatusPagesService) SectionDelete ¶ added in v0.5.4
func (s *StatusPagesService) SectionDelete(ctx context.Context, req *DeleteStatusPageSectionRequest) (*Response, error)
Delete status page section.
Delete one or more sections from a status page; their components move to the top level.
API: POST /status-page/section/delete (statusPageSectionDelete).
func (*StatusPagesService) SectionUpsert ¶ added in v0.5.4
func (s *StatusPagesService) SectionUpsert(ctx context.Context, req *UpsertStatusPageSectionRequest) (*UpsertStatusPageSectionResponse, *Response, error)
Upsert status page section.
Create or update one or more sections that group components on a status page.
API: POST /status-page/section/upsert (statusPageSectionUpsert).
func (*StatusPagesService) SubscriberExport ¶
func (s *StatusPagesService) SubscriberExport(ctx context.Context, req *ExportStatusPageSubscribersRequest) (*Response, error)
Export subscribers.
Export the subscribers of a status page as a CSV file.
The success body is a file, not a JSON envelope: it is returned on Response.Raw.
API: POST /status-page/subscriber/export (statusPageSubscriberExport).
func (*StatusPagesService) SubscriberImport ¶
func (s *StatusPagesService) SubscriberImport(ctx context.Context, req *ImportStatusPageSubscribersRequest) (*Response, error)
Import subscribers.
Bulk import subscribers into a status page without sending confirmation emails.
API: POST /status-page/subscriber/import (statusPageSubscriberImport).
func (*StatusPagesService) SubscriberList ¶
func (s *StatusPagesService) SubscriberList(ctx context.Context, req *StatusPagesSubscriberListRequest) (*StatusPageSubscriberListResponse, *Response, error)
List status page subscribers.
List subscribers who have signed up for status page notifications.
API: GET /status-page/subscriber/list (statusPageSubscriberList).
func (*StatusPagesService) TemplateDelete ¶ added in v0.5.4
func (s *StatusPagesService) TemplateDelete(ctx context.Context, req *DeleteStatusPageTemplateRequest) (*Response, error)
Delete status page template.
Delete a predefined event template or a message template from a status page.
API: POST /status-page/template/delete (statusPageTemplateDelete).
func (*StatusPagesService) TemplateList ¶ added in v0.5.4
func (s *StatusPagesService) TemplateList(ctx context.Context, req *StatusPagesTemplateListRequest) (*ListStatusPageTemplatesResponse, *Response, error)
List status page templates.
List the predefined event templates or message templates of a status page.
API: GET /status-page/template/list (statusPageTemplateList).
func (*StatusPagesService) TemplateUpsert ¶ added in v0.5.4
func (s *StatusPagesService) TemplateUpsert(ctx context.Context, req *UpsertStatusPageTemplateRequest) (*UpsertStatusPageTemplateResponse, *Response, error)
Upsert status page template.
Create or update a predefined event template or a message template of a status page.
API: POST /status-page/template/upsert (statusPageTemplateUpsert).
func (*StatusPagesService) Update ¶ added in v0.5.4
func (s *StatusPagesService) Update(ctx context.Context, req *UpdateStatusPageRequest) (*Response, error)
Update status page.
Update the configuration of an existing status page; omitted fields keep their values.
API: POST /status-page/update (statusPageUpdate).
type StatusPagesSubscriberListRequest ¶
type StatusPagesSubscriberListRequest struct {
// Status page ID.
PageID int64 `url:"page_id"`
// Comma-separated component IDs to filter subscribers by.
ComponentIDs string `url:"component_ids,omitempty"`
// Page number (1-based).
P int64 `url:"p,omitempty"`
// Page size (1-100).
Limit int64 `url:"limit,omitempty"`
}
StatusPagesSubscriberListRequest holds the query parameters for List status page subscribers.
type StatusPagesTemplateListRequest ¶ added in v0.5.4
type StatusPagesTemplateListRequest struct {
// Status page ID.
PageID int64 `url:"page_id"`
// Template category. `pre_defined` returns predefined event templates; `message` returns message notification templates.
Type string `url:"type"`
}
StatusPagesTemplateListRequest holds the query parameters for List status page templates.
type StringMapPatch ¶ added in v0.14.3
type StringMapPatch struct {
// Keys to remove.
Delete []string `json:"delete,omitempty" toon:"delete,omitempty"`
// Keys to insert or replace.
Set map[string]string `json:"set,omitempty" toon:"set,omitempty"`
}
StringMapPatch is generated from the Flashduty OpenAPI schema.
type TeamBriefItem ¶
type TeamBriefItem struct {
// Array of person IDs belonging to the team; empty array (never null) when the team has no members.
PersonIDs []uint64 `json:"person_ids" toon:"person_ids"`
// Team ID, one of the requested `team_ids`.
TeamID uint64 `json:"team_id" toon:"team_id"`
// Team name. Deleted teams are included, so this can be the name of a team that no longer appears in `POST /team/list`.
TeamName string `json:"team_name" toon:"team_name"`
}
TeamBriefItem is generated from the Flashduty OpenAPI schema.
type TeamDeleteRequest ¶
type TeamDeleteRequest struct {
// External reference ID. Only used when neither `team_id` nor `team_name` is provided.
RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
// Team ID. At least one of the three lookup fields is required; when several are provided, `team_id` wins.
TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Team name. Only used when `team_id` is not provided.
TeamName string `json:"team_name,omitempty" toon:"team_name,omitempty"`
}
TeamDeleteRequest is generated from the Flashduty OpenAPI schema.
type TeamInfoRequest ¶
type TeamInfoRequest struct {
// External reference ID. When provided, takes precedence over `team_name` and `team_id`.
RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
// Team ID. At least one of the three lookup fields is required; lowest priority — only used when neither `ref_id` nor `team_name` is provided.
TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Team name. Only used when `ref_id` is not provided; takes precedence over `team_id`.
TeamName string `json:"team_name,omitempty" toon:"team_name,omitempty"`
}
TeamInfoRequest is generated from the Flashduty OpenAPI schema.
type TeamInfosRequest ¶
type TeamInfosRequest struct {
// List of team IDs to look up.
TeamIDs []uint64 `json:"team_ids" toon:"team_ids"`
}
TeamInfosRequest is generated from the Flashduty OpenAPI schema.
type TeamInfosResponse ¶
type TeamInfosResponse struct {
// Brief info for the matched teams, including deleted ones; `null` when no ID matches.
Items []TeamBriefItem `json:"items" toon:"items"`
}
TeamInfosResponse is generated from the Flashduty OpenAPI schema.
type TeamItem ¶
type TeamItem struct {
// Owning account ID.
AccountID uint64 `json:"account_id" toon:"account_id"`
// Unix epoch seconds the team was created.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Member ID of the creator.
CreatorID uint64 `json:"creator_id" toon:"creator_id"`
// Display name of the creator. Not populated by current endpoints — always an empty string; resolve `creator_id` via `POST /person/infos`.
CreatorName string `json:"creator_name" toon:"creator_name"`
// Free-form description.
Description string `json:"description" toon:"description"`
// Person IDs of the team's members (member IDs; the account owner's ID when the owner is in the team). Empty array when the team has no members.
PersonIDs []uint64 `json:"person_ids" toon:"person_ids"`
// External reference ID for third-party HR system integration.
RefID string `json:"ref_id" toon:"ref_id"`
// Team status. `enabled` — active; `deleted` — soft-deleted (only possible when fetching a deleted team by `team_id`; list and name/ref_id lookups exclude deleted teams).
Status string `json:"status" toon:"status"`
// Unique team ID.
TeamID uint64 `json:"team_id" toon:"team_id"`
// Team display name. 1–39 characters, unique per account.
TeamName string `json:"team_name" toon:"team_name"`
// Unix epoch seconds the team was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Member ID of the last editor.
UpdatedBy uint64 `json:"updated_by" toon:"updated_by"`
// Name of the last editor: the member's name, or the account name when the account owner made the change; empty string when unknown.
UpdatedByName string `json:"updated_by_name" toon:"updated_by_name"`
}
TeamItem is generated from the Flashduty OpenAPI schema.
type TeamListRequest ¶
type TeamListRequest struct {
ListOptions
// Ascending sort order. Default: false (descending).
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Sort field. Default: `updated_at`.
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Filter by member ID — return only teams this person belongs to.
PersonID uint64 `json:"person_id,omitempty" toon:"person_id,omitempty"`
// Substring match on team name or description.
Query string `json:"query,omitempty" toon:"query,omitempty"`
}
TeamListRequest is generated from the Flashduty OpenAPI schema.
type TeamListResponse ¶
type TeamListResponse struct {
ListOptions
// Array of teams for the current page, used with `p`, `limit` and `total` for pagination; empty array on an empty page.
Items []TeamItem `json:"items" toon:"items"`
// Number of non-deleted teams matching the filters, across all pages.
Total int64 `json:"total" toon:"total"`
}
TeamListResponse is generated from the Flashduty OpenAPI schema.
type TeamUpsertRequest ¶
type TeamUpsertRequest struct {
// Region hint for `phones` entries without a `+` prefix: an ISO 3166-1 alpha-2 code such as `CN` (the default when omitted) or a digit calling code such as `86`.
CountryCode string `json:"countryCode,omitempty" toon:"countryCode,omitempty"`
// Free-form description, up to 500 characters. On update, omitting it clears the stored description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Emails of existing members to place in the team; merged with `person_ids` and `phones`. Addresses that match no member are ignored and no invitation is sent.
Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
// Person IDs to place in the team (member IDs, or the account ID for the account owner). Together with `emails` and `phones` they replace the entire member list; IDs that are not members of the account are ignored.
PersonIDs []uint64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
// Phone numbers of existing members to place in the team; merged with `person_ids` and `emails`. Numbers without a `+` prefix are parsed with `countryCode`; an unparseable number fails the whole request with `400`, and numbers that match no member are ignored.
Phones []string `json:"phones,omitempty" toon:"phones,omitempty"`
// External reference ID (for example a department ID in an HR system), usable as a lookup key in `POST /team/info` and `POST /team/delete`. On update, omitting it clears the stored value.
RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
// When true and `team_id` is 0, an existing team with the same `team_name` is updated in place instead of returning a name-conflict error.
ResetIfNameExist bool `json:"reset_if_name_exist,omitempty" toon:"reset_if_name_exist,omitempty"`
// ID of the team to update. Omit or set to 0 to create a new team; a non-zero ID must belong to an existing team of the account.
TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Team display name. 1–39 characters.
TeamName string `json:"team_name" toon:"team_name"`
}
TeamUpsertRequest is generated from the Flashduty OpenAPI schema.
type TeamUpsertResponse ¶
type TeamUpsertResponse struct {
// Created or updated team ID.
TeamID uint64 `json:"team_id" toon:"team_id"`
// Team name echoed from the request.
TeamName string `json:"team_name" toon:"team_name"`
}
TeamUpsertResponse is generated from the Flashduty OpenAPI schema.
type TeamsService ¶
type TeamsService service
TeamsService handles the "Platform/Teams" API resource.
func (*TeamsService) ReadInfo ¶
func (s *TeamsService) ReadInfo(ctx context.Context, req *TeamInfoRequest) (*TeamItem, *Response, error)
Get team detail.
Return a single team by ID, name, or external reference ID.
API: POST /team/info (team-read-info).
func (*TeamsService) ReadInfos ¶
func (s *TeamsService) ReadInfos(ctx context.Context, req *TeamInfosRequest) (*TeamInfosResponse, *Response, error)
Batch get teams.
Return basic info for multiple teams by their IDs in a single request.
API: POST /team/infos (team-read-infos).
func (*TeamsService) ReadList ¶
func (s *TeamsService) ReadList(ctx context.Context, req *TeamListRequest) (*TeamListResponse, *Response, error)
List teams.
Return a paginated list of teams in the current account.
API: POST /team/list (team-read-list).
func (*TeamsService) WriteDelete ¶
func (s *TeamsService) WriteDelete(ctx context.Context, req *TeamDeleteRequest) (*Response, error)
Delete a team.
Delete a team by ID, name, or external reference ID and remove all of its members.
API: POST /team/delete (team-write-delete).
func (*TeamsService) WriteUpsert ¶
func (s *TeamsService) WriteUpsert(ctx context.Context, req *TeamUpsertRequest) (*TeamUpsertResponse, *Response, error)
Create or update a team.
Create a new team or update an existing one. Pass `team_id` to update.
API: POST /team/upsert (team-write-upsert).
type TemplateCreateRequest ¶
type TemplateCreateRequest struct {
// Free-form description. Up to 500 characters.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// DingTalk robot message template source.
Dingtalk string `json:"dingtalk,omitempty" toon:"dingtalk,omitempty"`
// DingTalk app message template source.
DingtalkApp string `json:"dingtalk_app,omitempty" toon:"dingtalk_app,omitempty"`
// Show the Create War Room button on DingTalk app cards.
DingtalkAppWarRoomEnabled bool `json:"dingtalk_app_war_room_enabled,omitempty" toon:"dingtalk_app_war_room_enabled,omitempty"`
// Email body template source (Go `html/template` syntax).
Email string `json:"email,omitempty" toon:"email,omitempty"`
// Feishu robot message template source.
Feishu string `json:"feishu,omitempty" toon:"feishu,omitempty"`
// Feishu app message template source.
FeishuApp string `json:"feishu_app,omitempty" toon:"feishu_app,omitempty"`
// Keep blank lines in the body of Feishu app card v2 messages.
FeishuAppCardV2PreserveBlankLines bool `json:"feishu_app_card_v2_preserve_blank_lines,omitempty" toon:"feishu_app_card_v2_preserve_blank_lines,omitempty"`
// Render Markdown tables in the `feishu_app` content as native Feishu card tables.
FeishuAppCardV2TableEnabled bool `json:"feishu_app_card_v2_table_enabled,omitempty" toon:"feishu_app_card_v2_table_enabled,omitempty"`
// Show the Create War Room button on Feishu app cards.
FeishuAppWarRoomEnabled bool `json:"feishu_app_war_room_enabled,omitempty" toon:"feishu_app_war_room_enabled,omitempty"`
// IM apps whose closed-incident cards keep the custom action buttons. Supported values: `feishu_app`, `dingtalk_app`, `wecom_app`, `slack_app`, `teams_app`. An empty list hides the buttons on every app.
IncidentCardClosedActionApps []string `json:"incident_card_closed_action_apps,omitempty" toon:"incident_card_closed_action_apps,omitempty"`
// Incident card fields to hide per IM app type.
IncidentCardHiddenFields IncidentCardHiddenFields `json:"incident_card_hidden_fields,omitempty" toon:"incident_card_hidden_fields,omitempty"`
// Slack robot message template source.
Slack string `json:"slack,omitempty" toon:"slack,omitempty"`
// Slack app message template source.
SlackApp string `json:"slack_app,omitempty" toon:"slack_app,omitempty"`
// Show the Create War Room button on Slack app cards.
SlackAppWarRoomEnabled bool `json:"slack_app_war_room_enabled,omitempty" toon:"slack_app_war_room_enabled,omitempty"`
// SMS template source (Go `text/template` syntax).
SMS string `json:"sms,omitempty" toon:"sms,omitempty"`
// Owning team ID from `POST /team/list`; `0` (default) means account-wide. A non-zero ID must be an existing team.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Microsoft Teams app message template source.
TeamsApp string `json:"teams_app,omitempty" toon:"teams_app,omitempty"`
// Telegram bot message template source.
Telegram string `json:"telegram,omitempty" toon:"telegram,omitempty"`
// Template name, 1–39 characters, unique among the account's non-deleted templates and different from the built-in preset template's name in every supported language.
TemplateName string `json:"template_name" toon:"template_name"`
// Voice call script template source.
Voice string `json:"voice,omitempty" toon:"voice,omitempty"`
// WeCom robot message template source.
Wecom string `json:"wecom,omitempty" toon:"wecom,omitempty"`
// WeCom app message template source.
WecomApp string `json:"wecom_app,omitempty" toon:"wecom_app,omitempty"`
// Send WeCom robot notifications as `markdown_v2` messages instead of plain markdown. While enabled, the rendered `wecom` content must be at most 4,096 bytes.
WecomMarkdownV2Enabled bool `json:"wecom_markdown_v2_enabled,omitempty" toon:"wecom_markdown_v2_enabled,omitempty"`
// Zoom bot message template source.
Zoom string `json:"zoom,omitempty" toon:"zoom,omitempty"`
}
TemplateCreateRequest is generated from the Flashduty OpenAPI schema.
type TemplateCreateResponse ¶
type TemplateCreateResponse struct {
// Newly created template ID.
TemplateID string `json:"template_id" toon:"template_id"`
// Template name echoed from the request.
TemplateName string `json:"template_name" toon:"template_name"`
}
TemplateCreateResponse is generated from the Flashduty OpenAPI schema.
type TemplateIDRequest ¶
type TemplateIDRequest struct {
// Target template ID. Pass `6321aad26c12104586a88916` to address the built-in preset.
TemplateID string `json:"template_id" toon:"template_id"`
}
TemplateIDRequest is generated from the Flashduty OpenAPI schema.
type TemplateItem ¶
type TemplateItem struct {
// ID of the owning account.
AccountID int64 `json:"account_id" toon:"account_id"`
// Unix epoch seconds the template was created.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Member ID of the creator.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Unix epoch seconds the template was soft-deleted. Absent (omitempty) when the template is live.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Free-form description (up to 500 characters); empty string when none was given.
Description string `json:"description" toon:"description"`
// DingTalk robot message template source.
Dingtalk string `json:"dingtalk" toon:"dingtalk"`
// DingTalk app message template source.
DingtalkApp string `json:"dingtalk_app" toon:"dingtalk_app"`
// Whether DingTalk app cards show the Create War Room button. Hidden for closed incidents and when the incident has no responders.
DingtalkAppWarRoomEnabled bool `json:"dingtalk_app_war_room_enabled" toon:"dingtalk_app_war_room_enabled"`
// Email body template source (Go `html/template` syntax).
Email string `json:"email" toon:"email"`
// Feishu robot message template source.
Feishu string `json:"feishu" toon:"feishu"`
// Feishu app message template source.
FeishuApp string `json:"feishu_app" toon:"feishu_app"`
// Whether Feishu app card v2 messages keep blank lines in the body.
FeishuAppCardV2PreserveBlankLines bool `json:"feishu_app_card_v2_preserve_blank_lines" toon:"feishu_app_card_v2_preserve_blank_lines"`
// Whether Markdown tables in the `feishu_app` content are rendered as native Feishu card tables.
FeishuAppCardV2TableEnabled bool `json:"feishu_app_card_v2_table_enabled" toon:"feishu_app_card_v2_table_enabled"`
// Whether Feishu app cards show the Create War Room button. Hidden when the incident has no responders.
FeishuAppWarRoomEnabled bool `json:"feishu_app_war_room_enabled" toon:"feishu_app_war_room_enabled"`
// IM apps whose cards for closed incidents keep the custom action buttons (open incidents always show them). Values: `feishu_app`, `dingtalk_app`, `wecom_app`, `slack_app`, `teams_app`. Empty or `null` hides the buttons on closed-incident cards in every app.
IncidentCardClosedActionApps []string `json:"incident_card_closed_action_apps" toon:"incident_card_closed_action_apps"`
// Incident card fields hidden per IM app type; an empty object when none are configured.
IncidentCardHiddenFields IncidentCardHiddenFields `json:"incident_card_hidden_fields" toon:"incident_card_hidden_fields"`
// Slack robot message template source.
Slack string `json:"slack" toon:"slack"`
// Slack app message template source.
SlackApp string `json:"slack_app" toon:"slack_app"`
// Whether Slack app cards show the Create War Room button. Hidden for closed incidents and when the incident has no responders.
SlackAppWarRoomEnabled bool `json:"slack_app_war_room_enabled" toon:"slack_app_war_room_enabled"`
// SMS template source (Go `text/template` syntax).
SMS string `json:"sms" toon:"sms"`
// Template status.
// - `enabled`: usable by escalation rules.
// - `disabled`: not used for new notifications; cannot be set through this API.
// - `deleted`: soft-deleted by `/template/delete`; excluded from `/template/list` but still returned by `/template/info`.
Status string `json:"status" toon:"status"`
// ID of the team this template is scoped to, or 0 for account-wide.
TeamID int64 `json:"team_id" toon:"team_id"`
// Microsoft Teams app message template source.
TeamsApp string `json:"teams_app" toon:"teams_app"`
// Telegram bot message template source.
Telegram string `json:"telegram" toon:"telegram"`
// Template ID (24-character hex). The built-in preset template always has the ID `6321aad26c12104586a88916`.
TemplateID string `json:"template_id" toon:"template_id"`
// Unique template name within the account.
TemplateName string `json:"template_name" toon:"template_name"`
// Unix epoch seconds the template was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Member ID of the last editor.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Voice call script template source.
Voice string `json:"voice" toon:"voice"`
// WeCom robot message template source.
Wecom string `json:"wecom" toon:"wecom"`
// WeCom app message template source.
WecomApp string `json:"wecom_app" toon:"wecom_app"`
// Whether WeCom robot notifications use the `markdown_v2` message format.
WecomMarkdownV2Enabled bool `json:"wecom_markdown_v2_enabled" toon:"wecom_markdown_v2_enabled"`
// Zoom bot message template source.
Zoom string `json:"zoom" toon:"zoom"`
}
TemplateItem is generated from the Flashduty OpenAPI schema.
type TemplateListRequest ¶
type TemplateListRequest struct {
ListOptions
// Sort ascending when `true`; defaults to newest first.
Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
// Filter by creator member ID; obtain member IDs from `POST /member/list`.
CreatorID *int64 `json:"creator_id,omitempty" toon:"creator_id,omitempty"`
// When `true`, only templates of teams the caller belongs to are returned. If `team_ids` is also sent, only teams in both lists are kept. When they share no team, or the caller belongs to no team, the result is empty.
IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
// Sort field: `created_at` (default, creation time) or `updated_at` (last update time).
Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
// Case-insensitive regular expression matched against `template_name`; an invalid expression is matched as literal text.
Query string `json:"query,omitempty" toon:"query,omitempty"`
// Return only templates of these team IDs (from `POST /team/list`); `0` selects account-wide templates. Empty or omitted applies no team filter. See `is_my_team` for how the two combine.
TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}
TemplateListRequest is generated from the Flashduty OpenAPI schema.
type TemplateListResponse ¶
type TemplateListResponse struct {
// True if another page exists after the returned one.
HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
// Notification templates on the current page; the first item of the first page is always the built-in preset template.
Items []TemplateItem `json:"items" toon:"items"`
// Total number of templates matching the filter, across all pages (including the built-in preset template).
Total int64 `json:"total" toon:"total"`
}
TemplateListResponse is generated from the Flashduty OpenAPI schema.
type TemplateUpdateRequest ¶
type TemplateUpdateRequest struct {
// Free-form description. Up to 500 characters. Omit to keep the current content; send an empty string to clear it.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// DingTalk robot message template source. Omit to keep the current content; send an empty string to clear it.
Dingtalk *string `json:"dingtalk,omitempty" toon:"dingtalk,omitempty"`
// DingTalk app message template source. Omit to keep the current content; send an empty string to clear it.
DingtalkApp *string `json:"dingtalk_app,omitempty" toon:"dingtalk_app,omitempty"`
// When set, show or hide the Create War Room button on DingTalk app cards. Omit to keep the existing setting.
DingtalkAppWarRoomEnabled *bool `json:"dingtalk_app_war_room_enabled,omitempty" toon:"dingtalk_app_war_room_enabled,omitempty"`
// Email body template source (Go `html/template` syntax). Omit to keep the current content; send an empty string to clear it.
Email *string `json:"email,omitempty" toon:"email,omitempty"`
// Feishu robot message template source. Omit to keep the current content; send an empty string to clear it.
Feishu *string `json:"feishu,omitempty" toon:"feishu,omitempty"`
// Feishu app message template source. Omit to keep the current content; send an empty string to clear it.
FeishuApp *string `json:"feishu_app,omitempty" toon:"feishu_app,omitempty"`
// When set, keep or drop blank lines in the body of Feishu app card v2 messages. Omit to keep the existing setting.
FeishuAppCardV2PreserveBlankLines *bool `json:"feishu_app_card_v2_preserve_blank_lines,omitempty" toon:"feishu_app_card_v2_preserve_blank_lines,omitempty"`
// Render Markdown tables in the `feishu_app` content as native Feishu card tables. Omit to keep the current setting.
FeishuAppCardV2TableEnabled *bool `json:"feishu_app_card_v2_table_enabled,omitempty" toon:"feishu_app_card_v2_table_enabled,omitempty"`
// When set, show or hide the Create War Room button on Feishu app cards. Omit to keep the existing setting.
FeishuAppWarRoomEnabled *bool `json:"feishu_app_war_room_enabled,omitempty" toon:"feishu_app_war_room_enabled,omitempty"`
// Replaces the retained-app list when sent. Supported values: `feishu_app`, `dingtalk_app`, `wecom_app`, `slack_app`, `teams_app`. Omit the field to leave it unchanged.
IncidentCardClosedActionApps []string `json:"incident_card_closed_action_apps,omitempty" toon:"incident_card_closed_action_apps,omitempty"`
// Incident card fields to hide per IM app type. When sent, replaces the stored value as a whole; omit to keep.
IncidentCardHiddenFields IncidentCardHiddenFields `json:"incident_card_hidden_fields,omitempty" toon:"incident_card_hidden_fields,omitempty"`
// Slack robot message template source. Omit to keep the current content; send an empty string to clear it.
Slack *string `json:"slack,omitempty" toon:"slack,omitempty"`
// Slack app message template source. Omit to keep the current content; send an empty string to clear it.
SlackApp *string `json:"slack_app,omitempty" toon:"slack_app,omitempty"`
// When set, show or hide the Create War Room button on Slack app cards. Omit to keep the existing setting.
SlackAppWarRoomEnabled *bool `json:"slack_app_war_room_enabled,omitempty" toon:"slack_app_war_room_enabled,omitempty"`
// SMS template source (Go `text/template` syntax). Omit to keep the current content; send an empty string to clear it.
SMS *string `json:"sms,omitempty" toon:"sms,omitempty"`
// Team scope. 0 for account-wide. Omit to keep the template's current team.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// Microsoft Teams app message template source. Omit to keep the current content; send an empty string to clear it.
TeamsApp *string `json:"teams_app,omitempty" toon:"teams_app,omitempty"`
// Telegram bot message template source. Omit to keep the current content; send an empty string to clear it.
Telegram *string `json:"telegram,omitempty" toon:"telegram,omitempty"`
// Target template ID; obtain it from `POST /template/list`.
TemplateID string `json:"template_id" toon:"template_id"`
// Template name, 1–39 characters. Required and written on every call; must not be used by another template.
TemplateName string `json:"template_name" toon:"template_name"`
// Voice call script template source. Omit to keep the current content; send an empty string to clear it.
Voice *string `json:"voice,omitempty" toon:"voice,omitempty"`
// WeCom robot message template source. Omit to keep the current content; send an empty string to clear it.
Wecom *string `json:"wecom,omitempty" toon:"wecom,omitempty"`
// WeCom app message template source. Omit to keep the current content; send an empty string to clear it.
WecomApp *string `json:"wecom_app,omitempty" toon:"wecom_app,omitempty"`
// Send WeCom robot notifications as `markdown_v2` messages instead of plain markdown. While enabled, the rendered `wecom` content must be at most 4,096 bytes. Omit to keep the current setting.
WecomMarkdownV2Enabled *bool `json:"wecom_markdown_v2_enabled,omitempty" toon:"wecom_markdown_v2_enabled,omitempty"`
// Zoom bot message template source. Omit to keep the current content; send an empty string to clear it.
Zoom *string `json:"zoom,omitempty" toon:"zoom,omitempty"`
}
TemplateUpdateRequest is generated from the Flashduty OpenAPI schema.
type TencentCLSQueryParams ¶ added in v0.15.2
type TencentCLSQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
// Tencent Cloud region, e.g. `ap-guangzhou`.
Region string `json:"region"`
// CLS log topic ID.
TopicID string `json:"topic_id"`
// Search syntax: `cql` or `lucene`.
Syntax string `json:"syntax"`
// Maximum raw-log entries to return (1–1000); only bounds raw logs, not
// SQL rows or scanned data.
Limit *int64 `json:"limit,omitempty"`
// Raw-log retrieval order: `latest` or `earliest`.
Direction *string `json:"direction,omitempty"`
}
TencentCLSQueryParams are the params for `tencent_cls.query` on Tencent Cloud CLS. Execution.Kind must be `window`.
type TimeFilter ¶
type TimeFilter struct {
// Service calendar ID from `POST /calendar/list` (for example `cal.xxxx`). When set, the window applies only on the calendar's workdays or days off, as chosen by `is_off`.
CalID string `json:"cal_id,omitempty" toon:"cal_id,omitempty"`
// Window end, `HH:MM`, inclusive (`23:59` lasts to midnight).
End string `json:"end" toon:"end"`
// Used with `cal_id`: `true` applies the window only on the calendar's days off, `false` only on its workdays.
IsOff bool `json:"is_off,omitempty" toon:"is_off,omitempty"`
// Days of the week the window applies on: `0` = Sunday … `6` = Saturday. Empty means every day.
Repeat []int64 `json:"repeat,omitempty" toon:"repeat,omitempty"`
// Window start, `HH:MM`, inclusive.
Start string `json:"start" toon:"start"`
}
TimeFilter is generated from the Flashduty OpenAPI schema.
type Timestamp ¶ added in v0.3.0
type Timestamp int64
Timestamp is a Unix-seconds instant as it appears on the Flashduty API wire.
It marshals to an RFC3339 string in the local timezone, so structured output is human- and LLM-readable instead of an opaque integer. It unmarshals from either a numeric epoch (the wire form) or an RFC3339 string (so a marshaled value round-trips). The zero value marshals to 0 — an unset sentinel, never a 1970 date — and is dropped by `json:",omitempty"`.
Use Timestamp only for absolute instants. Durations, cyclic-window offsets, and counts stay int64.
func (Timestamp) IsZero ¶ added in v0.3.0
IsZero reports whether the value is the unset sentinel (0).
func (Timestamp) MarshalJSON ¶ added in v0.3.0
MarshalJSON renders a non-zero value as a quoted RFC3339 string in the local timezone; zero renders as the bare integer 0.
func (Timestamp) String ¶ added in v0.3.0
String renders the instant as RFC3339 in the local timezone, or "0" when unset. Non-JSON encoders (TOON, fmt) render the value through this method.
func (*Timestamp) UnmarshalJSON ¶ added in v0.3.0
UnmarshalJSON accepts a numeric Unix-seconds epoch, a quoted integer, an RFC3339 string, or null (→ 0).
type TimestampMilli ¶ added in v0.3.0
type TimestampMilli int64
TimestampMilli is a Unix-milliseconds instant. It has the same rendering contract as Timestamp (RFC3339 out, epoch-or-RFC3339 in, zero→0); only the wire unit differs.
func (TimestampMilli) IsZero ¶ added in v0.3.0
func (t TimestampMilli) IsZero() bool
IsZero reports whether the value is the unset sentinel (0).
func (TimestampMilli) MarshalJSON ¶ added in v0.3.0
func (t TimestampMilli) MarshalJSON() ([]byte, error)
MarshalJSON renders a non-zero value as a quoted RFC3339 string in the local timezone; zero renders as the bare integer 0. RFC3339Nano is used so that sub-second (millisecond) precision survives a marshal→unmarshal round-trip; it elides trailing zeros, so whole-second values render identically to a plain RFC3339 timestamp.
func (TimestampMilli) String ¶ added in v0.3.0
func (t TimestampMilli) String() string
String renders the instant as RFC3339Nano in the local timezone (preserving sub-second precision), or "0" when unset. Non-JSON encoders (TOON, fmt) render the value through this method.
func (TimestampMilli) Time ¶ added in v0.3.0
func (t TimestampMilli) Time() time.Time
Time returns the instant as a time.Time.
func (TimestampMilli) Unix ¶ added in v0.3.0
func (t TimestampMilli) Unix() int64
Unix returns the raw wire value (milliseconds since the Unix epoch).
func (*TimestampMilli) UnmarshalJSON ¶ added in v0.3.0
func (t *TimestampMilli) UnmarshalJSON(b []byte) error
UnmarshalJSON accepts a numeric Unix-milliseconds epoch, a quoted integer, an RFC3339 string, or null (→ 0).
type TryLinkPersonRequest ¶ added in v0.5.4
type TryLinkPersonRequest struct {
// IM integration ID; obtain it from `POST /datasource/im/war-room-enabled/list`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}
TryLinkPersonRequest is generated from the Flashduty OpenAPI schema.
type TryLinkPersonResponse ¶ added in v0.5.4
type TryLinkPersonResponse struct {
// Person IDs linked to the IM app during this call. Empty when nobody was newly linked.
NewLinkedPersonIDs []int64 `json:"new_linked_person_ids" toon:"new_linked_person_ids"`
// Unlinked members skipped because they have neither an email nor a phone number.
NoContactCount int64 `json:"no_contact_count" toon:"no_contact_count"`
// Members with an email or phone that were looked up but not newly linked: not found on the IM platform, the IM account is already linked to another member, or the lookup failed for them.
UnmatchedCount int64 `json:"unmatched_count" toon:"unmatched_count"`
}
TryLinkPersonResponse is generated from the Flashduty OpenAPI schema.
type UnackIncidentRequest ¶
type UnackIncidentRequest struct {
// Incident IDs to unacknowledge. At most 100 per call.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
}
UnackIncidentRequest is generated from the Flashduty OpenAPI schema.
type UnsubscribeRuleItem ¶
type UnsubscribeRuleItem struct {
// ID of the account the rule belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// ID of the channel the rule belongs to.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Creation time, Unix timestamp in seconds.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Deletion time, Unix timestamp in seconds. Omitted unless the rule is soft-deleted; deleted rules are excluded from list responses.
DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
// Rule description.
Description string `json:"description" toon:"description"`
// Alert event conditions (OR of AND groups); matching events are discarded entirely. Empty means the rule matches nothing; `null` when the last update omitted `filters`.
Filters FilterGroup `json:"filters" toon:"filters"`
// Rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Drop rule name, 1–39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Rule status: `enabled` or `disabled`; deleted rules never appear in the list.
Status string `json:"status" toon:"status"`
// Last update time, Unix timestamp in seconds.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// ID of the user who last updated the rule.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
UnsubscribeRuleItem is generated from the Flashduty OpenAPI schema.
type UpdateChannelRequest ¶
type UpdateChannelRequest struct {
// How the auto-resolve timer runs: `trigger` starts it once when the incident is triggered, `update` restarts it whenever a new alert merges in. Applied only together with `auto_resolve_timeout`; if `auto_resolve_timeout` is sent without it, the mode resets to `trigger`.
AutoResolveMode string `json:"auto_resolve_mode,omitempty" toon:"auto_resolve_mode,omitempty"`
// Auto-resolve timeout in seconds. 0 disables auto-resolve. Max 30 days.
AutoResolveTimeout *int64 `json:"auto_resolve_timeout,omitempty" toon:"auto_resolve_timeout,omitempty"`
// ID of the channel to update; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// New channel name, 1–59 characters, unique within the account. A changed name must not contain a comma or start or end with whitespace. Omit or pass `null` to keep the current name.
ChannelName *string `json:"channel_name,omitempty" toon:"channel_name,omitempty"`
// New description. Up to 500 characters.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// Disable automatic incident closing.
DisableAutoClose *bool `json:"disable_auto_close,omitempty" toon:"disable_auto_close,omitempty"`
// Disable outlier incident detection.
DisableOutlierDetection *bool `json:"disable_outlier_detection,omitempty" toon:"disable_outlier_detection,omitempty"`
// Alert event merge configuration; replaces the stored configuration as a whole when present.
EventGroup EventGroup `json:"event_group,omitzero" toon:"event_group,omitempty"`
// Flapping detection configuration; replaces the stored configuration as a whole when present.
Flapping Flapping `json:"flapping,omitzero" toon:"flapping,omitempty"`
// Alert grouping configuration; replaces the stored configuration as a whole when present.
Group Group `json:"group,omitzero" toon:"group,omitempty"`
// `true` enables external reporting and generates a new token, returned in the response (any previous token stops working); `false` disables it and clears the token.
IsExternalReportEnabled *bool `json:"is_external_report_enabled,omitempty" toon:"is_external_report_enabled,omitempty"`
// When true, the channel is visible only to its managing teams.
IsPrivate *bool `json:"is_private,omitempty" toon:"is_private,omitempty"`
// Replaces the additional managing teams, up to 3; every ID must exist. Pass `[]` to remove them all; omit to keep the current list.
ManagingTeamIDs []int64 `json:"managing_team_ids,omitempty" toon:"managing_team_ids,omitempty"`
// New owning team ID; obtain it from `POST /team/list`. Must exist. Omit or pass `null` to keep the current team.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
UpdateChannelRequest is generated from the Flashduty OpenAPI schema.
type UpdateChannelResponse ¶
type UpdateChannelResponse struct {
// Newly generated token for external reporters; the previous token stops working. It can be read again later from `external_report_token` in `POST /channel/info`.
ExternalReportToken string `json:"external_report_token" toon:"external_report_token"`
}
UpdateChannelResponse is generated from the Flashduty OpenAPI schema.
type UpdateDropRuleRequest ¶
type UpdateDropRuleRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters. Omitting it clears the stored description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Alert event conditions (OR of AND groups); matching events are discarded entirely. Keys: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`. The stored conditions are replaced; omitting this field clears them and the rule then matches nothing.
Filters FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
// Drop rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
}
UpdateDropRuleRequest is generated from the Flashduty OpenAPI schema.
type UpdateEscalationRuleRequest ¶
type UpdateEscalationRuleRequest struct {
// Delay in seconds before the first notification for a newly assigned incident; `0` notifies immediately. Omitting it resets the value to `0`.
AggrWindow int64 `json:"aggr_window,omitempty" toon:"aggr_window,omitempty"`
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters. Omitting it clears the stored description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Incident conditions (OR of AND groups), matched against the incident the alert was grouped into, not against the alert. Keys: `title`, `description`, `severity` (alias `incident_severity`, `alert_severity`), `status` (alias `incident_status`, `alert_status`), `dedup_key`, `integration_id` (alias `data_source_id`), or any `labels.<name>`. Replaces the stored conditions; omit or leave empty to match every incident in the channel.
Filters FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
// Escalation levels in order. At least one level is required.
Layers []EscalateLayer `json:"layers" toon:"layers"`
// Evaluation order; lower values are evaluated first. Omit or pass `null` to keep the current value.
Priority *int64 `json:"priority,omitempty" toon:"priority,omitempty"`
// Escalation rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Notification template ID (24-character hex); obtain it from `POST /template/list`. Must exist.
TemplateID string `json:"template_id" toon:"template_id"`
// Recurring time windows during which the rule can match. Replaces the stored windows; omit or leave empty to match at any time.
TimeFilters []TimeFilter `json:"time_filters,omitempty" toon:"time_filters,omitempty"`
}
UpdateEscalationRuleRequest is generated from the Flashduty OpenAPI schema.
type UpdateFieldRequest ¶
type UpdateFieldRequest struct {
// New default value; its type must match the field's `field_type`. Always written: omitting it clears the default.
DefaultValue any `json:"default_value,omitempty" toon:"default_value,omitempty"`
// New description. Always written: omitting it clears the description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// New display name (max 39 characters); must stay unique among non-deleted fields. Always written.
DisplayName string `json:"display_name,omitempty" toon:"display_name,omitempty"`
// Field ID — 24-character hex ObjectID.
FieldID string `json:"field_id" toon:"field_id"`
// Replacement options list. Must obey the same per-type rules as create. Note: the update always overwrites `display_name`, `description`, `options`, and `default_value` with the submitted values, so for `single_select`/`multi_select` fields a non-empty `options` list must be sent on every update.
Options []string `json:"options,omitempty" toon:"options,omitempty"`
}
UpdateFieldRequest is generated from the Flashduty OpenAPI schema.
type UpdateIncidentCommentTypeRequest ¶ added in v0.8.0
type UpdateIncidentCommentTypeRequest struct {
// New label color as a hex value in #RRGGBB format. Normalized to uppercase.
Color string `json:"color,omitempty" toon:"color,omitempty"`
// ID of the comment type to update (24-character hex ObjectID).
CommentTypeID string `json:"comment_type_id" toon:"comment_type_id"`
// New display name. Trimmed before storing; must be unique within the account (case-insensitive). At most 40 characters. Must not contain control or text-direction characters.
Name string `json:"name,omitempty" toon:"name,omitempty"`
}
UpdateIncidentCommentTypeRequest is generated from the Flashduty OpenAPI schema.
type UpdateIncidentFieldsRequest ¶
type UpdateIncidentFieldsRequest struct {
// New description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// New impact description.
Impact string `json:"impact,omitempty" toon:"impact,omitempty"`
// Incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// New severity: `Info`, `Warning` or `Critical` (most severe).
IncidentSeverity string `json:"incident_severity,omitempty" toon:"incident_severity,omitempty"`
// New resolution notes.
Resolution string `json:"resolution,omitempty" toon:"resolution,omitempty"`
// New root cause analysis.
RootCause string `json:"root_cause,omitempty" toon:"root_cause,omitempty"`
// New incident title.
Title string `json:"title,omitempty" toon:"title,omitempty"`
}
UpdateIncidentFieldsRequest is generated from the Flashduty OpenAPI schema.
type UpdateInhibitRuleRequest ¶
type UpdateInhibitRuleRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters. Omitting it clears the stored description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Keys whose values must be equal on the source alert and the incoming event. Only `title`, `severity` and `labels.<name>` take effect; any other key (for example `data_source_id`) is accepted but makes the rule never fire. Must be present; an empty array also makes the rule inert.
Equals []string `json:"equals" toon:"equals"`
// When true, matching alert events are discarded entirely; when false, alerts are still recorded but marked as muted by this rule. Omitting it sets it to `false`.
IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
// Inhibit rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// Conditions the source (inhibiting) alert must match, evaluated against active alerts already stored in the channel. Keys: `title`, `description`, `severity` (alias `incident_severity`, `alert_severity`), `status` (alias `incident_status`, `alert_status`), or any `labels.<name>`. Empty makes the rule inert. Omitting it clears the stored conditions.
SourceFilters FilterGroup `json:"source_filters,omitempty" toon:"source_filters,omitempty"`
// Conditions the incoming target alert event must match to be inhibited; empty means every incoming event is a target. Keys: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`. Omitting it clears the stored conditions.
TargetFilters FilterGroup `json:"target_filters,omitempty" toon:"target_filters,omitempty"`
}
UpdateInhibitRuleRequest is generated from the Flashduty OpenAPI schema.
type UpdateIntegrationRequest ¶ added in v0.15.9
type UpdateIntegrationRequest struct {
// New description, at most 499 characters.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// ID of a public integration, returned by `POST /integration/list`. An unknown ID or a channel-owned integration returns `ResourceNotFound`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Run the plugin test when submitting `settings`; no test is performed for a metadata-only update.
IsTest bool `json:"is_test,omitempty" toon:"is_test,omitempty"`
// New name, 2–49 characters.
Name *string `json:"name,omitempty" toon:"name,omitempty"`
// Replacement type-specific configuration. Known sensitive fields omitted or sent as `******` keep their stored value; an explicit empty headers object clears headers. A stored secret cannot be kept while its destination (such as `endpoint`, `url`, or a database host or port) changes.
Settings map[string]any `json:"settings,omitempty" toon:"settings,omitempty"`
// New owning team ID; `0` clears the team assignment.
TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}
UpdateIntegrationRequest is generated from the Flashduty OpenAPI schema.
type UpdateRemoteConfigRequest ¶ added in v0.15.2
type UpdateRemoteConfigRequest struct {
// RUM application ID. Get application IDs via `POST /rum/application/list`.
ApplicationID string `json:"application_id" toon:"application_id"`
// The complete configuration to publish.
Config RemoteConfig `json:"config" toon:"config"`
// Optional free-text note (not an enum) on why this version was published, at most 255 characters; stored verbatim and returned as `reason` by `POST /rum/application/remote-config/history/list`.
Reason string `json:"reason,omitempty" toon:"reason,omitempty"`
}
UpdateRemoteConfigRequest is generated from the Flashduty OpenAPI schema.
type UpdateRemoteConfigResponse ¶ added in v0.15.2
type UpdateRemoteConfigResponse struct {
// Version number allocated to the published configuration (previous highest version + 1).
Version int64 `json:"version" toon:"version"`
}
UpdateRemoteConfigResponse is generated from the Flashduty OpenAPI schema.
type UpdateSilenceRuleRequest ¶
type UpdateSilenceRuleRequest struct {
// Owning channel ID; obtain it from `POST /channel/list`.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Rule description, up to 500 characters. Omitting it clears the stored description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Alert event conditions (OR of AND groups); matching events are silenced while the time window is active. Required, with at least one condition. Keys: `title`, `description`, `severity` (alias `alert_severity`, `event_severity`), `status`, `alert_key`, `title_rule`, `integration_id` (alias `data_source_id`), or any `labels.<name>`.
Filters FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
// When true, a rule with a one-off `time_filter` is permanently removed about 24 hours after `end_time` (or after its last update, whichever is later). Rules created with `from_incident_id` are cleaned up the same way. Rules with recurring `time_filters` are never removed automatically. Omitting it sets it to `false`.
IsAutoDelete bool `json:"is_auto_delete,omitempty" toon:"is_auto_delete,omitempty"`
// When true, matching alert events are discarded entirely; when false, alerts are still recorded but marked as silenced by this rule. Omitting it sets it to `false`.
IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
// Silence rule ID (MongoDB ObjectID).
RuleID string `json:"rule_id" toon:"rule_id"`
// Rule name, 1 to 39 characters.
RuleName string `json:"rule_name" toon:"rule_name"`
// One-off silence window. Mutually exclusive with `time_filters`; exactly one of the two must be set.
TimeFilter OnceTimeFilter `json:"time_filter,omitzero" toon:"time_filter,omitempty"`
// Recurring time windows. Mutually exclusive with `time_filter`.
TimeFilters []TimeFilter `json:"time_filters,omitempty" toon:"time_filters,omitempty"`
}
UpdateSilenceRuleRequest is generated from the Flashduty OpenAPI schema.
type UpdateStatusPageChangeRequest ¶
type UpdateStatusPageChangeRequest struct {
// Target change ID; obtain it from `GET /status-page/change/list`.
ChangeID int64 `json:"change_id" toon:"change_id"`
// Linked event IDs, replacing the current list. An omitted or empty array keeps the current list.
LinkedChanges []string `json:"linked_changes,omitempty" toon:"linked_changes,omitempty"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Member IDs responsible for this event, replacing the current list. An omitted or empty array keeps the current list.
Responders []int64 `json:"responders,omitempty" toon:"responders,omitempty"`
// New event title, up to 255 characters. Omit to keep the existing value.
Title *string `json:"title,omitempty" toon:"title,omitempty"`
}
UpdateStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.
type UpdateStatusPageChangeTimelineRequest ¶
type UpdateStatusPageChangeTimelineRequest struct {
// New update time in Unix seconds; must not be earlier than the previous entry or later than the next one. Omit or pass 0 to keep the current time.
AtSeconds int64 `json:"at_seconds,omitempty" toon:"at_seconds,omitempty"`
// Owning change ID; obtain it from `GET /status-page/change/list`.
ChangeID int64 `json:"change_id" toon:"change_id"`
// New update description (Markdown). Omit or pass an empty string to keep the current text; editing the latest entry also updates the event description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Target timeline update ID; obtain it from `GET /status-page/change/info`.
UpdateID string `json:"update_id" toon:"update_id"`
}
UpdateStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.
type UpdateStatusPageRequest ¶ added in v0.6.0
type UpdateStatusPageRequest struct {
// Get-in-touch contact, such as a mailto or website URL. Omit or pass null to keep the existing value.
ContactInfo *string `json:"contact_info,omitempty" toon:"contact_info,omitempty"`
// Custom domain for a public status page; must not be used by another status page. Rejected for internal pages. Omit or pass null to keep the existing value; an empty string removes the domain.
CustomDomain *string `json:"custom_domain,omitempty" toon:"custom_domain,omitempty"`
// Custom navigation links shown on the status page. Omit or pass an empty array to keep the current links.
CustomLinks []map[string]string `json:"custom_links,omitempty" toon:"custom_links,omitempty"`
// Dark-mode logo image of the status page. Omit or pass null to keep the existing value.
DarkLogo *string `json:"dark_logo,omitempty" toon:"dark_logo,omitempty"`
// How event dates are displayed: `calendar` uses a calendar view, `list` uses a list view. Omit or pass null to keep the current value; an empty string clears the setting.
DateView *string `json:"date_view,omitempty" toon:"date_view,omitempty"`
// How uptime is displayed: `chart_and_percentage` shows the chart and the percentage, `chart` shows only the chart, `none` hides uptime. Omit or pass null to keep the current value; an empty string clears the setting.
DisplayUptimeMode *string `json:"display_uptime_mode,omitempty" toon:"display_uptime_mode,omitempty"`
// Favicon of the status page. Omit or pass null to keep the existing value.
Favicon *string `json:"favicon,omitempty" toon:"favicon,omitempty"`
// Logo image of the status page. Omit or pass null to keep the existing value.
Logo *string `json:"logo,omitempty" toon:"logo,omitempty"`
// URL opened when the logo is clicked. Omit or pass null to keep the existing value.
LogoURL *string `json:"logo_url,omitempty" toon:"logo_url,omitempty"`
// Display name of the status page. Omit or pass null to keep the existing value.
Name *string `json:"name,omitempty" toon:"name,omitempty"`
PageFooter *string `json:"page_footer,omitempty" toon:"page_footer,omitempty"`
// Header content shown on the status page. Omit or pass null to keep the existing value.
PageHeader *string `json:"page_header,omitempty" toon:"page_header,omitempty"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Accepted for compatibility but not stored; it has no effect.
PageTitle *string `json:"page_title,omitempty" toon:"page_title,omitempty"`
// Subscription channel toggles. A public page can enable only `email` and an internal page only `im`. Omit or pass null to keep the existing value.
Subscription StatusPageSubscriptionItem `json:"subscription,omitzero" toon:"subscription,omitempty"`
// Event template mode used when publishing events in the console: `message` (status descriptions: per-status texts) or `pre_defined` (full status updates: complete examples with title, status, and description). Omit or pass null to keep the current value; the value is not validated.
TemplatePreference *string `json:"template_preference,omitempty" toon:"template_preference,omitempty"`
// URL-safe slug; normalized to lowercase with non-alphanumeric characters replaced by hyphens, and must be unique among the account's pages of the same type. Omit or pass null to keep the existing value.
URLName *string `json:"url_name,omitempty" toon:"url_name,omitempty"`
}
UpdateStatusPageRequest is generated from the Flashduty OpenAPI schema.
type UpdateWorkItemRequest ¶ added in v0.8.0
type UpdateWorkItemRequest struct {
// New description, at most 65,535 characters; `""` clears it. `null` or omitted keeps the current value.
Description *string `json:"description,omitempty" toon:"description,omitempty"`
// New free-form priority, at most 64 characters; `""` clears it. `null` or omitted keeps the current value.
Priority *string `json:"priority,omitempty" toon:"priority,omitempty"`
// New status. `null` or omitted keeps the current status.
// - `open`: not started.
// - `in_progress`: being worked on.
// - `done`: finished.
// - `cancelled`: no longer needed.
Status *string `json:"status,omitempty" toon:"status,omitempty"`
// New title, at most 512 characters; trimmed and must not be blank. `null` or omitted keeps the current title.
Title *string `json:"title,omitempty" toon:"title,omitempty"`
// The item's current `version` (≥ 1) for optimistic locking.
Version int64 `json:"version" toon:"version"`
// Work item ID (opaque string, max 128 characters).
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
UpdateWorkItemRequest is generated from the Flashduty OpenAPI schema.
type UpsertPostMortemTemplateRequest ¶ added in v0.5.4
type UpsertPostMortemTemplateRequest struct {
// Template body as BlockNote editor JSON (an array of blocks), serialized as a string. New reports created from this template start from this body.
Content string `json:"content" toon:"content"`
// Markdown version of the body, used as the outline when AI generates a report. Empty when omitted.
ContentMarkdown string `json:"content_markdown,omitempty" toon:"content_markdown,omitempty"`
// Template description; empty when omitted.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// Template name shown in the console.
Name string `json:"name" toon:"name"`
// Managing team ID. Required when creating; the team must exist. On update, a different team ID moves the template; omit it or send 0 to keep the current team.
TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
// ID of the custom template to replace. Omit it to create a new template (the server generates the ID).
TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
}
UpsertPostMortemTemplateRequest is generated from the Flashduty OpenAPI schema.
type UpsertRouteRequest ¶
type UpsertRouteRequest struct {
// Ordered list of case branches. Cases are evaluated top to bottom.
Cases []RouteCase `json:"cases,omitempty" toon:"cases,omitempty"`
// Fallback branch used when no case yields a channel. Omitting it removes any existing default branch.
Default RouteDefault `json:"default,omitzero" toon:"default,omitempty"`
// Shared integration ID; obtain it from `POST /integration/list`. Channel-exclusive integrations are rejected with `InvalidParameter`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Optional sections that group consecutive cases for display.
Sections []RouteSection `json:"sections,omitempty" toon:"sections,omitempty"`
// Ignored. The server increments `version` on every upsert and does not compare it with this value.
Version int64 `json:"version,omitempty" toon:"version,omitempty"`
}
UpsertRouteRequest is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageComponentRequest ¶ added in v0.5.4
type UpsertStatusPageComponentRequest struct {
// Components to create or update.
Components []UpsertStatusPageComponentRequestComponentsItem `json:"components" toon:"components"`
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
}
UpsertStatusPageComponentRequest is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageComponentRequestComponentsItem ¶ added in v0.5.4
type UpsertStatusPageComponentRequestComponentsItem struct {
// Time the component became available, in Unix seconds, used as the start of its uptime history. Applies only on create, defaulting to the current time; ignored on update.
AvailableSinceSeconds int64 `json:"available_since_seconds,omitempty" toon:"available_since_seconds,omitempty"`
// Component ID. Omit to create a new component; supply to update an existing one.
ComponentID string `json:"component_id,omitempty" toon:"component_id,omitempty"`
// Component description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// When true, the component is hidden entirely from summary endpoints.
HideAll bool `json:"hide_all,omitempty" toon:"hide_all,omitempty"`
// When true, uptime data is hidden from summary responses.
HideUptime bool `json:"hide_uptime,omitempty" toon:"hide_uptime,omitempty"`
// Component display name; must be unique within the page.
Name string `json:"name" toon:"name"`
// Display order within its section; on update an omitted value resets to 0.
OrderID int64 `json:"order_id,omitempty" toon:"order_id,omitempty"`
// Parent section ID; must be an existing section of the page. Omit to place the component at the top level (on update too).
SectionID string `json:"section_id,omitempty" toon:"section_id,omitempty"`
}
UpsertStatusPageComponentRequestComponentsItem is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageComponentResponse ¶ added in v0.5.4
type UpsertStatusPageComponentResponse struct {
// IDs of the created or updated components, in the same order as the request.
ComponentIDs []string `json:"component_ids" toon:"component_ids"`
}
UpsertStatusPageComponentResponse is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageSectionRequest ¶ added in v0.5.4
type UpsertStatusPageSectionRequest struct {
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Sections to create or update.
Sections []UpsertStatusPageSectionRequestSectionsItem `json:"sections" toon:"sections"`
}
UpsertStatusPageSectionRequest is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageSectionRequestSectionsItem ¶ added in v0.5.4
type UpsertStatusPageSectionRequestSectionsItem struct {
// Section description.
Description string `json:"description,omitempty" toon:"description,omitempty"`
// When true, the entire section is hidden from summary endpoints.
HideAll bool `json:"hide_all,omitempty" toon:"hide_all,omitempty"`
// When true, uptime data for all components in this section is hidden.
HideUptime bool `json:"hide_uptime,omitempty" toon:"hide_uptime,omitempty"`
// Section display name; must be unique within the page.
Name string `json:"name" toon:"name"`
// Display order of the section; on update an omitted value resets to 0.
OrderID int64 `json:"order_id,omitempty" toon:"order_id,omitempty"`
// Section ID. Omit to create a new section; supply to update an existing one.
SectionID string `json:"section_id,omitempty" toon:"section_id,omitempty"`
}
UpsertStatusPageSectionRequestSectionsItem is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageSectionResponse ¶ added in v0.5.4
type UpsertStatusPageSectionResponse struct {
// IDs of the created or updated sections, in the same order as the request.
SectionIDs []string `json:"section_ids" toon:"section_ids"`
}
UpsertStatusPageSectionResponse is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageTemplateRequest ¶ added in v0.5.4
type UpsertStatusPageTemplateRequest struct {
// Status page ID; obtain it from `GET /status-page/list`.
PageID int64 `json:"page_id" toon:"page_id"`
// Template content. Shape depends on `type`: a predefined event template for `pre_defined`, a message template for `message`.
Template any `json:"template" toon:"template"`
// Template category. `pre_defined` for predefined event templates; `message` for notification message templates.
Type string `json:"type" toon:"type"`
}
UpsertStatusPageTemplateRequest is generated from the Flashduty OpenAPI schema.
type UpsertStatusPageTemplateResponse ¶ added in v0.5.4
type UpsertStatusPageTemplateResponse struct {
// ID of the created or updated template.
TemplateID string `json:"template_id" toon:"template_id"`
}
UpsertStatusPageTemplateResponse is generated from the Flashduty OpenAPI schema.
type VictoriaLogsQueryParams ¶ added in v0.15.2
type VictoriaLogsQueryParams struct {
Expr string `json:"expr"`
Execution DatasourceQueryExecution `json:"execution"`
// Maximum raw-log entries to return (1–1000); only bounds raw logs, not
// SQL rows or scanned data.
Limit *int64 `json:"limit,omitempty"`
// Raw-log retrieval order: `latest` or `earliest`.
Direction *string `json:"direction,omitempty"`
}
VictoriaLogsQueryParams are the params for `victorialogs.query`. Expr is LogsQL. Use a `window` execution for raw logs (Limit/Direction allowed) or an `instant`/`range` execution with FromMS for stats queries (Limit/Direction rejected).
type WakeIncidentRequest ¶
type WakeIncidentRequest struct {
// Incident IDs to wake. At most 100 per call.
IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
}
WakeIncidentRequest is generated from the Flashduty OpenAPI schema.
type WarRoom ¶
type WarRoom struct {
// Chat/group ID on the IM side.
ChatID string `json:"chat_id" toon:"chat_id"`
// Chat/group display name.
ChatName string `json:"chat_name" toon:"chat_name"`
ShareLink string `json:"share_link" toon:"share_link"`
}
WarRoom is generated from the Flashduty OpenAPI schema.
type WarRoomDataSourceItem ¶ added in v0.4.0
type WarRoomDataSourceItem struct {
// Account this integration belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// Plugin category. Always `im`, because this endpoint returns only IM integrations.
Category string `json:"category" toon:"category"`
// Unix timestamp in seconds when the integration was created.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Person who created the integration.
CreatorID int64 `json:"creator_id" toon:"creator_id"`
// Integration ID.
DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
// Integration description.
Description string `json:"description" toon:"description"`
// Deprecated; always `0` in this response.
ExclusiveDataSourceID int64 `json:"exclusive_data_source_id" toon:"exclusive_data_source_id"`
// Integration ID; same value as `data_source_id`.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Push key used by alert sources to send to this integration.
IntegrationKey string `json:"integration_key" toon:"integration_key"`
// Unix timestamp in seconds of the latest upstream event. Always `0` in this response.
LastSourceTime Timestamp `json:"last_source_time" toon:"last_source_time"`
// Unix timestamp in seconds of the most recent activity in this datasource. Always `0` — this endpoint does not populate the field.
LastTime Timestamp `json:"last_time" toon:"last_time"`
// Integration name.
Name string `json:"name" toon:"name"`
// Whether the integration is read-only.
NoEditable bool `json:"no_editable" toon:"no_editable"`
// Plugin ID backing this integration.
PluginID int64 `json:"plugin_id" toon:"plugin_id"`
// IM integration type: `feishu_app` Feishu (Lark), `dingtalk_app` DingTalk, `wecom_app` WeCom, `slack_app` Slack, `teams_app` Microsoft Teams.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Localized display name of the integration plugin type.
PluginTypeName string `json:"plugin_type_name" toon:"plugin_type_name"`
// External reference ID of the integration.
RefID string `json:"ref_id" toon:"ref_id"`
// Plugin-specific configuration of the integration; includes `war_room_enabled: true`. Secret values are masked as `******`.
Settings map[string]any `json:"settings" toon:"settings"`
// Integration status: `enabled` or `disabled`. Deleted integrations are never returned.
Status string `json:"status" toon:"status"`
// Team that owns this integration.
TeamID int64 `json:"team_id" toon:"team_id"`
// Unix timestamp in seconds when the integration was last updated.
UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
// Person who last updated the integration.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}
WarRoomDataSourceItem is generated from the Flashduty OpenAPI schema.
type WarRoomItem ¶
type WarRoomItem struct {
// ID of the account that owns this record; the same for every record returned to one `app_key`.
AccountID int64 `json:"account_id" toon:"account_id"`
// Chat/group ID on the IM side.
ChatID string `json:"chat_id" toon:"chat_id"`
// Display name of the group chat on the IM side.
ChatName string `json:"chat_name" toon:"chat_name"`
// Unix timestamp (seconds) when the war room was created.
CreatedAt Timestamp `json:"created_at" toon:"created_at"`
// Member ID that created the war room.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// Associated incident ID (MongoDB ObjectID).
IncidentID string `json:"incident_id" toon:"incident_id"`
// IM integration ID.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
IntegrationUnavailable bool `json:"integration_unavailable" toon:"integration_unavailable"`
// Plugin type of the IM integration: `feishu_app` (Feishu), `dingtalk_app` (DingTalk), `wecom_app` (WeCom), or `slack_app` (Slack). Empty string when the integration no longer exists.
PluginType string `json:"plugin_type" toon:"plugin_type"`
// Record status. Always `enabled` in this list, because deleted war rooms are not returned.
Status string `json:"status" toon:"status"`
}
WarRoomItem is generated from the Flashduty OpenAPI schema.
type WarRoomPersonItem ¶ added in v0.4.0
type WarRoomPersonItem struct {
// Account this person belongs to.
AccountID int64 `json:"account_id" toon:"account_id"`
// Identity type of the person.
// - `account`: the account owner.
// - `member`: a regular member of the account.
As string `json:"as" toon:"as"`
// URL of the person's avatar image.
Avatar string `json:"avatar" toon:"avatar"`
// Email address; omitted when the member has not verified it.
Email string `json:"email" toon:"email"`
// Preferred language, e.g. `zh-CN` or `en-US`.
Locale string `json:"locale" toon:"locale"`
// Person ID: a member ID, or the account ID when the person is the account owner (`as` = `account`).
PersonID int64 `json:"person_id" toon:"person_id"`
// Display name of the person.
PersonName string `json:"person_name" toon:"person_name"`
// Phone number; omitted when the member has not verified it.
Phone string `json:"phone" toon:"phone"`
// Membership status.
// - `enabled`: active.
// - `pending`: invited but has not joined yet.
// - `deleted`: removed from the account.
Status string `json:"status" toon:"status"`
// IANA time zone name, e.g. `Asia/Shanghai`.
TimeZone string `json:"time_zone" toon:"time_zone"`
}
WarRoomPersonItem is generated from the Flashduty OpenAPI schema.
type WebhookHistoryDetail ¶
type WebhookHistoryDetail struct {
// Number of HTTP tries made for this delivery; retries happen only on connection errors.
Attempt int64 `json:"attempt" toon:"attempt"`
// Channel ID when applicable.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Name of the associated channel, resolved at query time.
ChannelName string `json:"channel_name" toon:"channel_name"`
// Total time of the delivery including retries, in milliseconds.
Duration int64 `json:"duration" toon:"duration"`
// Destination URL.
Endpoint string `json:"endpoint" toon:"endpoint"`
// Error text when the delivery failed (connection error or unexpected status code), truncated. Omitted on success.
ErrorMessage string `json:"error_message" toon:"error_message"`
// ID of this delivery record: the delivery date (`YYYYMMDD`) followed by a random suffix. Pass it to `POST /webhook/history/detail`.
EventID string `json:"event_id" toon:"event_id"`
// Event time formatted as `YYYY-MM-DD HH:MM:SS.ffffff`.
EventTime string `json:"event_time" toon:"event_time"`
// Event type code. `i_*` values are incident events (for example `i_new` = incident created); `a_*` values are alert events (for example `a_new` = alert triggered).
EventType string `json:"event_type" toon:"event_type"`
// ID of the webhook integration that sent the request.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Source object ID.
RefID string `json:"ref_id" toon:"ref_id"`
// Title of the source incident or alert, resolved at query time.
RefTitle string `json:"ref_title" toon:"ref_title"`
// JSON payload sent to the endpoint, truncated to the stored size limit.
RequestBody string `json:"request_body" toon:"request_body"`
// Serialized outbound request headers.
RequestHeaders string `json:"request_headers" toon:"request_headers"`
// Body returned by the endpoint, truncated to the stored size limit. Omitted when empty or when no response was received.
ResponseBody string `json:"response_body" toon:"response_body"`
// Serialized response headers.
ResponseHeaders string `json:"response_headers" toon:"response_headers"`
// Delivery outcome: `success` when the endpoint answered HTTP 200; `failed` on a connection error or any other status code.
Status string `json:"status" toon:"status"`
// HTTP status code returned by the endpoint; `0` when no response was received.
StatusCode int64 `json:"status_code" toon:"status_code"`
// Source object kind: `incident` or `alert`.
WebhookType string `json:"webhook_type" toon:"webhook_type"`
}
WebhookHistoryDetail is generated from the Flashduty OpenAPI schema.
type WebhookHistoryItem ¶
type WebhookHistoryItem struct {
// Number of HTTP tries made for this delivery; retries happen only on connection errors.
Attempt int64 `json:"attempt" toon:"attempt"`
// Channel ID associated with the event, when applicable.
ChannelID int64 `json:"channel_id" toon:"channel_id"`
// Total time of the delivery including retries, in milliseconds.
Duration int64 `json:"duration" toon:"duration"`
// Destination URL.
Endpoint string `json:"endpoint" toon:"endpoint"`
// Error text when the delivery failed (connection error or unexpected status code), truncated. Omitted on success.
ErrorMessage string `json:"error_message" toon:"error_message"`
// ID of this delivery record: the delivery date (`YYYYMMDD`) followed by a random suffix. Pass it to `POST /webhook/history/detail`.
EventID string `json:"event_id" toon:"event_id"`
// Event time formatted as `YYYY-MM-DD HH:MM:SS.ffffff`.
EventTime string `json:"event_time" toon:"event_time"`
// Event type code. `i_*` values are incident events (for example `i_new` = incident created); `a_*` values are alert events (for example `a_new` = alert triggered).
EventType string `json:"event_type" toon:"event_type"`
// ID of the webhook integration that sent the request.
IntegrationID int64 `json:"integration_id" toon:"integration_id"`
// Source object ID (incident ID or alert ID).
RefID string `json:"ref_id" toon:"ref_id"`
// JSON payload sent to the endpoint, truncated to the stored size limit.
RequestBody string `json:"request_body" toon:"request_body"`
// Serialized outbound request headers.
RequestHeaders string `json:"request_headers" toon:"request_headers"`
// Body returned by the endpoint, truncated to the stored size limit. Omitted when empty or when no response was received.
ResponseBody string `json:"response_body" toon:"response_body"`
// Serialized response headers from the destination.
ResponseHeaders string `json:"response_headers" toon:"response_headers"`
// Delivery outcome: `success` when the endpoint answered HTTP 200; `failed` on a connection error or any other status code.
Status string `json:"status" toon:"status"`
// HTTP status code returned by the endpoint; `0` when no response was received.
StatusCode int64 `json:"status_code" toon:"status_code"`
// Source object kind: `incident` or `alert`.
WebhookType string `json:"webhook_type" toon:"webhook_type"`
}
WebhookHistoryItem is generated from the Flashduty OpenAPI schema.
type WorkItemAssignee ¶ added in v0.15.5
type WorkItemAssignee struct {
// Member ID. Required when `type` is `person`. Omitted when `type` is `ai_sre`.
ID int64 `json:"id,omitempty" toon:"id,omitempty"`
// Assignee kind: `person` (a member) or `ai_sre` (the account AI SRE).
Type string `json:"type" toon:"type"`
}
WorkItemAssignee is generated from the Flashduty OpenAPI schema.
type WorkItemCreateResult ¶ added in v0.8.0
type WorkItemCreateResult struct {
// Member IDs of the person assignees added by this call (and notified); AI SRE is not included. Omitted when none.
AddedAssigneeIDs []int64 `json:"added_assignee_ids" toon:"added_assignee_ids"`
// True when the call replayed an earlier request with the same idempotency key and no new item was created.
IdempotentReplay bool `json:"idempotent_replay" toon:"idempotent_replay"`
Item WorkItemItem `json:"item" toon:"item"`
}
WorkItemCreateResult is generated from the Flashduty OpenAPI schema.
type WorkItemItem ¶ added in v0.8.0
type WorkItemItem struct {
// ID of the AI SRE session executing this item. Omitted when no session is recorded.
AgentSessionID string `json:"agent_session_id" toon:"agent_session_id"`
// Where that AI SRE session runs: `web` or `im`. Omitted when no session is recorded.
AgentSessionVenue string `json:"agent_session_venue" toon:"agent_session_venue"`
// Member IDs of the current person assignees. AI SRE is not included. Never null; an empty array means no person assignee.
AssigneeIDs []int64 `json:"assignee_ids" toon:"assignee_ids"`
// Current assignees. Each entry is `{type, id?}`. `type` is `person` or `ai_sre`; an `ai_sre` entry omits `id`. Never null; an empty array means unassigned. `assignee_ids` is the person-only subset of this list.
Assignees []WorkItemAssignee `json:"assignees" toon:"assignees"`
// Conversion time as a Unix timestamp in seconds. Present only after conversion.
ConvertedAtSeconds Timestamp `json:"converted_at_seconds" toon:"converted_at_seconds"`
// Member ID of the operator who converted the action into a follow-up. Present only after conversion.
ConvertedBy int64 `json:"converted_by" toon:"converted_by"`
// Creation time as a Unix timestamp in seconds.
CreatedAtSeconds Timestamp `json:"created_at_seconds" toon:"created_at_seconds"`
// Member ID of the creator.
CreatedBy int64 `json:"created_by" toon:"created_by"`
// Optional longer description (max 65,535 characters).
Description string `json:"description" toon:"description"`
// Incident ID (MongoDB ObjectID) the item is anchored to.
IncidentID string `json:"incident_id" toon:"incident_id"`
// Work item type.
// - `action`: a to-do on an incident that is not closed yet.
// - `follow_up`: a post-mortem follow-up, created on a closed incident or converted from an action.
ItemType string `json:"item_type" toon:"item_type"`
// Original identifier of the legacy follow-up this item was migrated from. Present only when `source_kind` is `legacy_follow_up`.
LegacySourceID string `json:"legacy_source_id" toon:"legacy_source_id"`
// Post-mortem ID (32-character hex string). Present only on follow-ups bound to a report; omitted otherwise.
PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
// Free-form priority, at most 64 characters; omitted when empty. The console uses `high`, `medium` and `low`, but any string set through the API is returned as-is.
Priority string `json:"priority" toon:"priority"`
// `native` for items created through this API; `legacy_follow_up` for items migrated from legacy post-mortem follow-ups.
SourceKind string `json:"source_kind" toon:"source_kind"`
// Item status: `open` (not started), `in_progress` (being worked on), `done` (finished) or `cancelled` (no longer needed). `done` and `cancelled` count as finished. Older items may still hold other free text, which counts as unfinished.
Status string `json:"status" toon:"status"`
// Item title (max 512 characters).
Title string `json:"title" toon:"title"`
// Last update time as a Unix timestamp in seconds.
UpdatedAtSeconds Timestamp `json:"updated_at_seconds" toon:"updated_at_seconds"`
// Member ID of the last updater.
UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
// Optimistic-locking version, incremented on every mutation.
Version int64 `json:"version" toon:"version"`
// Work item ID (opaque string, max 128 characters).
WorkItemID string `json:"work_item_id" toon:"work_item_id"`
}
WorkItemItem is generated from the Flashduty OpenAPI schema.
type WorkItemListResult ¶ added in v0.8.0
type WorkItemListResult struct {
// True when more results are available.
HasMore bool `json:"has_more" toon:"has_more"`
// True when the call replayed an earlier request with the same idempotency key.
IdempotentReplay bool `json:"idempotent_replay" toon:"idempotent_replay"`
// Work items for the current page.
Items []WorkItemItem `json:"items" toon:"items"`
// Cursor for the next page. Pass it as `cursor`; absent when there are no more results.
NextCursor string `json:"next_cursor" toon:"next_cursor"`
}
WorkItemListResult is generated from the Flashduty OpenAPI schema.
type WorkItemMutationResult ¶ added in v0.8.0
type WorkItemMutationResult struct {
// Member IDs of the person assignees added by this call (and notified); AI SRE is not included. Omitted when none.
AddedAssigneeIDs []int64 `json:"added_assignee_ids" toon:"added_assignee_ids"`
// True when the call replayed an earlier request with the same idempotency key.
IdempotentReplay bool `json:"idempotent_replay" toon:"idempotent_replay"`
Item WorkItemItem `json:"item" toon:"item"`
// Member IDs of the person assignees removed by this call (never notified). Omitted when none.
RemovedAssigneeIDs []int64 `json:"removed_assignee_ids" toon:"removed_assignee_ids"`
}
WorkItemMutationResult is generated from the Flashduty OpenAPI schema.
Source Files
¶
- a2a_agents.go
- account.go
- alert_enrichment.go
- alert_enrichment_upload.go
- alert_rules.go
- alerts.go
- analytics.go
- applications.go
- artifacts.go
- audit_logs.go
- automations.go
- automations_fire.go
- automations_models.go
- calendars.go
- changes.go
- channels.go
- dashboards.go
- data_query.go
- data_sources.go
- data_sources_prometheus.go
- datasource_query_params.go
- dedicated_integrations.go
- diagnostics.go
- doc.go
- error_ingestion_rules.go
- errorcodes.go
- errors.go
- facets.go
- flashduty.go
- im_integrations.go
- incidents.go
- integrations.go
- issue_preset_severity_rules.go
- issues.go
- knowledge.go
- licenses.go
- logger.go
- mcp_servers.go
- members.go
- models_gen.go
- notification_templates.go
- options.go
- pagination.go
- ptr.go
- query.go
- ratelimit.go
- redact.go
- resources.go
- roles_permissions.go
- rule_folders.go
- rule_folders_compat.go
- rum_dashboards.go
- schedules.go
- services_gen.go
- session_replay.go
- sessions.go
- sessions_export.go
- sessions_message.go
- sessions_subscribe.go
- skills.go
- skills_upload.go
- sourcemaps.go
- status_pages.go
- teams.go
- timestamp.go
- upload.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package e2e contains live end-to-end tests for the Flashduty SDK.
|
Package e2e contains live end-to-end tests for the Flashduty SDK. |
|
internal
|
|
|
cmd/gen
command
Command gen generates the typed Flashduty service layer and models from the vendored OpenAPI specification (openapi/openapi.en.json).
|
Command gen generates the typed Flashduty service layer and models from the vendored OpenAPI specification (openapi/openapi.en.json). |
|
Package retry provides a safe-by-default retrying http.RoundTripper for the Flashduty SDK, usable as a composable transport middleware.
|
Package retry provides a safe-by-default retrying http.RoundTripper for the Flashduty SDK, usable as a composable transport middleware. |