@@ -23,25 +23,26 @@ import (
23
23
"github.com/elastic/cloud-sdk-go/pkg/api"
24
24
"github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi"
25
25
"github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi/noteapi"
26
- "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
26
+ sdkcmdutil "github.com/elastic/cloud-sdk-go/pkg/util/cmdutil"
27
27
"github.com/spf13/cobra"
28
28
29
+ cmdutil "github.com/elastic/ecctl/cmd/util"
29
30
"github.com/elastic/ecctl/pkg/ecctl"
30
31
)
31
32
32
33
// Command represents the deployment note subcommand.
33
34
var Command = & cobra.Command {
34
35
Use : "note" ,
35
- Short : "Manages a deployment's notes" ,
36
+ Short : cmdutil . AdminReqDescription ( "Manages a deployment's notes" ) ,
36
37
PreRunE : cobra .MaximumNArgs (0 ),
37
38
Run : func (cmd * cobra.Command , args []string ) { cmd .Help () },
38
39
}
39
40
40
41
var deploymentNoteCreateCmd = & cobra.Command {
41
42
Use : "create <deployment id> --comment <comment content>" ,
42
43
Aliases : []string {"add" },
43
- Short : "Adds a note to a deployment" ,
44
- PreRunE : cmdutil .MinimumNArgsAndUUID (1 ),
44
+ Short : cmdutil . AdminReqDescription ( "Adds a note to a deployment" ) ,
45
+ PreRunE : sdkcmdutil .MinimumNArgsAndUUID (1 ),
45
46
RunE : func (cmd * cobra.Command , args []string ) error {
46
47
comment , _ := cmd .Flags ().GetString ("comment" )
47
48
esID , err := getElasticsearchID (args [0 ], ecctl .Get ().API )
@@ -63,8 +64,8 @@ var deploymentNoteCreateCmd = &cobra.Command{
63
64
64
65
var deploymentNoteListCmd = & cobra.Command {
65
66
Use : "list <deployment id>" ,
66
- Short : "Lists the deployment notes" ,
67
- PreRunE : cmdutil .MinimumNArgsAndUUID (1 ),
67
+ Short : cmdutil . AdminReqDescription ( "Lists the deployment notes" ) ,
68
+ PreRunE : sdkcmdutil .MinimumNArgsAndUUID (1 ),
68
69
RunE : func (cmd * cobra.Command , args []string ) error {
69
70
esID , err := getElasticsearchID (args [0 ], ecctl .Get ().API )
70
71
if err != nil {
@@ -86,8 +87,8 @@ var deploymentNoteListCmd = &cobra.Command{
86
87
87
88
var deploymentNoteUpdateCmd = & cobra.Command {
88
89
Use : "update <deployment id> --id <note id> --comment <comment content>" ,
89
- Short : "Updates the deployment notes" ,
90
- PreRunE : cmdutil .MinimumNArgsAndUUID (1 ),
90
+ Short : cmdutil . AdminReqDescription ( "Updates the deployment notes" ) ,
91
+ PreRunE : sdkcmdutil .MinimumNArgsAndUUID (1 ),
91
92
RunE : func (cmd * cobra.Command , args []string ) error {
92
93
comment , _ := cmd .Flags ().GetString ("comment" )
93
94
noteID , _ := cmd .Flags ().GetString ("id" )
@@ -113,8 +114,8 @@ var deploymentNoteUpdateCmd = &cobra.Command{
113
114
114
115
var deploymentNoteShowCmd = & cobra.Command {
115
116
Use : "show <deployment id> --id <note id>" ,
116
- Short : "Shows a deployment note" ,
117
- PreRunE : cmdutil .MinimumNArgsAndUUID (1 ),
117
+ Short : cmdutil . AdminReqDescription ( "Shows a deployment note" ) ,
118
+ PreRunE : sdkcmdutil .MinimumNArgsAndUUID (1 ),
118
119
RunE : func (cmd * cobra.Command , args []string ) error {
119
120
noteID , _ := cmd .Flags ().GetString ("id" )
120
121
esID , err := getElasticsearchID (args [0 ], ecctl .Get ().API )
0 commit comments