// GetServiceID returns a service by ID.
435897
func (c *Client) GetServiceID(id int64) (*models.Service, error) {
	params := service.NewGetServiceIDParams().WithID(id).WithTimeout(api.ClientTimeout)
	resp, err := c.Service.GetServiceID(params)
	if err != nil {
		return nil, Hint(err)
	}
	return resp.Payload, nil
}
523085
func (client *Client) GetService(serviceGUID string) (Service, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetServiceRequest,
		URIParams:   Params{"service_guid": serviceGUID},
	})
	if err != nil {
		return Service{}, nil, err
	}

	var service Service
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &service,
	}

	err = client.connection.Make(request, &response)
	return service, response.Warnings, err
}
315618
func (v *Service) GetParentID() (o ServiceID) {
	if v != nil && v.ParentID != nil {
		return *v.ParentID
	}

	return
}
1300057
func (s *ServicesService) GetService(serviceIdentifier string) (*serviceResponse, error) {
	path := versioned(servicePath(serviceIdentifier))
	serviceResponse := &serviceResponse{}

	resp, err := s.client.get(path, serviceResponse)
	if err != nil {
		return nil, err
	}

	serviceResponse.HttpResponse = resp
	return serviceResponse, nil
}
31030
func GetService(tx ReadTx, id string) *api.Service {
	s := tx.get(tableService, id)
	if s == nil {
		return nil
	}
	return s.(*api.Service)
}
1020682
func (client *Client) GetServiceInstance(serviceInstanceGUID string) (ServiceInstance, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetServiceInstanceRequest,
		URIParams:   Params{"service_instance_guid": serviceInstanceGUID},
	})
	if err != nil {
		return ServiceInstance{}, nil, err
	}

	var serviceInstance ServiceInstance
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &serviceInstance,
	}

	err = client.connection.Make(request, &response)
	return serviceInstance, response.Warnings, err
}
845896
func (s *storeImpl) GetServiceCountByImage(ctx datastore.Context, imageID string) (int, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("ServiceStore.GetServiceCountByImage"))
	id := strings.TrimSpace(imageID)
	if id == "" {
		return 0, errors.New("empty imageID not allowed")
	}
	q := datastore.NewQuery(ctx)
	query := search.Query().Term("ImageID", id)
	search := search.Search("controlplane").Type(kind).Size("50000").Query(query)
	results, err := q.Execute(search)
	if err != nil {
		return 0, err
	}
	return results.Len(), nil
}
81653
func (s *storeImpl) Get(ctx datastore.Context, id string) (*Service, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("ServiceStore.Get"))
	// Get the service from elastic and fill additional info into the
	// service object.
	svc, err := s.get(ctx, id)
	if err == nil {
		s.fillAdditionalInfo(svc) // Mutex RLock
	}
	return svc, err
}
1171855
func (t *transport) getSessionID() []byte {
	if t.sessionID == nil {
		panic("session ID not set yet")
	}
	return t.sessionID
}
469242
func (d *Daemon) GetServiceList() []*models.Service {
	list := []*models.Service{}

	d.loadBalancer.BPFMapMU.RLock()
	defer d.loadBalancer.BPFMapMU.RUnlock()

	for _, v := range d.loadBalancer.SVCMap {
		list = append(list, v.GetModel())
	}
	return list
}
316588
func (f *Facade) GetTenantID(ctx datastore.Context, serviceID string) (string, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetTenantID"))
	logger := plog.WithFields(log.Fields{
		"serviceID": serviceID,
	})
	logger.Debug("Started Facade.GetTenantID")
	defer logger.Debug("Finished Facade.GetTenantID")

	gs := func(id string) (*service.ServiceDetails, error) {
		return f.GetServiceDetails(ctx, id)
	}
	return f.serviceCache.GetTenantID(serviceID, gs)
}
906175
func (s *Server) GetService(serviceID string, svc *service.Service) error {
	sv, err := s.f.GetService(s.context(), serviceID)
	if err != nil {
		return err
	}
	*svc = *sv
	return nil
}
199828
func (actor Actor) GetService(serviceGUID string) (Service, Warnings, error) {
	service, warnings, err := actor.CloudControllerClient.GetService(serviceGUID)
	return Service(service), Warnings(warnings), err
}
818541
func (f *Facade) GetServiceList(ctx datastore.Context, serviceID string) ([]*service.Service, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetServiceList"))
	svcs := make([]*service.Service, 0, 1)

	err := f.walkServices(ctx, serviceID, true, func(childService *service.Service) error {
		// Populate service config + addr info
		if err := f.fillOutService(ctx, childService); err != nil {
			return err
		}

		svcs = append(svcs, childService)
		return nil
	}, "GetServiceList")

	if err != nil {
		return nil, fmt.Errorf("error assembling list of services: %s", err)
	}

	return svcs, nil
}
283156
func (s *GetInstanceInput) SetServiceId(v string) *GetInstanceInput {
	s.ServiceId = &v
	return s
}
1191948
func (client *Client) GetService() (*GetServiceResp, error) {
	bucket := client.Bucket("")

	r, err := bucket.Get("")
	if err != nil {
		return nil, err
	}

	// Parse the XML response.
	var resp GetServiceResp
	if err = xml.Unmarshal(r, &resp); err != nil {
		return nil, err
	}

	return &resp, nil
}
714441
func (r *RegisterMonitor) serviceID() string {
	id := fmt.Sprintf("%s-proxy", r.Service)
	if r.IDSuffix != "" {
		id += "-" + r.IDSuffix
	}

	return id
}