api.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package sdk
  2. import (
  3. "context"
  4. cf "github.com/aws/aws-sdk-go/service/cloudformation"
  5. "github.com/awslabs/goformation/v4/cloudformation"
  6. "github.com/docker/ecs-plugin/pkg/compose"
  7. )
  8. type API interface {
  9. CheckRequirements(ctx context.Context) error
  10. GetDefaultVPC(ctx context.Context) (string, error)
  11. VpcExists(ctx context.Context, vpcID string) (bool, error)
  12. GetSubNets(ctx context.Context, vpcID string) ([]string, error)
  13. StackExists(ctx context.Context, name string) (bool, error)
  14. CreateStack(ctx context.Context, name string, template *cloudformation.Template, parameters map[string]string) error
  15. DeleteStack(ctx context.Context, name string) error
  16. ListStackParameters(ctx context.Context, name string) (map[string]string, error)
  17. ListStackResources(ctx context.Context, name string) ([]compose.StackResource, error)
  18. GetStackID(ctx context.Context, name string) (string, error)
  19. WaitStackComplete(ctx context.Context, name string, operation int) error
  20. DescribeStackEvents(ctx context.Context, stackID string) ([]*cf.StackEvent, error)
  21. DescribeServices(ctx context.Context, cluster string, arns []string) ([]compose.ServiceStatus, error)
  22. LoadBalancerExists(ctx context.Context, arn string) (bool, error)
  23. GetLoadBalancerURL(ctx context.Context, arn string) (string, error)
  24. ClusterExists(ctx context.Context, name string) (bool, error)
  25. GetLogs(ctx context.Context, name string, consumer compose.LogConsumer) error
  26. CreateSecret(ctx context.Context, secret compose.Secret) (string, error)
  27. InspectSecret(ctx context.Context, id string) (compose.Secret, error)
  28. ListSecrets(ctx context.Context) ([]compose.Secret, error)
  29. DeleteSecret(ctx context.Context, id string, recover bool) error
  30. }