Documentation ¶
Index ¶
- Constants
- func AgentMetadataHandler(containerInstanceArn *string, cfg *config.Config) func(http.ResponseWriter, *http.Request)
- func CredentialsHandler(credentialsManager credentials.Manager, auditLogger audit.AuditLogger) func(http.ResponseWriter, *http.Request)
- func CredentialsHandlerImpl(w http.ResponseWriter, r *http.Request, auditLogger audit.AuditLogger, ...)
- func TaskContainerMetadataHandler(taskEngine utils.DockerStateResolver) func(http.ResponseWriter, *http.Request)
- type ContainerResponse
- type MetadataResponse
- type PortResponse
- type TaskResponse
- type TasksResponse
Constants ¶
const ( // ErrNoIDInRequest is the error code indicating that no ID was specified ErrNoIDInRequest = "NoIdInRequest" // ErrInvalidIDInRequest is the error code indicating that the ID was invalid ErrInvalidIDInRequest = "InvalidIdInRequest" // ErrNoCredentialsAssociated is the error code indicating no credentials are // associated with the specified ID ErrNoCredentialsAssociated = "NoCredentialsAssociated" // ErrCredentialsUninitialized is the error code indicating that credentials were // not properly initialized. This may happen immediately after the agent is // started, before it has completed state reconciliation. ErrCredentialsUninitialized = "CredentialsUninitialized" // ErrInternalServer is the error indicating something generic went wrong ErrInternalServer = "InternalServerError" )
const AgentMetadataPath = "/v1/metadata"
AgentMetadataPath is the Agent metadata path for v1 handler.
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 CredentialsHandler ¶
func CredentialsHandler(credentialsManager credentials.Manager, auditLogger audit.AuditLogger) func(http.ResponseWriter, *http.Request)
CredentialsHandler creates response for the 'v1/credentials' API. It returns a JSON response containing credentials when found. The HTTP status code of 400 is returned otherwise.
func CredentialsHandlerImpl ¶
func CredentialsHandlerImpl(w http.ResponseWriter, r *http.Request, auditLogger audit.AuditLogger, credentialsManager credentials.Manager, credentialsID string, errPrefix string)
CredentialsHandlerImpl is the major logic in CredentialsHandler, abstract this out because v2.CredentialsHandler also uses the same logic.
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 DockerName string Name string Ports []PortResponse `json:",omitempty"` Networks []containermetadata.Network `json:",omitempty"` }
ContainerResponse is the schema for the container response JSON object
func NewContainerResponse ¶
func NewContainerResponse(dockerContainer *apicontainer.DockerContainer, eni *apieni.ENI) ContainerResponse
NewContainerResponse creates ContainerResponse for a container.
type MetadataResponse ¶
MetadataResponse is the schema for the metadata response JSON object
type PortResponse ¶
type PortResponse struct { ContainerPort uint16 Protocol string HostPort uint16 `json:",omitempty"` }
PortResponse defines the schema for portmapping response JSON object.
func NewPortBindingsResponse ¶
func NewPortBindingsResponse(dockerContainer *apicontainer.DockerContainer, eni *apieni.ENI) []PortResponse
NewPortBindingsResponse creates PortResponse for a container.
type TaskResponse ¶
type TaskResponse struct { Arn string DesiredStatus string `json:",omitempty"` KnownStatus string Family string Version string Containers []ContainerResponse }
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
}
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.