diff --git a/cmd/ceph-destroy.go b/cmd/ceph-destroy.go index 985a671..aaccb8c 100644 --- a/cmd/ceph-destroy.go +++ b/cmd/ceph-destroy.go @@ -16,11 +16,12 @@ limitations under the License. package cmd import ( + "log" + "github.com/IoTCLI/cmd/utils" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/delete" - "log" //"time" ) @@ -63,7 +64,7 @@ func cephDestroy() { // destroyCmd represents the destroy command var cephDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destroy the Ceph cluster", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ceph-secrets.go b/cmd/ceph-secrets.go index 03766b7..e0b96ee 100644 --- a/cmd/ceph-secrets.go +++ b/cmd/ceph-secrets.go @@ -16,11 +16,12 @@ limitations under the License. package cmd import ( + "log" + "github.com/IoTCLI/cmd/utils" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/get" - "log" ) func getCredentials() { @@ -44,7 +45,7 @@ func getCredentials() { // secretsCmd represents the secrets command var cephSecretsCmd = &cobra.Command{ Use: "secrets", - Short: "A brief description of your command", + Short: "Get S3 secrets from ceph object storage", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ceph-setup.go b/cmd/ceph-setup.go index 6a64e05..dd723c0 100644 --- a/cmd/ceph-setup.go +++ b/cmd/ceph-setup.go @@ -16,13 +16,14 @@ limitations under the License. package cmd import ( + "log" + "time" + "github.com/IoTCLI/cmd/utils" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/apply" "k8s.io/kubectl/pkg/cmd/get" - "log" - "time" ) //Made from Instructions @https://opendatahub.io/docs/administration/advanced-installation/object-storage.html for installing @@ -96,7 +97,7 @@ func cephSetup() { // setupCmd represents the setup command var cephSetupCmd = &cobra.Command{ Use: "setup", - Short: "A brief description of your command", + Short: "Setup Ceph Object storage", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ceph.go b/cmd/ceph.go index b190e6a..4a79005 100644 --- a/cmd/ceph.go +++ b/cmd/ceph.go @@ -24,13 +24,8 @@ import ( // cephCmd represents the ceph command var cephCmd = &cobra.Command{ Use: "ceph", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Short: "Deploy Ceph object storage", + Long: `Deploy Ceph object storage`, Run: func(cmd *cobra.Command, args []string) { fmt.Println("ceph called") }, diff --git a/cmd/enmasse-IoT-addDevice.go b/cmd/enmasse-IoT-addDevice.go index 3fad0a4..16ff252 100644 --- a/cmd/enmasse-IoT-addDevice.go +++ b/cmd/enmasse-IoT-addDevice.go @@ -21,13 +21,15 @@ import ( //"os" "bytes" "crypto/tls" - "github.com/spf13/cobra" "net/http" "strings" + "github.com/spf13/cobra" + //in package import "github.com/IoTCLI/cmd/utils" "k8s.io/cli-runtime/pkg/genericclioptions" + //"k8s.io/kubectl/pkg/cmd/" "k8s.io/kubectl/pkg/cmd/get" ) @@ -113,7 +115,7 @@ func device(tenant string, deviceID string) { // addDeviceCmd represents the addDevice command var addDeviceCmd = &cobra.Command{ Use: "addDevice", - Short: "A brief description of your command", + Short: "Add an IoT device to enmasse", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/enmasse-IoT-project.go b/cmd/enmasse-IoT-project.go index 0ec53b6..fa94d1b 100644 --- a/cmd/enmasse-IoT-project.go +++ b/cmd/enmasse-IoT-project.go @@ -23,10 +23,8 @@ import ( "strings" "time" - "github.com/spf13/cobra" - - //in package import "github.com/IoTCLI/cmd/utils" + "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/apply" "k8s.io/kubectl/pkg/cmd/get" @@ -118,7 +116,7 @@ func createProject() { // projectCmd represents the project command var enmasseIoTProjectCmd = &cobra.Command{ Use: "project", - Short: "A brief description of your command", + Short: "Setup enmasse project", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/enmasse-IoT.go b/cmd/enmasse-IoT.go index 67aece6..e4c3fb8 100644 --- a/cmd/enmasse-IoT.go +++ b/cmd/enmasse-IoT.go @@ -24,7 +24,7 @@ import ( // IoTCmd represents the IoT command var enmasseIoTCmd = &cobra.Command{ Use: "IoT", - Short: "A brief description of your command", + Short: "Setup Enmasse IoT project", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/enmasse-destroy.go b/cmd/enmasse-destroy.go index 9232af0..b7d32f8 100644 --- a/cmd/enmasse-destroy.go +++ b/cmd/enmasse-destroy.go @@ -57,7 +57,7 @@ func enmasseDestroy() { // destroyCmd represents the destroy command var enmasseDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destroy enmasse project", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/enmasse-setup.go b/cmd/enmasse-setup.go index b87646f..04a768e 100644 --- a/cmd/enmasse-setup.go +++ b/cmd/enmasse-setup.go @@ -94,7 +94,7 @@ func enmasseSetup() { // setupCmd represents the setup command var enmasseSetupCmd = &cobra.Command{ Use: "setup", - Short: "A brief description of your command", + Short: "Setup Enmasse as a messaging backend", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/enmasse.go b/cmd/enmasse.go index 84dd526..8c40127 100644 --- a/cmd/enmasse.go +++ b/cmd/enmasse.go @@ -24,7 +24,7 @@ import ( // enmasseCmd represents the enmasse command var enmasseCmd = &cobra.Command{ Use: "enmasse", - Short: "A brief description of your command", + Short: "Setup Enmasse as a messaging backend", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/gstreamer-destroy.go b/cmd/gstreamer-destroy.go index 1ffbc0c..3617a97 100644 --- a/cmd/gstreamer-destroy.go +++ b/cmd/gstreamer-destroy.go @@ -57,7 +57,7 @@ func gstreamerDestroy() { // destroyCmd represents the destroy command var gstreamerDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destroy gstreamer deployment", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/gstreamer-setup.go b/cmd/gstreamer-setup.go index 80858c0..037a218 100644 --- a/cmd/gstreamer-setup.go +++ b/cmd/gstreamer-setup.go @@ -29,7 +29,7 @@ import ( // setupCmd represents the setup command var gstreamerSetupCmd = &cobra.Command{ Use: "setup", - Short: "A brief description of your command", + Short: "Setup Gstreamer with Openvino toolkit for video streaming and analytics", Long: `A longer descriptSion that spans multiple lines and likely contains examples and usage of using your command. For example: @@ -37,13 +37,12 @@ Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { - fmt.Println(" gstreamer setup called") - fstatus, _ := cmd.Flags().GetBool("float") - if fstatus { // if status is true, call addFloat - gstreamerSetup() - } else { - log.Println("a") + fmt.Println("Gstreamer setup called") + fstatus, _ := cmd.Flags().GetBool("local") + if fstatus { // if status is true, gstreamerLocalSetup() + } else { + gstreamerSetup() } }, } diff --git a/cmd/gstreamer.go b/cmd/gstreamer.go index 4cec986..610ec37 100644 --- a/cmd/gstreamer.go +++ b/cmd/gstreamer.go @@ -25,7 +25,7 @@ import ( // gstreamerCmd represents the gstreamer command var gstreamerCmd = &cobra.Command{ Use: "gstreamer", - Short: "A brief description of your command", + Short: "Setup Gstreamer with OpenVino toolkit for video streaming with analytics ", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/kafka-bridge-destroy.go b/cmd/kafka-bridge-destroy.go index 12c245a..5ae4309 100644 --- a/cmd/kafka-bridge-destroy.go +++ b/cmd/kafka-bridge-destroy.go @@ -95,7 +95,7 @@ func kafkaBridgeDestroy() { // destroyCmd represents the destroy command var kafkaBridgeDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destory the Kafka Bridge", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: @@ -103,13 +103,13 @@ Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { - fstatus, _ := cmd.Flags().GetBool("float") - if fstatus { // if status is true, call addFloat + fstatus, _ := cmd.Flags().GetBool("route") + if fstatus { // if status is true, call Kafka bridge destroy with route log.Println("Kafka Bridge Destroy called") - kafkaBridgeDestroy() + kafkaBridgeRouteDestroy() } else { log.Println("Kafka Bridge Destroy called") - kafkaBridgeRouteDestroy() + kafkaBridgeDestroy() } }, } diff --git a/cmd/kafka-bridge.go b/cmd/kafka-bridge.go index 4b42b9d..ce0bf58 100644 --- a/cmd/kafka-bridge.go +++ b/cmd/kafka-bridge.go @@ -95,7 +95,7 @@ func kafkaBridgeRoute() { // bridgeCmd represents the bridge command var kafkaBridgeCmd = &cobra.Command{ Use: "bridge", - Short: "A brief description of your command", + Short: "Setup Kafka bridge to send data over to the Kafka cluster", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: @@ -104,13 +104,13 @@ This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { - fstatus, _ := cmd.Flags().GetBool("float") + fstatus, _ := cmd.Flags().GetBool("route") if fstatus { // if status is true, call addFloat - log.Println("Kafka Http Bridge called using Ingress") - kafkaBridge() - } else { log.Println("Kafka Http Bridge called using Route") kafkaBridgeRoute() + } else { + log.Println("Kafka Http Bridge called using Ingress") + kafkaBridge() } }, diff --git a/cmd/kafka-destroy.go b/cmd/kafka-destroy.go index 30dfc1f..9932f71 100644 --- a/cmd/kafka-destroy.go +++ b/cmd/kafka-destroy.go @@ -16,11 +16,12 @@ limitations under the License. package cmd import ( + "log" + "github.com/IoTCLI/cmd/utils" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/delete" - "log" ) var ( @@ -39,8 +40,10 @@ func kafkaDestroy() { co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/setup/kafka.yaml") co.Commands = append(co.Commands, "https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.17.0/strimzi-cluster-operator-0.17.0.yaml") co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/setup/kafka-namespace.yaml") - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml") - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/cloud-generic.yaml") + + //Destroying kafka + // co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml") + // co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/cloud-generic.yaml") // IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() @@ -63,7 +66,7 @@ func kafkaDestroy() { // destroyCmd represents the destroy command var kafkaDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destroy the Kafka cluster along with Strimzi operator", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/kafka.go b/cmd/kafka.go index 7b64987..965e842 100644 --- a/cmd/kafka.go +++ b/cmd/kafka.go @@ -24,7 +24,7 @@ import ( // kafkaCmd represents the kafka command var kafkaCmd = &cobra.Command{ Use: "kafka", - Short: "A brief description of your command", + Short: "Setup kafka as the messaging backend", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/knative-destroy.go b/cmd/knative-destroy.go index fc287bc..78eebc0 100644 --- a/cmd/knative-destroy.go +++ b/cmd/knative-destroy.go @@ -24,6 +24,7 @@ import ( //in package import "github.com/IoTCLI/cmd/utils" "k8s.io/cli-runtime/pkg/genericclioptions" + //"k8s.io/kubectl/pkg/cmd/" "k8s.io/kubectl/pkg/cmd/delete" ) @@ -76,7 +77,7 @@ func destroyKnative() { // destroyCmd represents the destroy command var knativeDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destroy Knative serving and eventing", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: @@ -84,7 +85,7 @@ Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { - log.Println("destroy called") + log.Println("knative destroy called") destroyKnative() }, } diff --git a/cmd/knative-service.go b/cmd/knative-service.go index caf2136..6bc0591 100644 --- a/cmd/knative-service.go +++ b/cmd/knative-service.go @@ -17,15 +17,16 @@ package cmd import ( b64 "encoding/base64" + "io/ioutil" + "log" + "os" + "strings" + "github.com/IoTCLI/cmd/utils" "github.com/spf13/cobra" - "io/ioutil" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/apply" "k8s.io/kubectl/pkg/cmd/get" - "log" - "os" - "strings" ) var ( @@ -197,7 +198,7 @@ func logs(name string) { // serviceCmd represents the service command var knativeServiceCmd = &cobra.Command{ Use: "service", - Short: "A brief description of your command", + Short: "Setup Knative service for video analtytics", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/knative-setup.go b/cmd/knative-setup.go index 7a5d13c..9166664 100644 --- a/cmd/knative-setup.go +++ b/cmd/knative-setup.go @@ -24,11 +24,13 @@ import ( //in package import "github.com/IoTCLI/cmd/utils" "k8s.io/cli-runtime/pkg/genericclioptions" + //"k8s.io/kubectl/pkg/cmd/" - "k8s.io/kubectl/pkg/cmd/apply" - "k8s.io/kubectl/pkg/cmd/get" "strings" "time" + + "k8s.io/kubectl/pkg/cmd/apply" + "k8s.io/kubectl/pkg/cmd/get" ) //var setupStatus = false @@ -202,7 +204,7 @@ func knativeStatus() { // setupCmd represents the setup command var knativeSetupCmd = &cobra.Command{ Use: "setup", - Short: "A brief description of your command", + Short: "Setup Knative serving and eventing for serverless application", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/knative-source-destroy.go b/cmd/knative-source-destroy.go index c3e8e69..95d7146 100644 --- a/cmd/knative-source-destroy.go +++ b/cmd/knative-source-destroy.go @@ -25,6 +25,7 @@ import ( //in package import "github.com/IoTCLI/cmd/utils" "k8s.io/cli-runtime/pkg/genericclioptions" + //"k8s.io/kubectl/pkg/cmd/" "k8s.io/kubectl/pkg/cmd/delete" ) @@ -67,7 +68,7 @@ func desContainerSource(source string) { // destroyCmd represents the destroy command var knativeSourceDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destroy Knative Source eployment", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/knative.go b/cmd/knative.go index e74fc0a..9802418 100644 --- a/cmd/knative.go +++ b/cmd/knative.go @@ -24,7 +24,7 @@ import ( // knativeCmd represents the knative command var knativeCmd = &cobra.Command{ Use: "knative", - Short: "A brief description of your command", + Short: "Setup Knative serving and eventing for serverless application", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/login.go b/cmd/login.go index a15784e..a2a7167 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -17,12 +17,13 @@ package cmd import ( "fmt" - "github.com/IoTCLI/cmd/utils" - "github.com/spf13/cobra" - "golang.org/x/crypto/ssh/terminal" "log" "os" "os/exec" + + "github.com/IoTCLI/cmd/utils" + "github.com/spf13/cobra" + "golang.org/x/crypto/ssh/terminal" ) func login() { @@ -56,7 +57,7 @@ func login() { // loginCmd represents the login command var loginCmd = &cobra.Command{ Use: "login", - Short: "A brief description of your command", + Short: "Login to the Openshift Cluster", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/root.go b/cmd/root.go index ad836c6..a170f19 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,9 +17,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "os" + "github.com/spf13/cobra" + homedir "github.com/mitchellh/go-homedir" "github.com/spf13/viper" ) @@ -29,13 +30,9 @@ var cfgFile string // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "IoTCLI", - Short: "A brief description of your application", - Long: `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Short: "Setting up Cloud native Egde Applications with various messaging backends", + Long: `Setting up Cloud native Egde Applications with various messaging backends. +Allows user to track the IoTDevices, setup various messaging backends like Kafka or Enmasse, deploy gstreamer analytics as smart edge device etc`, // Uncomment the following line if your bare application // has an action associated with it: // Run: func(cmd *cobra.Command, args []string) { }, diff --git a/cmd/tensorflowServing-destroy.go b/cmd/tensorflowServing-destroy.go index 72655f6..acd3b52 100644 --- a/cmd/tensorflowServing-destroy.go +++ b/cmd/tensorflowServing-destroy.go @@ -16,11 +16,12 @@ limitations under the License. package cmd import ( + "log" + "github.com/IoTCLI/cmd/utils" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/delete" - "log" ) func tensorflowServingDestroy() { @@ -52,7 +53,7 @@ func tensorflowServingDestroy() { // tensorflowServingDestroyCmd represents the tensorflowServingDestroy command var tensorflowServingDestroyCmd = &cobra.Command{ Use: "destroy", - Short: "A brief description of your command", + Short: "Destroy the deployed tensorflow service", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/tensorflowServing-setup.go b/cmd/tensorflowServing-setup.go index f81fc8b..442545d 100644 --- a/cmd/tensorflowServing-setup.go +++ b/cmd/tensorflowServing-setup.go @@ -16,11 +16,12 @@ limitations under the License. package cmd import ( + "log" + "github.com/IoTCLI/cmd/utils" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/kubectl/pkg/cmd/apply" - "log" ) func tensorflowServingSetup() { @@ -51,7 +52,7 @@ func tensorflowServingSetup() { // tensorflowServingSetupCmd represents the tensorflowServingSetup command var tensorflowServingSetupCmd = &cobra.Command{ Use: "setup", - Short: "A brief description of your command", + Short: "Setup tensorflow service for analtyics", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/tensorflowServing.go b/cmd/tensorflowServing.go index ae9a49e..e022a4c 100644 --- a/cmd/tensorflowServing.go +++ b/cmd/tensorflowServing.go @@ -28,7 +28,7 @@ var ( // tensorflowServingCmd represents the tensorflowServing command var tensorflowServingCmd = &cobra.Command{ Use: "tensorflowServing", - Short: "A brief description of your command", + Short: "Setup a tensorflow service for analytics", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: