lxd/db/images.go
func (c *Cluster) ImageGetPoolNamesFromIDs(poolIDs []int64) ([]string, error) {
	var poolName string
	query := "SELECT name FROM storage_pools WHERE id=?"

	poolNames := []string{}
	for _, poolID := range poolIDs {
		inargs := []interface{}{poolID}
		outargs := []interface{}{poolName}

		result, err := queryScan(c.db, query, inargs, outargs)
		if err != nil {
			return []string{}, err
		}

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

	return poolNames, nil
}
func (c *Cluster) ImageGetPoolNamesFromIDs(poolIDs []int64) ([]string, error) {
	var poolName string
	query := "SELECT name FROM storage_pools WHERE id=?"

	poolNames := []string{}
	for _, poolID := range poolIDs {
		inargs := []interface{}{poolID}
		outargs := []interface{}{poolName}

		result, err := queryScan(c.db, query, inargs, outargs)
		if err != nil {
			return []string{}, err
		}

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

	return poolNames, nil
}
func ( c * Cluster ) ImageGetPoolNamesFromIDs ( poolIDs [ ] int64 ) ( [ ] string , error ) { var poolName string query := " " poolNames := [ ] string { } for _ , poolID := range poolIDs { inargs := [ ] interface { } { poolID } outargs := [ ] interface { } { poolName } result , err := queryScan ( c . db , query , inargs , outargs ) if err != nil { return [ ] string { } , err } for _ , r := range result { poolNames = append ( poolNames , r [ 0 ] . ( string ) ) } } return poolNames , nil }
// ImageGetPoolNamesFromIDs get the names of all storage pools on which a given image exists.
ImageGetPoolNamesFromIDs get the names of all storage pools on which a given image exists .