api

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: 18 Imported by: 587

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachmentStateChange

type AttachmentStateChange struct {
	// Attachment is the attachment object to send
	Attachment attachment.Attachment
}

AttachmentStateChange represents a state change that needs to be sent to the SubmitAttachmentStateChanges API

func NewAttachmentStateChangeEvent

func NewAttachmentStateChangeEvent(eniAttachment *ni.ENIAttachment) AttachmentStateChange

NewAttachmentStateChangeEvent creates a new attachment state change event

func (AttachmentStateChange) GetEventType

GetEventType returns an enum identifying the event type

func (*AttachmentStateChange) String

func (change *AttachmentStateChange) String() string

String returns a human readable string representation of this object

func (*AttachmentStateChange) ToECSAgent

func (change *AttachmentStateChange) ToECSAgent() *ecs.AttachmentStateChange

ToECSAgent converts the agent module level AttachmentStateChange to ecs-agent module level AttachmentStateChange.

type ContainerStateChange

type ContainerStateChange struct {
	// TaskArn is the unique identifier for the task
	TaskArn string
	// RuntimeID is the dockerID of the container
	RuntimeID string
	// ContainerName is the name of the container
	ContainerName string
	// Status is the status to send
	Status apicontainerstatus.ContainerStatus
	// ImageDigest is the sha-256 digest of the container image as pulled from the repository
	ImageDigest string
	// Reason may contain details of why the container stopped
	Reason string
	// ExitCode is the exit code of the container, if available
	ExitCode *int
	// PortBindings are the details of the host ports picked for the specified
	// container ports
	PortBindings []apicontainer.PortBinding
	// Container is a pointer to the container involved in the state change that gives the event handler a hook into
	// storing what status was sent.  This is used to ensure the same event is handled only once.
	Container *apicontainer.Container
}

ContainerStateChange represents a state change that needs to be sent to the SubmitContainerStateChange API

func NewContainerStateChangeEvent

func NewContainerStateChangeEvent(task *apitask.Task, cont *apicontainer.Container, reason string) (ContainerStateChange, error)

NewContainerStateChangeEvent creates a new container state change event returns error if the state change doesn't need to be sent to the ECS backend.

func (ContainerStateChange) GetEventType

GetEventType returns an enum identifying the event type

func (*ContainerStateChange) String

func (c *ContainerStateChange) String() string

String returns a human readable string representation of this object

func (*ContainerStateChange) ToECSAgent

func (c *ContainerStateChange) ToECSAgent() (*ecs.ContainerStateChange, error)

ToECSAgent converts the agent module level ContainerStateChange to ecs-agent module level ContainerStateChange.

func (*ContainerStateChange) ToFields

func (c *ContainerStateChange) ToFields() logger.Fields

type ErrShouldNotSendEvent

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

func (ErrShouldNotSendEvent) Error

func (e ErrShouldNotSendEvent) Error() string

type ManagedAgentStateChange

type ManagedAgentStateChange struct {
	// TaskArn is the unique identifier for the task
	TaskArn string
	// Name is the name of the managed agent
	Name string
	// Container is a pointer to the container involved in the state change that gives the event handler a hook into
	// storing what status was sent.  This is used to ensure the same event is handled only once.
	Container *apicontainer.Container
	// Status is the status of the managed agent
	Status apicontainerstatus.ManagedAgentStatus
	// Reason indicates an error in a managed agent state chage
	Reason string
}

func NewManagedAgentChangeEvent

func NewManagedAgentChangeEvent(task *apitask.Task, cont *apicontainer.Container, managedAgentName string, reason string) (ManagedAgentStateChange, error)

NewManagedAgentChangeEvent creates a new managedAgent change event to convey managed agent state changes returns error if the state change doesn't need to be sent to the ECS backend.

func (ManagedAgentStateChange) GetEventType

func (ms ManagedAgentStateChange) GetEventType() statechange.EventType

func (*ManagedAgentStateChange) String

func (m *ManagedAgentStateChange) String() string

String returns a human readable string representation of ManagedAgentStateChange

type ProtocolBindIP

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

ProtocolBindIP used to store protocol and bindIP information associated to a particular host port

type TaskStateChange

type TaskStateChange struct {
	// Attachment is the eni attachment object to send
	Attachment *ni.ENIAttachment
	// TaskArn is the unique identifier for the task
	TaskARN string
	// Status is the status to send
	Status apitaskstatus.TaskStatus
	// Reason may contain details of why the task stopped
	Reason string
	// Containers holds the events generated by containers owned by this task
	Containers []ContainerStateChange
	// ManagedAgents contain the name and status of Agents running inside the container
	ManagedAgents []ManagedAgentStateChange
	// PullStartedAt is the timestamp when the task start pulling
	PullStartedAt *time.Time
	// PullStoppedAt is the timestamp when the task finished pulling
	PullStoppedAt *time.Time
	// ExecutionStoppedAt is the timestamp when the essential container stopped
	ExecutionStoppedAt *time.Time
	// Task is a pointer to the task involved in the state change that gives the event handler a hook into storing
	// what status was sent.  This is used to ensure the same event is handled only once.
	Task *apitask.Task
}

TaskStateChange represents a state change that needs to be sent to the SubmitTaskStateChange API

func NewTaskStateChangeEvent

func NewTaskStateChangeEvent(task *apitask.Task, reason string) (TaskStateChange, error)

NewTaskStateChangeEvent creates a new task state change event returns error if the state change doesn't need to be sent to the ECS backend.

func (TaskStateChange) GetEventType

func (ts TaskStateChange) GetEventType() statechange.EventType

GetEventType returns an enum identifying the event type

func (*TaskStateChange) SetTaskTimestamps

func (change *TaskStateChange) SetTaskTimestamps()

SetTaskTimestamps adds the timestamp information of task into the event to be sent by SubmitTaskStateChange

func (*TaskStateChange) ShouldBeReported

func (change *TaskStateChange) ShouldBeReported() bool

ShouldBeReported checks if the statechange should be reported to backend

func (*TaskStateChange) String

func (change *TaskStateChange) String() string

String returns a human readable string representation of this object

func (*TaskStateChange) ToECSAgent

func (change *TaskStateChange) ToECSAgent() (*ecs.TaskStateChange, error)

ToECSAgent converts the agent module level TaskStateChange to ecs-agent module level TaskStateChange.

func (*TaskStateChange) ToFields

func (change *TaskStateChange) ToFields() logger.Fields

Directories

Path Synopsis
Package testutils contains files that are used in tests but not elsewhere and thus can be excluded from the final executable.
Package testutils contains files that are used in tests but not elsewhere and thus can be excluded from the final executable.

Jump to

Keyboard shortcuts

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