aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/emcoctl/cmd/delete.go
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-09-02 21:28:23 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-02 21:28:23 +0000
commita330e54f63ecadf3b9332e9504cb51f843a2d853 (patch)
treeb8e54b1f171f7a8a0064fdd883fe218e4ec96a7c /src/tools/emcoctl/cmd/delete.go
parent1898c1f1ece6ec8c02d599f1ca4f1cda1166e0de (diff)
parentd8ed6e76a40b8942c2b56c623dcc097d734e3dca (diff)
Merge "Update CLI with complete get implementation"
Diffstat (limited to 'src/tools/emcoctl/cmd/delete.go')
-rw-r--r--src/tools/emcoctl/cmd/delete.go20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/tools/emcoctl/cmd/delete.go b/src/tools/emcoctl/cmd/delete.go
index d6dbfe34..faa52b5b 100644
--- a/src/tools/emcoctl/cmd/delete.go
+++ b/src/tools/emcoctl/cmd/delete.go
@@ -1,5 +1,5 @@
/*
-Copyright © 2020 Intel Corp
+Copyright © 2020 Intel Corp
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,9 +24,8 @@ import (
// deleteCmd represents the delete command
var deleteCmd = &cobra.Command{
Use: "delete",
- Short: "Delete resources in input file or commandline",
+ Short: "Delete the resources from input file or url from command line",
Run: func(cmd *cobra.Command, args []string) {
- fmt.Println("delete called")
c := NewRestClient()
if len(inputFiles) > 0 {
resources := readResources()
@@ -35,23 +34,14 @@ var deleteCmd = &cobra.Command{
c.RestClientDelete(res.anchor, res.body)
}
} else if len(args) >= 1 {
- fmt.Println(args[0])
- c.RestClientDelete(args[0], nil)
+ c.RestClientDeleteAnchor(args[0])
+ } else {
+ fmt.Println("Error: No args ")
}
},
}
func init() {
rootCmd.AddCommand(deleteCmd)
-
- // Here you will define your flags and configuration settings.
-
- // Cobra supports Persistent Flags which will work for this command
- // and all subcommands, e.g.:
- // deleteCmd.PersistentFlags().String("foo", "", "A help for foo")
-
- // Cobra supports local flags which will only run when this command
- // is called directly, e.g.:
- // deleteCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
deleteCmd.Flags().StringSliceVarP(&inputFiles, "filename", "f", []string{}, "Filename of the input file")
}