Documentation ¶
Overview ¶
Package spot provides an interface to Spot requests, that are polled from the API. It manages a local cache, which is updated periodically.
Index ¶
Constants ¶
View Source
const ( StateActive = "active" StateCancelled = "cancelled" StateFailed = "failed" StateClosed = "closed" )
See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html
View Source
const ( StatusCodeFulfilled = "fulfilled" StatusCodeInstanceTerminatedByUser = "instance-terminated-by-user" StatusCodeMarkedForTermination = "marked-for-termination" StatusCodeMarkedForStop = "marked-for-stop" StatusCodeRequestCanceledAndInstanceRunning = "request-canceled-and-instance-running" )
See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-status.html
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Run executes the EC2 API poller. It will update the instance cache // periodically. Run(context.Context) error // List returns all Spot requests that are currently in the cache. Those // instance cache will be updated in the background. List() []Instance // SignalEmitter gets triggered every time the cache changes. See syncutil // package for more information. SignalEmitter() *syncutil.SignalEmitter // Healthy indicates whether the background job is running correctly. Healthy() bool }
Client is an interface to Spot request data.
type Instance ¶
type Instance struct { InstanceID string `logfield:"instance-id,omitempty"` RequestID string `logfield:"spot-request-id"` CreateTime time.Time `logfield:"spot-create-time"` State string `logfield:"spot-state"` StatusCode string `logfield:"spot-status-code"` StatusUpdateTime time.Time `logfield:"spot-status-update-time"` }
Instance is the instance-related data that is retrieved via API.
Click to show internal directories.
Click to hide internal directories.