tests(splunk-on-call-plugin): update docs + fix unused things

This commit is contained in:
Remi
2021-02-06 20:05:52 +01:00
parent 7f33886240
commit d8df97140c
6 changed files with 45 additions and 84 deletions
+1
View File
@@ -212,6 +212,7 @@ Sneha
Snyk
sourcemaps
sparklines
Splunk
Spotifiers
spotify
Spotify
-1
View File
@@ -80,7 +80,6 @@ const routes = (
path="/tech-radar"
element={<TechRadarRouter width={1500} height={800} />}
/>
<Route path="/splunk-on-call" element={<SplunkOnCallRouter />} />
<Route path="/graphiql" element={<GraphiQLRouter />} />
<Route path="/lighthouse" element={<LighthouseRouter />} />
<Route
+41 -6
View File
@@ -1,7 +1,20 @@
# Splunk-On-Call
# Splunk On-Call
## Overview
This plugin displays Splunk On-Call information about an entity.
There is a way to trigger an new incident directly to specific users or/and specific teams.
This plugin requires that entities are annotated with a team name. See more further down in this document.
This plugin provides:
- A list of incidents
- A way to trigger a new incident to specific users or/and teams
- A way to acknowledge/resolve an incident
- Information details about the persons on-call
## Setup instructions
Install the plugin:
@@ -13,7 +26,7 @@ yarn add @backstage/plugin-splunkoncall
Add it to the app in `plugins.ts`:
```ts
export { plugin as Pagerduty } from '@backstage/plugin-splunkoncall';
export { plugin as SplunkOnCall } from '@backstage/plugin-splunk-on-call';
```
Add it to the `EntityPage.ts`:
@@ -22,7 +35,7 @@ Add it to the `EntityPage.ts`:
import {
isPluginApplicableToEntity as isSplunkOnCallAvailable,
SplunkOnCallCard,
} from '@backstage/plugin-splunkoncall';
} from '@backstage/plugin-splunk-on-call';
// add to code
{
isSplunkOnCallAvailable(entity) && (
@@ -35,11 +48,33 @@ import {
## Client configuration
## Providing the API Token
In order to be able to perform certain action (create-acknowledge-resolve an action), you need to provide the username of the user making the action.
The user supplied must be a valid Splunk On-Call user and a member of your organization.
In order for the client to make requests to the [SplunkOnCall API](https://developer.splunkoncall.com/docs/rest-api-v2/rest-api/) it needs an [API Token](https://support.splunkoncall.com/docs/generating-api-keys#generating-a-general-access-rest-api-key).
In `app-config.yaml`:
Then start the backend passing the token as an environment variable:
```yaml
splunkoncall:
username: <SPLUNK_ON_CALL_USERNAME>
```
The user supplied must be a valid Splunk On-Call user and a member of your organization.
### Adding your team name to the entity annotation
The information displayed for each entity is based on the team name.
If you want to use this plugin for an entity, you need to label it with the below annotation:
```yaml
annotations:
splunk-on-call.com/team: <SPLUNK_ON_CALL_TEAM_NAME>
```
## Providing the API key and API id
In order for the client to make requests to the [Splunk On-Call API](https://portal.victorops.com/public/api-docs.html#/) it needs an [API ID and an API Key](https://help.victorops.com/knowledge-base/api/).
Then start the backend passing the values as an environment variable:
```bash
$ SPLUNK_ON_CALL_API_KEY='' SPLUNK_ON_CALL_API_ID='' yarn start
+3 -3
View File
@@ -56,7 +56,7 @@ export interface SplunkOnCallApi {
getOnCallUsers(): Promise<OnCall[]>;
/**
* Triggers an incident to whoever is on-call.
* Triggers an incident to specific users and/or specific teams.
*/
triggerAlarm(request: TriggerAlarmRequest): Promise<Response>;
@@ -66,7 +66,7 @@ export interface SplunkOnCallApi {
resolveIncident(request: PatchIncidentRequest): Promise<Response>;
/**
* Acknowledge an incident to whoever is on-call.
* Acknowledge an incident.
*/
acknowledgeIncident(request: PatchIncidentRequest): Promise<Response>;
@@ -76,7 +76,7 @@ export interface SplunkOnCallApi {
getUsers(): Promise<User[]>;
/**
* Get a list of users for your organization.
* Get a list of teams for your organization.
*/
getTeams(): Promise<Team[]>;
@@ -1,72 +0,0 @@
/*
* Copyright 2021 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Grid, makeStyles } from '@material-ui/core';
import {
Content,
ContentHeader,
Page,
Header,
SupportButton,
} from '@backstage/core';
import { SplunkOnCallCard } from '..';
const useStyles = makeStyles(() => ({
overflowXScroll: {
overflowX: 'scroll',
},
}));
export type SplunkOnCallProps = {
title?: string;
subtitle?: string;
pageTitle?: string;
};
export const SplunkOnCallPage = ({
title,
subtitle,
pageTitle,
...props
}: SplunkOnCallProps): JSX.Element => {
const classes = useStyles();
return (
<Page themeId="tool">
<Header title={title} subtitle={subtitle} />
<Content className={classes.overflowXScroll}>
<ContentHeader title={pageTitle}>
<SupportButton>
This is used for visualizing the official guidelines of different
areas of software development such as languages, frameworks,
infrastructure and processes.
</SupportButton>
</ContentHeader>
<Grid container spacing={3} direction="row">
<Grid item xs={12}>
<SplunkOnCallCard {...props} />
</Grid>
</Grid>
</Content>
</Page>
);
};
SplunkOnCallPage.defaultProps = {
title: 'Splunk On-Call',
subtitle: 'Offers a simple way to identify incidents and escalation policies',
pageTitle: 'Welcome to Splunk On-Call in Backstage!',
};
-2
View File
@@ -23,5 +23,3 @@ export {
splunkOnCallApiRef,
UnauthorizedError,
} from './api/client';
export { SplunkOnCallPage as Router } from './components/SplunkOnCallPage';