// Get the last_port field of the given PVS_server.
961936
func (_class PVSServerClass) GetLastPort(sessionID SessionRef, self PVSServerRef) (_retval int, _err error) {
	_method := "PVS_server.get_last_port"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertPVSServerRefToXen(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 = convertIntToGo(_method + " -> ", _result.Value)
	return
}
446802
func GetVHost(conn client.Connection, key VHostKey) (string, string, error) {
	pth := path.Join("/net/vhost", key.HostID, key.Subdomain)

	logger := plog.WithFields(log.Fields{
		"hostid":    key.HostID,
		"subdomain": key.Subdomain,
		"zkpath":    pth,
	})

	vhost := &VHost{}
	err := conn.Get(pth, vhost)
	if err == client.ErrNoNode {
		logger.WithError(err).Debug("Virtual host subdomain not found")
		return "", "", nil
	} else if err != nil {
		logger.WithError(err).Debug("Could not look up virtual host subdomain")
		return "", "", &RegistryError{
			Action:  "get",
			Path:    pth,
			Message: "could not look up virtual host subdomain",
		}
	}

	logger.WithFields(log.Fields{
		"tenantid":    vhost.TenantID,
		"application": vhost.Application,
	}).Debug("Found vhost subdomain")

	return vhost.ServiceID, vhost.Application, nil
}
1029249
func (_class PVSSiteClass) GetServers(sessionID SessionRef, self PVSSiteRef) (_retval []PVSServerRef, _err error) {
	_method := "PVS_site.get_servers"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertPVSSiteRefToXen(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 = convertPVSServerRefSetToGo(_method + " -> ", _result.Value)
	return
}
178001
func (z *zkf) GetVHost(subdomain string) (string, string, error) {
	logger := plog.WithField("subdomain", subdomain)

	// get the root-based connection to check the public port
	conn, err := zzk.GetLocalConnection("/")
	if err != nil {
		logger.WithError(err).Debug("Could not acquire root-based connection to look up a public endpoint vhost")
		return "", "", err
	}

	// look for the vhost
	key := zkr.VHostKey{
		HostID:    "master",
		Subdomain: subdomain,
	}
	serviceID, application, err := zkr.GetVHost(conn, key)
	if err != nil {
		logger.WithError(err).Debug("Could not look up public endpoint vhost")
		return "", "", err
	}

	logger.Debug("Searched for public endpoint vhost")
	return serviceID, application, err
}
893648
func (_class VMGuestMetricsClass) GetLastUpdated(sessionID SessionRef, self VMGuestMetricsRef) (_retval time.Time, _err error) {
	_method := "VM_guest_metrics.get_last_updated"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMGuestMetricsRefToXen(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
}
346094
func (c *clusterConnection) getCurrentServer() driver.Connection {
	c.mutex.RLock()
	defer c.mutex.RUnlock()
	return c.servers[c.current]
}
1280730
func LastCap() capability.Cap {
	last := capability.CAP_LAST_CAP
	// hack for RHEL6 which has no /proc/sys/kernel/cap_last_cap
	if last == capability.Cap(63) {
		last = capability.CAP_BLOCK_SUSPEND
	}

	return last
}
1004006
func (m *Maestro) GetPort(name string) (uint16, error) {
	sname, err := m.GetServiceName()
	if err != nil {
		return 0, errors.Annotate(err, "cannot load service for port")
	}
	cname, err := m.GetContainerName()
	if err != nil {
		return 0, errors.Annotate(err, "cannot load container name for port")
	}
	return m.GetSpecificExposedPort(sname, cname, name)
}
627910
func (c *asyncClient) Lastsave() (result FutureInt64, err Error) {
	var resp *PendingResponse
	resp, err = c.conn.QueueRequest(&LASTSAVE, [][]byte{})
	if err == nil {
		result = resp.future.(FutureInt64)
	}
	return result, err

}
617994
func (soc *Socket) GetReconnectIvlMax() (time.Duration, error) {
	v, err := soc.getInt(C.ZMQ_RECONNECT_IVL_MAX)
	return time.Duration(v) * time.Millisecond, err
}
843505
func (c LastSentClient) GetLastSent(ids []LastSentID) ([]LastSentResult, error) {
	var args params.LogForwardingGetLastSentParams
	args.IDs = make([]params.LogForwardingID, len(ids))
	for i, id := range ids {
		args.IDs[i] = params.LogForwardingID{
			ModelTag: id.Model.String(),
			Sink:     id.Sink,
		}
	}

	var apiResults params.LogForwardingGetLastSentResults
	err := c.caller.FacadeCall("GetLastSent", args, &apiResults)
	if err != nil {
		return nil, errors.Trace(err)
	}

	results := make([]LastSentResult, len(ids))
	for i, apiRes := range apiResults.Results {
		results[i] = LastSentResult{
			LastSentInfo: LastSentInfo{
				LastSentID: ids[i],
				RecordID:   apiRes.RecordID,
			},
			Error: common.RestoreError(apiRes.Error),
		}
		if apiRes.RecordTimestamp > 0 {
			results[i].RecordTimestamp = time.Unix(0, apiRes.RecordTimestamp)
		}
	}
	return results, nil
}
136589
func (_class PVSSiteClass) GetAllRecords(sessionID SessionRef) (_retval map[PVSSiteRef]PVSSiteRecord, _err error) {
	_method := "PVS_site.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPVSSiteRefToPVSSiteRecordMapToGo(_method + " -> ", _result.Value)
	return
}
670097
func (handler *deviceHandler) GetISCSIPortalHostMapForTarget(targetIqn string) (map[string]int, error) {
	portalHostMap := make(map[string]int)
	return portalHostMap, nil
}
115143
func (vrsConnection VRSConnection) GetPortState(name string) (map[port.StateKey]interface{}, error) {

	readRowArgs := ovsdb.ReadRowArgs{
		Columns: []string{ovsdb.NuagePortTableColumnIPAddress, ovsdb.NuagePortTableColumnSubnetMask,
			ovsdb.NuagePortTableColumnGateway, ovsdb.NuagePortTableColumnEVPNID,
			ovsdb.NuagePortTableColumnVRFId},
		Condition: []string{ovsdb.NuagePortTableColumnName, "==", name},
	}

	var row map[string]interface{}
	var err error
	if row, err = vrsConnection.portTable.ReadRow(vrsConnection.ovsdbClient, readRowArgs); err != nil {
		return make(map[port.StateKey]interface{}), fmt.Errorf("Unable to obtain the port row %v", err)
	}

	portState := make(map[port.StateKey]interface{})
	portState[port.StateKeyIPAddress] = row[ovsdb.NuagePortTableColumnIPAddress]
	portState[port.StateKeySubnetMask] = row[ovsdb.NuagePortTableColumnSubnetMask]
	portState[port.StateKeyGateway] = row[ovsdb.NuagePortTableColumnGateway]
	portState[port.StateKeyVrfID] = row[ovsdb.NuagePortTableColumnVRFId]
	portState[port.StateKeyEvpnID] = row[ovsdb.NuagePortTableColumnEVPNID]

	return portState, nil
}
473776
func (_class PVSProxyClass) GetAllRecords(sessionID SessionRef) (_retval map[PVSProxyRef]PVSProxyRecord, _err error) {
	_method := "PVS_proxy.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPVSProxyRefToPVSProxyRecordMapToGo(_method + " -> ", _result.Value)
	return
}
449664
func (z *zkf) GetPublicPort(portAddress string) (string, string, error) {
	logger := plog.WithField("portaddress", portAddress)

	// get the root-based connection to check the public port
	conn, err := zzk.GetLocalConnection("/")
	if err != nil {
		logger.WithError(err).Debug("Could not acquire a root-based connection to look up a public endpoint port")
		return "", "", err
	}

	// look for the public port
	key := zkr.PublicPortKey{
		HostID:      "master",
		PortAddress: portAddress,
	}
	serviceID, application, err := zkr.GetPublicPort(conn, key)
	if err != nil {
		logger.WithError(err).Debug("Could not look up public endpoint port")
		return "", "", err
	}

	logger.Debug("Searched for public endpoint port")
	return serviceID, application, err
}
1127154
func (_class PVSProxyClass) GetStatus(sessionID SessionRef, self PVSProxyRef) (_retval PvsProxyStatus, _err error) {
	_method := "PVS_proxy.get_status"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertPVSProxyRefToXen(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 = convertEnumPvsProxyStatusToGo(_method + " -> ", _result.Value)
	return
}