lxd/db/containers.mapper.go
func (c *ClusterTx) ContainerGet(project string, name string) (*Container, error) {
	filter := ContainerFilter{}
	filter.Project = project
	filter.Name = name
	filter.Type = -1

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

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

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

	switch len(objects) {
	case 0:
		return nil, ErrNoSuchObject
	case 1:
		return &objects[0], nil
	default:
		return nil, fmt.Errorf("More than one container matches")
	}
}
func ( c * ClusterTx ) ContainerGet ( project string , name string ) ( * Container , error ) { filter := ContainerFilter { } filter . Project = project filter . Name = name filter . Type = - 1 objects , err := c . ContainerList ( filter ) if err != nil { return nil , errors . Wrap ( err , " " ) } switch len ( objects ) { case 0 : return nil , ErrNoSuchObject case 1 : return & objects [ 0 ] , nil default : return nil , fmt . Errorf ( " " ) } }
// ContainerGet returns the container with the given key.
ContainerGet returns the container with the given key .