Documentation ¶
Index ¶
- Constants
- type InstanceAction
- type NodeMetadata
- type ScheduledEventDetail
- type Service
- func (e *Service) GetMetadataInfo(path string) (info string, err error)
- func (e *Service) GetNodeMetadata() NodeMetadata
- func (e *Service) GetScheduledMaintenanceEvents() ([]ScheduledEventDetail, error)
- func (e *Service) GetSpotITNEvent() (instanceAction *InstanceAction, err error)
- func (e *Service) Request(contextPath string) (*http.Response, error)
Constants ¶
View Source
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" // InstanceIDPath path to instance id InstanceIDPath = "/latest/meta-data/instance-id" // 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" )
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 { InstanceID string InstanceType string PublicHostname string PublicIP string LocalHostname string LocalIP string AvailabilityZone string }
NodeMetadata contains information that applies to every drain event
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) 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
Click to show internal directories.
Click to hide internal directories.