client

package
v0.12.12-rc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const REQUIRED_SUCCESS_WAIT_COUNT = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	Endpoint      string
	Token         string
	VerifyVersion bool
	Clock         waitutils.Clock
	// contains filtered or unexported fields
}

func NewAPIClient

func NewAPIClient(config Config) *APIClient

func (*APIClient) CreateDeploy

func (c *APIClient) CreateDeploy(name string, content []byte) (*models.Deploy, error)

func (*APIClient) CreateEnvironment

func (c *APIClient) CreateEnvironment(name, instanceSize string, minCount int, userData []byte, os, amiID string) (*models.Environment, error)
func (c *APIClient) CreateLink(sourceID string, destinationID string) error

func (*APIClient) CreateLoadBalancer

func (c *APIClient) CreateLoadBalancer(name, environmentID string, healthCheck models.HealthCheck, ports []models.Port, isPublic bool, idleTimeout int, crossZone bool) (*models.LoadBalancer, error)

func (*APIClient) CreateService

func (c *APIClient) CreateService(name, environmentID, deployID, serviceID string) (*models.Service, error)

func (*APIClient) CreateTask

func (c *APIClient) CreateTask(
	name string,
	environmentID string,
	deployID string,
	overrides []models.ContainerOverride,
) (string, error)

func (*APIClient) Delete

func (c *APIClient) Delete(id string) error

func (*APIClient) DeleteDeploy

func (c *APIClient) DeleteDeploy(id string) error

func (*APIClient) DeleteEnvironment

func (c *APIClient) DeleteEnvironment(id string) (string, error)
func (c *APIClient) DeleteLink(sourceID string, destinationID string) error

func (*APIClient) DeleteLoadBalancer

func (c *APIClient) DeleteLoadBalancer(id string) (string, error)

func (*APIClient) DeleteService

func (c *APIClient) DeleteService(id string) (string, error)

func (*APIClient) DeleteTask

func (c *APIClient) DeleteTask(id string) error

func (*APIClient) Execute

func (c *APIClient) Execute(sling *sling.Sling, receive interface{}) error

func (*APIClient) ExecuteWithJob

func (c *APIClient) ExecuteWithJob(sling *sling.Sling) (string, error)

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() (*models.APIConfig, error)

func (*APIClient) GetDeploy

func (c *APIClient) GetDeploy(id string) (*models.Deploy, error)

func (*APIClient) GetEnvironment

func (c *APIClient) GetEnvironment(id string) (*models.Environment, error)

func (*APIClient) GetJob

func (c *APIClient) GetJob(id string) (*models.Job, error)

func (*APIClient) GetLoadBalancer

func (c *APIClient) GetLoadBalancer(id string) (*models.LoadBalancer, error)

func (*APIClient) GetService

func (c *APIClient) GetService(id string) (*models.Service, error)

func (*APIClient) GetServiceLogs

func (c *APIClient) GetServiceLogs(id, start, end string, tail int) ([]*models.LogFile, error)

func (*APIClient) GetTask

func (c *APIClient) GetTask(id string) (*models.Task, error)

func (*APIClient) GetTaskLogs

func (c *APIClient) GetTaskLogs(id, start, end string, tail int) ([]*models.LogFile, error)

func (*APIClient) GetVersion

func (c *APIClient) GetVersion() (string, error)

func (*APIClient) ListDeploys

func (c *APIClient) ListDeploys() ([]*models.DeploySummary, error)

func (*APIClient) ListEnvironments

func (c *APIClient) ListEnvironments() ([]*models.EnvironmentSummary, error)

func (*APIClient) ListJobs

func (c *APIClient) ListJobs() ([]*models.Job, error)

func (*APIClient) ListLoadBalancers

func (c *APIClient) ListLoadBalancers() ([]*models.LoadBalancerSummary, error)

func (*APIClient) ListServices

func (c *APIClient) ListServices() ([]*models.ServiceSummary, error)

func (*APIClient) ListTasks

func (c *APIClient) ListTasks() ([]*models.TaskSummary, error)

func (*APIClient) RunScaler

func (c *APIClient) RunScaler(environmentID string) (*models.ScalerRunInfo, error)

func (*APIClient) ScaleService

func (c *APIClient) ScaleService(id string, count int) (*models.Service, error)

func (*APIClient) SelectByQuery

func (c *APIClient) SelectByQuery(params map[string]string) ([]*models.EntityWithTags, error)

func (*APIClient) Sling

func (c *APIClient) Sling(path string) *sling.Sling

func (*APIClient) UpdateEnvironment

func (c *APIClient) UpdateEnvironment(id string, minCount int) (*models.Environment, error)

func (*APIClient) UpdateLoadBalancerCrossZone added in v0.11.0

func (c *APIClient) UpdateLoadBalancerCrossZone(id string, crossZone bool) (*models.LoadBalancer, error)

func (*APIClient) UpdateLoadBalancerHealthCheck

func (c *APIClient) UpdateLoadBalancerHealthCheck(id string, healthCheck models.HealthCheck) (*models.LoadBalancer, error)

func (*APIClient) UpdateLoadBalancerIdleTimeout added in v0.10.7

func (c *APIClient) UpdateLoadBalancerIdleTimeout(id string, idleTimeout int) (*models.LoadBalancer, error)

func (*APIClient) UpdateLoadBalancerPorts

func (c *APIClient) UpdateLoadBalancerPorts(id string, ports []models.Port) (*models.LoadBalancer, error)

func (*APIClient) UpdateSQL

func (c *APIClient) UpdateSQL() error

func (*APIClient) UpdateService

func (c *APIClient) UpdateService(serviceID, deployID string) (*models.Service, error)

func (*APIClient) WaitForDeployment

func (c *APIClient) WaitForDeployment(serviceID string, timeout time.Duration) (*models.Service, error)

func (*APIClient) WaitForJob

func (c *APIClient) WaitForJob(jobID string, timeout time.Duration) error

type Client

type Client interface {
	CreateDeploy(name string, content []byte) (*models.Deploy, error)
	DeleteDeploy(id string) error
	GetDeploy(id string) (*models.Deploy, error)
	ListDeploys() ([]*models.DeploySummary, error)

	CreateEnvironment(name, instanceSize string, minCount int, userData []byte, os, amiID string) (*models.Environment, error)
	DeleteEnvironment(id string) (string, error)
	GetEnvironment(id string) (*models.Environment, error)
	ListEnvironments() ([]*models.EnvironmentSummary, error)
	UpdateEnvironment(id string, minCount int) (*models.Environment, error)
	CreateLink(sourceID string, destinationID string) error
	DeleteLink(sourceID string, destinationID string) error

	Delete(id string) error
	GetJob(id string) (*models.Job, error)
	ListJobs() ([]*models.Job, error)
	WaitForJob(jobID string, timeout time.Duration) error

	CreateLoadBalancer(name, environmentID string, healthCheck models.HealthCheck, ports []models.Port, isPublic bool, idleTimeout int, crossZone bool) (*models.LoadBalancer, error)
	DeleteLoadBalancer(id string) (string, error)
	GetLoadBalancer(id string) (*models.LoadBalancer, error)
	ListLoadBalancers() ([]*models.LoadBalancerSummary, error)
	UpdateLoadBalancerHealthCheck(id string, healthCheck models.HealthCheck) (*models.LoadBalancer, error)
	UpdateLoadBalancerPorts(id string, ports []models.Port) (*models.LoadBalancer, error)
	UpdateLoadBalancerIdleTimeout(id string, idleTimeout int) (*models.LoadBalancer, error)
	UpdateLoadBalancerCrossZone(id string, crossZone bool) (*models.LoadBalancer, error)

	CreateService(name, environmentID, deployID, loadBalancerID string) (*models.Service, error)
	DeleteService(id string) (string, error)
	UpdateService(serviceID, deployID string) (*models.Service, error)
	GetService(id string) (*models.Service, error)
	GetServiceLogs(id, start, end string, tail int) ([]*models.LogFile, error)
	ListServices() ([]*models.ServiceSummary, error)
	ScaleService(id string, scale int) (*models.Service, error)
	WaitForDeployment(serviceID string, timeout time.Duration) (*models.Service, error)

	CreateTask(name, environmentID, deployID string, overrides []models.ContainerOverride) (string, error)
	DeleteTask(id string) error
	GetTask(id string) (*models.Task, error)
	GetTaskLogs(id, start, end string, tail int) ([]*models.LogFile, error)
	ListTasks() ([]*models.TaskSummary, error)

	SelectByQuery(params map[string]string) ([]*models.EntityWithTags, error)
	GetVersion() (string, error)
	GetConfig() (*models.APIConfig, error)
	UpdateSQL() error
	RunScaler(environmentID string) (*models.ScalerRunInfo, error)
}

type Config

type Config struct {
	Endpoint      string
	Token         string
	VerifySSL     bool
	VerifyVersion bool
	Clock         waitutils.Clock
}

type DoerFunc

type DoerFunc func(req *http.Request) (*http.Response, error)

func (DoerFunc) Do

func (d DoerFunc) Do(req *http.Request) (*http.Response, error)

type ServerError

type ServerError models.ServerError

func (*ServerError) Error

func (s *ServerError) Error() string

func (*ServerError) ToCommonError added in v0.10.3

func (s *ServerError) ToCommonError() *errors.ServerError

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL