// ServiceID retrieves a service with ID from store.
439730
func (s *Service) ServiceID(w http.ResponseWriter, r *http.Request) {
	id, err := paramID("kid", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	srcID, err := paramID("id", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	ctx := r.Context()
	srv, err := s.Store.Servers(ctx).Get(ctx, id)
	if err != nil || srv.SrcID != srcID || srv.Type == "" {
		notFound(w, id, s.Logger)
		return
	}

	res := newService(srv)
	encodeJSON(w, http.StatusOK, res, s.Logger)
}
32063
func (s *XPackWatcherExecuteWatchService) Id(id string) *XPackWatcherExecuteWatchService {
	s.id = id
	return s
}
534428
func (s *Simulation) Service(name string, id enode.ID) node.Service {
	simNode, ok := s.Net.GetNode(id).Node.(*adapters.SimNode)
	if !ok {
		return nil
	}
	services := simNode.ServiceMap()
	if len(services) == 0 {
		return nil
	}
	return services[name]
}
1259237
func (s *PutScriptService) Id(id string) *PutScriptService {
	s.id = id
	return s
}
59360
func (s *DeleteScriptService) Id(id string) *DeleteScriptService {
	s.id = id
	return s
}
1371867
func (f *Facade) getService(ctx datastore.Context, id string) (service.Service, error) {
	glog.V(3).Infof("Facade.getService: id=%s", id)
	store := f.serviceStore
	svc, err := store.Get(ctx, id)
	if err != nil || svc == nil {
		return service.Service{}, err
	}
	return *svc, err
}
61632
func (s *DeleteService) Id(id string) *DeleteService {
	s.id = id
	return s
}
776191
func (o *PutServiceIDParams) WithID(id int64) *PutServiceIDParams {
	o.SetID(id)
	return o
}
558641
func ParseIngressID(svc *types.Ingress) ServiceID {
	id := ServiceID{
		Namespace: svc.ObjectMeta.Namespace,
	}

	if svc.Spec.Backend != nil {
		id.Name = svc.Spec.Backend.ServiceName
	}

	return id
}
68932
func ServiceName(a *API) string {
	if oldName, ok := oldServiceNames[a.PackageName()]; ok {
		return oldName
	}

	return ServiceID(a)
}
1293805
func (f *Facade) GetServiceDetailsByTenantID(ctx datastore.Context, tenantID string) ([]service.ServiceDetails, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetServiceDetailsByTenantID"))
	svcs, err := f.serviceStore.Query(ctx, service.Query{})
	if err != nil {
		return nil, err
	}
	return f.filterDetailsByTenantID(ctx, tenantID, svcs)
}
787376
func (s *ListProvisioningArtifactsForServiceActionInput) SetServiceActionId(v string) *ListProvisioningArtifactsForServiceActionInput {
	s.ServiceActionId = &v
	return s
}
1077721
func (s *IGDService) ID() string {
	return s.UUID + "/" + s.Device.FriendlyName + "/" + s.ServiceID + "/" + s.URN + "/" + s.URL
}
486580
func (s *GetTemplateService) Id(id string) *GetTemplateService {
	s.id = id
	return s
}
1022786
func RequestID(c *web.C, h http.Handler) http.Handler {
	return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
		id := r.Header.Get(RequestIDHeader)
		if id == "" {
			id = fmt.Sprintf("%s-%d", reqPrefix, atomic.AddInt64(&reqID, 1))
		}
		c.Env[middleware.RequestIDKey] = id

		h.ServeHTTP(rw, r)
	})
}
720157
func (s *GetScriptService) Id(id string) *GetScriptService {
	s.id = id
	return s
}
107310
func (s *Server) GetTenantID(serviceID string, tenantId *string) error {
	result, err := s.f.GetTenantID(s.context(), serviceID)
	if err != nil {
		return err
	}
	*tenantId = result
	return nil
}