2022-04-13 13:01:38 +02:00
|
|
|
package cloudcmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-06-07 16:30:41 +02:00
|
|
|
azurecl "github.com/edgelesssys/constellation/cli/internal/azure/client"
|
2022-06-07 14:52:47 +02:00
|
|
|
gcpcl "github.com/edgelesssys/constellation/cli/internal/gcp/client"
|
2022-04-13 13:01:38 +02:00
|
|
|
"github.com/edgelesssys/constellation/internal/state"
|
|
|
|
)
|
|
|
|
|
|
|
|
type gcpclient interface {
|
2022-08-01 12:35:35 +02:00
|
|
|
GetState() state.ConstellationState
|
|
|
|
SetState(state.ConstellationState)
|
2022-05-16 18:54:25 +02:00
|
|
|
CreateVPCs(ctx context.Context) error
|
2022-04-13 13:01:38 +02:00
|
|
|
CreateFirewall(ctx context.Context, input gcpcl.FirewallInput) error
|
|
|
|
CreateInstances(ctx context.Context, input gcpcl.CreateInstancesInput) error
|
2022-08-01 16:51:34 +02:00
|
|
|
CreateLoadBalancers(ctx context.Context) error
|
2022-04-13 13:01:38 +02:00
|
|
|
TerminateFirewall(ctx context.Context) error
|
|
|
|
TerminateVPCs(context.Context) error
|
2022-08-01 16:51:34 +02:00
|
|
|
TerminateLoadBalancers(context.Context) error
|
2022-04-13 13:01:38 +02:00
|
|
|
TerminateInstances(context.Context) error
|
|
|
|
Close() error
|
|
|
|
}
|
|
|
|
|
|
|
|
type azureclient interface {
|
2022-08-01 12:35:35 +02:00
|
|
|
GetState() state.ConstellationState
|
|
|
|
SetState(state.ConstellationState)
|
2022-06-10 13:18:30 +02:00
|
|
|
CreateApplicationInsight(ctx context.Context) error
|
2022-04-13 13:01:38 +02:00
|
|
|
CreateResourceGroup(ctx context.Context) error
|
2022-05-24 10:04:42 +02:00
|
|
|
CreateExternalLoadBalancer(ctx context.Context) error
|
2022-04-13 13:01:38 +02:00
|
|
|
CreateVirtualNetwork(ctx context.Context) error
|
|
|
|
CreateSecurityGroup(ctx context.Context, input azurecl.NetworkSecurityGroupInput) error
|
|
|
|
CreateInstances(ctx context.Context, input azurecl.CreateInstancesInput) error
|
|
|
|
// TODO: deprecate as soon as scale sets are available
|
|
|
|
CreateInstancesVMs(ctx context.Context, input azurecl.CreateInstancesInput) error
|
|
|
|
CreateServicePrincipal(ctx context.Context) (string, error)
|
|
|
|
TerminateResourceGroup(ctx context.Context) error
|
|
|
|
TerminateServicePrincipal(ctx context.Context) error
|
|
|
|
}
|