statuspage-cli

command module
v0.0.0-...-f158b1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

Statuspage CLI

Statuspage CLI allows you to create, read, update and delete Statuspage resources.

Prerequisite

It is assumed that you have created an Atlassian Statuspage account, a page and an API key.

Getting Started

Statuspage resources exist within the scope of a page, therefore --page-id or -p is a required global flag with all commands.

The Statuspage CLI only supports key-based authentication, therefore API_KEY environment variable (default) or --key-id or -k is a required global flag with all commands.

Installing
$ go build -o statuspage
Usage
$ ./statuspage
A command line interface for Atlassian statuspage.

Usage:
  statuspage [command]

Available Commands:
  create      Creates one of more resources in statuspage
  delete      Allows you to delete one of more resources in statuspage
  get         Allows you to get one of more resources in statuspage
  help        Help about any command
  update      Allows you to update one of more resources in statuspage

Flags:
      --config string   config file (default is $HOME/.statuspage.yaml)
  -h, --help            help for statuspage
  -t, --toggle          Help message for toggle

Use "statuspage [command] --help" for more information about a command.
Get page identifier
PAGE_ID=$(./statuspage get page -k <API_KEY> | jq -r .[].id)
Get component identifier
COMPONENT_ID=$(./statuspage get component -k <API_KEY> -p $PAGE_ID | jq '.[] | select(.name=="<COMPONENT_NAME") | .id')
Create incident and associate a component
./statuspage create incident -k <API_KEY> -n 'Example incident' -b 'created by Statuspage CLI' -p $PAGE_ID -s investigating -c $COMPONENT_ID=<COMPONENT_STATUS>
Create incident and associate more than one component
COMPONENT_1_ID=$(./statuspage get component -k <API_KEY> -p $PAGE_ID | jq '.[] | select(.name=="<COMPONENT_1_NAME") | .id')

COMPONENT_2_ID=$(./statuspage get component -k <API_KEY> -p $PAGE_ID | jq '.[] | select(.name=="<COMPONENT_2_NAME") | .id')

./statuspage create incident -k <API_KEY> -n 'Example incident' -b 'created by Statuspage CLI' -p $PAGE_ID -s investigating -c $COMPONENT_1_ID=<COMPONENT_1_STATUS> -c $COMPONENT_2_ID=<COMPONENT_2_STATUS>
Update incident and associated component(s)
INCIDENT_ID=$(./statuspage get incident -k <API_KEY> -p $PAGE_ID | jq '.[] | select(.name=="<INCIDENT_NAME>") | .id')

./statuspage update incident -k <API_KEY> -b 'created by the statuspage CLI' -i $INCIDENT_ID -p $PAGE_ID -s identified -c $COMPONENT_1_ID=<COMPONENT_1_STATUS> -c $COMPONENT_2_ID=<COMPONENT_2_STATUS>

Documentation

Overview

Copyright © 2020 Appvia Ltd <[email protected]>

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL