v2

package
v0.0.0-...-41d593c Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 13

Documentation

Index

Constants

View Source
const (

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

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

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

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

	// TaskStatsPath specifies the relative URI path for serving task stats.
	TaskStatsPath = "/v2/stats"

	// TaskStatsPathWithSlash specifies the relative URI path for serving task stats.
	TaskStatsPathWithSlash = TaskStatsPath + "/"
)

Variables

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

ContainerMetadataPath specifies the relative URI path for serving container metadata.

View Source
var ContainerStatsPath = TaskStatsPathWithSlash + utils.ConstructMuxVar(statsContainerIDMuxName, utils.AnythingButEmptyRegEx)

ContainerStatsPath specifies the relative URI path for serving container stats.

Functions

func NewContainerResponse

func NewContainerResponse(
	dockerContainer *apicontainer.DockerContainer,
	eni *ni.NetworkInterface,
	includeV4Metadata bool,
) tmdsv2.ContainerResponse

NewContainerResponse creates a new container response TODO: remove includeV4Metadata from NewContainerResponse

func NewContainerResponseFromState

func NewContainerResponseFromState(
	containerID string,
	state dockerstate.TaskEngineState,
	includeV4Metadata bool,
) (*tmdsv2.ContainerResponse, error)

NewContainerResponseFromState creates a new container response based on container id TODO: remove includeV4Metadata from NewContainerResponseFromState/NewContainerResponse

func NewTaskResponse

func NewTaskResponse(
	taskARN string,
	state dockerstate.TaskEngineState,
	ecsClient ecs.ECSClient,
	cluster string,
	az string,
	containerInstanceArn string,
	propagateTags bool,
	includeV4Metadata bool,
) (*tmdsv2.TaskResponse, error)

NewTaskResponse creates a new response object for the task

func NewTaskStatsResponse

func NewTaskStatsResponse(taskARN string,
	state dockerstate.TaskEngineState,
	statsEngine stats.Engine) (map[string]*types.StatsJSON, error)

NewTaskStatsResponse returns a new task stats response object

func TaskContainerMetadataHandler

func TaskContainerMetadataHandler(state dockerstate.TaskEngineState, ecsClient ecs.ECSClient, cluster, az, containerInstanceArn string, propagateTags bool) func(http.ResponseWriter, *http.Request)

TaskContainerMetadataHandler returns the handler method for handling task and container metadata requests.

func TaskContainerStatsHandler

func TaskContainerStatsHandler(state dockerstate.TaskEngineState, statsEngine stats.Engine) func(http.ResponseWriter, *http.Request)

TaskContainerStatsHandler returns the handler method for handling task and container stats requests.

func WriteContainerMetadataResponse

func WriteContainerMetadataResponse(w http.ResponseWriter, containerID string, state dockerstate.TaskEngineState)

WriteContainerMetadataResponse writes the container metadata to response writer.

func WriteContainerStatsResponse

func WriteContainerStatsResponse(w http.ResponseWriter,
	taskARN string,
	containerID string,
	statsEngine stats.Engine)

WriteContainerStatsResponse writes the container stats to response writer.

func WriteTaskMetadataResponse

func WriteTaskMetadataResponse(w http.ResponseWriter, taskARN string, cluster string, state dockerstate.TaskEngineState, ecsClient ecs.ECSClient, az, containerInstanceArn string, propagateTags bool)

WriteTaskMetadataResponse writes the task metadata to response writer.

func WriteTaskStatsResponse

func WriteTaskStatsResponse(w http.ResponseWriter,
	taskARN string,
	state dockerstate.TaskEngineState,
	statsEngine stats.Engine)

WriteTaskStatsResponse writes the task stats to response writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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