Example #1
0
func (vt *Vultr) mapInstanceStatus(status string, powerStatus string) compute.InstanceStatus {
	if status == "pending" {
		return "installing"
	} else if status == "active" {
		if powerStatus == "stopped" {
			return compute.StatusOffline
		} else if powerStatus == "running" {
			return compute.StatusOnline
		} else {
			return compute.InstanceStatus(powerStatus)
		}
	} else {
		return compute.InstanceStatus(status)
	}
}
Example #2
0
func (os *OpenStack) mapInstanceStatus(status string) compute.InstanceStatus {
	if status == "ACTIVE" {
		return compute.StatusOnline
	} else if status == "SHUTOFF" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(status))
	}
}
Example #3
0
func (cs *CloudStack) mapInstanceStatus(status string) compute.InstanceStatus {
	if status == "Running" {
		return compute.StatusOnline
	} else if status == "Stopped" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(status))
	}
}
Example #4
0
func (e *EC2) mapInstanceStatus(state string) compute.InstanceStatus {
	if state == "running" {
		return compute.StatusOnline
	} else if state == "stopped" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(state))
	}
}
Example #5
0
func (ln *LunaNode) mapInstanceStatus(status string) compute.InstanceStatus {
	if status == "Online" {
		return compute.StatusOnline
	} else if status == "Offline" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(status))
	}
}
Example #6
0
func (pm *Proxmox) mapInstanceStatus(status string) compute.InstanceStatus {
	if status == "running" {
		return compute.StatusOnline
	} else if status == "stopped" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(status))
	}
}
Example #7
0
func (gc *GoogleCompute) mapInstanceStatus(state string) compute.InstanceStatus {
	if state == "RUNNING" {
		return compute.StatusOnline
	} else if state == "STOPPED" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(state))
	}
}
Example #8
0
func (do *DigitalOcean) mapInstanceStatus(status string) compute.InstanceStatus {
	if status == "active" {
		return compute.StatusOnline
	} else if status == "off" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(status)
	}
}
Example #9
0
func (ln *Linode) mapInstanceStatus(status string) compute.InstanceStatus {
	if status == "Running" {
		return compute.StatusOnline
	} else if status == "Powered Off" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(status))
	}
}
Example #10
0
func (solus *SolusVM) mapInstanceStatus(status string) compute.InstanceStatus {
	if status == "online" {
		return compute.StatusOnline
	} else if status == "offline" {
		return compute.StatusOffline
	} else {
		return compute.InstanceStatus(strings.ToLower(status))
	}
}