/// import * as React from 'react'; import { Entity } from '@backstage/catalog-model'; import * as _backstage_core_plugin_api from '@backstage/core-plugin-api'; import { DiscoveryApi, ConfigApi } from '@backstage/core-plugin-api'; /** @public */ declare const isSplunkOnCallAvailable: (entity: Entity) => boolean; /** @public */ type EntitySplunkOnCallCardProps = { readOnly?: boolean; }; /** @public */ type SplunkOnCallPageProps = { title?: string; subtitle?: string; pageTitle?: string; }; /** @public */ declare const splunkOnCallPlugin: _backstage_core_plugin_api.BackstagePlugin<{ root: _backstage_core_plugin_api.RouteRef; }, {}>; /** @public */ declare const SplunkOnCallPage: { (props: SplunkOnCallPageProps): JSX.Element; defaultProps: { title: string; subtitle: string; pageTitle: string; }; }; /** @public */ declare const EntitySplunkOnCallCard: (props: EntitySplunkOnCallCardProps) => React.JSX.Element; /** @public */ type Team = { name?: string; slug?: string; memberCount?: number; version?: number; isDefaultTeam?: boolean; _selfUrl?: string; _policiesUrl?: string; _membersUrl?: string; _adminsUrl?: string; }; /** @public */ type OnCall = { team?: OnCallTeamResource; oncallNow?: OnCallNowResource[]; }; /** @public */ type OnCallTeamResource = { name?: string; slug?: string; }; /** @public */ type OnCallNowResource = { escalationPolicy?: OnCallEscalationPolicyResource; users?: OnCallUsersResource[]; }; /** @public */ type OnCallEscalationPolicyResource = { name?: string; slug?: string; }; /** @public */ type OnCallUsersResource = { onCalluser?: OnCallUser; }; /** @public */ type OnCallUser = { username?: string; }; /** @public */ type User = { firstName?: string; lastName?: string; displayName?: string; username?: string; email?: string; createdAt?: string; passwordLastUpdated?: string; verified?: boolean; _selfUrl?: string; }; /** @public */ type IncidentPhase = 'UNACKED' | 'ACKED' | 'RESOLVED'; /** @public */ type Incident = { incidentNumber?: string; startTime?: string; currentPhase: IncidentPhase; entityState?: string; entityType?: string; routingKey?: string; alertCount?: number; lastAlertTime?: string; lastAlertId?: string; entityId: string; host?: string; service?: string; pagedUsers?: string[]; pagedTeams?: string[]; entityDisplayName?: string; pagedPolicies?: EscalationPolicyInfo[]; transitions?: IncidentTransition[]; firstAlertUuid?: string; monitorName?: string; monitorType?: string; incidentLink?: string; }; /** @public */ type EscalationPolicyInfo = { policy: EscalationPolicySummary; team?: EscalationPolicyTeam; }; /** @public */ type IncidentTransition = { name?: string; at?: string; by?: string; message?: string; manually?: boolean; alertId?: string; alertUrl?: string; }; /** @public */ type EscalationPolicySummary = { name: string; slug: string; _selfUrl: string; }; /** @public */ type EscalationPolicyTeam = { name: string; slug: string; }; /** @public */ type RoutingKey = { routingKey: string; targets: RoutingKeyTarget[]; isDefault: boolean; }; /** @public */ type RoutingKeyTarget = { policyName: string; policySlug: string; _teamUrl: string; }; /** @public */ type MessageType = 'CRITICAL' | 'WARNING' | 'ACKNOWLEDGEMENT' | 'INFO' | 'RECOVERY'; /** @public */ type TriggerAlarmRequest = { routingKey?: string; incidentType: MessageType; incidentId?: string; incidentDisplayName?: string; incidentMessage?: string; incidentStartTime?: number; }; /** @public */ interface SplunkOnCallApi { /** * Fetches a list of incidents */ getIncidents(): Promise; /** * Fetches the list of users in an escalation policy. */ getOnCallUsers(): Promise; /** * Triggers-Resolves-Acknowledge an incident. */ incidentAction(request: TriggerAlarmRequest): Promise; /** * Get a list of users for your organization. */ getUsers(): Promise; /** * Get a list of teams for your organization. */ getTeams(): Promise; /** * Get a list of routing keys for your organization. */ getRoutingKeys(): Promise; /** * Get a list of escalation policies for your organization. */ getEscalationPolicies(): Promise; } /** @public */ type EscalationPolicyResponse = { policies: EscalationPolicyInfo[]; }; /** @public */ type ListUserResponse = { users: User[]; _selfUrl?: string; }; /** @public */ type ListRoutingKeyResponse = { routingKeys: RoutingKey[]; _selfUrl?: string; }; /** @public */ type IncidentsResponse = { incidents: Incident[]; }; /** @public */ type OnCallsResponse = { teamsOnCall: OnCall[]; }; /** @public */ type ClientApiConfig = { eventsRestEndpoint: string | null; discoveryApi: DiscoveryApi; }; /** @public */ type RequestOptions = { method: string; headers: HeadersInit; body?: BodyInit; }; /** @public */ declare class UnauthorizedError extends Error { } /** @public */ declare const splunkOnCallApiRef: _backstage_core_plugin_api.ApiRef; /** @public */ declare class SplunkOnCallClient implements SplunkOnCallApi { private readonly config; static fromConfig(configApi: ConfigApi, discoveryApi: DiscoveryApi): SplunkOnCallClient; constructor(config: ClientApiConfig); getIncidents(): Promise; getOnCallUsers(): Promise; getTeams(): Promise; getRoutingKeys(): Promise; getUsers(): Promise; getEscalationPolicies(): Promise; incidentAction(options: TriggerAlarmRequest): Promise; private findByUrl; private request; } export { type ClientApiConfig, EntitySplunkOnCallCard, type EntitySplunkOnCallCardProps, type EscalationPolicyInfo, type EscalationPolicyResponse, type EscalationPolicySummary, type EscalationPolicyTeam, type Incident, type IncidentPhase, type IncidentTransition, type IncidentsResponse, type ListRoutingKeyResponse, type ListUserResponse, type MessageType, type OnCall, type OnCallEscalationPolicyResource, type OnCallNowResource, type OnCallTeamResource, type OnCallUser, type OnCallUsersResource, type OnCallsResponse, type RequestOptions, type RoutingKey, type RoutingKeyTarget, type SplunkOnCallApi, SplunkOnCallClient, SplunkOnCallPage, type SplunkOnCallPageProps, type Team, type TriggerAlarmRequest, UnauthorizedError, type User, isSplunkOnCallAvailable, splunkOnCallPlugin as plugin, splunkOnCallApiRef, splunkOnCallPlugin };