v2

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const StatsPath = "/v2/stats"

StatsPath specifies the relative URI path for serving task and container stats.

View Source
const TaskContainerMetadataPath = "/v2/metadata"

TaskContainerMetadataPath specifies the relative URI path for serving task metadata.

Variables

This section is empty.

Functions

func CredentialsHandler

func CredentialsHandler(credentialsManager credentials.Manager, auditLogger audit.AuditLogger) func(http.ResponseWriter, *http.Request)

CredentialsHandler creates response for the 'v2/credentials' API.

func NewTaskStatsResponse

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

NewTaskStatsResponse returns a new task stats response object

func StatsHandler

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

StatsHandler creates response for 'v2/stats' API.

func TaskContainerMetadataHandler

func TaskContainerMetadataHandler(state dockerstate.TaskEngineState, cluster string) func(http.ResponseWriter, *http.Request)

TaskContainerMetadataHandler returns the handler method for handling task metadata requests.

Types

type ContainerResponse

type ContainerResponse struct {
	ID            string `json:"DockerId"`
	Name          string
	DockerName    string
	Image         string
	ImageID       string
	Ports         []v1.PortResponse `json:",omitempty"`
	Labels        map[string]string `json:",omitempty"`
	DesiredStatus string
	KnownStatus   string
	ExitCode      *int `json:",omitempty"`
	Limits        LimitsResponse
	CreatedAt     *time.Time `json:",omitempty"`
	StartedAt     *time.Time `json:",omitempty"`
	FinishedAt    *time.Time `json:",omitempty"`
	Type          string
	Networks      []containermetadata.Network `json:",omitempty"`
	Health        *apicontainer.HealthStatus  `json:",omitempty"`
}

ContainerResponse defines the schema for the container response JSON object

func NewContainerResponse

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

NewContainerResponse creates a new container response based on container id

type LimitsResponse

type LimitsResponse struct {
	CPU    *float64 `json:",omitempty"`
	Memory *int64   `json:",omitempty"`
}

LimitsResponse defines the schema for task/cpu limits response JSON object

type TaskResponse

type TaskResponse struct {
	Cluster            string
	TaskARN            string
	Family             string
	Revision           string
	DesiredStatus      string `json:",omitempty"`
	KnownStatus        string
	Containers         []ContainerResponse `json:",omitempty"`
	Limits             *LimitsResponse     `json:",omitempty"`
	PullStartedAt      *time.Time          `json:",omitempty"`
	PullStoppedAt      *time.Time          `json:",omitempty"`
	ExecutionStoppedAt *time.Time          `json:",omitempty"`
}

TaskResponse defines the schema for the task response JSON object

func NewTaskResponse

func NewTaskResponse(taskARN string,
	state dockerstate.TaskEngineState,
	cluster string) (*TaskResponse, error)

NewTaskResponse creates a new response object for the task

Jump to

Keyboard shortcuts

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