From 620d8002e45837a269115e5b3d21ec44b0e15806 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 20 Dec 2022 07:44:56 -0500 Subject: [PATCH] New server version operation --- cmd/activate.go | 2 +- cmd/activate_exec_env.go | 2 +- cmd/build.go | 2 +- cmd/delete.go | 2 +- cmd/export.go | 2 +- cmd/export_appliance.go | 2 +- cmd/export_exec_env_cfg.go | 2 +- cmd/export_provider_metadata.go | 2 +- cmd/import.go | 2 +- cmd/import_appliance.go | 2 +- cmd/layout.go | 2 +- cmd/list.go | 2 +- cmd/list_appliances.go | 2 +- cmd/list_idsources.go | 2 +- cmd/list_providers.go | 2 +- cmd/server-version.go | 40 +++++++++++++++++++++++++++++++++ cmd/start.go | 2 +- cmd/stop.go | 2 +- cmd/test.go | 2 +- cmd/test_store.go | 2 +- cmd/validate.go | 2 +- cmd/version.go | 2 +- cmd/view.go | 2 +- cmd/view_appliance.go | 2 +- cmd/view_idsource.go | 2 +- cmd/view_provider.go | 2 +- go.mod | 4 ++++ go.sum | 4 ---- 28 files changed, 69 insertions(+), 29 deletions(-) create mode 100644 cmd/server-version.go diff --git a/cmd/activate.go b/cmd/activate.go index f92b2c9..14f133b 100644 --- a/cmd/activate.go +++ b/cmd/activate.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/activate_exec_env.go b/cmd/activate_exec_env.go index 4f77e23..89fc023 100644 --- a/cmd/activate_exec_env.go +++ b/cmd/activate_exec_env.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/build.go b/cmd/build.go index 1905d46..ffd5da7 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/delete.go b/cmd/delete.go index c448353..fa37326 100644 --- a/cmd/delete.go +++ b/cmd/delete.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/export.go b/cmd/export.go index ed94928..2fb1969 100644 --- a/cmd/export.go +++ b/cmd/export.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/export_appliance.go b/cmd/export_appliance.go index da61584..010245a 100644 --- a/cmd/export_appliance.go +++ b/cmd/export_appliance.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/export_exec_env_cfg.go b/cmd/export_exec_env_cfg.go index dd22915..d04eb51 100644 --- a/cmd/export_exec_env_cfg.go +++ b/cmd/export_exec_env_cfg.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/export_provider_metadata.go b/cmd/export_provider_metadata.go index 9e4f2ec..0343381 100644 --- a/cmd/export_provider_metadata.go +++ b/cmd/export_provider_metadata.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/import.go b/cmd/import.go index d8ceba1..773e97a 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/import_appliance.go b/cmd/import_appliance.go index b9c4b5b..b3c7660 100644 --- a/cmd/import_appliance.go +++ b/cmd/import_appliance.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/layout.go b/cmd/layout.go index ab5b863..f7f5110 100644 --- a/cmd/layout.go +++ b/cmd/layout.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/list.go b/cmd/list.go index d1cfd31..ec8bdd1 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/list_appliances.go b/cmd/list_appliances.go index 0796fd7..14e064a 100644 --- a/cmd/list_appliances.go +++ b/cmd/list_appliances.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/list_idsources.go b/cmd/list_idsources.go index ffc997b..959f233 100644 --- a/cmd/list_idsources.go +++ b/cmd/list_idsources.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/list_providers.go b/cmd/list_providers.go index a1d1182..a9d5e0a 100644 --- a/cmd/list_providers.go +++ b/cmd/list_providers.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/server-version.go b/cmd/server-version.go new file mode 100644 index 0000000..91b9ba6 --- /dev/null +++ b/cmd/server-version.go @@ -0,0 +1,40 @@ +package cmd + +/* +Copyright © 2022 atricore + +*/ + +import ( + "os" + + "github.com/spf13/cobra" +) + +// listCmd represents the list command +var serverVersionCmd = &cobra.Command{ + Use: "server-version", + Short: "shows current server version", + Args: cobra.MaximumNArgs(0), + Long: `shows the version for the configured server`, + RunE: func(cmd *cobra.Command, args []string) error { + v, err := serverVersion() + if err != nil { + client.Error(err) + os.Exit(1) + } + printOut(v + "\n") + + return nil + + }, +} + +func serverVersion() (string, error) { + + return client.Client().ServerVersion() +} + +func init() { + rootCmd.AddCommand(serverVersionCmd) +} diff --git a/cmd/start.go b/cmd/start.go index 843868c..37846cd 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/stop.go b/cmd/stop.go index 6bd7adc..3dd32c5 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/test.go b/cmd/test.go index f452a82..c477a34 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -1,5 +1,5 @@ package cmd /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ diff --git a/cmd/test_store.go b/cmd/test_store.go index 83ca2ae..b5890f1 100644 --- a/cmd/test_store.go +++ b/cmd/test_store.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/validate.go b/cmd/validate.go index f473da4..745f0b9 100644 --- a/cmd/validate.go +++ b/cmd/validate.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/version.go b/cmd/version.go index 9010faf..7e0fc84 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/view.go b/cmd/view.go index e784286..1a59a69 100644 --- a/cmd/view.go +++ b/cmd/view.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/view_appliance.go b/cmd/view_appliance.go index a58cb1d..27195e7 100644 --- a/cmd/view_appliance.go +++ b/cmd/view_appliance.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/view_idsource.go b/cmd/view_idsource.go index ed780c9..2f61b1d 100644 --- a/cmd/view_idsource.go +++ b/cmd/view_idsource.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/cmd/view_provider.go b/cmd/view_provider.go index 290130b..26611b7 100644 --- a/cmd/view_provider.go +++ b/cmd/view_provider.go @@ -1,5 +1,5 @@ /* -Copyright © 2022 NAME HERE +Copyright © 2022 atricore */ package cmd diff --git a/go.mod b/go.mod index b27a970..ea8a4c9 100644 --- a/go.mod +++ b/go.mod @@ -11,3 +11,7 @@ require ( golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 ) + +replace github.com/atricore/josso-api-go => ../josso-api-go + +replace github.com/atricore/josso-sdk-go => ../josso-sdk-go diff --git a/go.sum b/go.sum index 3266c20..67fe7bb 100644 --- a/go.sum +++ b/go.sum @@ -59,10 +59,6 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/atricore/josso-api-go v0.4.1 h1:cFIdmVR2t0QSLItmwRyBgxenO1wS8Uq5SH91Jj1fJEk= -github.com/atricore/josso-api-go v0.4.1/go.mod h1:Oys9D0y1x+bvyIsnRFl6JOYiIV7KQkuToIQa+jxeuHs= -github.com/atricore/josso-sdk-go v0.4.1 h1:TXV6VHTj296CL8ZeRTwa0FYHBAPCRWRkuy/MJ2UlfoM= -github.com/atricore/josso-sdk-go v0.4.1/go.mod h1:wuJAao5Vsc7BHf6lnS7yopqaZJZP3ddTBbB8ni9OUoU= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=