Renamed package and removed unused make calls
This commit is contained in:
parent
7c5db7fa39
commit
55e9f86759
16 changed files with 91 additions and 103 deletions
24
cmd/app.go
24
cmd/app.go
|
|
@ -7,7 +7,7 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"edp.buildth.ing/DevFW-CICD/edge-connect-client/sdk/client"
|
||||
"edp.buildth.ing/DevFW-CICD/edge-connect-client/sdk/edgeconnect"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
|
@ -19,20 +19,20 @@ var (
|
|||
region string
|
||||
)
|
||||
|
||||
func newSDKClient() *client.Client {
|
||||
func newSDKClient() *edgeconnect.Client {
|
||||
baseURL := viper.GetString("base_url")
|
||||
username := viper.GetString("username")
|
||||
password := viper.GetString("password")
|
||||
|
||||
if username != "" && password != "" {
|
||||
return client.NewClientWithCredentials(baseURL, username, password,
|
||||
client.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
|
||||
return edgeconnect.NewClientWithCredentials(baseURL, username, password,
|
||||
edgeconnect.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
|
||||
)
|
||||
}
|
||||
|
||||
// Fallback to no auth for now - in production should require auth
|
||||
return client.NewClient(baseURL,
|
||||
client.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
|
||||
return edgeconnect.NewClient(baseURL,
|
||||
edgeconnect.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -47,10 +47,10 @@ var createAppCmd = &cobra.Command{
|
|||
Short: "Create a new Edge Connect application",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
input := &client.NewAppInput{
|
||||
input := &edgeconnect.NewAppInput{
|
||||
Region: region,
|
||||
App: client.App{
|
||||
Key: client.AppKey{
|
||||
App: edgeconnect.App{
|
||||
Key: edgeconnect.AppKey{
|
||||
Organization: organization,
|
||||
Name: appName,
|
||||
Version: appVersion,
|
||||
|
|
@ -72,7 +72,7 @@ var showAppCmd = &cobra.Command{
|
|||
Short: "Show details of an Edge Connect application",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
appKey := client.AppKey{
|
||||
appKey := edgeconnect.AppKey{
|
||||
Organization: organization,
|
||||
Name: appName,
|
||||
Version: appVersion,
|
||||
|
|
@ -92,7 +92,7 @@ var listAppsCmd = &cobra.Command{
|
|||
Short: "List Edge Connect applications",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
appKey := client.AppKey{
|
||||
appKey := edgeconnect.AppKey{
|
||||
Organization: organization,
|
||||
Name: appName,
|
||||
Version: appVersion,
|
||||
|
|
@ -115,7 +115,7 @@ var deleteAppCmd = &cobra.Command{
|
|||
Short: "Delete an Edge Connect application",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
appKey := client.AppKey{
|
||||
appKey := edgeconnect.AppKey{
|
||||
Organization: organization,
|
||||
Name: appName,
|
||||
Version: appVersion,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"edp.buildth.ing/DevFW-CICD/edge-connect-client/sdk/client"
|
||||
"edp.buildth.ing/DevFW-CICD/edge-connect-client/sdk/edgeconnect"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
|
@ -27,23 +27,23 @@ var createInstanceCmd = &cobra.Command{
|
|||
Short: "Create a new Edge Connect application instance",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
input := &client.NewAppInstanceInput{
|
||||
input := &edgeconnect.NewAppInstanceInput{
|
||||
Region: region,
|
||||
AppInst: client.AppInstance{
|
||||
Key: client.AppInstanceKey{
|
||||
AppInst: edgeconnect.AppInstance{
|
||||
Key: edgeconnect.AppInstanceKey{
|
||||
Organization: organization,
|
||||
Name: instanceName,
|
||||
CloudletKey: client.CloudletKey{
|
||||
CloudletKey: edgeconnect.CloudletKey{
|
||||
Organization: cloudletOrg,
|
||||
Name: cloudletName,
|
||||
},
|
||||
},
|
||||
AppKey: client.AppKey{
|
||||
AppKey: edgeconnect.AppKey{
|
||||
Organization: organization,
|
||||
Name: appName,
|
||||
Version: appVersion,
|
||||
},
|
||||
Flavor: client.Flavor{
|
||||
Flavor: edgeconnect.Flavor{
|
||||
Name: flavorName,
|
||||
},
|
||||
},
|
||||
|
|
@ -63,10 +63,10 @@ var showInstanceCmd = &cobra.Command{
|
|||
Short: "Show details of an Edge Connect application instance",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
instanceKey := client.AppInstanceKey{
|
||||
instanceKey := edgeconnect.AppInstanceKey{
|
||||
Organization: organization,
|
||||
Name: instanceName,
|
||||
CloudletKey: client.CloudletKey{
|
||||
CloudletKey: edgeconnect.CloudletKey{
|
||||
Organization: cloudletOrg,
|
||||
Name: cloudletName,
|
||||
},
|
||||
|
|
@ -86,10 +86,10 @@ var listInstancesCmd = &cobra.Command{
|
|||
Short: "List Edge Connect application instances",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
instanceKey := client.AppInstanceKey{
|
||||
instanceKey := edgeconnect.AppInstanceKey{
|
||||
Organization: organization,
|
||||
Name: instanceName,
|
||||
CloudletKey: client.CloudletKey{
|
||||
CloudletKey: edgeconnect.CloudletKey{
|
||||
Organization: cloudletOrg,
|
||||
Name: cloudletName,
|
||||
},
|
||||
|
|
@ -112,10 +112,10 @@ var deleteInstanceCmd = &cobra.Command{
|
|||
Short: "Delete an Edge Connect application instance",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
c := newSDKClient()
|
||||
instanceKey := client.AppInstanceKey{
|
||||
instanceKey := edgeconnect.AppInstanceKey{
|
||||
Organization: organization,
|
||||
Name: instanceName,
|
||||
CloudletKey: client.CloudletKey{
|
||||
CloudletKey: edgeconnect.CloudletKey{
|
||||
Organization: cloudletOrg,
|
||||
Name: cloudletName,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue