api

package
v0.0.0-...-b748cd6 Latest Latest
Warning

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

Go to latest
Published: May 13, 2018 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the Herogate API client. This is a wrapper of AWS API clients.

func NewClient

func NewClient(option *ClientOption) *Client

NewClient initializes a new client from AWS config.

func (*Client) CreateApp

func (c *Client) CreateApp(appName string) *objects.App

CreateApp creates a new CloudFormation stack and wait until stack create complete. When the stack is created, returns ALB endpoint URL and CodeCommit URL. If the stack creation is failed, delete this stack.

func (*Client) DescribeEnvVars

func (c *Client) DescribeEnvVars(appName string) (map[string]string, error)

DescribeEnvVars describes environment variables from container deifinitions.

func (*Client) DescribeLogs

func (c *Client) DescribeLogs(appName string, options *options.DescribeLogs) ([]*log.Log, error)

DescribeLogs returns the Herogate application logs. In this function, it calls CodeBuild API, CloudWatchLogs API, and ECS Service API internally and sorts logs by timestamps.

func (*Client) DestroyApp

func (c *Client) DestroyApp(appName string) error

DestroyApp destroys resources in the following order:

- S3 Bucket - ECR Repository - CloudFormation Stack

This function waits until stack deletion complete.

func (*Client) GetApp

func (c *Client) GetApp(appName string) (*objects.App, error)

GetApp returns the application object. If the application not found, returns nil and error.

func (*Client) GetAppCreationProgress

func (c *Client) GetAppCreationProgress(appName string) int

GetAppCreationProgress returns the creation progress of the application. This function calculates the proportion of resources that are "CREATE_COMPLETE".

func (*Client) GetAppDeletionProgress

func (c *Client) GetAppDeletionProgress(appName string) int

GetAppDeletionProgress returns the deletion progress of the application. This function calculates the proportion of resources that are "DELETE_COMPLETE".

func (*Client) GetAppInfo

func (c *Client) GetAppInfo(appName string) (*objects.AppInfo, error)

GetAppInfo returns the application info object. If the application not found, returns nil and error. The difference from `GetApp` is to include container's details, platform version, etc.

func (*Client) GetTemplate

func (c *Client) GetTemplate(appName string) string

GetTemplate is wrapper for cloudformation.GetTemplate

func (*Client) ListApps

func (c *Client) ListApps() []*objects.App

ListApps returns applications.

func (*Client) SetEnvVars

func (c *Client) SetEnvVars(appName string, envVars map[string]string) error

SetEnvVars updates CloudFormation stack with new environment variables. It generates new template by adding or merging environment variables from existing template. When the template did not change, it does not perform updates. Because this operation restarts existing containers, It takes time to complete.

func (*Client) StackExists

func (c *Client) StackExists(stackName string) bool

StackExists returns whether or not the stack exists.

func (*Client) UnsetEnvVars

func (c *Client) UnsetEnvVars(appName string, envList []string) error

UnsetEnvVars updates CloudFormation stack with new environment variables. It generates new template by deleting environment variables from existing template. When the template did not change, it does not perform updates. Because this operation restarts existing containers, It takes time to complete.

type ClientOption

type ClientOption struct {
	Region string
}

ClientOption is options for Herogate API Client. Regions can specify regions used in AWS.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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