v4

package
v1.36.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TaskMetadataPath specifies the relative URI path for serving task metadata.
	TaskMetadataPath = "/v4/metadata"

	// TaskWithTagsMetadataPath specifies the relative URI path for serving task metadata with Container Instance and Task Tags.
	TaskWithTagsMetadataPath = "/v4/metadataWithTags"

	// TaskMetadataPathWithSlash specifies the relative URI path for serving task metadata.
	TaskMetadataPathWithSlash = TaskMetadataPath + "/"

	// TaskWithTagsMetadataPathWithSlash specifies the relative URI path for serving task metadata with Container Instance and Task Tags.
	TaskWithTagsMetadataPathWithSlash = TaskWithTagsMetadataPath + "/"
)

Variables

View Source
var ContainerMetadataPath = TaskMetadataPathWithSlash + utils.ConstructMuxVar(metadataContainerIDMuxName, utils.AnythingButEmptyRegEx)

ContainerMetadataPath specifies the relative URI path for serving container metadata.

Functions

This section is empty.

Types

type ContainerResponse

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

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

func NewContainerResponse

func NewContainerResponse(
	containerID string,
	state dockerstate.TaskEngineState,
) (*ContainerResponse, error)

NewContainerResponse creates a new v4 container response based on container id. It augments v4 container response with additional network interface fields.

type Network

type Network struct {
	containermetadata.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"`
	// IPV4SubnetCIDRBlock is the subnet CIDR netmask associated with network interface.
	IPV4SubnetCIDRBlock string `json:"IPv4SubnetCIDRBlock,ommitempty"`
	// MACAddress is the mac address of the network interface.
	MACAddress string `json:"MACAddress,ommitempty"`
	// 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 gateway address for the network interface.
	SubnetGatewayIPV4Address string `json:"SubnetGatewayIpv4Address,ommitempty"`
}

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 TaskResponse

type TaskResponse struct {
	*v2.TaskResponse
	Containers []ContainerResponse `json:"Containers,omitempty"`
}

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

func NewTaskResponse

func NewTaskResponse(
	taskARN string,
	state dockerstate.TaskEngineState,
	ecsClient api.ECSClient,
	cluster string,
	az string,
	containerInstanceARN string,
	propagateTags bool,
) (*TaskResponse, error)

NewTaskResponse creates a new v4 response object for the task. It augments v2 task response with additional network interface fields.

Jump to

Keyboard shortcuts

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