aws

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerLabels

type ContainerLabels struct {
	Cluster               string `json:"com.amazonaws.ecs.cluster"`
	TaskARN               string `json:"com.amazonaws.ecs.task-arn"`
	TaskDefinition        string `json:"com.amazonaws.ecs.task-definition-family"`
	TaskDefinitionVersion string `json:"com.amazonaws.ecs.task-definition-version"`
}

type ContainerLimits

type ContainerLimits struct {
	CPU    int `json:"CPU"`
	Memory int `json:"Memory"`
}

ContainerLimits represents the resource limits specified at the task level

type ContainerNetwork

type ContainerNetwork struct {
	Mode          string   `json:"NetworkMode"`
	IPv4Addresses []string `json:"IPv4Addresses"`
}

type ECSContainerMetadata

type ECSContainerMetadata struct {
	DockerID        string             `json:"DockerId"`
	Name            string             `json:"Name"`
	DockerName      string             `json:"DockerName"`
	Image           string             `json:"Image"`
	ImageID         string             `json:"ImageID"`
	DesiredStatus   string             `json:"DesiredStatus"`
	KnownStatus     string             `json:"KnownStatus"`
	Limits          ContainerLimits    `json:"Limits"`
	CreatedAt       time.Time          `json:"CreatedAt"`
	StartedAt       time.Time          `json:"StartedAt"`
	Type            string             `json:"Type"`
	Networks        []ContainerNetwork `json:"Networks"`
	ContainerLabels `json:"Labels"`
}

ECSContainerV3Metadata represents the ECS container metadata as described in https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-metadata.html#metadata-file-format

type ECSMetadataProvider

type ECSMetadataProvider struct {
	Endpoint string
	// contains filtered or unexported fields
}

ECSMetadataProvider retireves ECS service metadata from the ECS_CONTAINER_METADATA_URI endpoint

func NewECSMetadataProvider

func NewECSMetadataProvider(endpoint string, c *http.Client) *ECSMetadataProvider

NewECSMetadataProvider initializes a new ECSMetadataClient with given endpoint and HTTP client. If there is no HTTP client provided, the provider will use http.DefaultClient

func (*ECSMetadataProvider) ContainerMetadata

func (c *ECSMetadataProvider) ContainerMetadata(ctx context.Context) (ECSContainerMetadata, error)

ContainerMetadata returns ECS metadata for current container

func (*ECSMetadataProvider) TaskMetadata

func (c *ECSMetadataProvider) TaskMetadata(ctx context.Context) (ECSTaskMetadata, error)

TaskMetadata returns ECS metadata for current task

type ECSTaskMetadata

type ECSTaskMetadata struct {
	TaskARN          string                 `json:"TaskARN"`
	AvailabilityZone string                 `json:"AvailabilityZone,omitempty"` // only available starting from ECS platform v1.4
	Family           string                 `json:"Family"`
	Revision         string                 `json:"Revision"`
	DesiredStatus    string                 `json:"DesiredStatus"`
	KnownStatus      string                 `json:"KnownStatus"`
	Containers       []ECSContainerMetadata `json:"Containers"`
	PullStartedAt    time.Time              `json:"PullStartedAt"`
	PullStoppedAt    time.Time              `json:"PullStoppedAt"`
}

ECSTaskMetadata represents the ECS task metadata as described in https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v3.html#task-metadata-endpoint-v3-response

Jump to

Keyboard shortcuts

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