lxd/db/projects.mapper.go
func (c *ClusterTx) ProjectGet(name string) (*api.Project, error) {
	filter := ProjectFilter{}
	filter.Name = name

	objects, err := c.ProjectList(filter)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to fetch Project")
	}

	switch len(objects) {
	case 0:
		return nil, ErrNoSuchObject
	case 1:
		return &objects[0], nil
	default:
		return nil, fmt.Errorf("More than one project matches")
	}
}
func (c *ClusterTx) ProjectGet(name string) (*api.Project, error) {
	filter := ProjectFilter{}
	filter.Name = name

	objects, err := c.ProjectList(filter)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to fetch Project")
	}

	switch len(objects) {
	case 0:
		return nil, ErrNoSuchObject
	case 1:
		return &objects[0], nil
	default:
		return nil, fmt.Errorf("More than one project matches")
	}
}
// ProjectGet returns the project with the given key.