diff --git a/README-ja.md b/README-ja.md index 5a206cb..614865a 100644 --- a/README-ja.md +++ b/README-ja.md @@ -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) @@ -67,10 +67,10 @@ OPTIONS: ``` # APIキーが環境変数 MACKEREL_APIKEY に設定されている場合 -sabadashi host -host -from -to +sabadashi host -id -from -to # APIキーをオプションで指定する場合 -sabadashi host -apikey -host -from -to +sabadashi host -apikey -id -from -to ``` 環境変数の`MACKEREL_APIKEY`もしくは`-apikey`オプションに指定するAPIキーには参照権限が必要となります。 diff --git a/README.md b/README.md index d48fdb8..f8c2723 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 -from -to +sabadashi host -id -from -to # If not, and you explicitly specify -sabadashi host -apkey -host -from -to +sabadashi host -apkey -id -from -to ``` The API key specified in the environment variable `MACKEREL_APIKEY` or the `-apikey` option must have read permission. diff --git a/cmd/subcommand/cli_host.go b/cmd/subcommand/cli_host.go index 729ebd0..066cd35 100644 --- a/cmd/subcommand/cli_host.go +++ b/cmd/subcommand/cli_host.go @@ -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, },