service

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deploy

type Deploy struct {
	Cluster               string                      `json:"cluster" binding:"required"`
	ServiceName           string                      `json:"serviceName"`
	ServicePort           int64                       `json:"servicePort"`
	ServiceProtocol       string                      `json:"serviceProtocol" binding:"required"`
	DesiredCount          int64                       `json:"desiredCount" binding:"required"`
	MinimumHealthyPercent int64                       `json:"minimumHealthyPercent"`
	MaximumPercent        int64                       `json:"maximumPercent"`
	Containers            []*DeployContainer          `json:"containers" binding:"required,dive"`
	HealthCheck           DeployHealthCheck           `json:"healthCheck"`
	RuleConditions        []*DeployRuleConditions     `json:"ruleConditions`
	NetworkMode           string                      `json:"networkMode"`
	NetworkConfiguration  DeployNetworkConfiguration  `json:"networkConfiguration"`
	PlacementConstraints  []DeployPlacementConstraint `json:"placementConstraints"`
	LaunchType            string                      `json:"launchType"`
	DeregistrationDelay   int64                       `json:"deregistrationDelay"`
	Stickiness            DeployStickiness            `json:"stickiness"`
}

type DeployContainer

type DeployContainer struct {
	ContainerName     string    `json:"containerName" binding:"required"`
	ContainerTag      string    `json:"containerTag" binding:"required"`
	ContainerPort     int64     `json:"containerPort"`
	ContainerCommand  []*string `json:"containerCommand"`
	ContainerImage    string    `json:"containerImage`
	ContainerURI      string    `json:"containerURI"`
	Essential         bool      `json:"essential"`
	Memory            int64     `json:"memory"`
	MemoryReservation int64     `json:"memoryReservation"`
	CPU               int64     `json:"cpu"`
	CPUReservation    int64     `json:"cpuReservation"`
}

type DeployHealthCheck

type DeployHealthCheck struct {
	HealthyThreshold   int64  `json:"healthyThreshold"`
	UnhealthyThreshold int64  `json:"unhealthyThreshold"`
	Path               string `json:"path"`
	Port               string `json:"port"`
	Protocol           string `json:"protocol"`
	Interval           int64  `json:"interval"`
	Matcher            string `json:"matcher"`
	Timeout            int64  `json:"timeout"`
	GracePeriodSeconds int64  `json:"gracePeriodSeconds"`
}

type DeployNetworkConfiguration

type DeployNetworkConfiguration struct {
	AssignPublicIp string   `json:"assignPublicIp"`
	SecurityGroups []string `json:"securityGroups"`
	Subnets        []string `json:"subnets"`
}

type DeployPlacementConstraint

type DeployPlacementConstraint struct {
	Expression string `json:"expression"`
	Type       string `json:"type"`
}

type DeployResult

type DeployResult struct {
	ServiceName       string    `json:"serviceName"`
	ClusterName       string    `json:"clusterName"`
	TaskDefinitionArn string    `json:"taskDefinitionArn"`
	Status            string    `json:"status"`
	DeployError       string    `json:"deployError"`
	DeploymentTime    time.Time `json:"deploymentTime"`
}

type DeployRuleConditions

type DeployRuleConditions struct {
	Listeners   []string `json:"listeners"`
	PathPattern string   `json:"pathPattern"`
	Hostname    string   `json:"hostname"`
}

type DeployServiceParameter

type DeployServiceParameter struct {
	Name      string `json:"name" binding:"required"`
	Value     string `json:"value" binding:"required"`
	Encrypted bool   `json:"encrypted"`
}

type DeployServices

type DeployServices struct {
	Services []Deploy `json:"services" binding:"required"`
}

deploy binding from JSON

type DeployStickiness

type DeployStickiness struct {
	Enabled  bool  `json:"enabled"`
	Duration int64 `json:"duration"`
}

type DynamoCluster

type DynamoCluster struct {
	Identifier         string    `dynamo:"ServiceName,hash"`
	Time               time.Time `dynamo:"Time,range"`
	ContainerInstances []DynamoClusterContainerInstance
	ScalingOperation   DynamoClusterScalingOperation
	ExpirationTime     time.Time
}

dynamo cluster struct

type DynamoClusterContainerInstance

type DynamoClusterContainerInstance struct {
	ClusterName         string
	ContainerInstanceId string
	AvailabilityZone    string
	FreeMemory          int64
	FreeCpu             int64
	Status              string
}

type DynamoClusterScalingOperation

type DynamoClusterScalingOperation struct {
	ClusterName string
	Action      string
}

type DynamoDeployment

type DynamoDeployment struct {
	ServiceName       string    `dynamo:"ServiceName,hash"`
	Time              time.Time `dynamo:"Time,range" index:"DayIndex,range" index:"MonthIndex,range"`
	Day               string    `index:"DayIndex,hash"`
	Month             string    `index:"MonthIndex,hash"`
	Status            string
	DeployError       string
	Tag               string
	Scaling           DynamoDeploymentScaling
	ManualTasksArns   []string
	TaskDefinitionArn *string
	DeployData        *Deploy
	Version           int64
}

type DynamoDeploymentScaling

type DynamoDeploymentScaling struct {
	DesiredCount int64
}

type DynamoServices

type DynamoServices struct {
	ServiceName string `dynamo:"ServiceName,hash"`
	Services    []*DynamoServicesElement
	Time        string `dynamo:"Time,range"`
	Version     int64
	ApiVersion  string
}

dynamo services struct

type DynamoServicesElement

type DynamoServicesElement struct {
	C                 string
	S                 string
	MemoryLimit       int64 `dynamo:"ML"`
	MemoryReservation int64 `dynamo:"MR"`
	CpuLimit          int64 `dynamo:"CL"`
	CpuReservation    int64 `dynamo:"CR"`
	L                 []string
}

type RunTask

type RunTask struct {
	StartedBy          string                     `json:"startedBy"`
	ContainerOverrides []RunTaskContainerOverride `json:"containerOverrides"`
}

"Run ad-hoc task" type

type RunTaskContainerOverride

type RunTaskContainerOverride struct {
	Name    string   `json:"name"`
	Command []string `json:"command"`
}

type RunningService

type RunningService struct {
	ServiceName  string                     `json:"serviceName"`
	ClusterName  string                     `json:"clusterName"`
	RunningCount int64                      `json:"runningCount"`
	PendingCount int64                      `json:"pendingCount"`
	DesiredCount int64                      `json:"desiredCount"`
	Status       string                     `json:"status"`
	Events       []RunningServiceEvent      `json:"events"`
	Deployments  []RunningServiceDeployment `json:"deployments"`
	Tasks        []RunningTask              `json:"tasks"`
}

type RunningServiceDeployment

type RunningServiceDeployment struct {
	Status         string    `json:"status"`
	RunningCount   int64     `json:"runningCount"`
	PendingCount   int64     `json:"pendingCount"`
	DesiredCount   int64     `json:"desiredCount"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`
	TaskDefinition string    `json:"taskDefinition"`
}

type RunningServiceEvent

type RunningServiceEvent struct {
	CreatedAt time.Time `json:"createdAt"`
	Id        string    `json:"id"`
	Message   string    `json:"message"`
}

type RunningTask

type RunningTask struct {
	ContainerInstanceArn string                 `json:"containerInstanceArn"`
	Containers           []RunningTaskContainer `json:"containers"`
	Cpu                  string                 `json:"cpu"`
	CreatedAt            time.Time              `json:"createdAt"`
	DesiredStatus        string                 `json:"desiredStatus"`
	ExecutionStoppedAt   time.Time              `json:"executionStoppedAt"`
	Group                string                 `json:"group"`
	LastStatus           string                 `json:"lastStatus"`
	LaunchType           string                 `json:"launchType"`
	Memory               string                 `json:"memory"`
	PullStartedAt        time.Time              `json:"pullStartedAt"`
	PullStoppedAt        time.Time              `json:"pullStoppedAt"`
	StartedAt            time.Time              `json:"startedAt"`
	StartedBy            string                 `json:"startedBy"`
	StoppedAt            time.Time              `json:"stoppedAt"`
	StoppedReason        string                 `json:"stoppedReason"`
	StoppingAt           time.Time              `json:"stoppingAt"`
	TaskArn              string                 `json:"taskArn"`
	TaskDefinitionArn    string                 `json:"taskDefinitionArn"`
	Version              int64                  `json:"version"`
}

type RunningTaskContainer

type RunningTaskContainer struct {
	ContainerArn string `json:"containerArn"`
	ExitCode     int64  `json:"exitCode"`
	LastStatus   string `json:"lastStatus"`
	Name         string `json:"name"`
	Reason       string `json:"reason"`
}

type Service

type Service struct {
	ServiceName string
	ClusterName string
	Listeners   []string
	// contains filtered or unexported fields
}

func NewService

func NewService() *Service

func (*Service) CreateService

func (s *Service) CreateService(dsElement *DynamoServicesElement) error

func (*Service) CreateTable

func (s *Service) CreateTable() error

func (*Service) GetApiVersion

func (s *Service) GetApiVersion() (string, error)

func (*Service) GetClusterInfo

func (s *Service) GetClusterInfo() (*DynamoCluster, error)

func (*Service) GetClusterName

func (s *Service) GetClusterName() (string, error)

func (*Service) GetDeployment

func (s *Service) GetDeployment(serviceName string, strTime string) (*DynamoDeployment, error)

func (*Service) GetDeploys

func (s *Service) GetDeploys(action string, limit int64) ([]DynamoDeployment, error)

func (*Service) GetDeploysForService

func (s *Service) GetDeploysForService(serviceName string) ([]DynamoDeployment, error)

func (*Service) GetLastDeploy

func (s *Service) GetLastDeploy() (*DynamoDeployment, error)

func (*Service) GetScalingActivity

func (s *Service) GetScalingActivity(clusterName string, startTime time.Time) (string, error)

func (*Service) GetServiceVersionsByTags

func (s *Service) GetServiceVersionsByTags(serviceName, imageName string, tags map[string]string) ([]ServiceVersion, error)

func (*Service) GetServices

func (s *Service) GetServices(ds *DynamoServices) error

func (*Service) NewDeployment

func (s *Service) NewDeployment(taskDefinitionArn *string, d *Deploy) (*DynamoDeployment, error)

func (*Service) PutClusterInfo

func (s *Service) PutClusterInfo(dc DynamoCluster, clusterName string, action string) (*DynamoCluster, error)

func (*Service) SetApiVersion

func (s *Service) SetApiVersion(apiVersion string) error

func (*Service) SetDeploymentStatus

func (s *Service) SetDeploymentStatus(dd *DynamoDeployment, status string) error

func (*Service) SetDeploymentStatusWithReason

func (s *Service) SetDeploymentStatusWithReason(dd *DynamoDeployment, status, reason string) error

func (*Service) SetManualTasksArn

func (s *Service) SetManualTasksArn(manualTaskArn string) error

func (*Service) SetScalingProperty

func (s *Service) SetScalingProperty(desiredCount int64) error

func (*Service) UpdateServiceLimits

func (s *Service) UpdateServiceLimits(clusterName, serviceName string, cpuReservation, cpuLimit, memoryReservation, memoryLimit int64) error

type ServiceVersion

type ServiceVersion struct {
	ImageName  string    `json:"imageName"`
	Tag        string    `json:"tag"`
	ImageId    string    `json:"imageId"`
	LastDeploy time.Time `json:"lastDeploy"`
}

Jump to

Keyboard shortcuts

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