v3

package
v1.44.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const V3EndpointIDMuxName = "v3EndpointIDMuxName"

v3EndpointIDMuxName is the key that's used in gorilla/mux to get the v3 endpoint ID.

Variables

View Source
var (
	// Container associations endpoint: /v3/<v3 endpoint id>/<association type>
	ContainerAssociationsPath = fmt.Sprintf("/v3/%s/associations/%s",
		utils.ConstructMuxVar(V3EndpointIDMuxName, utils.AnythingButSlashRegEx),
		utils.ConstructMuxVar(associationTypeMuxName, utils.AnythingButSlashRegEx))
	// Container association endpoint: /v3/<v3 endpoint id>/<association type>/<association name>
	ContainerAssociationPath = fmt.Sprintf("/v3/%s/associations/%s/%s",
		utils.ConstructMuxVar(V3EndpointIDMuxName, utils.AnythingButSlashRegEx),
		utils.ConstructMuxVar(associationTypeMuxName, utils.AnythingButSlashRegEx),
		utils.ConstructMuxVar(associationNameMuxName, utils.AnythingButEmptyRegEx))
	// Treat "/v3/<v3 endpoint id>/<association type>/" as a container association endpoint with empty association name (therefore invalid), to be consistent with similar situation in credentials endpoint and v3 metadata endpoint
	ContainerAssociationPathWithSlash = ContainerAssociationsPath + "/"
)

ContainerMetadataPath specifies the relative URI path for serving container metadata.

View Source
var ContainerStatsPath = "/v3/" + utils.ConstructMuxVar(V3EndpointIDMuxName, utils.AnythingButSlashRegEx) + "/stats"

ContainerStatsPath specifies the relative URI path for serving container stats.

View Source
var TaskMetadataPath = "/v3/" + utils.ConstructMuxVar(V3EndpointIDMuxName, utils.AnythingButSlashRegEx) + "/task"

TaskMetadataPath specifies the relative URI path for serving task metadata.

View Source
var TaskStatsPath = "/v3/" + utils.ConstructMuxVar(V3EndpointIDMuxName, utils.AnythingButSlashRegEx) + "/task/stats"

TaskStatsPath specifies the relative URI path for serving task stats.

View Source
var TaskWithTagsMetadataPath = "/v3/" + utils.ConstructMuxVar(V3EndpointIDMuxName, utils.AnythingButSlashRegEx) + "/taskWithTags"

TaskWithTagsMetadataPath specifies the relative URI path for serving task metdata with Container Instance and Task Tags retrieved through the ECS API

Functions

func ContainerAssociationHandler added in v1.25.0

func ContainerAssociationHandler(state dockerstate.TaskEngineState) func(http.ResponseWriter, *http.Request)

ContainerAssociationHandler returns the handler method for handling container association requests.

func ContainerAssociationsHandler added in v1.25.0

func ContainerAssociationsHandler(state dockerstate.TaskEngineState) func(http.ResponseWriter, *http.Request)

ContainerAssociationHandler returns the handler method for handling container associations requests.

func ContainerMetadataHandler

func ContainerMetadataHandler(state dockerstate.TaskEngineState) func(http.ResponseWriter, *http.Request)

ContainerMetadataHandler returns the handler method for handling container metadata requests.

func ContainerStatsHandler

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

ContainerStatsHandler returns the handler method for handling container stats requests.

func GetAssociationNameByRequest added in v1.39.0

func GetAssociationNameByRequest(r *http.Request) (string, error)

func GetAssociationTypeByRequest added in v1.39.0

func GetAssociationTypeByRequest(r *http.Request) (string, error)

func GetContainerIDByRequest added in v1.39.0

func GetContainerIDByRequest(r *http.Request, state dockerstate.TaskEngineState) (string, error)

func GetContainerNetworkMetadata added in v1.25.3

func GetContainerNetworkMetadata(containerID string, state dockerstate.TaskEngineState) ([]containermetadata.Network, error)

GetContainerNetworkMetadata returns the network metadata for the container

func GetContainerResponse added in v1.25.3

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

GetContainerResponse gets container response for v3 metadata

func GetTaskARNByRequest added in v1.39.0

func GetTaskARNByRequest(r *http.Request, state dockerstate.TaskEngineState) (string, error)

func NewAssociationResponse added in v1.39.0

func NewAssociationResponse(taskARN, associationType, associationName string, state dockerstate.TaskEngineState) (string, error)

Association response is a string that's assumed to be in valid JSON format, which will be exactly the same as the value of Association.Content.Value (cp is responsible to validate it and deal with it if it's not valid). We don't do any decoding base on the encoding, because the only encoding that cp currently sends us is 'identity'; we don't explicitly model the value field as a struct because we don't want to let agent's implementation depends on the payload format of the association (i.e. eia device for now)

func TaskMetadataHandler

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

TaskMetadataHandler returns the handler method for handling task metadata requests.

func TaskStatsHandler

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

TaskStatsHandler returns the handler method for handling task stats requests.

Types

type AssociationsResponse added in v1.25.0

type AssociationsResponse struct {
	Associations []string `json:"Associations"`
}

AssociationsResponse defines the schema for the associations response JSON object

func NewAssociationsResponse added in v1.39.0

func NewAssociationsResponse(containerID, taskARN, associationType string, state dockerstate.TaskEngineState) (*AssociationsResponse, error)

Jump to

Keyboard shortcuts

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