--- /dev/null
+/*
+Copyright © 2020 NAME HERE <EMAIL ADDRESS>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package cmd
+
+import (
+ "fmt"
+
+ appCmds "ealt/cmd/appm"
+
+ "github.com/spf13/cobra"
+)
+
+// appCmd represents the app command
+var appCmd = &cobra.Command{
+ Use: "app",
+ Short: "The command is used for Application Management in the EALT Edge System.",
+ Long: `The command is used for Application Management in the EALT Edge System.
+ It has multiple options like create , delete`,
+ Run: func(cmd *cobra.Command, args []string) {
+ fmt.Println("app called")
+ },
+}
+
+func init() {
+ appCmd.AddCommand(appCmds.NewAppCreateCommand())
+ appCmd.AddCommand(appCmds.NewAppDeleteCommand())
+
+ rootCmd.AddCommand(appCmd)
+}
--- /dev/null
+/*
+Copyright © 2020 NAME HERE <EMAIL ADDRESS>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package cmd
+
+import (
+ "fmt"
+
+ applcmCmds "ealt/cmd/applcmpkg"
+
+ "github.com/spf13/cobra"
+)
+
+// applcmCmd represents the applcm command
+var applcmCmd = &cobra.Command{
+ Use: "applcm",
+ 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.`,
+ Run: func(cmd *cobra.Command, args []string) {
+ fmt.Println("applcm called")
+ },
+}
+
+func init() {
+
+ applcmCmd.AddCommand(applcmCmds.NewApplcmCreateCommand())
+ rootCmd.AddCommand(applcmCmd)
+
+}
--- /dev/null
+/*
+Copyright 2020 Huawei Technologies Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package applcmpkg
+
+import (
+ "ealt/cmd/adapter"
+
+ "github.com/spf13/cobra"
+)
+
+// allCmd represents the all command
+func NewApplcmDeleteCommand() *cobra.Command {
+ var cmd = &cobra.Command{
+ Use: "delete",
+ Short: "Install Complete EALT Deployment Environment",
+ Long: `Install Complete EALT Deployment Environment`,
+ RunE: func(cmd *cobra.Command, args []string) error {
+ applicationIdArg := cmd.Flag("appid")
+ applicationId := applicationIdArg.Value.String()
+ err := adapter.BuilderRequest(applicationId, "NewApplcmDeleteCommand")
+ if err != nil {
+ return err
+ }
+ return nil
+ },
+ }
+
+ cmd.Flags().StringP("appid", "i", "", "Application Package ID to be deleted from MEP")
+
+ return cmd
+}
--- /dev/null
+/*
+Copyright 2020 Huawei Technologies Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package applcmpkg
+
+import (
+ "ealt/cmd/adapter"
+
+ "github.com/spf13/cobra"
+)
+
+// deployCmd represents the deploy command
+func NewApplcmStartCommand() *cobra.Command {
+ var cmd = &cobra.Command{
+ Use: "start",
+ Short: "To start the application instance on MEP Node",
+ Long: `To start the application instance on MEP Node`,
+ RunE: func(cmd *cobra.Command, args []string) error {
+ appIdArg := cmd.Flag("appid")
+ applicationId := appIdArg.Value.String()
+ err := adapter.BuilderRequest(applicationId, "NewApplcmStartCommand")
+ if err != nil {
+ return err
+ }
+ return nil
+ },
+ }
+ cmd.Flags().StringP("appid", "i", "", "Application Instance ID to be started")
+ return cmd
+}
--- /dev/null
+/*
+Copyright 2020 Huawei Technologies Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package applcmpkg
+
+import (
+ "ealt/cmd/adapter"
+
+ "github.com/spf13/cobra"
+)
+
+// allCmd represents the all command
+func NewApplcmTerminateCommand() *cobra.Command {
+ var cmd = &cobra.Command{
+ Use: "kill",
+ Short: "To kill the application ",
+ Long: `Install Complete EALT Deployment Environment`,
+ RunE: func(cmd *cobra.Command, args []string) error {
+ appIdArg := cmd.Flag("appid")
+ applicationId := appIdArg.Value.String()
+ err := adapter.BuilderRequest(applicationId, "NewApplcmTerminateCommand")
+ if err != nil {
+ return err
+ }
+ return nil
+ },
+ }
+
+ cmd.Flags().StringP("appid", "i", "", "Application Instance ID to be terminated")
+
+ return cmd
+}
--- /dev/null
+/*
+Copyright 2020 Huawei Technologies Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package appm
+
+import (
+ "ealt/cmd/adapter"
+
+ "github.com/spf13/cobra"
+)
+
+// allCmd represents the all command
+func NewAppDeleteCommand() *cobra.Command {
+ var cmd = &cobra.Command{
+ Use: "delete",
+ Short: "Install Complete EALT Deployment Environment",
+ Long: `Install Complete EALT Deployment Environment`,
+ RunE: func(cmd *cobra.Command, args []string) error {
+ pkgidArg := cmd.Flag("pkgid")
+ packageId := pkgidArg.Value.String()
+ err := adapter.BuilderRequest(packageId, "NewAppDeleteCommand")
+ if err != nil {
+ return err
+ }
+ return nil
+ },
+ }
+
+ cmd.Flags().StringP("pkgid", "i", "", "Application Package ID to be deleted from MEP")
+
+ return cmd
+}