annotations

package
v0.57.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = cli.Command{
	Name:  "annotations",
	Usage: "Manipulate graph annotations",
	Description: `
    Manipulate graph annotations. Requests APIs under "/api/v0/graph-annotations".
    See https://mackerel.io/api-docs/entry/graph-annotations .
`,
	Subcommands: []cli.Command{
		{
			Name:      "create",
			Usage:     "create a graph annotation",
			ArgsUsage: "--title <title> [--description <description>] [--description-file <file-path>] --from <from> --to <to> --service|-s <service> [--role|-r <role>]",
			Description: `
    Creates a graph annotation.
`,
			Action: doAnnotationsCreate,
			Flags: []cli.Flag{
				cli.StringFlag{Name: "title", Usage: "Title for annotation"},
				cli.StringFlag{Name: "description", Usage: "Description for annotation"},
				cli.StringFlag{Name: "description-file", Usage: `Read description text for annotation from file (use "-" to read from stdin)`},
				cli.IntFlag{Name: "from", Usage: "Starting time (epoch seconds)"},
				cli.IntFlag{Name: "to", Usage: "Ending time (epoch seconds)"},
				cli.StringFlag{Name: "service, s", Usage: "Service name for annotation"},
				cli.StringSliceFlag{
					Name:  "role, r",
					Value: &cli.StringSlice{},
					Usage: "Roles for annotation. Multiple choices are allowed",
				},
			},
		},
		{
			Name:      "list",
			Usage:     "list annotations",
			ArgsUsage: "--from <from> --to <to> --service|-s <service> [--jq <formula>]",
			Description: `
    Shows annotations by service name and duration (from and to)
`,
			Action: doAnnotationsList,
			Flags: []cli.Flag{
				cli.StringFlag{Name: "service, s", Usage: "Service name for annotation"},
				cli.IntFlag{Name: "from", Usage: "Starting time (epoch seconds)"},
				cli.IntFlag{Name: "to", Usage: "Ending time (epoch seconds)"},
				jq.CommandLineFlag,
			},
		},
		{
			Name:      "update",
			Usage:     "update annotation",
			ArgsUsage: "--id <id> [--title <title>] [--description <description>] [--description-file <file-path>] --from <from> --to <to> --service|-s <service> [--role|-r <role>]",
			Description: `
    Updates an annotation
`,
			Action: doAnnotationsUpdate,
			Flags: []cli.Flag{
				cli.StringFlag{Name: "id", Usage: "Annotation ID."},
				cli.StringFlag{Name: "service, s", Usage: "Service name for annotation"},
				cli.StringFlag{Name: "title", Usage: "Title for annotation"},
				cli.StringFlag{Name: "description", Usage: "Description for annotation"},
				cli.StringFlag{Name: "description-file", Usage: `Read description text for annotation from file (use "-" to read from stdin)`},
				cli.IntFlag{Name: "from", Usage: "Starting time (epoch seconds)"},
				cli.IntFlag{Name: "to", Usage: "Ending time (epoch seconds)"},
				cli.StringSliceFlag{
					Name:  "role, r",
					Value: &cli.StringSlice{},
					Usage: "Roles for annotation. Multiple choices are allowed",
				},
			},
		},
		{
			Name:      "delete",
			Usage:     "delete annotation",
			ArgsUsage: "--id <id>",
			Description: `
    Delete graph annotation by annotation id
`,
			Action: doAnnotationsDelete,
			Flags: []cli.Flag{
				cli.StringFlag{Name: "id", Usage: "Graph annotation ID"},
			},
		},
	},
}

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