v2

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 20 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                      `json:"Name"`
	DockerName    string                      `json:"DockerName"`
	Image         string                      `json:"Image"`
	ImageID       string                      `json:"ImageID"`
	Ports         []v1.PortResponse           `json:"Ports,omitempty"`
	Labels        map[string]string           `json:"Labels,omitempty"`
	DesiredStatus string                      `json:"DesiredStatus"`
	KnownStatus   string                      `json:"KnownStatus"`
	ExitCode      *int                        `json:"ExitCode,omitempty"`
	Limits        LimitsResponse              `json:"Limits"`
	CreatedAt     *time.Time                  `json:"CreatedAt,omitempty"`
	StartedAt     *time.Time                  `json:"StartedAt,omitempty"`
	FinishedAt    *time.Time                  `json:"FinishedAt,omitempty"`
	Type          string                      `json:"Type"`
	Networks      []containermetadata.Network `json:"Networks,omitempty"`
	Health        *apicontainer.HealthStatus  `json:"Health,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:"CPU,omitempty"`
	Memory *int64   `json:"Memory,omitempty"`
}

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

type TaskResponse

type TaskResponse struct {
	Cluster            string              `json:"Cluster"`
	TaskARN            string              `json:"TaskARN"`
	Family             string              `json:"Family"`
	Revision           string              `json:"Revision"`
	DesiredStatus      string              `json:"DesiredStatus,omitempty"`
	KnownStatus        string              `json:"KnownStatus"`
	Containers         []ContainerResponse `json:"Containers,omitempty"`
	Limits             *LimitsResponse     `json:"Limits,omitempty"`
	PullStartedAt      *time.Time          `json:"PullStartedAt,omitempty"`
	PullStoppedAt      *time.Time          `json:"PullStoppedAt,omitempty"`
	ExecutionStoppedAt *time.Time          `json:"ExecutionStoppedAt,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