// GetNamespaceByID returns the Namespace specified by Id.
199277
func GetNamespaceByID(namespaceId string) (*HostComputeNamespace, error) {
	return getNamespace(guid.FromString(namespaceId), defaultQueryJson())
}
245425
func GetLobbyByID(id uint) (*Lobby, error) {
	lob := &Lobby{}
	err := db.DB.First(lob, id).Error

	if err == gorm.ErrRecordNotFound {
		return nil, ErrLobbyNotFound
	}

	return lob, err
}
1121919
func getByID(c context.Context, id string) (*instances.Instance, error) {
	if vmtoken.Has(c) {
		return nil, status.Errorf(codes.PermissionDenied, "unauthorized user")
	}
	vm := &model.VM{
		ID: id,
	}
	switch err := datastore.Get(c, vm); {
	case err == datastore.ErrNoSuchEntity:
		return nil, status.Errorf(codes.NotFound, "no VM found with ID %q", id)
	case err != nil:
		return nil, errors.Annotate(err, "failed to fetch VM").Err()
	default:
		return toInstance(vm), nil
	}
}
807280
func indexNamespaceByRequester(obj interface{}) ([]string, error) {
	requester := obj.(*corev1.Namespace).Annotations[projectapi.ProjectRequester]
	return []string{requester}, nil
}
31016
func (p *podTolerationsPlugin) getNamespace(nsName string) (*corev1.Namespace, error) {
	namespace, err := p.namespaceLister.Get(nsName)
	if errors.IsNotFound(err) {
		// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
		namespace, err = p.client.CoreV1().Namespaces().Get(nsName, metav1.GetOptions{})
		if err != nil {
			if errors.IsNotFound(err) {
				return nil, err
			}
			return nil, errors.NewInternalError(err)
		}
	} else if err != nil {
		return nil, errors.NewInternalError(err)
	}

	return namespace, nil
}
1274898
func (d *Daemon) GetIDByName(name string) (string, error) {
	return d.inspectFieldWithError(name, "Id")
}
966865
func (s *CreateServiceInput) SetNamespaceId(v string) *CreateServiceInput {
	s.NamespaceId = &v
	return s
}
944578
func (actor Actor) GetApplicationByNameAndSpace(appName string, spaceGUID string) (Application, Warnings, error) {
	apps, warnings, err := actor.CloudControllerClient.GetApplications(
		ccv3.Query{Key: ccv3.NameFilter, Values: []string{appName}},
		ccv3.Query{Key: ccv3.SpaceGUIDFilter, Values: []string{spaceGUID}},
	)
	if err != nil {
		return Application{}, Warnings(warnings), err
	}

	if len(apps) == 0 {
		return Application{}, Warnings(warnings), actionerror.ApplicationNotFoundError{Name: appName}
	}

	return actor.convertCCToActorApplication(apps[0]), Warnings(warnings), nil
}
498252
func (s *LocalLoginSources) GetLoginSourceByID(id int64) (*LoginSource, error) {
	s.RLock()
	defer s.RUnlock()

	for i := range s.sources {
		if s.sources[i].ID == id {
			source := &LoginSource{}
			*source = *s.sources[i]
			return source, nil
		}
	}

	return nil, errors.LoginSourceNotExist{id}
}
301584
func (c *namespaces) Get(name string) (result *api.Namespace, err error) {
	result = &api.Namespace{}
	err = c.client.Get().
		Resource("namespaces").
		Name(name).
		Do().
		Into(result)
	return
}
828434
func (db *DynamoDB) GetByID(id string) (u *models.User, ok bool) {
	res, err := db.DB.GetItem(&dynamodb.GetItemInput{
		ConsistentRead: aws.Bool(true),
		TableName:      aws.String("users"),
		Key: map[string]*dynamodb.AttributeValue{
			"ID": {
				S: aws.String(id),
			},
		},
	})
	if err != nil {
		log.Printf("dynamodb: error: %v", err)
		return nil, false
	}
	if len(res.Item) == 0 {
		return nil, false
	}

	var user models.User
	if err := dynamodbattribute.UnmarshalMap(res.Item, &user); err != nil {
		log.Printf("dynamodb: getbyid error: %v", err)
		return nil, false
	}

	return &user, true
}
764591
func (r *ChainResource) GetByIDs(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ids []string) {
	resp := ChainResponse{}
	resp.Init(ctx)

	for _, id := range ids {
		chain := bees.GetChain(id)
		if chain == nil {
			r.NotFound(request, response)
			return
		}

		resp.AddChain(*chain)
	}

	resp.Send(response)
}
243187
func (k *kubernetesClient) getNamespaceByName(name string) (*core.Namespace, error) {
	ns, err := k.client().CoreV1().Namespaces().Get(name, v1.GetOptions{IncludeUninitialized: true})
	if k8serrors.IsNotFound(err) {
		return nil, errors.NotFoundf("namespace %q", name)
	}
	if err != nil {
		return nil, errors.Annotatef(err, "getting namespace %q", name)
	}
	return ns, nil
}
169700
func (t *TeamsClient) GetByName(ctx context.Context, orgID *identity.ID, name string) ([]envelope.Team, error) {
	return t.List(ctx, orgID, name, primitive.AnyTeamType)
}
611736
func (j *Job) NamespacedID() *NamespacedID {
	return &NamespacedID{
		ID:        j.ID,
		Namespace: j.Namespace,
	}
}
505313
func (c *connection) ImageByID(namespace, name, imageID string) (*Image, error) {
	if len(namespace) == 0 && reference.IsRegistryDockerHub(c.url.Host) {
		namespace = "library"
	}
	if len(name) == 0 {
		return nil, fmt.Errorf("image name must be specified")
	}

	repo, err := c.getCachedRepository(fmt.Sprintf("%s/%s", namespace, name))
	if err != nil {
		return nil, err
	}

	image, _, err := repo.getImage(c, imageID, "")
	return image, err
}
400058
func (u HubUser) GetOrgByID(orgID string) (model.Org, error) {
	for _, org := range u.Orgs {
		if org.ID == orgID {
			return org, nil
		}
	}
	return model.Org{}, fmt.Errorf("org %s not found", orgID)
}