// Get the details of the child services for the given parent
777934
func (f *Facade) GetServiceDetailsByParentID(ctx datastore.Context, parentID string, since time.Duration) ([]service.ServiceDetails, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetServiceDetailsByParentID"))
	return f.serviceStore.GetServiceDetailsByParentID(ctx, parentID, since)
}
1328750
func (p *basePlan) GetParentByIndex(index int) (parent Plan) {
	if index < len(p.parents) && index >= 0 {
		return p.parents[index]
	}
	return nil
}
638277
func (c *SystemInfo) GetProcessInfo() ([]*SystemInfoProcessInfo, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "SystemInfo.getProcessInfo"})
	if err != nil {
		return nil, err
	}

	var chromeData struct {
		Result struct {
			ProcessInfo []*SystemInfoProcessInfo
		}
	}

	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}

	return chromeData.Result.ProcessInfo, nil
}
811117
func (ctx *Context) GetService(vsID string) (*ServiceInfo, error) {
	ctx.mutex.RLock()
	defer ctx.mutex.RUnlock()

	vs, exists := ctx.services[vsID]

	if !exists {
		return nil, ErrObjectNotFound
	}

	result := ServiceInfo{Options: vs.options}

	// This is O(n), can be optimized with reverse backend map.
	for rsID, backend := range ctx.backends {
		if backend.service != vs {
			continue
		}

		result.Backends = append(result.Backends, rsID)
		result.Health += backend.metrics.Health
	}

	if len(result.Backends) == 0 {
		// Service without backends is healthy, albeit useless.
		result.Health = 1.0
	} else {
		result.Health /= float64(len(result.Backends))
	}

	return &result, nil
}
1328006
func (s *IndexService) Parent(parent string) *IndexService {
	s.parent = parent
	return s
}
142426
func (_m *FacadeInterface) GetServiceTemplates(ctx datastore.Context) (map[string]servicetemplate.ServiceTemplate, error) {
	ret := _m.Called(ctx)

	var r0 map[string]servicetemplate.ServiceTemplate
	if rf, ok := ret.Get(0).(func(datastore.Context) map[string]servicetemplate.ServiceTemplate); ok {
		r0 = rf(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(map[string]servicetemplate.ServiceTemplate)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(datastore.Context) error); ok {
		r1 = rf(ctx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1070476
func (rbac *RBAC) GetParents(id string) ([]string, error) {
	rbac.mutex.Lock()
	defer rbac.mutex.Unlock()
	if _, ok := rbac.roles[id]; !ok {
		return nil, ErrRoleNotExist
	}
	ids, ok := rbac.parents[id]
	if !ok {
		return nil, nil
	}
	var parents []string
	for parent := range ids {
		parents = append(parents, parent)
	}
	return parents, nil
}
1173072
func (r Resource_Metadata) GetServiceResource(serviceName *string, index *int) (resp string, err error) {
	params := []interface{}{
		serviceName,
		index,
	}
	err = r.Session.DoRequest("SoftLayer_Resource_Metadata", "getServiceResource", params, &r.Options, &resp)
	return
}
1097539
func (_m *ClientInterface) GetServiceDetailsByTenantID(tenantID string) ([]service.ServiceDetails, error) {
	ret := _m.Called(tenantID)

	var r0 []service.ServiceDetails
	if rf, ok := ret.Get(0).(func(string) []service.ServiceDetails); ok {
		r0 = rf(tenantID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]service.ServiceDetails)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(tenantID)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1310059
func (_m *ClientInterface) GetAllServiceDetails(since time.Duration) ([]service.ServiceDetails, error) {
	ret := _m.Called(since)

	var r0 []service.ServiceDetails
	if rf, ok := ret.Get(0).(func(time.Duration) []service.ServiceDetails); ok {
		r0 = rf(since)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]service.ServiceDetails)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(time.Duration) error); ok {
		r1 = rf(since)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1337326
func (s *DomainSnapshot) GetParent(flags uint32) (*DomainSnapshot, error) {
	var err C.virError
	ptr := C.virDomainSnapshotGetParentWrapper(s.ptr, C.uint(flags), &err)
	if ptr == nil {
		return nil, makeError(&err)
	}
	return &DomainSnapshot{ptr: ptr}, nil
}
1027051
func (_m *FacadeInterface) GetServiceAddressAssignmentDetails(ctx datastore.Context, serviceID string, children bool) ([]service.IPAssignment, error) {
	ret := _m.Called(ctx, serviceID, children)

	var r0 []service.IPAssignment
	if rf, ok := ret.Get(0).(func(datastore.Context, string, bool) []service.IPAssignment); ok {
		r0 = rf(ctx, serviceID, children)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]service.IPAssignment)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(datastore.Context, string, bool) error); ok {
		r1 = rf(ctx, serviceID, children)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
665841
func (s *Server) GetServiceDetails(serviceID string, response *service.ServiceDetails) error {
	svc, err := s.f.GetServiceDetails(s.context(), serviceID)
	if err != nil {
		return err
	}
	*response = *svc
	return nil
}
1086890
func (s *MultiTermvectorService) Parent(parent string) *MultiTermvectorService {
	s.parent = parent
	return s
}
1005462
func (s *Server) GetServiceInfo() map[string]ServiceInfo {
	ret := make(map[string]ServiceInfo)
	for n, srv := range s.m {
		methods := make([]MethodInfo, 0, len(srv.md)+len(srv.sd))
		for m := range srv.md {
			methods = append(methods, MethodInfo{
				Name:           m,
				IsClientStream: false,
				IsServerStream: false,
			})
		}
		for m, d := range srv.sd {
			methods = append(methods, MethodInfo{
				Name:           m,
				IsClientStream: d.ClientStreams,
				IsServerStream: d.ServerStreams,
			})
		}

		ret[n] = ServiceInfo{
			Methods:  methods,
			Metadata: srv.mdata,
		}
	}
	return ret
}
677045
func (s *GetService) Parent(parent string) *GetService {
	s.parent = parent
	return s
}
824770
func (s *redisStore) Get(parent, scope string) (string, error) {
	token, err := s.client.Get(key(parent, scope)).Result()
	if err != nil {
		if err == redis.Nil {
			return "", nil
		}
		return "", err
	}

	return token, err
}