Example #1
0
func getGceInstanceID() info.InstanceID {
	instanceID, err := metadata.Get("instance/id")
	if err != nil {
		return info.UnknownInstance
	}
	return info.InstanceID(info.InstanceType(instanceID))
}
Example #2
0
func getAzureInstanceID() info.InstanceID {
	data, err := ioutil.ReadFile(BiosUUIDFileName)
	if err != nil {
		return info.UnNamedInstance
	}
	return info.InstanceID(strings.TrimSuffix(string(data), "\n"))
}
Example #3
0
func getAwsInstanceID() info.InstanceID {
	return info.InstanceID(getAwsMetadata("instance-id"))
}