Documentation ¶
Index ¶
- Constants
- type InstanceAction
- type NodeMetadata
- type RebalanceRecommendation
- type ScheduledEventDetail
- type Service
- func (e *Service) GetMetadataInfo(path string) (info string, err error)
- func (e *Service) GetNodeMetadata() NodeMetadata
- func (e *Service) GetRebalanceRecommendationEvent() (rebalanceRec *RebalanceRecommendation, err error)
- func (e *Service) GetScheduledMaintenanceEvents() ([]ScheduledEventDetail, error)
- func (e *Service) GetSpotITNEvent() (instanceAction *InstanceAction, err error)
- func (e *Service) Request(contextPath string) (*http.Response, error)
Constants ¶
const ( // SpotInstanceActionPath is the context path to spot/instance-action within IMDS SpotInstanceActionPath = "/latest/meta-data/spot/instance-action" // ScheduledEventPath is the context path to events/maintenance/scheduled within IMDS ScheduledEventPath = "/latest/meta-data/events/maintenance/scheduled" // RebalanceRecommendationPath is the context path to events/recommendations/rebalance within IMDS RebalanceRecommendationPath = "/latest/meta-data/events/recommendations/rebalance" // InstanceIDPath path to instance id InstanceIDPath = "/latest/meta-data/instance-id" // InstanceLifeCycle path to instance life cycle InstanceLifeCycle = "/latest/meta-data/instance-life-cycle" // InstanceTypePath path to instance type InstanceTypePath = "/latest/meta-data/instance-type" // PublicHostnamePath path to public hostname PublicHostnamePath = "/latest/meta-data/public-hostname" // PublicIPPath path to public ip PublicIPPath = "/latest/meta-data/public-ipv4" // LocalHostnamePath path to local hostname LocalHostnamePath = "/latest/meta-data/local-hostname" // LocalIPPath path to local ip LocalIPPath = "/latest/meta-data/local-ipv4" // AZPlacementPath path to availability zone placement AZPlacementPath = "/latest/meta-data/placement/availability-zone" // IdentityDocPath is the path to the instance identity document IdentityDocPath = "/latest/dynamic/instance-identity/document" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstanceAction ¶
InstanceAction metadata structure for json parsing
type NodeMetadata ¶ added in v1.3.0
type NodeMetadata struct { AccountId string `json:"accountId"` InstanceID string `json:"instanceId"` InstanceLifeCycle string `json:"instanceLifeCycle"` InstanceType string `json:"instanceType"` PublicHostname string `json:"publicHostname"` PublicIP string `json:"publicIp"` LocalHostname string `json:"localHostname"` LocalIP string `json:"privateIp"` AvailabilityZone string `json:"availabilityZone"` Region string `json:"region"` }
NodeMetadata contains information that applies to every drain event
type RebalanceRecommendation ¶ added in v1.10.0
type RebalanceRecommendation struct {
NoticeTime string `json:"noticeTime"`
}
RebalanceRecommendation metadata structure for json parsing
type ScheduledEventDetail ¶ added in v1.2.0
type ScheduledEventDetail struct { NotBefore string `json:"NotBefore"` Code string `json:"Code"` Description string `json:"Description"` EventID string `json:"EventId"` NotAfter string `json:"NotAfter"` State string `json:"State"` }
ScheduledEventDetail metadata structure for json parsing
type Service ¶ added in v1.3.0
Service is used to query the EC2 instance metadata service v1 and v2
func (*Service) GetMetadataInfo ¶ added in v1.3.0
GetMetadataInfo generic function for retrieving ec2 metadata
func (*Service) GetNodeMetadata ¶ added in v1.3.0
func (e *Service) GetNodeMetadata() NodeMetadata
GetNodeMetadata attempts to gather additional ec2 instance information from the metadata service
func (*Service) GetRebalanceRecommendationEvent ¶ added in v1.10.0
func (e *Service) GetRebalanceRecommendationEvent() (rebalanceRec *RebalanceRecommendation, err error)
GetRebalanceRecommendationEvent retrieves rebalance recommendation events from imds
func (*Service) GetScheduledMaintenanceEvents ¶ added in v1.3.0
func (e *Service) GetScheduledMaintenanceEvents() ([]ScheduledEventDetail, error)
GetScheduledMaintenanceEvents retrieves EC2 scheduled maintenance events from imds
func (*Service) GetSpotITNEvent ¶ added in v1.3.0
func (e *Service) GetSpotITNEvent() (instanceAction *InstanceAction, err error)
GetSpotITNEvent retrieves EC2 spot interruption events from imds