Skip to content

Commit

Permalink
cli docs
Browse files Browse the repository at this point in the history
  • Loading branch information
83bytes committed Jul 2, 2024
1 parent de477a4 commit 872bac0
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,65 @@ action: SendToSlack
result of ENRICHMENT_STEP_1 enrichment(s): ARG1,ARG2
```

## Running the CLI

TAM is a cli application that works in 2 operating mode.
The first one is the configuration mode, where the binary can either generate a sample config or validate a config-file. This ensures that users have a way of validating a config before deploying it in an environment.

The `config mode` is accessed by using the `config` subcommand in the alertmanager cli.

```
$ ./alertmanager config --help
Use this command to validate an existing config-file or to generate a sample template
Usage:
alertmanager config [command]
Available Commands:
generate-template generate a sample config template
validate validate a config-file for errors
Flags:
-h, --help help for config
Use "alertmanager config [command] --help" for more information about a command.
```

The `server mode` is when the tam is operating as a server and accepts webhook at `url:port/webhook` api-endpoint

```
$ ./alertmanager server --help
Start the AlertManager Webhook Server
Usage:
alertmanager server [flags]
Flags:
--config-file string Path to alert config (default "./alert-manager-config.yml")
-h, --help help for server
--log-level string log-level for alertmanager; options INFO|DEBUG|ERROR (default "INFO")
--server-port int Port to listen on (default 8081)
```

## API Endpoint

### /ping

Basic health-check endpoint. Get `/ping` responds with a `pong`

### /webhook/

Accepts json as a POST request.

Sending a request using curl

```
curl -v -H "Content-Type: application/json" -X POST localhost:8081/webhook -d @basicWebhookPayload.json
```

[Sample Json Payload](./basicWebhookPayload.json)

# Design

The tam is a simple webhook server.
Expand Down

0 comments on commit 872bac0

Please sign in to comment.