From d8df97140cc8d1a95f732fc86ccc363be4298b7d Mon Sep 17 00:00:00 2001 From: Remi Date: Sat, 6 Feb 2021 20:05:52 +0100 Subject: [PATCH] tests(splunk-on-call-plugin): update docs + fix unused things --- .github/styles/vocab.txt | 1 + packages/app/src/App.tsx | 1 - plugins/splunk-on-call/README.md | 47 ++++++++++-- plugins/splunk-on-call/src/api/types.ts | 6 +- .../src/components/SplunkOnCallPage.tsx | 72 ------------------- plugins/splunk-on-call/src/index.ts | 2 - 6 files changed, 45 insertions(+), 84 deletions(-) delete mode 100644 plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index 48f2f81d9f..d012264ae2 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -212,6 +212,7 @@ Sneha Snyk sourcemaps sparklines +Splunk Spotifiers spotify Spotify diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index a349a0411e..70fceb8a01 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -80,7 +80,6 @@ const routes = ( path="/tech-radar" element={} /> - } /> } /> } /> +``` + +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: +``` + +## 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 diff --git a/plugins/splunk-on-call/src/api/types.ts b/plugins/splunk-on-call/src/api/types.ts index bf725ba158..3d6d325f58 100644 --- a/plugins/splunk-on-call/src/api/types.ts +++ b/plugins/splunk-on-call/src/api/types.ts @@ -56,7 +56,7 @@ export interface SplunkOnCallApi { getOnCallUsers(): Promise; /** - * Triggers an incident to whoever is on-call. + * Triggers an incident to specific users and/or specific teams. */ triggerAlarm(request: TriggerAlarmRequest): Promise; @@ -66,7 +66,7 @@ export interface SplunkOnCallApi { resolveIncident(request: PatchIncidentRequest): Promise; /** - * Acknowledge an incident to whoever is on-call. + * Acknowledge an incident. */ acknowledgeIncident(request: PatchIncidentRequest): Promise; @@ -76,7 +76,7 @@ export interface SplunkOnCallApi { getUsers(): Promise; /** - * Get a list of users for your organization. + * Get a list of teams for your organization. */ getTeams(): Promise; diff --git a/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx b/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx deleted file mode 100644 index 9765e6701e..0000000000 --- a/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx +++ /dev/null @@ -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 ( - -
- - - - This is used for visualizing the official guidelines of different - areas of software development such as languages, frameworks, - infrastructure and processes. - - - - - - - - - - ); -}; - -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!', -}; diff --git a/plugins/splunk-on-call/src/index.ts b/plugins/splunk-on-call/src/index.ts index 2ff5936225..8d9555d0be 100644 --- a/plugins/splunk-on-call/src/index.ts +++ b/plugins/splunk-on-call/src/index.ts @@ -23,5 +23,3 @@ export { splunkOnCallApiRef, UnauthorizedError, } from './api/client'; - -export { SplunkOnCallPage as Router } from './components/SplunkOnCallPage';