lxd/db/containers.go
func (c *Cluster) ContainerGetBackups(project, name string) ([]string, error) {
	var result []string

	q := `SELECT containers_backups.name FROM containers_backups
JOIN containers ON containers_backups.container_id=containers.id
JOIN projects ON projects.id=containers.project_id
WHERE projects.name=? AND containers.name=?`
	inargs := []interface{}{project, name}
	outfmt := []interface{}{name}
	dbResults, err := queryScan(c.db, q, inargs, outfmt)
	if err != nil {
		return nil, err
	}

	for _, r := range dbResults {
		result = append(result, r[0].(string))
	}

	return result, nil
}
func (c *Cluster) ContainerGetBackups(project, name string) ([]string, error) {
	var result []string

	q := `SELECT containers_backups.name FROM containers_backups
JOIN containers ON containers_backups.container_id=containers.id
JOIN projects ON projects.id=containers.project_id
WHERE projects.name=? AND containers.name=?`
	inargs := []interface{}{project, name}
	outfmt := []interface{}{name}
	dbResults, err := queryScan(c.db, q, inargs, outfmt)
	if err != nil {
		return nil, err
	}

	for _, r := range dbResults {
		result = append(result, r[0].(string))
	}

	return result, nil
}
func ( c * Cluster ) ContainerGetBackups ( project , name string ) ( [ ] string , error ) { var result [ ] string q := `SELECT containers_backups.name FROM containers_backups
JOIN containers ON containers_backups.container_id=containers.id
JOIN projects ON projects.id=containers.project_id
WHERE projects.name=? AND containers.name=?` inargs := [ ] interface { } { project , name } outfmt := [ ] interface { } { name } dbResults , err := queryScan ( c . db , q , inargs , outfmt ) if err != nil { return nil , err } for _ , r := range dbResults { result = append ( result , r [ 0 ] . ( string ) ) } return result , nil }
// ContainerGetBackups returns the names of all backups of the container
// with the given name.
ContainerGetBackups returns the names of all backups of the container with the given name .