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"` }
ContainerLabels represents AWS container labels
type ContainerLimits ¶
ContainerLimits represents the resource limits specified at the task level
type ContainerNetwork ¶
type ContainerNetwork struct { Mode string `json:"NetworkMode"` IPv4Addresses []string `json:"IPv4Addresses"` }
ContainerNetwork represents AWS container network configuration
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"` }
ECSContainerMetadata 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
func (*ECSMetadataProvider) TaskStats ¶ added in v1.19.0
func (c *ECSMetadataProvider) TaskStats(ctx context.Context) (map[string]docker.ContainerStats, error)
TaskStats returns Docker stats for current ECS 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