client/lxd_images.go
func (r *ProtocolLXD) GetPrivateImage(fingerprint string, secret string) (*api.Image, string, error) {
	image := api.Image{}

	// Build the API path
	path := fmt.Sprintf("/images/%s", url.QueryEscape(fingerprint))
	var err error
	path, err = r.setQueryAttributes(path)
	if err != nil {
		return nil, "", err
	}

	if secret != "" {
		path, err = setQueryParam(path, "secret", secret)
		if err != nil {
			return nil, "", err
		}
	}

	// Fetch the raw value
	etag, err := r.queryStruct("GET", path, nil, "", &image)
	if err != nil {
		return nil, "", err
	}

	return &image, etag, nil
}
func (r *ProtocolLXD) GetPrivateImage(fingerprint string, secret string) (*api.Image, string, error) {
	image := api.Image{}

	// Build the API path
	path := fmt.Sprintf("/images/%s", url.QueryEscape(fingerprint))
	var err error
	path, err = r.setQueryAttributes(path)
	if err != nil {
		return nil, "", err
	}

	if secret != "" {
		path, err = setQueryParam(path, "secret", secret)
		if err != nil {
			return nil, "", err
		}
	}

	// Fetch the raw value
	etag, err := r.queryStruct("GET", path, nil, "", &image)
	if err != nil {
		return nil, "", err
	}

	return &image, etag, nil
}
func ( r * ProtocolLXD ) GetPrivateImage ( fingerprint string , secret string ) ( * api . Image , string , error ) { image := api . Image { } // Build the API path path := fmt . Sprintf ( " " , url . QueryEscape ( fingerprint ) ) var err error path , err = r . setQueryAttributes ( path ) if err != nil { return nil , " " , err } if secret != " " { path , err = setQueryParam ( path , " " , secret ) if err != nil { return nil , " " , err } } // Fetch the raw value etag , err := r . queryStruct ( " " , path , nil , " " , & image ) if err != nil { return nil , " " , err } return & image , etag , nil }
// GetPrivateImage is similar to GetImage but allows passing a secret download token
GetPrivateImage is similar to GetImage but allows passing a secret download token