Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "events", Short: "Get Powervs events", Long: `Get the PowerVS events`, PreRunE: func(cmd *cobra.Command, args []string) error { if pkg.Options.InstanceID == "" && pkg.Options.InstanceName == "" { return fmt.Errorf("--instance-name or --instance-name required") } return nil }, RunE: func(cmd *cobra.Command, args []string) error { opt := pkg.Options c, err := client.NewClientWithEnv(opt.APIKey, opt.Environment, opt.Debug) if err != nil { klog.Errorf("failed to create a session with IBM cloud: %v", err) return err } pvmclient, err := client.NewPVMClientWithEnv(c, opt.InstanceID, opt.InstanceName, opt.Environment) if err != nil { return err } events, err := pvmclient.EventsClient.GetPcloudEventsGetsince(since) if err != nil { return err } table := utils.NewTable() table.Render(events.Payload.Events, []string{"user", "timestamp"}) return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.