File tree Expand file tree Collapse file tree 5 files changed +17
-8
lines changed
cmd/ctrlc/root/api/create Expand file tree Collapse file tree 5 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ func NewCreateCmd() *cobra.Command {
1717 },
1818 }
1919
20- cmd .AddCommand (release .NewReleaseCmd ())
21- cmd .AddCommand (releasechannel .NewReleaseChannelCmd ())
22- cmd .AddCommand (environment .NewEnvironmentCmd ())
20+ cmd .AddCommand (release .NewCreateReleaseCmd ())
21+ cmd .AddCommand (releasechannel .NewCreateReleaseChannelCmd ())
22+ cmd .AddCommand (environment .NewCreateEnvironmentCmd ())
2323
2424 return cmd
2525}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
1212 "github.com/spf13/viper"
1313)
1414
15- func NewEnvironmentCmd () * cobra.Command {
15+ func NewCreateEnvironmentCmd () * cobra.Command {
1616 var nameFlag string
1717 var releaseChannels []string
1818 var expiresIn string
Original file line number Diff line number Diff line change 44 "fmt"
55
66 "github.com/MakeNowJust/heredoc/v2"
7+ "github.com/ctrlplanedev/cli/internal/api"
78 "github.com/spf13/cobra"
9+ "github.com/spf13/viper"
810)
911
1012func NewCreateRelationshipCmd () * cobra.Command {
@@ -40,8 +42,15 @@ func NewCreateRelationshipCmd() *cobra.Command {
4042 return nil
4143 },
4244 RunE : func (cmd * cobra.Command , args []string ) error {
43- // apiURL := viper.GetString("url")
44- // apiKey := viper.GetString("api-key")
45+ apiURL := viper .GetString ("url" )
46+ apiKey := viper .GetString ("api-key" )
47+
48+ _ , err := api .NewAPIKeyClientWithResponses (apiURL , apiKey )
49+ if err != nil {
50+ return fmt .Errorf ("failed to create relationship API client: %w" , err )
51+ }
52+
53+
4554
4655 // return cliutil.HandleOutput(cmd, response)
4756 return nil
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import (
1313 "github.com/spf13/viper"
1414)
1515
16- func NewReleaseCmd () * cobra.Command {
16+ func NewCreateReleaseCmd () * cobra.Command {
1717 var versionFlag string
1818 var deploymentID []string
1919 var metadata map [string ]string
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
1111 "github.com/spf13/viper"
1212)
1313
14- func NewReleaseChannelCmd () * cobra.Command {
14+ func NewCreateReleaseChannelCmd () * cobra.Command {
1515 var name string
1616 var deploymentID string
1717 var description string
You can’t perform that action at this time.
0 commit comments