@@ -19,8 +19,10 @@ package cmdinstanceconfig
1919
2020import (
2121"path/filepath"
22+ "strconv"
2223
2324"github.com/elastic/cloud-sdk-go/pkg/api/platformapi/instanceconfigapi"
25+ "github.com/elastic/cloud-sdk-go/pkg/util/ec"
2426"github.com/spf13/cobra"
2527
2628cmdutil "github.com/elastic/ecctl/cmd/util"
@@ -32,10 +34,27 @@ var showCmd = &cobra.Command{
3234Short : cmdutil .AdminReqDescription ("Shows an instance configuration" ),
3335PreRunE : cobra .ExactArgs (1 ),
3436RunE : func (cmd * cobra.Command , args []string ) error {
37+ configVersion , _ := cmd .Flags ().GetString ("config-version" )
38+ showDeleted , _ := cmd .Flags ().GetBool ("show-deleted" )
39+
40+ var version * int64 = nil
41+
42+ if configVersion != "" {
43+ parsedVersion , err := strconv .ParseInt (configVersion , 10 , 64 )
44+
45+ version = ec .Int64 (parsedVersion )
46+
47+ if err != nil {
48+ return err
49+ }
50+ }
51+
3552res , err := instanceconfigapi .Get (instanceconfigapi.GetParams {
36- API : ecctl .Get ().API ,
37- Region : ecctl .Get ().Config .Region ,
38- ID : args [0 ],
53+ API : ecctl .Get ().API ,
54+ Region : ecctl .Get ().Config .Region ,
55+ ID : args [0 ],
56+ ConfigVersion : version ,
57+ ShowDeleted : showDeleted ,
3958})
4059
4160if err != nil {
@@ -48,4 +67,6 @@ var showCmd = &cobra.Command{
4867
4968func init () {
5069Command .AddCommand (showCmd )
70+ showCmd .Flags ().StringP ("config-version" , "v" , "" , "Instance configuration version" )
71+ showCmd .Flags ().Bool ("show-deleted" , false , "If set to true, allows to show deleted instance configurations" )
5172}
0 commit comments