state

package
v0.0.0-...-b702281 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ClockStatusSynchronized    = "SYNCHRONIZED"
	ClockStatusNotSynchronized = "NOT_SYNCHRONIZED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentState

type AgentState interface {
	// Returns container metadata in v4 format for the container identified by the
	// provided endpointContinerID.
	// Returns ErrorLookupFailure if container lookup fails.
	// Returns ErrorMetadataFetchFailure if something else goes wrong.
	GetContainerMetadata(endpointContainerID string) (ContainerResponse, error)

	// Returns task metadata in v4 format for the task identified by the provided endpointContainerID.
	// Returns ErrorTaskLookupFailed if task lookup fails.
	// Returns ErrorMetadataFetchFailure if something else goes wrong.
	GetTaskMetadata(endpointContainerID string) (TaskResponse, error)

	// Returns task metadata including task and container instance tags (if applicable) in v4 format
	// for the task identified by the provided endpointContainerID.
	// Returns ErrorTaskLookupFailed if task lookup fails.
	// Returns ErrorMetadataFetchFailure if something else goes wrong.
	GetTaskMetadataWithTags(endpointContainerID string) (TaskResponse, error)

	// Returns container stats in v4 format for the container identified by the provided
	// endpointContainerID.
	// Returns ErrorStatsLookupFailure if container lookup fails.
	// Returns ErrorStatsFetchFailure if something else goes wrong.
	GetContainerStats(endpointContainerID string) (StatsResponse, error)

	// Returns task stats in v4 format for the task identified by the provided
	// endpointContainerID.
	// Returns ErrorStatsLookupFailure if container lookup fails.
	// Returns ErrorStatsFetchFailure if something else goes wrong.
	GetTaskStats(endpointContainerID string) (map[string]*StatsResponse, error)
}

Interface for interacting with Agent State relevant to TMDS

type ClockDrift

type ClockDrift struct {
	ClockErrorBound            float64    `json:"ClockErrorBound,omitempty"`
	ReferenceTimestamp         *time.Time `json:"ReferenceTimestamp,omitempty"`
	ClockSynchronizationStatus string     `json:"ClockSynchronizationStatus,omitempty"`
}

Instance's clock drift status

type ContainerResponse

type ContainerResponse struct {
	*v2.ContainerResponse
	Networks    []Network `json:"Networks,omitempty"`
	Snapshotter string    `json:"Snapshotter,omitempty"`
}

ContainerResponse is the v4 Container response. It augments the v4 Network response with the v2 container response object.

type EphemeralStorageMetrics

type EphemeralStorageMetrics struct {
	UtilizedMiBs int64 `json:"Utilized"`
	ReservedMiBs int64 `json:"Reserved"`
}

EphemeralStorageMetrics struct that is specific to the TMDS response. This struct will show customers the disk utilization and reservation metrics in MiBs to match the units used in other fields in TMDS.

type ErrorLookupFailure

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

Error to be returned when container or task lookup failed

func NewErrorLookupFailure

func NewErrorLookupFailure(externalReason string) *ErrorLookupFailure

func (*ErrorLookupFailure) Error

func (e *ErrorLookupFailure) Error() string

func (*ErrorLookupFailure) ExternalReason

func (e *ErrorLookupFailure) ExternalReason() string

type ErrorMetadataFetchFailure

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

General "catch-all" error to be returned when container or task metadata could not be fetched for some reason

func NewErrorMetadataFetchFailure

func NewErrorMetadataFetchFailure(externalReason string) *ErrorMetadataFetchFailure

func (*ErrorMetadataFetchFailure) Error

func (e *ErrorMetadataFetchFailure) Error() string

func (*ErrorMetadataFetchFailure) ExternalReason

func (e *ErrorMetadataFetchFailure) ExternalReason() string

type ErrorStatsFetchFailure

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

General "catch-all" error to be returned when container or task stats could not be fetched for some reason.

func NewErrorStatsFetchFailure

func NewErrorStatsFetchFailure(externalReason string, cause error) *ErrorStatsFetchFailure

func (*ErrorStatsFetchFailure) Error

func (e *ErrorStatsFetchFailure) Error() string

func (*ErrorStatsFetchFailure) ExternalReason

func (e *ErrorStatsFetchFailure) ExternalReason() string

func (*ErrorStatsFetchFailure) Unwrap

func (e *ErrorStatsFetchFailure) Unwrap() error

type ErrorStatsLookupFailure

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

Error to be returned when container or task stats lookup failed due to a lookup failure

func NewErrorStatsLookupFailure

func NewErrorStatsLookupFailure(externalReason string) *ErrorStatsLookupFailure

func (*ErrorStatsLookupFailure) Error

func (e *ErrorStatsLookupFailure) Error() string

func (*ErrorStatsLookupFailure) ExternalReason

func (e *ErrorStatsLookupFailure) ExternalReason() string

type Network

type Network struct {
	response.Network
	// NetworkInterfaceProperties specifies additional properties of the network
	// of the network interface that are exposed via the metadata server.
	// We currently populate this only for the `awsvpc` networking mode.
	NetworkInterfaceProperties
}

Network is the v4 Network response. It adds a bunch of information about network interface(s) on top of what is supported by v4. See `NetworkInterfaceProperties` for more details.

type NetworkInterfaceProperties

type NetworkInterfaceProperties struct {
	// AttachmentIndex reflects the `index` specified by the customer (if any)
	// while creating the task with `awsvpc` mode.
	AttachmentIndex *int `json:"AttachmentIndex,omitempty"`
	// MACAddress is the MAC address of the network interface.
	MACAddress string `json:"MACAddress,omitempty"`
	// IPv4SubnetCIDRBlock is the IPv4 CIDR address block associated with the interface's subnet.
	IPV4SubnetCIDRBlock string `json:"IPv4SubnetCIDRBlock,omitempty"`
	// IPv6SubnetCIDRBlock is the IPv6 CIDR address block associated with the interface's subnet.
	IPv6SubnetCIDRBlock string `json:"IPv6SubnetCIDRBlock,omitempty"`
	// DomainNameServers specifies the nameserver IP addresses for the network interface.
	DomainNameServers []string `json:"DomainNameServers,omitempty"`
	// DomainNameSearchList specifies the search list for the domain name lookup for
	// the network interface.
	DomainNameSearchList []string `json:"DomainNameSearchList,omitempty"`
	// PrivateDNSName is the dns name assigned to this network interface.
	PrivateDNSName string `json:"PrivateDNSName,omitempty"`
	// SubnetGatewayIPV4Address is the IPv4 gateway address for the network interface.
	SubnetGatewayIPV4Address string `json:"SubnetGatewayIpv4Address,omitempty"`
}

NetworkInterfaceProperties represents additional properties we may want to expose via task metadata about the network interface that's attached to the container/task. We mostly use this to populate data about ENIs for tasks launched with `awsvpc` mode.

type StatsResponse

type StatsResponse struct {
	*types.StatsJSON
	Network_rate_stats *stats.NetworkStatsPerSec `json:"network_rate_stats,omitempty"`
}

StatsResponse is the v4 Stats response for a container.

type TaskResponse

type TaskResponse struct {
	*v2.TaskResponse
	Containers              []ContainerResponse      `json:"Containers,omitempty"`
	VPCID                   string                   `json:"VPCID,omitempty"`
	ServiceName             string                   `json:"ServiceName,omitempty"`
	ClockDrift              *ClockDrift              `json:"ClockDrift,omitempty"`
	EphemeralStorageMetrics *EphemeralStorageMetrics `json:"EphemeralStorageMetrics,omitempty"`
	CredentialsID           string                   `json:"-"`
}

TaskResponse is the v4 Task response. It augments the v4 Container response with the v2 task response object.

Directories

Path Synopsis
Package mock_state is a generated GoMock package.
Package mock_state is a generated GoMock package.

Jump to

Keyboard shortcuts

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