Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/stackit_argus.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ stackit argus [flags]
* [stackit argus grafana](./stackit_argus_grafana.md) - Provides functionality for the Grafana configuration of Argus instances
* [stackit argus instance](./stackit_argus_instance.md) - Provides functionality for Argus instances
* [stackit argus plans](./stackit_argus_plans.md) - Lists all Argus service plans
* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

38 changes: 38 additions & 0 deletions docs/stackit_argus_scrape-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## stackit argus scrape-config

Provides functionality for scrape configurations in Argus

### Synopsis

Provides functionality for scrape configurations in Argus.

```
stackit argus scrape-config [flags]
```

### Options

```
-h, --help Help for "stackit argus scrape-config"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus](./stackit_argus.md) - Provides functionality for Argus
* [stackit argus scrape-config create](./stackit_argus_scrape-config_create.md) - Creates a scrape configuration for an Argus instance
* [stackit argus scrape-config delete](./stackit_argus_scrape-config_delete.md) - Deletes a scrape configuration from an Argus instance
* [stackit argus scrape-config describe](./stackit_argus_scrape-config_describe.md) - Shows details of a scrape configuration from an Argus instance
* [stackit argus scrape-config generate-payload](./stackit_argus_scrape-config_generate-payload.md) - Generates a payload to create/update scrape configurations for an Argus instance
* [stackit argus scrape-config list](./stackit_argus_scrape-config_list.md) - Lists all scrape configurations of an Argus instance
* [stackit argus scrape-config update](./stackit_argus_scrape-config_update.md) - Updates a scrape configuration of an Argus instance

55 changes: 55 additions & 0 deletions docs/stackit_argus_scrape-config_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## stackit argus scrape-config create

Creates a scrape configuration for an Argus instance

### Synopsis

Creates a scrape configuration job for an Argus instance.
The payload can be provided as a JSON string or a file path prefixed with "@".
If no payload is provided, a default payload will be used.
See https://docs.api.stackit.cloud/documentation/argus/version/v1#tag/scrape-config/operation/v1_projects_instances_scrapeconfigs_create for information regarding the payload structure.

```
stackit argus scrape-config create [flags]
```

### Examples

```
Create a scrape configuration on Argus instance "xxx" using default configuration
$ stackit argus scrape-config create

Create a scrape configuration on Argus instance "xxx" using an API payload sourced from the file "./payload.json"
$ stackit argus scrape-config create --payload @./payload.json --instance-id xxx

Create a scrape configuration on Argus instance "xxx" using an API payload provided as a JSON string
$ stackit argus scrape-config create --payload "{...}" --instance-id xxx

Generate a payload with default values, and adapt it with custom values for the different configuration options
$ stackit argus scrape-config generate-payload > ./payload.json
<Modify payload in file, if needed>
$ stackit argus scrape-config create --payload @./payload.json --instance-id xxx
```

### Options

```
-h, --help Help for "stackit argus scrape-config create"
--instance-id string Instance ID
--payload string Request payload (JSON). Can be a string or a file path, if prefixed with "@" (example: @./payload.json). If unset, will use a default payload (you can check it by running "stackit argus scrape-config generate-payload")
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

40 changes: 40 additions & 0 deletions docs/stackit_argus_scrape-config_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit argus scrape-config delete

Deletes a scrape configuration from an Argus instance

### Synopsis

Deletes a scrape configuration from an Argus instance.

```
stackit argus scrape-config delete JOB_NAME [flags]
```

### Examples

```
Delete a scrape configuration job with name "my-config" from Argus instance "xxx"
$ stackit argus scrape-config delete my-config --instance-id xxx
```

### Options

```
-h, --help Help for "stackit argus scrape-config delete"
--instance-id string Instance ID
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

43 changes: 43 additions & 0 deletions docs/stackit_argus_scrape-config_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## stackit argus scrape-config describe

Shows details of a scrape configuration from an Argus instance

### Synopsis

Shows details of a scrape configuration from an Argus instance.

```
stackit argus scrape-config describe JOB_NAME [flags]
```

### Examples

```
Get details of a scrape configuration with name "my-config" from Argus instance "xxx"
$ stackit argus scrape-config describe my-config --instance-id xxx

Get details of a scrape configuration with name "my-config" from Argus instance "xxx" in a table format
$ stackit argus scrape-config describe my-config --output-format pretty
```

### Options

```
-h, --help Help for "stackit argus scrape-config describe"
--instance-id string Instance ID
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

54 changes: 54 additions & 0 deletions docs/stackit_argus_scrape-config_generate-payload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## stackit argus scrape-config generate-payload

Generates a payload to create/update scrape configurations for an Argus instance

### Synopsis

Generates a JSON payload with values to be used as --payload input for scrape configurations creation or update.
This command can be used to generate a payload to update an existing scrape config or to create a new scrape config job.
To update an existing scrape config job, provide the job name and the instance ID of the Argus instance.
To obtain a default payload to create a new scrape config job, run the command with no flags.
Note that some of the default values provided, such as the job name, the metrics path and URL of the targets, should be adapted to your use case.
See https://docs.api.stackit.cloud/documentation/argus/version/v1#tag/scrape-config/operation/v1_projects_instances_scrapeconfigs_create for information regarding the payload structure.


```
stackit argus scrape-config generate-payload [flags]
```

### Examples

```
Generate a Create payload with default values, and adapt it with custom values for the different configuration options
$ stackit argus scrape-config generate-payload > ./payload.json
<Modify payload in file, if needed>
$ stackit argus scrape-config create my-config --payload @./payload.json

Generate an Update payload with the values of an existing configuration named "my-config" for Argus instance xxx, and adapt it with custom values for the different configuration options
$ stackit argus scrape-config generate-payload --job-name my-config --instance-id xxx > ./payload.json
<Modify payload in file>
$ stackit argus scrape-config update my-config --payload @./payload.json
```

### Options

```
-h, --help Help for "stackit argus scrape-config generate-payload"
--instance-id string Instance ID
-n, --job-name string If set, generates an update payload with the current state of the given scrape config. If unset, generates a create payload with default values
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

47 changes: 47 additions & 0 deletions docs/stackit_argus_scrape-config_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## stackit argus scrape-config list

Lists all scrape configurations of an Argus instance

### Synopsis

Lists all scrape configurations of an Argus instance.

```
stackit argus scrape-config list [flags]
```

### Examples

```
List all scrape configurations of Argus instance "xxx"
$ stackit argus scrape-config list --instance-id xxx

List all scrape configurations of Argus instance "xxx" in JSON format
$ stackit argus scrape-config list --instance-id xxx --output-format json

List up to 10 scrape configurations of Argus instance "xxx"
$ stackit argus scrape-config list --instance-id xxx --limit 10
```

### Options

```
-h, --help Help for "stackit argus scrape-config list"
--instance-id string Instance ID
--limit int Maximum number of entries to list
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

51 changes: 51 additions & 0 deletions docs/stackit_argus_scrape-config_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## stackit argus scrape-config update

Updates a scrape configuration of an Argus instance

### Synopsis

Updates a scrape configuration of an Argus instance.
The payload can be provided as a JSON string or a file path prefixed with "@".
See https://docs.api.stackit.cloud/documentation/argus/version/v1#tag/scrape-config/operation/v1_projects_instances_scrapeconfigs_update for information regarding the payload structure.

```
stackit argus scrape-config update JOB_NAME [flags]
```

### Examples

```
Update a scrape configuration with name "my-config" from Argus instance "xxx", using an API payload sourced from the file "./payload.json"
$ stackit argus scrape-config update my-config --payload @./payload.json --instance-id xxx

Update an scrape configuration with name "my-config" from Argus instance "xxx", using an API payload provided as a JSON string
$ stackit argus scrape-config update my-config --payload "{...}" --instance-id xxx

Generate a payload with the current values of a scrape configuration, and adapt it with custom values for the different configuration options
$ stackit argus scrape-config generate-payload --job-name my-config > ./payload.json
<Modify payload in file>
$ stackit argus scrape-configs update my-config --payload @./payload.json
```

### Options

```
-h, --help Help for "stackit argus scrape-config update"
--instance-id string Instance ID
--payload string Request payload (JSON). Can be a string or a file path, if prefixed with "@". Example: @./payload.json
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

2 changes: 2 additions & 0 deletions internal/cmd/argus/argus.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/stackitcloud/stackit-cli/internal/cmd/argus/grafana"
"github.com/stackitcloud/stackit-cli/internal/cmd/argus/instance"
"github.com/stackitcloud/stackit-cli/internal/cmd/argus/plans"
scrapeconfig "github.com/stackitcloud/stackit-cli/internal/cmd/argus/scrape-config"
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
Expand All @@ -26,5 +27,6 @@ func NewCmd(p *print.Printer) *cobra.Command {
func addSubcommands(cmd *cobra.Command, p *print.Printer) {
cmd.AddCommand(grafana.NewCmd(p))
cmd.AddCommand(instance.NewCmd(p))
cmd.AddCommand(scrapeconfig.NewCmd(p))
cmd.AddCommand(plans.NewCmd(p))
}
Loading