client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BashExec added in v0.4.0

func BashExec(command string, opts ...cmd.Option) error

BashExec execute bash commands.

Types

type AWS added in v0.4.0

type AWS struct{}

AWS is a wrapper around aws commands.

func NewAWS added in v0.4.0

func NewAWS() *AWS

NewAWS returns a wrapper around AWS commands.

func (*AWS) CreateECRRepo added in v0.4.0

func (a *AWS) CreateECRRepo(name string) (string, error)

CreateECRRepo runs: aws ecr create-repository --repository-name $name |

jq -r .repository.repositoryUri

func (*AWS) CreateStack added in v0.4.0

func (a *AWS) CreateStack(name, templatePath string) error

CreateStack runs: aws cloudformation create-stack

--stack-name $name
--template-body $templatePath

func (*AWS) DeleteECRRepo added in v0.4.0

func (a *AWS) DeleteECRRepo(name string) error

DeleteECRRepo runs: aws ecr delete-repository

--repository-name $name --force

func (*AWS) DeleteStack added in v0.4.0

func (a *AWS) DeleteStack(name string) error

DeleteStack runs: aws cloudformation delete-stack --stack-name $name

func (*AWS) ECRLoginPassword added in v0.4.0

func (a *AWS) ECRLoginPassword() (string, error)

ECRLoginPassword runs: aws ecr get-login-password

func (*AWS) VPCStackOutput added in v0.4.0

func (a *AWS) VPCStackOutput(name string) ([]VPCStackOutput, error)

VPCStackOutput runs: aws cloudformation describe-stacks --stack-name $name |

jq -r .Stacks[0].Outputs

func (*AWS) WaitStackCreateComplete added in v0.4.0

func (a *AWS) WaitStackCreateComplete(name string) error

WaitStackCreateComplete runs: aws cloudformation wait stack-create-complete

--stack-name $name

func (*AWS) WaitStackDeleteComplete added in v0.4.0

func (a *AWS) WaitStackDeleteComplete(name string) error

WaitStackDeleteComplete runs: aws cloudformation wait stack-delete-complete

--stack-name $name

type AppInitRequest

type AppInitRequest struct {
	AppName string
	Domain  string
	Tags    map[string]string
}

AppInitRequest contains the parameters for calling copilot app init.

type AppShowOutput

type AppShowOutput struct {
	Name string `json:"name"`
	URI  string `json:"uri"`
}

AppShowOutput is the JSON output of app show.

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI is a wrapper around os.execs.

func NewCLI

func NewCLI() (*CLI, error)

NewCLI returns a wrapper around CLI

func (*CLI) AppDelete

func (cli *CLI) AppDelete() (string, error)

AppDelete runs: copilot app delete --yes

func (*CLI) AppInit

func (cli *CLI) AppInit(opts *AppInitRequest) (string, error)

AppInit runs: copilot app init $a

--domain $d (optionally)
--resource-tags $k1=$v1,$k2=$k2 (optionally)

func (*CLI) AppList

func (cli *CLI) AppList() (string, error)

AppList runs: copilot app ls

func (*CLI) AppShow

func (cli *CLI) AppShow(appName string) (*AppShowOutput, error)

AppShow runs: copilot app show

--name $n
--json

func (*CLI) EnvDelete

func (cli *CLI) EnvDelete(envName string) (string, error)

EnvDelete runs: copilot env delete

--name $n
--yes

func (*CLI) EnvInit

func (cli *CLI) EnvInit(opts *EnvInitRequest) (string, error)

EnvInit runs: copilot env init

--name $n
--app $a
--profile $pr
--prod (optional)
--default-config (optional)
--import-private-subnets (optional)
--import-public-subnets (optional)
--import-vpc-id (optional)
--override-private-cidrs (optional)
--override-public-cidrs (optional)
--override-vpc-cidr (optional)

func (*CLI) EnvList

func (cli *CLI) EnvList(appName string) (*EnvListOutput, error)

EnvList runs: copilot env ls

--app $a
--json

func (*CLI) EnvShow

func (cli *CLI) EnvShow(opts *EnvShowRequest) (*EnvShowOutput, error)

EnvShow runs: copilot env show

--app $a
--name $n
--json

func (*CLI) Help

func (cli *CLI) Help() (string, error)

Help runs copilot --help

func (*CLI) Init

func (cli *CLI) Init(opts *InitRequest) (string, error)

Init runs: copilot init

--app $p
--svc $s
--svc-type $type
--tag $t
--dockerfile $d
--deploy (optionally)
--schedule $schedule (optionally)
--port $port (optionally)

func (*CLI) JobDelete added in v0.7.0

func (cli *CLI) JobDelete(jobName string) (string, error)

JobDelete runs: copilot job delete

--name $n
--yes

func (*CLI) JobDeploy added in v0.7.0

func (cli *CLI) JobDeploy(opts *JobDeployInput) (string, error)

JobDeploy runs: copilot job deploy

--name $n
--env $e
--tag $t

func (*CLI) JobInit added in v0.7.0

func (cli *CLI) JobInit(opts *JobInitInput) (string, error)

JobInit runs: copilot job init

--name $n
--dockerfile $d
--schedule $sched
--retries $r
--timeout $o

func (*CLI) JobList added in v0.7.0

func (cli *CLI) JobList(appName string) (*JobListOutput, error)

JobList runs: copilot job ls

--json?
--local?

func (*CLI) JobPackage added in v0.7.0

func (cli *CLI) JobPackage(opts *PackageInput) error

JobPackage runs: copilot job package

--output-dir $dir
--name $name
--env $env
--app $appname
--tag $tag

func (*CLI) SvcDelete

func (cli *CLI) SvcDelete(serviceName string) (string, error)

SvcDelete runs: copilot svc delete

--name $n
--yes

func (*CLI) SvcDeploy

func (cli *CLI) SvcDeploy(opts *SvcDeployInput) (string, error)

SvcDeploy runs: copilot svc deploy

--name $n
--env $e
--tag $t

func (*CLI) SvcInit

func (cli *CLI) SvcInit(opts *SvcInitRequest) (string, error)

SvcInit runs: copilot svc init

--name $n
--svc-type $t
--port $port

func (*CLI) SvcList

func (cli *CLI) SvcList(appName string) (*SvcListOutput, error)

SvcList runs: copilot svc ls

--app $p
--json

func (*CLI) SvcLogs

func (cli *CLI) SvcLogs(opts *SvcLogsRequest) ([]SvcLogsOutput, error)

SvcLogs runs: copilot svc logs

--app $p
--name $n
--since $s
--env $e
--json

func (*CLI) SvcPackage added in v0.7.0

func (cli *CLI) SvcPackage(opts *PackageInput) error

SvcPackage runs: copilot svc package

--output-dir $dir
--name $name
--env $env
--app $appname

func (*CLI) SvcShow

func (cli *CLI) SvcShow(opts *SvcShowRequest) (*SvcShowOutput, error)

SvcShow runs: copilot svc show

--app $p
--name $n
--json

func (*CLI) SvcStatus added in v0.4.0

func (cli *CLI) SvcStatus(opts *SvcStatusRequest) (*SvcStatusOutput, error)

SvcStatus runs: copilot svc status

--app $p
--env $e
--name $n
--json

func (*CLI) TaskRun added in v0.3.0

func (cli *CLI) TaskRun(input *TaskRunInput) (string, error)

TaskRun runs: copilot task run

-n $t
--dockerfile $d
--app $a (optionally)
--env $e (optionally)
--command $c (optionally)
--env-vars $e1=$v1,$e2=$v2 (optionally)
--default (optionally)
--follow (optionally)

func (*CLI) Version

func (cli *CLI) Version() (string, error)

Version runs: copilot --version

type Docker added in v0.4.0

type Docker struct{}

Docker is a wrapper around Docker commands.

func NewDocker added in v0.4.0

func NewDocker() *Docker

NewDocker returns a wrapper around Docker commands.

func (*Docker) Build added in v0.4.0

func (d *Docker) Build(uri, path string) error

Build runs: docker build -t $uri $path

func (*Docker) Login added in v0.4.0

func (d *Docker) Login(uri, password string) error

Login runs: docker login -u AWS --password-stdin $uri

func (*Docker) Push added in v0.4.0

func (d *Docker) Push(uri string) error

Push runs: docker push $uri

type EnvDescription

type EnvDescription struct {
	Name          string `json:"name"`
	App           string `json:"app"`
	Region        string `json:"region"`
	Account       string `json:"accountID"`
	Prod          bool   `json:"prod"`
	RegistryURL   string `json:"registryURL"`
	ExecutionRole string `json:"executionRoleARN"`
	ManagerRole   string `json:"managerRoleARN"`
}

EnvDescription contains descriptive info about an environment.

type EnvInitRequest

type EnvInitRequest struct {
	AppName       string
	EnvName       string
	Profile       string
	Prod          bool
	CustomizedEnv bool
	VPCImport     EnvInitRequestVPCImport
	VPCConfig     EnvInitRequestVPCConfig
}

EnvInitRequest contains the parameters for calling copilot env init.

type EnvInitRequestVPCConfig added in v0.4.0

type EnvInitRequestVPCConfig struct {
	CIDR               string
	PublicSubnetCIDRs  string
	PrivateSubnetCIDRs string
}

EnvInitRequestVPCConfig contains the parameters for configuring VPC config when calling copilot env init.

type EnvInitRequestVPCImport added in v0.4.0

type EnvInitRequestVPCImport struct {
	ID               string
	PublicSubnetIDs  string
	PrivateSubnetIDs string
}

EnvInitRequestVPCImport contains the parameters for configuring VPC import when calling copilot env init.

func (EnvInitRequestVPCImport) IsSet added in v0.4.0

func (e EnvInitRequestVPCImport) IsSet() bool

IsSet returns true if all fields are set.

type EnvListOutput

type EnvListOutput struct {
	Envs []EnvDescription `json:"environments"`
}

EnvListOutput is the JSON output of env list.

type EnvShowOutput

type EnvShowOutput struct {
	Environment EnvDescription    `json:"environment"`
	Services    []EnvShowServices `json:"services"`
	Tags        map[string]string `json:"tags"`
}

EnvShowOutput is the JSON output of env show.

type EnvShowRequest

type EnvShowRequest struct {
	AppName string
	EnvName string
}

EnvShowRequest contains the parameters for calling copilot env show.

type EnvShowServices

type EnvShowServices struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

EnvShowServices contains brief info about a service.

type Image added in v0.4.0

type Image struct {
	ID     string
	Digest string
}

Image contains very basic info of a container image.

type InitRequest

type InitRequest struct {
	AppName      string
	WorkloadName string
	Deploy       bool
	ImageTag     string
	Dockerfile   string
	WorkloadType string
	SvcPort      string
	Schedule     string
}

InitRequest contains the parameters for calling copilot init.

type JobDeployInput added in v0.7.0

type JobDeployInput struct {
	Name     string
	EnvName  string
	ImageTag string
}

JobDeployInput contains the parameters for calling copilot job deploy.

type JobInitInput added in v0.7.0

type JobInitInput struct {
	Name       string
	Dockerfile string
	Schedule   string
	Retries    string
	Timeout    string
}

JobInitInput contains the parameters for calling copilot job init.

type JobListOutput added in v0.7.0

type JobListOutput struct {
	Jobs []WkldDescription `json:"jobs"`
}

JobListOutput is the JSON output for job list.

type PackageInput added in v0.7.0

type PackageInput struct {
	AppName string
	Name    string
	Env     string
	Dir     string
	Tag     string
}

PackageInput contains the parameters for calling copilot job package.

type SvcDeployInput

type SvcDeployInput struct {
	Name     string
	EnvName  string
	ImageTag string
}

SvcDeployInput contains the parameters for calling copilot svc deploy.

type SvcInitRequest

type SvcInitRequest struct {
	Name       string
	SvcType    string
	Dockerfile string
	Image      string
	SvcPort    string
}

SvcInitRequest contains the parameters for calling copilot svc init.

type SvcListOutput

type SvcListOutput struct {
	Services []WkldDescription `json:"services"`
}

SvcListOutput is the JSON output for svc list.

type SvcLogsOutput

type SvcLogsOutput struct {
	LogStreamName string `json:"logStreamName"`
	IngestionTime int64  `json:"ingestionTime"`
	Timestamp     int64  `json:"timestamp"`
	Message       string `json:"message"`
}

SvcLogsOutput is the JSON output of svc logs.

type SvcLogsRequest

type SvcLogsRequest struct {
	AppName string
	EnvName string
	Name    string
	Since   string
}

SvcLogsRequest contains the parameters for calling copilot svc logs.

type SvcShowConfigurations

type SvcShowConfigurations struct {
	Environment string `json:"environment"`
	Port        string `json:"port"`
	Tasks       string `json:"tasks"`
	CPU         string `json:"cpu"`
	Memory      string `json:"memory"`
}

SvcShowConfigurations contains serialized configuration parameters for a service.

type SvcShowOutput

type SvcShowOutput struct {
	SvcName            string                      `json:"service"`
	Type               string                      `json:"type"`
	AppName            string                      `json:"application"`
	Configs            []SvcShowConfigurations     `json:"configurations"`
	ServiceDiscoveries []SvcShowServiceDiscoveries `json:"serviceDiscovery"`
	Routes             []SvcShowRoutes             `json:"routes"`
	Variables          []SvcShowVariables          `json:"variables"`
}

SvcShowOutput is the JSON output of the svc show.

type SvcShowRequest

type SvcShowRequest struct {
	Name    string
	AppName string
}

SvcShowRequest contains the parameters for calling copilot svc show.

type SvcShowRoutes

type SvcShowRoutes struct {
	Environment string `json:"environment"`
	URL         string `json:"url"`
}

SvcShowRoutes contains serialized route parameters for a web service.

type SvcShowServiceDiscoveries

type SvcShowServiceDiscoveries struct {
	Environment []string `json:"environment"`
	Namespace   string   `json:"namespace"`
}

SvcShowServiceDiscoveries contains serialized service discovery info for an service.

type SvcShowVariables

type SvcShowVariables struct {
	Environment string `json:"environment"`
	Name        string `json:"name"`
	Value       string `json:"value"`
}

SvcShowVariables contains serialized environment variables for a service.

type SvcStatusAlarmInfo added in v0.4.0

type SvcStatusAlarmInfo struct {
	Arn          string    `json:"arn"`
	Name         string    `json:"name"`
	Reason       string    `json:"reason"`
	Status       string    `json:"status"`
	Type         string    `json:"type"`
	UpdatedTimes time.Time `json:"updatedTimes"`
}

SvcStatusAlarmInfo contains CloudWatch alarm status info.

type SvcStatusOutput added in v0.4.0

type SvcStatusOutput struct {
	Service SvcStatusServiceInfo
	Tasks   []SvcStatusTaskInfo  `json:"tasks"`
	Alarms  []SvcStatusAlarmInfo `json:"alarms"`
}

SvcStatusOutput is the JSON output of the svc status.

type SvcStatusRequest added in v0.4.0

type SvcStatusRequest struct {
	Name    string
	AppName string
	EnvName string
}

SvcStatusRequest contains the parameters for calling copilot svc status.

type SvcStatusServiceInfo added in v0.4.0

type SvcStatusServiceInfo struct {
	DesiredCount     int64     `json:"desiredCount"`
	RunningCount     int64     `json:"runningCount"`
	Status           string    `json:"status"`
	LastDeploymentAt time.Time `json:"lastDeploymentAt"`
	TaskDefinition   string    `json:"taskDefinition"`
}

SvcStatusServiceInfo contains the status info of a service.

type SvcStatusTaskInfo added in v0.4.0

type SvcStatusTaskInfo struct {
	Health        string    `json:"health"`
	ID            string    `json:"id"`
	Images        []Image   `json:"images"`
	LastStatus    string    `json:"lastStatus"`
	StartedAt     time.Time `json:"startedAt"`
	StoppedAt     time.Time `json:"stoppedAt"`
	StoppedReason string    `json:"stoppedReason"`
}

SvcStatusTaskInfo contains the status info of a task.

type TaskRunInput added in v0.3.0

type TaskRunInput struct {
	AppName string

	GroupName string

	Image      string
	Dockerfile string

	Subnets        []string
	SecurityGroups []string
	Env            string

	Command string
	EnvVars string

	Default bool
	Follow  bool
}

TaskRunInput contains the parameters for calling copilot task run.

type VPCStackOutput added in v0.4.0

type VPCStackOutput struct {
	OutputKey   string
	OutputValue string
	ExportName  string
}

VPCStackOutput is the output for VPC stack.

type WkldDescription added in v0.7.0

type WkldDescription struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	AppName string `json:"app"`
}

WkldDescription contains the brief description of the workload.

Jump to

Keyboard shortcuts

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