// GetSlavesFromLeader will return the current slaves of the leader node of the cluster.
10390
func (c *Client) GetSlavesFromLeader() (*State, error) {
	resp, err := c.GetHTTPResponseFromLeader(c.GetURLForSlavesFilePid)
	return c.parseStateResponse(resp, err)
}
475074
func GetSlaveStatus(endpoint string) (SlaveStatus, error) {
	var (
		dataSet []map[string]string
		result  SlaveStatus
		err     error
	)
	if dataSet, err = readDataSet(endpoint, "SHOW SLAVE STATUS"); err != nil {
		return result, err
	}
	// There's at most one row in the resultset of "SHOW SLAVE STATUS"
	if len(dataSet) == 1 {
		result.SlaveIOState = dataSet[0]["Slave_IO_State"]
		result.MasterHost = dataSet[0]["Master_Host"]
		result.MasterUser = dataSet[0]["Master_User"]
		result.MasterPort = getInt(dataSet[0]["Master_Port"])
		result.ConnectRetry = dataSet[0]["Connect_Retry"]
		result.MasterLogFile = dataSet[0]["Master_Log_File"]
		result.ReadMasterLogPos = getInt(dataSet[0]["Read_Master_Log_Pos"])
		result.RelayLogFile = dataSet[0]["Relay_Log_File"]
		result.RelayLogPos = getInt(dataSet[0]["Relay_Log_Pos"])
		result.RelayMasterLogFile = dataSet[0]["Relay_Master_Log_File"]
		result.SlaveIORunning = dataSet[0]["Slave_IO_Running"]
		result.SlaveSQLRunning = dataSet[0]["Slave_SQL_Running"]
		result.ReplicateDoDB = dataSet[0]["Replicate_Do_DB"]
		result.ReplicateIgnoreDB = dataSet[0]["Replicate_Ignore_DB"]
		result.ReplicateDoTable = dataSet[0]["Replicate_Do_Table"]
		result.ReplicateIgnoreTable = dataSet[0]["Replicate_Ignore_Table"]
		result.ReplicateWildDoTable = dataSet[0]["Replicate_Wild_Do_Table"]
		result.ReplicateWildIgnoreTable = dataSet[0]["Replicate_Wild_Ignore_Table"]
		result.LastErrno = getInt(dataSet[0]["Last_Errno"])
		result.LastError = dataSet[0]["Last_Error"]
		result.SkipCounter = getInt(dataSet[0]["Skip_Counter"])
		result.ExecMasterLogPos = getInt(dataSet[0]["Exec_Master_Log_Pos"])
		result.RelayLogSpace = getInt(dataSet[0]["Relay_Log_Space"])
		result.UntilCondition = dataSet[0]["Until_Condition"]
		result.UntilLogFile = dataSet[0]["Until_Log_File"]
		result.UntilLogPos = getInt(dataSet[0]["Until_Log_Pos"])
		result.MasterSSLAllowed = dataSet[0]["Master_SSL_Allowed"]
		result.MasterSSLCAFile = dataSet[0]["Master_SSL_CA_File"]
		result.MasterSSLCAPath = dataSet[0]["Master_SSL_CA_Path"]
		result.MasterSSLCert = dataSet[0]["Master_SSL_Cert"]
		result.MasterSSLCipher = dataSet[0]["Master_SSL_Cipher"]
		result.MasterSSLKey = dataSet[0]["Master_SSL_Key"]
		result.SecondsBehindMaster = getInt(dataSet[0]["Seconds_Behind_Master"])
		result.MasterSSLVerifyServerCert = dataSet[0]["Master_SSL_Verify_Server_Cert"]
		result.LastIOErrno = getInt(dataSet[0]["Last_IO_Errno"])
		result.LastIOError = dataSet[0]["Last_IO_Error"]
		result.LastSQLErrno = getInt(dataSet[0]["Last_SQL_Errno"])
		result.LastSQLError = dataSet[0]["Last_SQL_Error"]
		result.ReplicateIgnoreServerIds = dataSet[0]["Replicate_Ignore_Server_Ids"]
		result.MasterServerID = getInt(dataSet[0]["Master_Server_Id"])
		result.MasterUUID = dataSet[0]["Master_UUID"]
		result.MasterInfoFile = dataSet[0]["Master_Info_File"]
		result.SQLDelay = getInt(dataSet[0]["SQL_Delay"])
		result.SQLRemainingDelay = dataSet[0]["SQL_Remaining_Delay"]
		result.SlaveSQLRunningState = dataSet[0]["Slave_SQL_Running_State"]
		result.MasterRetryCount = getInt(dataSet[0]["Master_Retry_Count"])
		result.MasterBind = dataSet[0]["Master_Bind"]
		result.LastIOErrorTimestamp = dataSet[0]["Last_IO_Error_Timestamp"]
		result.LastSQLErrorTimestamp = dataSet[0]["Last_SQL_Error_Timestamp"]
		result.MasterSSLCrl = dataSet[0]["Master_SSL_Crl"]
		result.MasterSSLCrlpath = dataSet[0]["Master_SSL_Crlpath"]
		result.RetrievedGtidSet = dataSet[0]["Retrieved_Gtid_Set"]
		result.ExecutedGtidSet = dataSet[0]["Executed_Gtid_Set"]
		result.AutoPosition = getBool(dataSet[0]["Auto_Position"])
	}
	return result, nil
}
188033
func (s *Status) Leader() (string, error) {
	r := s.c.newRequest("GET", "/v1/status/leader")
	_, resp, err := requireOK(s.c.doRequest(r))
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	var leader string
	if err := decodeBody(resp, &leader); err != nil {
		return "", err
	}
	return leader, nil
}
22321
func (c *Client) GetStateSummaryFromLeader() (*State, error) {
	resp, err := c.GetHTTPResponseFromLeader(c.GetURLForStateSummaryFilePid)
	return c.parseStateResponse(resp, err)
}
1287533
func (p *RoleServiceClient) GetMembers(role string) (r []string, err error) {
	if err = p.sendGetMembers(role); err != nil {
		return
	}
	return p.recvGetMembers()
}
53735
func (process *TeleportProcess) getConnectors() []*Connector {
	process.Lock()
	defer process.Unlock()

	out := make([]*Connector, 0, len(process.connectors))
	for role := range process.connectors {
		out = append(out, process.connectors[role])
	}
	return out
}
1164046
func (c *Client) GetSlavesFromPid(pid *Pid) (*State, error) {
	u := c.GetURLForSlavesFilePid(*pid)
	resp, err := c.GetHTTPResponse(&u)
	return c.parseStateResponse(resp, err)
}
1336377
func GetDriver(name, root string, config map[string]string) (ConvoyDriver, error) {
	if _, exists := initializers[name]; !exists {
		return nil, fmt.Errorf("Driver %v is not supported!", name)
	}
	drvRoot := filepath.Join(root, name)
	return initializers[name](drvRoot, config)
}
175352
func (r legacyLeadershipReader) Leaders() (map[string]string, error) {
	l, err := r.st.ApplicationLeaders()
	return l, errors.Trace(err)
}
986436
func (folder *Folder) GetVirtualMachines(ctx context.Context) ([]*VirtualMachine, error) {
	vmFolders, err := folder.Children(ctx)
	if err != nil {
		klog.Errorf("Failed to get children from Folder: %s. err: %+v", folder.InventoryPath, err)
		return nil, err
	}
	var vmObjList []*VirtualMachine
	for _, vmFolder := range vmFolders {
		if vmFolder.Reference().Type == VirtualMachineType {
			vmObj := VirtualMachine{object.NewVirtualMachine(folder.Client(), vmFolder.Reference()), folder.Datacenter}
			vmObjList = append(vmObjList, &vmObj)
		}
	}
	return vmObjList, nil
}
577995
func (c *CreateOrgInvitationOptions) GetRole() string {
	if c == nil || c.Role == nil {
		return ""
	}
	return *c.Role
}
710398
func (a *AuthServer) GetNodes(namespace string, opts ...services.MarshalOption) ([]services.Server, error) {
	return a.GetCache().GetNodes(namespace, opts...)
}
1036834
func (c *ACLCaches) GetRole(roleID string) *RoleCacheEntry {
	if c == nil || c.roles == nil {
		return nil
	}

	if raw, ok := c.roles.Get(roleID); ok {
		return raw.(*RoleCacheEntry)
	}

	return nil
}
1029651
func (e *SyncedEnforcer) GetRolesForUser(name string) []string {
	e.m.Lock()
	defer e.m.Unlock()
	return e.Enforcer.GetRolesForUser(name)
}
452278
func (group *NodeGroup) GetNode(i int) Node {
	group.mux.RLock()
	defer group.mux.RUnlock()

	if i < 0 || group == nil || len(group.nodes) <= i {
		return Node{}
	}
	return group.nodes[i]
}
1349826
func determineLeader(node string, children []string) (isLeader bool, leaderNode string, err error) {
	err = func() error {
		if len(children) == 0 {
			return errors.New("no child nodes")
		}
		sequences, lookup, err := sortedChildrenSequences(children)
		if err != nil {
			return err
		}
		mySeq, err := sequencePart(node)
		if err != nil {
			return errors.Wrap(err, "invalid owner node")
		}
		leaderSeq := sequences[0]
		isLeader = mySeq == leaderSeq
		leaderNode = lookup[leaderSeq]
		return nil
	}()
	return isLeader, leaderNode, err
}
1302647
func (m *Membership) GetRole() string {
	if m == nil || m.Role == nil {
		return ""
	}
	return *m.Role
}