Documentation ¶
Index ¶
- Constants
- func GetAWSRegion() string
- func NewSession(meta ECSTaskMeta, userAgentCaller string) (*session.Session, error)
- func ParseTaskID(taskArn string) string
- func UserAgentHandler(caller string) request.NamedHandler
- type ECSTaskMeta
- type ECSTaskMetaContainer
- type ECSTaskMetaHealth
- type ECSTaskMetaNetwork
Constants ¶
View Source
const ( ECSMetadataURIEnvVar = "ECS_CONTAINER_METADATA_URI_V4" AWSRegionEnvVar = "AWS_REGION" )
Variables ¶
This section is empty.
Functions ¶
func GetAWSRegion ¶ added in v0.7.0
func GetAWSRegion() string
func NewSession ¶ added in v0.2.0
func NewSession(meta ECSTaskMeta, userAgentCaller string) (*session.Session, error)
NewSession prepares a client session. The returned session includes a User-Agent handler to enable AWS to track usage. If the AWS SDK fails to find the region, the region is parsed from Task metadata (on EC2 the region is not typically defined in the environment).
func ParseTaskID ¶ added in v0.5.0
func UserAgentHandler ¶ added in v0.2.0
func UserAgentHandler(caller string) request.NamedHandler
Types ¶
type ECSTaskMeta ¶
type ECSTaskMeta struct { Cluster string `json:"Cluster"` TaskARN string `json:"TaskARN"` Family string `json:"Family"` Containers []ECSTaskMetaContainer `json:"Containers"` AvailabilityZone string `json:"AvailabilityZone"` }
func ECSTaskMetadata ¶
func ECSTaskMetadata() (ECSTaskMeta, error)
func (ECSTaskMeta) AccountID ¶ added in v0.5.0
func (e ECSTaskMeta) AccountID() (string, error)
func (ECSTaskMeta) ClusterARN ¶ added in v0.5.0
func (e ECSTaskMeta) ClusterARN() (string, error)
func (ECSTaskMeta) HasContainerStopped ¶ added in v0.7.0
func (e ECSTaskMeta) HasContainerStopped(name string) bool
func (ECSTaskMeta) NodeIP ¶ added in v0.5.0
func (e ECSTaskMeta) NodeIP() string
NodeIP returns the IP of the node the task is running on.
func (ECSTaskMeta) Region ¶ added in v0.5.0
func (e ECSTaskMeta) Region() (string, error)
func (ECSTaskMeta) TaskID ¶
func (e ECSTaskMeta) TaskID() string
type ECSTaskMetaContainer ¶ added in v0.2.0
type ECSTaskMetaContainer struct { Name string `json:"Name"` Health ECSTaskMetaHealth `json:"Health"` DesiredStatus string `json:"DesiredStatus"` KnownStatus string `json:"KnownStatus"` Networks []ECSTaskMetaNetwork `json:"Networks"` Type string `json:"Type"` }
func (ECSTaskMetaContainer) HasStopped ¶ added in v0.7.0
func (c ECSTaskMetaContainer) HasStopped() bool
func (ECSTaskMetaContainer) IsNormalType ¶ added in v0.7.1
func (c ECSTaskMetaContainer) IsNormalType() bool
type ECSTaskMetaHealth ¶ added in v0.2.0
type ECSTaskMetaNetwork ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.