Documentation ¶
Index ¶
- Constants
- func AgentMetadataHandler(containerInstanceArn *string, cfg *config.Config) func(http.ResponseWriter, *http.Request)
- func LicenseHandler(w http.ResponseWriter, h *http.Request)
- func NewPortBindingsResponse(dockerContainer *apicontainer.DockerContainer, eni *ni.NetworkInterface) []tmdsresponse.PortResponse
- func NewVolumesResponse(dockerContainer *apicontainer.DockerContainer) []tmdsresponse.VolumeResponse
- func TaskContainerMetadataHandler(taskEngine utils.DockerStateResolver) func(http.ResponseWriter, *http.Request)
- type ContainerResponse
- type MetadataResponse
- type TaskResponse
- type TasksResponse
Constants ¶
const AgentMetadataPath = "/v1/metadata"
AgentMetadataPath is the Agent metadata path for v1 handler.
const LicensePath = "/license"
const (
// TaskContainerMetadataPath is the task/container metadata path for v1 handler.
TaskContainerMetadataPath = "/v1/tasks"
)
Variables ¶
This section is empty.
Functions ¶
func AgentMetadataHandler ¶
func AgentMetadataHandler(containerInstanceArn *string, cfg *config.Config) func(http.ResponseWriter, *http.Request)
AgentMetadataHandler creates response for 'v1/metadata' API.
func LicenseHandler ¶
func LicenseHandler(w http.ResponseWriter, h *http.Request)
LicenseHandler creates response for '/license' API.
func NewPortBindingsResponse ¶
func NewPortBindingsResponse(dockerContainer *apicontainer.DockerContainer, eni *ni.NetworkInterface) []tmdsresponse.PortResponse
NewPortBindingsResponse creates PortResponse for a container.
func NewVolumesResponse ¶
func NewVolumesResponse(dockerContainer *apicontainer.DockerContainer) []tmdsresponse.VolumeResponse
NewVolumesResponse creates VolumeResponse for a container
func TaskContainerMetadataHandler ¶
func TaskContainerMetadataHandler(taskEngine utils.DockerStateResolver) func(http.ResponseWriter, *http.Request)
TaskContainerMetadataHandler creates response for the 'v1/tasks' API. Lists all tasks if the request doesn't contain any fields. Returns a Task if either of 'dockerid' or 'taskarn' are specified in the request.
Types ¶
type ContainerResponse ¶
type ContainerResponse struct { DockerID string `json:"DockerId"` DockerName string `json:"DockerName"` Name string `json:"Name"` Image string `json:"Image"` ImageID string `json:"ImageID"` CreatedAt *time.Time `json:"CreatedAt,omitempty"` StartedAt *time.Time `json:"StartedAt,omitempty"` Ports []tmdsresponse.PortResponse `json:"Ports,omitempty"` Networks []tmdsresponse.Network `json:"Networks,omitempty"` Volumes []tmdsresponse.VolumeResponse `json:"Volumes,omitempty"` RestartCount *int `json:"RestartCount,omitempty"` }
ContainerResponse is the schema for the container response JSON object
func NewContainerResponse ¶
func NewContainerResponse(dockerContainer *apicontainer.DockerContainer, eni *ni.NetworkInterface) ContainerResponse
NewContainerResponse creates ContainerResponse for a container.
type MetadataResponse ¶
type MetadataResponse struct { Cluster string `json:"Cluster"` ContainerInstanceArn *string `json:"ContainerInstanceArn"` Version string `json:"Version"` }
MetadataResponse is the schema for the metadata response JSON object
type TaskResponse ¶
type TaskResponse struct { Arn string `json:"Arn"` DesiredStatus string `json:"DesiredStatus,omitempty"` KnownStatus string `json:"KnownStatus"` Family string `json:"Family"` Version string `json:"Version"` Containers []ContainerResponse `json:"Containers"` }
TaskResponse is the schema for the task response JSON object
func NewTaskResponse ¶
func NewTaskResponse(task *apitask.Task, containerMap map[string]*apicontainer.DockerContainer) *TaskResponse
NewTaskResponse creates a TaskResponse for a task.
type TasksResponse ¶
type TasksResponse struct {
Tasks []*TaskResponse `json:"Tasks"`
}
TasksResponse is the schema for the tasks response JSON object
func NewTasksResponse ¶
func NewTasksResponse(state dockerstate.TaskEngineState) *TasksResponse
NewTasksResponse creates TasksResponse for all the tasks.