diff --git a/Makefile b/Makefile index 3fc4d6d0..802506d8 100644 --- a/Makefile +++ b/Makefile @@ -163,15 +163,20 @@ check/format: $(call _print_step,Checking if files are formatted) ./scripts/check-formatting.sh -.PHONY: generate generate/code +.PHONY: generate generate/code generate/docs ## Auto generate files. -generate: generate/code +generate: generate/code generate/docs ## Generate Golang code. generate/code: echo "Generating Go code..." go generate ./... +## Generate sloctl docs. +generate/docs: + echo "Generating sloctl docs..." + go run internal/cmd/docgen/main.go + .PHONY: format format/go format/cspell ## Format files. format: format/go format/cspell diff --git a/docs/sloctl.md b/docs/sloctl.md new file mode 100644 index 00000000..db5d87b5 --- /dev/null +++ b/docs/sloctl.md @@ -0,0 +1,37 @@ +## sloctl + +Create, get and delete SLO definitions from command line easily. + +### Synopsis + +All available commands for execution are listed below. +Use this tool to work with Nobl9 YAML configuration files (including, but not limited to SLOs). +More detailed help is available for each command. + +### Options + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl apply](sloctl_apply.md) - Apply object definition in YAML or JSON format +* [sloctl aws-iam-ids](sloctl_aws-iam-ids.md) - Returns IAM IDs used in AWS integrations +* [sloctl budgetadjustments](sloctl_budgetadjustments.md) - Budget adjustments management +* [sloctl config](sloctl_config.md) - Configuration management +* [sloctl convert](sloctl_convert.md) - Convert SLO definitions to Nobl9 configuration +* [sloctl delete](sloctl_delete.md) - Delete object definition by name or definition file +* [sloctl edit](sloctl_edit.md) - Edit resources +* [sloctl get](sloctl_get.md) - Display one or more than one resource +* [sloctl mcp](sloctl_mcp.md) - Start the MCP proxy listening on stdio +* [sloctl move](sloctl_move.md) - Move objects between Projects. +* [sloctl replay](sloctl_replay.md) - Retrieve historical SLI data and recalculate their SLO error budgets. +* [sloctl review](sloctl_review.md) - Manage SLO review (Enterprise Edition only) +* [sloctl validate](sloctl_validate.md) - Validate Nobl9 resources. +* [sloctl version](sloctl_version.md) - Print the sloctl version + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_apply.md b/docs/sloctl_apply.md new file mode 100644 index 00000000..e1db45ec --- /dev/null +++ b/docs/sloctl_apply.md @@ -0,0 +1,69 @@ +## sloctl apply + +Apply object definition in YAML or JSON format + +### Synopsis + +The apply command commits the changes by sending the updates to the application. +Sloctl supports glob patterns when using '-f' flag, it uses the standard Go glob patterns grammar and extends it with support of '**' for recursive reading of files and directories. +The standard Go grammar can be found here: https://pkg.go.dev/path/filepath#Match. +Only files with extensions: '.yaml', '.yml' and '.json' are processed when using glob patterns. +Additionally, before processing the file contents, sloctl checks if it contains Nobl9 API version with the following regex: '"?apiVersion"?\s*:\s*"?n9'. +Remember that glob patterns must be quoted to prevent the shell from evaluating them. + + +``` +sloctl apply [flags] +``` + +### Examples + +``` +# Apply the configuration from slo.yaml. +sloctl apply -f ./slo.yaml + +# Apply resources from multiple different sources at once. +sloctl apply -f ./slo.yaml -f test/config.yaml -f https://nobl9.com/slo.yaml + +# Apply the YAML or JSON passed directly into stdin. +sloctl apply -f - ./events.yaml +- eventStart: 2024-10-24T04:07:04Z + eventEnd: 2024-10-24T05:27:04Z + slos: + - project: test-project + name: sample-slo-1 +- eventStart: 2024-10-25T04:07:04Z + eventEnd: 2024-10-25T05:27:04Z + slos: + - project: test-project + name: sample-slo-2 +EOF +sloctl budgetadjustments events delete --adjustment-name=sample-adjustment-name -f ./events.yaml + +# Delete Adjustment Events using stdin: +sloctl budgetadjustments events delete --adjustment-name=sample-adjustment-name -f - <./events.yaml + +``` + +### Options + +``` + --adjustment-name string Name of the Adjustment. + -f, --file string File path to events definitions in YAML. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for events. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl budgetadjustments events](sloctl_budgetadjustments_events.md) - Budget adjustments events management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_budgetadjustments_events_get.md b/docs/sloctl_budgetadjustments_events_get.md new file mode 100644 index 00000000..3d116fe2 --- /dev/null +++ b/docs/sloctl_budgetadjustments_events_get.md @@ -0,0 +1,56 @@ +## sloctl budgetadjustments events get + +Return a list of events for given Adjustment with related SLOs + +### Synopsis + +Returns a list of events for the specified adjustment along with related **SLO**. This command returns past and ongoing events (events that have already started). The events 'get' command can return a maximum of 250 events. You can optionally filter for a specific SLO (only one). If an SLO is defined, only events for that SLO will be returned, but the results will also include other SLOs associated with those events. The results are sorted by event start time. + +``` +sloctl budgetadjustments events get [flags] +``` + +### Examples + +``` +# Get Adjustment Events for 'sample-adjustment-name' from 2024-09-23T00:45:00 UTC to 2024-09-23T20:46:00 UTC. +sloctl budgetadjustments events get --adjustment-name=sample-adjustment-name --from=2024-09-23T00:45:00Z --to=2024-09-23T20:46:00Z + + +# Get Adjustment Events for 'sample-adjustment-name' from 2024-09-23T00:45:00 UTC to 2024-09-23T20:46:00 UTC +# only for one slo with sloName and project filters. +sloctl budgetadjustments events get \ + --adjustment-name=sample-adjustment-name \ + --from=2024-09-23T00:45:00Z \ + --to=2024-09-23T20:46:00Z \ + --slo-project=sample-project-name \ + --slo-name=sample-slo-name + +``` + +### Options + +``` + --adjustment-name string Name of the Adjustment. + --from time Specifies the start date and time for the data range (in UTC). + -q, --jq string jq expression used to filter command results + -o, --output format Output format: one of yaml|json|csv. (default yaml) + --slo-name string Name of the SLO. Required when sloName is defined. + --slo-project string Name of the project. Required when sloName is defined. + --to time Specifies the end date and time for the data range (in UTC). +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for events. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl budgetadjustments events](sloctl_budgetadjustments_events.md) - Budget adjustments events management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_budgetadjustments_events_update.md b/docs/sloctl_budgetadjustments_events_update.md new file mode 100644 index 00000000..437d99aa --- /dev/null +++ b/docs/sloctl_budgetadjustments_events_update.md @@ -0,0 +1,58 @@ +## sloctl budgetadjustments events update + +Update existing past events with new values. Values for eventStart and eventEnd are required. + +``` +sloctl budgetadjustments events update [flags] +``` + +### Examples + +``` +# Update Adjustment Events using a file: +cat < ./events.yaml +- eventStart: 2024-10-24T04:07:04Z + eventEnd: 2024-10-24T05:27:04Z + slos: + - project: test-project + name: sample-slo-1 + update: + eventStart: 2024-10-24T03:07:04Z + eventEnd: 2024-10-24T04:27:04Z +- eventStart: 2024-10-25T04:07:04Z + eventEnd: 2024-10-25T05:27:04Z + slos: + - project: test-project + name: sample-slo-2 + update: + eventStart: 2024-10-25T03:07:04Z + eventEnd: 2024-10-25T04:27:04Z +EOF +sloctl budgetadjustments events update --adjustment-name=sample-adjustment-name -f ./events.yaml + +# Update Adjustment Events using stdin: +sloctl budgetadjustments events update --adjustment-name=sample-adjustment-name -f - <./events.yaml + +``` + +### Options + +``` + --adjustment-name string Name of the Adjustment. + -f, --file string File path to events definitions in YAML. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for events. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl budgetadjustments events](sloctl_budgetadjustments_events.md) - Budget adjustments events management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config.md b/docs/sloctl_config.md new file mode 100644 index 00000000..630f6452 --- /dev/null +++ b/docs/sloctl_config.md @@ -0,0 +1,29 @@ +## sloctl config + +Configuration management + +### Synopsis + +Manage configurations stored in configuration file. + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl](sloctl.md) - Create, get and delete SLO definitions from command line easily. +* [sloctl config add-context](sloctl_config_add-context.md) - Add new sloctl configuration context +* [sloctl config current-context](sloctl_config_current-context.md) - Display current context name +* [sloctl config current-user](sloctl_config_current-user.md) - Display current user ID +* [sloctl config delete-context](sloctl_config_delete-context.md) - Delete chosen context(s) +* [sloctl config get-contexts](sloctl_config_get-contexts.md) - Display all available context names +* [sloctl config rename-context](sloctl_config_rename-context.md) - Rename chosen context +* [sloctl config use-context](sloctl_config_use-context.md) - Set the default context + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config_add-context.md b/docs/sloctl_config_add-context.md new file mode 100644 index 00000000..6b025588 --- /dev/null +++ b/docs/sloctl_config_add-context.md @@ -0,0 +1,33 @@ +## sloctl config add-context + +Add new sloctl configuration context + +### Synopsis + +Add new sloctl configuration context, an interactive command which collects parameters in wizard mode. + +``` +sloctl config add-context [flags] +``` + +### Examples + +``` +# Run interactive form which adds a new context to your config.toml file. +sloctl config add-context +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl config](sloctl_config.md) - Configuration management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config_current-context.md b/docs/sloctl_config_current-context.md new file mode 100644 index 00000000..3071d211 --- /dev/null +++ b/docs/sloctl_config_current-context.md @@ -0,0 +1,48 @@ +## sloctl config current-context + +Display current context name + +### Synopsis + +In verbose mode, display configuration for the current context set in the configuration file. + +``` +sloctl config current-context [flags] +``` + +### Examples + +``` +# Fetch the current context name. +sloctl config current-context + +# Display detailed information about the current context in YAML format. +sloctl config current-context --verbose + +# Display detailed information with the client secret visible. +sloctl config current-context --verbose --show-secret +``` + +### Options + +``` + -q, --jq string jq expression used to filter command results + -o, --output format Output format: one of toml|yaml|json|csv. (default yaml) + --show-secret Display the client secret in plain text (requires --verbose) + -v, --verbose Display verbose information about configuration +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl config](sloctl_config.md) - Configuration management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config_current-user.md b/docs/sloctl_config_current-user.md new file mode 100644 index 00000000..4307f214 --- /dev/null +++ b/docs/sloctl_config_current-user.md @@ -0,0 +1,44 @@ +## sloctl config current-user + +Display current user ID + +### Synopsis + +In verbose mode, display extended details for the user associated with the current context's access key. + +``` +sloctl config current-user [flags] +``` + +### Examples + +``` +# Fetch the current user ID. +sloctl config current-user + +# Display detailed information about the current user in YAML format. +sloctl config current-user --verbose +``` + +### Options + +``` + -q, --jq string jq expression used to filter command results + -o, --output format Output format: one of toml|yaml|json|csv. (default yaml) + -v, --verbose Display verbose information about configuration +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl config](sloctl_config.md) - Configuration management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config_delete-context.md b/docs/sloctl_config_delete-context.md new file mode 100644 index 00000000..a1123387 --- /dev/null +++ b/docs/sloctl_config_delete-context.md @@ -0,0 +1,37 @@ +## sloctl config delete-context + +Delete chosen context(s) + +### Synopsis + +Delete one or more of the contexts from the configuration file. +Each argument is treated as a context name, when no arguments are provided a multi-selection prompt is displayed. + +``` +sloctl config delete-context [flags] +``` + +### Examples + +``` +# Display interactive selection of context to delete (multiple choice). +sloctl config delete-context + +# Delete "context-1" and "context-2" from your configuration file. +sloctl config delete-context context-1 context-2 +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl config](sloctl_config.md) - Configuration management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config_get-contexts.md b/docs/sloctl_config_get-contexts.md new file mode 100644 index 00000000..f3810205 --- /dev/null +++ b/docs/sloctl_config_get-contexts.md @@ -0,0 +1,44 @@ +## sloctl config get-contexts + +Display all available context names + +### Synopsis + +In verbose mode, display configuration for all available contexts set in the configuration file. + +``` +sloctl config get-contexts [flags] +``` + +### Examples + +``` +# List all context names. +sloctl config get-contexts + +# Display detailed information about every context in TOML format. +sloctl config get-contexts --verbose --output=toml +``` + +### Options + +``` + -q, --jq string jq expression used to filter command results + -o, --output format Output format: one of toml|yaml|json|csv. (default yaml) + -v, --verbose Display verbose information about configuration +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl config](sloctl_config.md) - Configuration management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config_rename-context.md b/docs/sloctl_config_rename-context.md new file mode 100644 index 00000000..347666a7 --- /dev/null +++ b/docs/sloctl_config_rename-context.md @@ -0,0 +1,37 @@ +## sloctl config rename-context + +Rename chosen context + +### Synopsis + +Rename one of the contexts in the configuration file. +If no arguments are provided, the command displays an interactive prompt. + +``` +sloctl config rename-context [flags] +``` + +### Examples + +``` +# Display interactive form which lets you select the old context name and type in the new one. +sloctl config rename-context + +# Rename "old-ctx" to "new-ctx". +sloctl config rename-context old-ctx new-ctx +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl config](sloctl_config.md) - Configuration management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_config_use-context.md b/docs/sloctl_config_use-context.md new file mode 100644 index 00000000..e094311a --- /dev/null +++ b/docs/sloctl_config_use-context.md @@ -0,0 +1,36 @@ +## sloctl config use-context + +Set the default context + +### Synopsis + +Set a default context in the existing configuration file. + +``` +sloctl config use-context [context name] [flags] +``` + +### Examples + +``` +# Display interactive selection of contexts to use as default. +sloctl config use-context + +# Use "my-context" as a default context. +sloctl config use-context my-context +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl config](sloctl_config.md) - Configuration management + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_convert.md b/docs/sloctl_convert.md new file mode 100644 index 00000000..99049056 --- /dev/null +++ b/docs/sloctl_convert.md @@ -0,0 +1,23 @@ +## sloctl convert + +Convert SLO definitions to Nobl9 configuration + +### Synopsis + +Converts external SLO (and more!) definitions to Nobl9 YAML configuration. + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl](sloctl.md) - Create, get and delete SLO definitions from command line easily. +* [sloctl convert openslo](sloctl_convert_openslo.md) - Convert OpenSLO specification to Nobl9 configuration + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_convert_openslo.md b/docs/sloctl_convert_openslo.md new file mode 100644 index 00000000..d95b3635 --- /dev/null +++ b/docs/sloctl_convert_openslo.md @@ -0,0 +1,67 @@ +## sloctl convert openslo + +Convert OpenSLO specification to Nobl9 configuration + +### Synopsis + +To learn more about how the conversion works, visit https://github.com/nobl9/nobl9-openslo. + +``` +sloctl convert openslo [flags] +``` + +### Examples + +``` +# Convert the OpenSLO definitions from service.yaml. +cat < ./service.yaml +apiVersion: openslo/v1 +kind: Service +metadata: + annotations: + nobl9.com/metadata.project: my-project + name: example-service +spec: + description: Example service description +EOF +sloctl convert openslo -f ./service.yaml + +# Convert definitions from multiple different sources at once. +sloctl convert openslo -f ./service.yaml -f test/config.yaml + +# Convert the YAML or JSON passed directly into stdin. +sloctl convert openslo -f - ./replay.yaml +- slo: prometheus-latency + from: 2023-03-02T16:00:00Z +- slo: datadog-latency + project: default +- slo: dynatrace-latency + project: default + from: 2023-03-02T16:00:00Z +EOF +sloctl -f ./replay.yaml replay --from=2023-03-02T15:00:00Z + +# Minimal config with project and from set via flags. +cat < ./replay.yaml +- slo: prometheus-latency +- slo: datadog-latency +EOF +sloctl replay -f ./replay.yaml -p my-project --from 2023-03-02T15:00:00Z + +# Replay SLOs using SLI data from other SLOs. +cat < ./replay.yaml +- slo: prometheus-latency + project: default + from: 2023-03-02T16:00:00Z + sourceSLO: + slo: my-service-latency + project: my-service-test-project + objectivesMap: + - source: acceptable + target: objective-1 + - source: alarming + target: objective-2 +- slo: datadog-latency + project: default + from: 2023-03-02T16:00:00Z + sourceSLO: + slo: my-service-latency + project: my-service-test-project + objectivesMap: + - source: alarming + target: objective-1 + - source: alarming + target: objective-2 +EOF +sloctl -f ./replay.yaml replay + +``` + +### Options + +``` + -f, --file stringArray File path, glob pattern or a URL to the configuration in YAML or JSON format. This option can be used multiple times. + --from time Sets the start of Replay time window. + -q, --jq string jq expression used to filter command results + -o, --output format Output format: one of yaml|json|csv. (default yaml) + -p, --project string Specifies the Project for the SLOs you want to Replay. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl](sloctl.md) - Create, get and delete SLO definitions from command line easily. +* [sloctl replay cancel](sloctl_replay_cancel.md) - Cancel an importing Replay +* [sloctl replay delete](sloctl_replay_delete.md) - Delete a queued Replay +* [sloctl replay list](sloctl_replay_list.md) - List all Replays + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_replay_cancel.md b/docs/sloctl_replay_cancel.md new file mode 100644 index 00000000..cc14f940 --- /dev/null +++ b/docs/sloctl_replay_cancel.md @@ -0,0 +1,30 @@ +## sloctl replay cancel + +Cancel an importing Replay + +``` +sloctl replay cancel [flags] +``` + +### Options + +``` + -p, --project string Specifies the Project of the SLO you want to cancel importing Replay for. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + -q, --jq string jq expression used to filter command results + --no-config-file Don't create config.toml, operate only on env variables. + -o, --output format Output format: one of yaml|json|csv. (default yaml) +``` + +### SEE ALSO + +* [sloctl replay](sloctl_replay.md) - Retrieve historical SLI data and recalculate their SLO error budgets. + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_replay_delete.md b/docs/sloctl_replay_delete.md new file mode 100644 index 00000000..b028e385 --- /dev/null +++ b/docs/sloctl_replay_delete.md @@ -0,0 +1,31 @@ +## sloctl replay delete + +Delete a queued Replay + +``` +sloctl replay delete [flags] +``` + +### Options + +``` + --all Delete ALL queued Replays. + -p, --project string Specifies the Project of the SLO you want to remove queued Replay for. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + -q, --jq string jq expression used to filter command results + --no-config-file Don't create config.toml, operate only on env variables. + -o, --output format Output format: one of yaml|json|csv. (default yaml) +``` + +### SEE ALSO + +* [sloctl replay](sloctl_replay.md) - Retrieve historical SLI data and recalculate their SLO error budgets. + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_replay_list.md b/docs/sloctl_replay_list.md new file mode 100644 index 00000000..3c332f62 --- /dev/null +++ b/docs/sloctl_replay_list.md @@ -0,0 +1,24 @@ +## sloctl replay list + +List all Replays + +``` +sloctl replay list [flags] +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + -q, --jq string jq expression used to filter command results + --no-config-file Don't create config.toml, operate only on env variables. + -o, --output format Output format: one of yaml|json|csv. (default yaml) +``` + +### SEE ALSO + +* [sloctl replay](sloctl_replay.md) - Retrieve historical SLI data and recalculate their SLO error budgets. + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_review.md b/docs/sloctl_review.md new file mode 100644 index 00000000..7348a482 --- /dev/null +++ b/docs/sloctl_review.md @@ -0,0 +1,25 @@ +## sloctl review + +Manage SLO review (Enterprise Edition only) + +### Synopsis + +Manage SLO review. + +Note: This feature is only available in Enterprise Edition tier. + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl](sloctl.md) - Create, get and delete SLO definitions from command line easily. +* [sloctl review set-status](sloctl_review_set-status.md) - Set SLO review status + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_review_set-status.md b/docs/sloctl_review_set-status.md new file mode 100644 index 00000000..33db1ec2 --- /dev/null +++ b/docs/sloctl_review_set-status.md @@ -0,0 +1,31 @@ +## sloctl review set-status + +Set SLO review status + +### Synopsis + +Set SLO review status. + +This command allows you to update the review status of a specific SLO. + +Note: This feature is only available in Enterprise Edition tier. + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl review](sloctl_review.md) - Manage SLO review (Enterprise Edition only) +* [sloctl review set-status not-started](sloctl_review_set-status_not-started.md) - Set SLO review status to notStarted +* [sloctl review set-status overdue](sloctl_review_set-status_overdue.md) - Set SLO review status to overdue +* [sloctl review set-status reviewed](sloctl_review_set-status_reviewed.md) - Set SLO review status to reviewed +* [sloctl review set-status skipped](sloctl_review_set-status_skipped.md) - Set SLO review status to skipped +* [sloctl review set-status to-review](sloctl_review_set-status_to-review.md) - Set SLO review status to toReview + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_review_set-status_not-started.md b/docs/sloctl_review_set-status_not-started.md new file mode 100644 index 00000000..402bcfa9 --- /dev/null +++ b/docs/sloctl_review_set-status_not-started.md @@ -0,0 +1,48 @@ +## sloctl review set-status not-started + +Set SLO review status to notStarted + +### Synopsis + +Set SLO review status to notStarted + +The SLO name must be provided as an argument, and the project can be specified +using the --project flag or will default to the configured project in your client. + +Note: This feature is only available in Enterprise Edition tier. + + +``` +sloctl review set-status not-started [flags] +``` + +### Examples + +``` +# Set "prometheus-latency" SLO (non-default Project) review status as "reviewed" and provide a review note. +sloctl review set-status reviewed prometheus-latency -p non-default -n "Target met, 20% error budget remaining" + +# Set "prometheus-latency" SLO (default Project) review status as "skipped" and provide a note explaining the reason for skipping. +sloctl review set-status skipped prometheus-latency --note "Insufficient data for this period" +``` + +### Options + +``` + -p, --project string Project name. Optional, fall backs to your default Project. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl review set-status](sloctl_review_set-status.md) - Set SLO review status + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_review_set-status_overdue.md b/docs/sloctl_review_set-status_overdue.md new file mode 100644 index 00000000..30beeadd --- /dev/null +++ b/docs/sloctl_review_set-status_overdue.md @@ -0,0 +1,48 @@ +## sloctl review set-status overdue + +Set SLO review status to overdue + +### Synopsis + +Set SLO review status to overdue + +The SLO name must be provided as an argument, and the project can be specified +using the --project flag or will default to the configured project in your client. + +Note: This feature is only available in Enterprise Edition tier. + + +``` +sloctl review set-status overdue [flags] +``` + +### Examples + +``` +# Set "prometheus-latency" SLO (non-default Project) review status as "reviewed" and provide a review note. +sloctl review set-status reviewed prometheus-latency -p non-default -n "Target met, 20% error budget remaining" + +# Set "prometheus-latency" SLO (default Project) review status as "skipped" and provide a note explaining the reason for skipping. +sloctl review set-status skipped prometheus-latency --note "Insufficient data for this period" +``` + +### Options + +``` + -p, --project string Project name. Optional, fall backs to your default Project. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl review set-status](sloctl_review_set-status.md) - Set SLO review status + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_review_set-status_reviewed.md b/docs/sloctl_review_set-status_reviewed.md new file mode 100644 index 00000000..dea46d4c --- /dev/null +++ b/docs/sloctl_review_set-status_reviewed.md @@ -0,0 +1,52 @@ +## sloctl review set-status reviewed + +Set SLO review status to reviewed + +### Synopsis + +Set SLO review status to reviewed +You can optionally include a note using the --note flag to provide additional +context or reasoning for the review decision. + + +The SLO name must be provided as an argument, and the project can be specified +using the --project flag or will default to the configured project in your client. + +Note: This feature is only available in Enterprise Edition tier. + + +``` +sloctl review set-status reviewed [flags] +``` + +### Examples + +``` +# Set "prometheus-latency" SLO (non-default Project) review status as "reviewed" and provide a review note. +sloctl review set-status reviewed prometheus-latency -p non-default -n "Target met, 20% error budget remaining" + +# Set "prometheus-latency" SLO (default Project) review status as "skipped" and provide a note explaining the reason for skipping. +sloctl review set-status skipped prometheus-latency --note "Insufficient data for this period" +``` + +### Options + +``` + -n, --note string Optional note annotation + -p, --project string Project name. Optional, fall backs to your default Project. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl review set-status](sloctl_review_set-status.md) - Set SLO review status + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_review_set-status_skipped.md b/docs/sloctl_review_set-status_skipped.md new file mode 100644 index 00000000..a735e2cd --- /dev/null +++ b/docs/sloctl_review_set-status_skipped.md @@ -0,0 +1,52 @@ +## sloctl review set-status skipped + +Set SLO review status to skipped + +### Synopsis + +Set SLO review status to skipped +You can optionally include a note using the --note flag to provide additional +context or reasoning for the review decision. + + +The SLO name must be provided as an argument, and the project can be specified +using the --project flag or will default to the configured project in your client. + +Note: This feature is only available in Enterprise Edition tier. + + +``` +sloctl review set-status skipped [flags] +``` + +### Examples + +``` +# Set "prometheus-latency" SLO (non-default Project) review status as "reviewed" and provide a review note. +sloctl review set-status reviewed prometheus-latency -p non-default -n "Target met, 20% error budget remaining" + +# Set "prometheus-latency" SLO (default Project) review status as "skipped" and provide a note explaining the reason for skipping. +sloctl review set-status skipped prometheus-latency --note "Insufficient data for this period" +``` + +### Options + +``` + -n, --note string Optional note annotation + -p, --project string Project name. Optional, fall backs to your default Project. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl review set-status](sloctl_review_set-status.md) - Set SLO review status + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_review_set-status_to-review.md b/docs/sloctl_review_set-status_to-review.md new file mode 100644 index 00000000..44683ac0 --- /dev/null +++ b/docs/sloctl_review_set-status_to-review.md @@ -0,0 +1,48 @@ +## sloctl review set-status to-review + +Set SLO review status to toReview + +### Synopsis + +Set SLO review status to toReview + +The SLO name must be provided as an argument, and the project can be specified +using the --project flag or will default to the configured project in your client. + +Note: This feature is only available in Enterprise Edition tier. + + +``` +sloctl review set-status to-review [flags] +``` + +### Examples + +``` +# Set "prometheus-latency" SLO (non-default Project) review status as "reviewed" and provide a review note. +sloctl review set-status reviewed prometheus-latency -p non-default -n "Target met, 20% error budget remaining" + +# Set "prometheus-latency" SLO (default Project) review status as "skipped" and provide a note explaining the reason for skipping. +sloctl review set-status skipped prometheus-latency --note "Insufficient data for this period" +``` + +### Options + +``` + -p, --project string Project name. Optional, fall backs to your default Project. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl review set-status](sloctl_review_set-status.md) - Set SLO review status + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_validate.md b/docs/sloctl_validate.md new file mode 100644 index 00000000..61431994 --- /dev/null +++ b/docs/sloctl_validate.md @@ -0,0 +1,23 @@ +## sloctl validate + +Validate Nobl9 resources. + +``` +sloctl validate [flags] +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl](sloctl.md) - Create, get and delete SLO definitions from command line easily. +* [sloctl validate sli](sloctl_validate_sli.md) - Validate SLI queries by querying data source values. + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_validate_sli.md b/docs/sloctl_validate_sli.md new file mode 100644 index 00000000..f5a2fb22 --- /dev/null +++ b/docs/sloctl_validate_sli.md @@ -0,0 +1,40 @@ +## sloctl validate sli + +Validate SLI queries by querying data source values. + +### Synopsis + +Validate SLI queries by querying data source values for SLO manifests or an existing SLO. By default, it validates the last 15 minutes. + +``` +sloctl validate sli [slo-name] [flags] +``` + +### Options + +``` + -f, --file stringArray File path, glob pattern or a URL to the configuration in YAML or JSON format. This option can be used multiple times. + --from time Sets the validation time range start. + -q, --jq string jq expression used to filter command results + --last duration Sets a relative validation time range ending now. Maximum value is 1h. (default 15m0s) + --objective string Filters SLO objectives by name. + -o, --output format Output format: one of yaml|json|csv. (default yaml) + -p, --project string Specifies the Project for the SLO selected by name, or assigns a default Project to SLOs read from a file. + --slo string Filters SLOs read from a file by name. + --to time Sets the validation time range end. +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl validate](sloctl_validate.md) - Validate Nobl9 resources. + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/docs/sloctl_version.md b/docs/sloctl_version.md new file mode 100644 index 00000000..a3594a41 --- /dev/null +++ b/docs/sloctl_version.md @@ -0,0 +1,22 @@ +## sloctl version + +Print the sloctl version + +``` +sloctl version [flags] +``` + +### Options inherited from parent commands + +``` + --config string Config file path. + -c, --context string Overrides the default context for the duration of the selected command. + -h, --help Help for sloctl. + --no-config-file Don't create config.toml, operate only on env variables. +``` + +### SEE ALSO + +* [sloctl](sloctl.md) - Create, get and delete SLO definitions from command line easily. + +###### Auto generated by spf13/cobra on 3-Aug-2026 diff --git a/go.mod b/go.mod index eadfa049..32372944 100644 --- a/go.mod +++ b/go.mod @@ -39,6 +39,7 @@ require ( github.com/charmbracelet/x/windows v0.2.2 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/fatih/color v1.19.0 // indirect @@ -66,12 +67,14 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.67.5 // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/teambition/rrule-go v1.8.2 // indirect github.com/tidwall/gjson v1.19.0 // indirect github.com/tidwall/match v1.2.0 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.52.0 // indirect golang.org/x/mod v0.36.0 // indirect golang.org/x/sys v0.46.0 // indirect diff --git a/go.sum b/go.sum index 3c91c08a..3f23cf3d 100644 --- a/go.sum +++ b/go.sum @@ -54,6 +54,7 @@ github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSE github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= +github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= @@ -154,6 +155,7 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/schollz/progressbar/v3 v3.19.1 h1:iv8BgwOvdML/S3p84uBpy/IMigv4U9594vPZYa2EdrU= github.com/schollz/progressbar/v3 v3.19.1/go.mod h1:LFL7jqimKxfhero4K1eCkUr/6R39AgQeiPCJtlTWIW8= diff --git a/internal/cmd/docgen/main.go b/internal/cmd/docgen/main.go new file mode 100644 index 00000000..89e26b54 --- /dev/null +++ b/internal/cmd/docgen/main.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "os" + + "github.com/spf13/cobra/doc" + + "github.com/nobl9/sloctl/internal" +) + +func main() { + cmd := internal.NewRootCmd() + err := doc.GenMarkdownTree(cmd, "./docs") + if err != nil { + fmt.Fprintf(os.Stderr, "Error generating markdown docs: %v\n", err) + os.Exit(1) + } +}