From 795a983fe0cf856053ca33e0ed8e30682d8dc94e Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Fri, 30 Jun 2023 12:15:32 +0800 Subject: [PATCH] fix: more event show subcmd --- cmd/climc/shell/events/events.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/climc/shell/events/events.go b/cmd/climc/shell/events/events.go index cbbf79cb9f..3811e8075a 100644 --- a/cmd/climc/shell/events/events.go +++ b/cmd/climc/shell/events/events.go @@ -21,6 +21,7 @@ import ( "yunion.io/x/onecloud/pkg/mcclient/modulebase" "yunion.io/x/onecloud/pkg/mcclient/modules" "yunion.io/x/onecloud/pkg/mcclient/modules/compute" + "yunion.io/x/onecloud/pkg/mcclient/modules/k8s" ) type BaseEventListOptions struct { @@ -78,6 +79,10 @@ func doNotifyEventList(s *mcclient.ClientSession, args *EventListOptions) error return DoEventList(modules.NotifyLogs, s, args) } +func doK8sEventList(s *mcclient.ClientSession, args *EventListOptions) error { + return DoEventList(*k8s.Logs.ResourceManager, s, args) +} + func DoEventList(man modulebase.ResourceManager, s *mcclient.ClientSession, args *EventListOptions) error { params := jsonutils.NewDict() if len(args.Type) > 0 { @@ -146,6 +151,12 @@ func DoEventList(man modulebase.ResourceManager, s *mcclient.ClientSession, args func init() { R(&EventListOptions{}, "event-show", "Show operation event logs", doComputeEventList) + R(&EventListOptions{}, "region-event-show", "Show operation event logs", doComputeEventList) + R(&EventListOptions{}, "glance-event-show", "Show operation event logs", doImageEventList) + R(&EventListOptions{}, "keystone-event-show", "Show operation event logs", doIdentityEventList) + R(&EventListOptions{}, "monitor-event-show", "Show operation event logs", doMonitorEventList) + R(&EventListOptions{}, "notify-event-show", "Show operation event logs", doNotifyEventList) + R(&EventListOptions{}, "kube-event-show", "Show operation event logs", doK8sEventList) R(&TypeEventListOptions{}, "server-event", "Show operation event logs of server", func(s *mcclient.ClientSession, args *TypeEventListOptions) error { nargs := EventListOptions{BaseEventListOptions: args.BaseEventListOptions, Id: args.ID, Type: []string{"server"}}