Skip to content

Commit

Permalink
change all flags of event report to non-required (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgksgf authored Feb 2, 2021
1 parent ae085de commit d0162a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ You can imitate the content of [the default template file](examples/global.yml)

<details>

<summary>event report --uuid=uuid --service=service --name=name --message=message --startTime=startTime [--endTime=endTime] [--instance=instance] [--endpoint=endpoint] [--type=type] [parameters...]</summary>
<summary>event report [--uuid=uuid] [--service=service] [--name=name] [--message=message] [--startTime=startTime] [--endTime=endTime] [--instance=instance] [--endpoint=endpoint] [--type=type] [parameters...]</summary>

`event report` reports an event to OAP server via gRPC.

Expand Down
40 changes: 16 additions & 24 deletions internal/commands/event/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,24 @@ var reportCommand = cli.Command{
ArgsUsage: "[parameters...]",
Flags: []cli.Flag{
cli.StringFlag{
Name: "uuid",
Usage: "Unique `ID` of the event.",
Required: true,
Name: "uuid",
Usage: "Unique `ID` of the event.",
},
cli.StringFlag{
Name: "service",
Usage: "The service of the event occurred on.",
Required: true,
Name: "service",
Usage: "The service of the event occurred on.",
},
cli.StringFlag{
Name: "instance",
Usage: "The service instance of the event occurred on.",
Required: false,
Name: "instance",
Usage: "The service instance of the event occurred on.",
},
cli.StringFlag{
Name: "endpoint",
Usage: "The endpoint of the event occurred on",
Required: false,
Name: "endpoint",
Usage: "The endpoint of the event occurred on",
},
cli.StringFlag{
Name: "name",
Usage: "The name of the event. For example, 'Reboot' and 'Upgrade' etc.",
Required: true,
Name: "name",
Usage: "The name of the event. For example, 'Reboot' and 'Upgrade' etc.",
},
cli.GenericFlag{
Name: "type",
Expand All @@ -71,19 +66,16 @@ var reportCommand = cli.Command{
},
},
cli.StringFlag{
Name: "message",
Usage: "The detail of the event. This should be a one-line message that briefly describes why the event is reported.",
Required: true,
Name: "message",
Usage: "The detail of the event. This should be a one-line message that briefly describes why the event is reported.",
},
cli.Int64Flag{
Name: "startTime",
Usage: "The start time (in milliseconds) of the event, measured between the current time and midnight, January 1, 1970 UTC.",
Required: true,
Name: "startTime",
Usage: "The start time (in milliseconds) of the event, measured between the current time and midnight, January 1, 1970 UTC.",
},
cli.Int64Flag{
Name: "endTime",
Usage: "The end time (in milliseconds) of the event, measured between the current time and midnight, January 1, 1970 UTC.",
Required: false,
Name: "endTime",
Usage: "The end time (in milliseconds) of the event, measured between the current time and midnight, January 1, 1970 UTC.",
},
},
Action: func(ctx *cli.Context) error {
Expand Down

0 comments on commit d0162a5

Please sign in to comment.