// Retrieve The last known power state of a virtual guest in the event the guest is turned off outside of IMS or has gone offline.
165322
func (r Virtual_Guest) GetLastKnownPowerState() (resp datatypes.Virtual_Guest_Power_State, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "getLastKnownPowerState", nil, &r.Options, &resp)
	return
}
338652
func (vm *VM) getVirtualNetworkClient() (virtualnetwork.VirtualNetworkClient, error) {
	c, err := vm.getClient()
	if err != nil {
		return virtualnetwork.VirtualNetworkClient{}, err
	}

	return virtualnetwork.NewClient(c), nil
}
1235332
func (c *Client) RecoverVirtualMachine(p *RecoverVirtualMachineParameter) (*VirtualMachine, error) {
	obj, err := c.Request("recoverVirtualMachine", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*VirtualMachine), err
}
971346
func (r Network_Storage_Allowed_Host_VirtualGuest) GetResource() (resp datatypes.Virtual_Guest, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Storage_Allowed_Host_VirtualGuest", "getResource", nil, &r.Options, &resp)
	return
}
408890
func (r Virtual_Guest) CloseAlarm(alarmId *string) (resp bool, err error) {
	params := []interface{}{
		alarmId,
	}
	err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "closeAlarm", params, &r.Options, &resp)
	return
}
617994
func (soc *Socket) GetReconnectIvlMax() (time.Duration, error) {
	v, err := soc.getInt(C.ZMQ_RECONNECT_IVL_MAX)
	return time.Duration(v) * time.Millisecond, err
}
737295
func (v VirtualMachine) WaitForPowerState(ctx context.Context, state types.VirtualMachinePowerState) error {
	p := property.DefaultCollector(v.c)
	err := property.Wait(ctx, p, v.Reference(), []string{PropRuntimePowerState}, func(pc []types.PropertyChange) bool {
		for _, c := range pc {
			if c.Name != PropRuntimePowerState {
				continue
			}
			if c.Val == nil {
				continue
			}

			ps := c.Val.(types.VirtualMachinePowerState)
			if ps == state {
				return true
			}
		}
		return false
	})

	return err
}
540394
func (r Scale_Asset_Virtual_Guest) GetVirtualGuestId() (resp int, err error) {
	err = r.Session.DoRequest("SoftLayer_Scale_Asset_Virtual_Guest", "getVirtualGuestId", nil, &r.Options, &resp)
	return
}
1131001
func (r Virtual_Guest) GetRecentMetricData(time *uint) (resp []datatypes.Metric_Tracking_Object, err error) {
	params := []interface{}{
		time,
	}
	err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "getRecentMetricData", params, &r.Options, &resp)
	return
}
1039394
func (vm *VM) GetState() (string, error) {
	// Set up the authorizer
	tok, err := getServicePrincipalToken(&vm.Creds, azure.PublicCloud.ResourceManagerEndpoint)
	if err != nil {
		return "", err
	}
	authorizer := autorest.NewBearerAuthorizer(tok)

	virtualMachinesClient := compute.NewVirtualMachinesClient(vm.Creds.SubscriptionID)
	virtualMachinesClient.Authorizer = authorizer

	r, e := virtualMachinesClient.Get(vm.ResourceGroup, vm.Name, "InstanceView")
	if e != nil {
		return "", e
	}

	if r.VirtualMachineProperties != nil && r.VirtualMachineProperties.InstanceView != nil && len(*r.VirtualMachineProperties.InstanceView.Statuses) > 1 {
		state := *(*r.VirtualMachineProperties.InstanceView.Statuses)[1].DisplayStatus
		return translateState(state), e
	}

	return "", errors.New("failed to get VM status")
}
1226312
func (r Virtual_DedicatedHost) GetAllocationStatus() (resp datatypes.Container_Virtual_DedicatedHost_AllocationStatus, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_DedicatedHost", "getAllocationStatus", nil, &r.Options, &resp)
	return
}
1050906
func (r Network_Component) GetLastCommand() (resp datatypes.Hardware_Component_RemoteManagement_Command_Request, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Component", "getLastCommand", nil, &r.Options, &resp)
	return
}
375800
func (_class HostClass) GetEnabled(sessionID SessionRef, self HostRef) (_retval bool, _err error) {
	_method := "host.get_enabled"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertBoolToGo(_method + " -> ", _result.Value)
	return
}
243007
func (r Billing_Item_Virtual_DedicatedHost) GetParentVirtualGuestBillingItem() (resp datatypes.Billing_Item_Virtual_Guest, err error) {
	err = r.Session.DoRequest("SoftLayer_Billing_Item_Virtual_DedicatedHost", "getParentVirtualGuestBillingItem", nil, &r.Options, &resp)
	return
}
1072257
func (_class VMMetricsClass) GetLastUpdated(sessionID SessionRef, self VMMetricsRef) (_retval time.Time, _err error) {
	_method := "VM_metrics.get_last_updated"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMMetricsRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
	return
}
961108
func (vm *VM) GetState() (string, error) {

	if vm.ID == "" {
		return "", fmt.Errorf("Need an ID to get virtual machine state")
	}

	if err := vm.updateInfo(); err != nil {
		return "", err
	}

	return vm.state, nil
}
910496
func (_class VMSSClass) GetEnabled(sessionID SessionRef, self VMSSRef) (_retval bool, _err error) {
	_method := "VMSS.get_enabled"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMSSRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertBoolToGo(_method + " -> ", _result.Value)
	return
}