Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking changes to the options of the host subcommand. #17

Merged
merged 1 commit into from
Oct 20, 2023
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
6 changes: 3 additions & 3 deletions README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ USAGE:
sabadashi host [command options] [arguments...]

OPTIONS:
--host value, -H value メトリックを取得するホストIDを指定
--id value メトリックを取得するホストIDを指定
--from value YYYYMMDD形式でメトリック取得を開始する日付を指定 (例: 20230101)
--to value YYYYMMDD形式でメトリック取得を終了する日付を指定 (例: 20231231)
--granularity value, -g value 取得するメトリックの粒度を 1m, 5m, 10m, 1h, 2h, 4h, 1d から指定 (デフォルト: 1m)
Expand Down Expand Up @@ -67,10 +67,10 @@ OPTIONS:

```
# APIキーが環境変数 MACKEREL_APIKEY に設定されている場合
sabadashi host -host <your host id> -from <YYYYMMDD> -to <YYYYMMDD>
sabadashi host -id <your host id> -from <YYYYMMDD> -to <YYYYMMDD>

# APIキーをオプションで指定する場合
sabadashi host -apikey <your api key> -host <your host id> -from <YYYYMMDD> -to <YYYYMMDD>
sabadashi host -apikey <your api key> -id <your host id> -from <YYYYMMDD> -to <YYYYMMDD>
```

環境変数の`MACKEREL_APIKEY`もしくは`-apikey`オプションに指定するAPIキーには参照権限が必要となります。
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ USAGE:
sabadashi host [command options] [arguments...]

OPTIONS:
--host value, -H value ID of the host from which to retrieve metric
--id value ID of the host from which to retrieve metric
--from value Specify the date to start retrieving metrics in YYYYMMDD format. (e.g. 20230101)
--to value Specify the date to end retrieving metrics in YYYYMMDD format. (e.g. 20231231)
--granularity value, -g value Specify the granularity of metric data. Choose from 1m, 5m, 10m, 1h, 2h, 4h or 1d. (default: 1m)
Expand Down Expand Up @@ -70,10 +70,10 @@ The tool will retrieve metrics posted from `YYYYY/MM/DD 00:00:00` specified in `

```
# If the MACKEREL_APIKEY is set in an environment variable
sabadashi host -host <your host id> -from <YYYYMMDD> -to <YYYYMMDD>
sabadashi host -id <your host id> -from <YYYYMMDD> -to <YYYYMMDD>

# If not, and you explicitly specify
sabadashi host -apkey <your api key> -host <your host id> -from <YYYYMMDD> -to <YYYYMMDD>
sabadashi host -apkey <your api key> -id <your host id> -from <YYYYMMDD> -to <YYYYMMDD>
```

The API key specified in the environment variable `MACKEREL_APIKEY` or the `-apikey` option must have read permission.
Expand Down
5 changes: 2 additions & 3 deletions cmd/subcommand/cli_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ func NewHostSubcommand() *cli.Command {
rawFrom: ctx.String("from"),
rawTo: ctx.String("to"),
},
host: ctx.String("host"),
host: ctx.String("id"),
}
return doHost(ctx, cmd)
},
Flags: []cli.Flag{
&cli.StringFlag{
Name: "host",
Aliases: []string{"H"},
Name: "id",
Usage: "ID of the host from which to retrieve metric",
Required: true,
},
Expand Down
Loading