Skip to content

Commit

Permalink
Merge pull request #17 from tukaelu/breaking-changes-option
Browse files Browse the repository at this point in the history
breaking changes to the options of the host subcommand.
  • Loading branch information
tukaelu authored Oct 20, 2023
2 parents be5536d + 366902d commit b0dca64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
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

0 comments on commit b0dca64

Please sign in to comment.