Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Delete = &cli.Command{ Name: "namespace", Usage: "call to delete namespace", Description: "delete namespace deletes namespace with name, provided by first arg. Aliases: " + strings.Join(aliases, ", "), UsageText: "chkit delete namespace", Aliases: aliases, Flags: util.DeleteFlags, Action: func(ctx *cli.Context) error { logrus.Debugf("running command delete namespace") client := util.GetClient(ctx) if ctx.NArg() == 0 { logrus.Debugf("show help") return cli.ShowSubcommandHelp(ctx) } namespace := ctx.Args().First() logrus.Debugf("deleting namespace %q", namespace) err := client.DeleteNamespace(namespace) return err }, }
View Source
var GetNamespace = &cli.Command{ Name: "namespace", Aliases: aliases, Description: `shows namespace data or namespace list. Aliases: ` + strings.Join(aliases, ", "), Usage: `shows namespace data or namespace list`, UsageText: "chkit get namespace_name... [-o yaml/json] [-f output_file]", Action: func(ctx *cli.Context) error { client := util.GetClient(ctx) defer util.StoreClient(ctx, client) var showItem model.Renderer var err error anime := &animation.Animation{ Framerate: 0.2, ClearLastFrame: true, Source: trasher.NewSilly(), } go func() { time.Sleep(time.Second) anime.Run() }() switch ctx.NArg() { case 1: namespaceLabel := ctx.Args().First() logrus.Debugf("getting namespace %q", namespaceLabel) showItem, err = client.GetNamespace(namespaceLabel) if err != nil { logrus.Debugf("fatal error: %v", err) anime.Stop() return err } default: var list namespace.NamespaceList logrus.Debugf("getting namespace list") list, err := client.GetNamespaceList() if err != nil { logrus.Debugf("fatal error: %v", err) anime.Stop() return err } showItem = list } logrus.Debugf("stopping animation") anime.Stop() logrus.Debugf("List recieved") err = util.ExportDataCommand(ctx, showItem) if err != nil { logrus.Debugf("fatal error: %v", err) } return err }, Flags: util.GetFlags, }
GetNamespace -- commmand 'get' entity data
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.