service

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = cli.Command{
	Name:      "service",
	ShortName: "s",
	Usage:     "Service related sub-command",
	Subcommands: cli.Commands{
		ListCommand,
	},
}
View Source
var ListCommand = cli.Command{
	Name:        "list",
	ShortName:   "ls",
	Usage:       "List services",
	ArgsUsage:   "<service name>",
	Description: "list all services if no <service name> is given, otherwise, only list the given service",
	Flags:       flags.DurationFlags,
	Before: interceptor.BeforeChain([]cli.BeforeFunc{
		interceptor.DurationInterceptor,
	}),
	Action: func(ctx *cli.Context) error {
		end := ctx.String("end")
		start := ctx.String("start")
		step := ctx.Generic("step")

		var services []schema.Service

		if args := ctx.Args(); len(args) == 0 {
			services = client.Services(ctx, schema.Duration{
				Start: start,
				End:   end,
				Step:  step.(*model.StepEnumValue).Selected,
			})
		} else {
			service, _ := client.SearchService(ctx, args.First())
			services = []schema.Service{service}
		}

		return display.Display(ctx, services)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL