From 8c36e06da363778d4bd81b04522531c1faea1677 Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 17 Jul 2025 15:17:08 +0200 Subject: [PATCH] docs --- docs/openstatus-docs.md | 30 +++++++++++-- docs/openstatus.1 | 67 +++++++++++++++++++++++++++-- internal/monitors/monitor_create.go | 2 +- 3 files changed, 90 insertions(+), 9 deletions(-) diff --git a/docs/openstatus-docs.md b/docs/openstatus-docs.md index 138d3de..42d30d4 100644 --- a/docs/openstatus-docs.md +++ b/docs/openstatus-docs.md @@ -22,6 +22,28 @@ Usage: $ openstatus [GLOBAL FLAGS] monitors [ARGUMENTS...] ``` +### `monitors apply` subcommand + +Create or update monitors. + +> openstatus monitors apply [options] + +Creates or updates monitors according to the OpenStatus configuration file. + +Usage: + +```bash +$ openstatus [GLOBAL FLAGS] monitors apply [COMMAND FLAGS] [ARGUMENTS...] +``` + +The following flags are supported: + +| Name | Description | Default value | Environment variables | +|-----------------------------|-------------------------------------------------------|:-----------------:|:----------------------:| +| `--config="…"` (`-c`) | The configuration file containing monitor information | `openstatus.yaml` | *none* | +| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` | +| `--auto-accept` (`-y`) | Automatically accept the prompt | `false` | *none* | + ### `monitors create` subcommand Create monitors (beta). @@ -40,7 +62,7 @@ The following flags are supported: | Name | Description | Default value | Environment variables | |-----------------------------|-------------------------------------------------------|:-----------------:|:----------------------:| -| `--config="…"` | The configuration file containing monitor information | `openstatus.yaml` | *none* | +| `--config="…"` (`-c`) | The configuration file containing monitor information | `openstatus.yaml` | *none* | | `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` | | `--auto-accept` (`-y`) | Automatically accept the prompt | `false` | *none* | @@ -67,9 +89,9 @@ The following flags are supported: Export all your monitors. -> openstatus monitor export [options] +> openstatus monitors export [options] -Export all your monitors to YAML. +Export all your monitors in your workspace to a YAML file; it will also create a lock file to manage your monitors with 'apply'. Usage: @@ -88,7 +110,7 @@ The following flags are supported: Get a monitor information. -> openstatus monitor info [MonitorID] +> openstatus monitors info [MonitorID] Fetch the monitor information. The monitor information includes details such as name, description, endpoint, method, frequency, locations, active status, public status, timeout, degraded after, and body. The body is truncated to 40 characters. diff --git a/docs/openstatus.1 b/docs/openstatus.1 index 3d167e3..aa9c9e6 100644 --- a/docs/openstatus.1 +++ b/docs/openstatus.1 @@ -24,6 +24,64 @@ Usage: .EX $ openstatus [GLOBAL FLAGS] monitors [ARGUMENTS...] .EE +.SS \f[CR]monitors apply\f[R] subcommand +Create or update monitors. +.RS +.PP +openstatus monitors apply [options] +.RE +.PP +Creates or updates monitors according to the OpenStatus configuration +file. +.PP +Usage: +.IP +.EX +$ openstatus [GLOBAL FLAGS] monitors apply [COMMAND FLAGS] [ARGUMENTS...] +.EE +.PP +The following flags are supported: +.PP +.TS +tab(@); +lw(16.0n) lw(30.3n) cw(10.5n) cw(13.2n). +T{ +Name +T}@T{ +Description +T}@T{ +Default value +T}@T{ +Environment variables +T} +_ +T{ +\f[CR]\-\-config=\(dq\&...\(dq\f[R] (\f[CR]\-c\f[R]) +T}@T{ +The configuration file containing monitor information +T}@T{ +\f[CR]openstatus.yaml\f[R] +T}@T{ +\f[I]none\f[R] +T} +T{ +\f[CR]\-\-access\-token=\(dq\&...\(dq\f[R] (\f[CR]\-t\f[R]) +T}@T{ +OpenStatus API Access Token +T}@T{ +T}@T{ +\f[CR]OPENSTATUS_API_TOKEN\f[R] +T} +T{ +\f[CR]\-\-auto\-accept\f[R] (\f[CR]\-y\f[R]) +T}@T{ +Automatically accept the prompt +T}@T{ +\f[CR]false\f[R] +T}@T{ +\f[I]none\f[R] +T} +.TE .SS \f[CR]monitors create\f[R] subcommand Create monitors (beta). .RS @@ -55,7 +113,7 @@ Environment variables T} _ T{ -\f[CR]\-\-config=\(dq\&...\(dq\f[R] +\f[CR]\-\-config=\(dq\&...\(dq\f[R] (\f[CR]\-c\f[R]) T}@T{ The configuration file containing monitor information T}@T{ @@ -131,10 +189,11 @@ T} Export all your monitors. .RS .PP -openstatus monitor export [options] +openstatus monitors export [options] .RE .PP -Export all your monitors to YAML. +Export all your monitors in your workspace to a YAML file; it will also +create a lock file to manage your monitors with `apply'. .PP Usage: .IP @@ -179,7 +238,7 @@ T} Get a monitor information. .RS .PP -openstatus monitor info [MonitorID] +openstatus monitors info [MonitorID] .RE .PP Fetch the monitor information. diff --git a/internal/monitors/monitor_create.go b/internal/monitors/monitor_create.go index 98a46a1..46f65f0 100644 --- a/internal/monitors/monitor_create.go +++ b/internal/monitors/monitor_create.go @@ -88,7 +88,7 @@ func GetMonitorCreateCmd() *cli.Command { &cli.StringFlag{ Name: "config", Usage: "The configuration file containing monitor information", - Aliases: []string{"c"}, + Aliases: []string{"c"}, DefaultText: "openstatus.yaml", Value: "openstatus.yaml", }, -- knotmirror 0.0.1