v2

package
v0.0.0-...-b702281 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var CredentialsPath = credentials.V2CredentialsPath + "/" + utils.ConstructMuxVar(credentialsIDMuxName, utils.AnythingRegEx)

CredentialsPath specifies the relative URI path for serving task IAM credentials. Use "AnythingRegEx" regex to handle the case where the "credentialsIDMuxName" is empty, this is because the name that's used to extract dynamic value in gorilla cannot be empty by default. If we don't do this, we will get 404 error when we access "/v2/credentials/", but it should be 400 error.

Functions

func CredentialsHandler

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

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

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         []response.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      []response.Network        `json:"Networks,omitempty"`
	Health        *HealthStatus             `json:"Health,omitempty"`
	Volumes       []response.VolumeResponse `json:"Volumes,omitempty"`
	LogDriver     string                    `json:"LogDriver,omitempty"`
	LogOptions    map[string]string         `json:"LogOptions,omitempty"`
	ContainerARN  string                    `json:"ContainerARN,omitempty"`
}

ContainerResponse defines the schema for the container response JSON object

type ErrorResponse

type ErrorResponse struct {
	ErrorField   string `json:"ErrorField,omitempty"`
	ErrorCode    string `json:"ErrorCode,omitempty"`
	ErrorMessage string `json:"ErrorMessage,omitempty"`
	StatusCode   int    `json:"StatusCode,omitempty"`
	RequestId    string `json:"RequestId,omitempty"`
	ResourceARN  string `json:"ResourceARN,omitempty"`
}

ErrorResponse defined the schema for error response JSON object

type HealthStatus

type HealthStatus struct {
	// Status is the container health status
	Status string `json:"status,omitempty"`
	// Since is the timestamp when container health status changed
	Since *time.Time `json:"statusSince,omitempty"`
	// ExitCode is the exitcode of health check if failed
	ExitCode int `json:"exitCode,omitempty"`
	// Output is the output of health check
	Output string `json:"output,omitempty"`
}

Container health status

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"`
	AvailabilityZone      string              `json:"AvailabilityZone,omitempty"`
	TaskTags              map[string]string   `json:"TaskTags,omitempty"`
	ContainerInstanceTags map[string]string   `json:"ContainerInstanceTags,omitempty"`
	LaunchType            string              `json:"LaunchType,omitempty"`
	Errors                []ErrorResponse     `json:"Errors,omitempty"`
}

TaskResponse defines the schema for the task response JSON object

Jump to

Keyboard shortcuts

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