func (c *Client) AddDockerResource(id *charm.URL, resourceName string, imageName, digest string) (revision int, err error) {
	path := fmt.Sprintf("/%s/resource/%s", id.Path(), resourceName)
	var result params.ResourceUploadResponse
	if err := c.DoWithResponse("POST", path, params.DockerResourceUploadRequest{
		Digest:    digest,
		ImageName: imageName,
	}, &result); err != nil {
		return 0, errgo.Mask(err)
	}
	return result.Revision, nil
}
// AddDockerResource adds a reference to a docker image that is available in a docker
// registry as a resource to the charm with the given id. If imageName is non-empty,
// it names the image in some non-charmstore-associated registry; otherwise
// the image should have been uploaded to the charmstore-associated registry
// (see DockerResourceUploadInfo for details on how to do that).
// The digest should hold the digest of the image (in "sha256:hex" format).
//
// AddDockerResource returns the revision of the newly added resource.
AddDockerResource adds a reference to a docker image that is available in a docker
registry as a resource to the charm with the given id. If imageName is non-empty,
it names the image in some non-charmstore-associated registry; otherwise
the image should have been uploaded to the charmstore-associated registry
.
The digest should hold the digest of the image (in "sha256:hex" format).

AddDockerResource returns the revision of the newly added resource.
// AddDockerResource adds a reference to a docker image that is available in a docker // registry as a resource to the charm with the given id . If imageName is non - empty // it names the image in some non - charmstore - associated registry ; otherwise // the image should have been uploaded to the charmstore - associated registry // ( see DockerResourceUploadInfo for details on how to do that ) . // The digest should hold the digest of the image ( in " sha256 : hex " format ) . // // AddDockerResource returns the revision of the newly added resource .
func (c *Client) AddDockerResource(id *charm.URL, resourceName string, imageName, digest string) (revision int, err error) {
	path := fmt.Sprintf("/%s/resource/%s", id.Path(), resourceName)
	var result params.ResourceUploadResponse
	if err := c.DoWithResponse("POST", path, params.DockerResourceUploadRequest{
		Digest:    digest,
		ImageName: imageName,
	}, &result); err != nil {
		return 0, errgo.Mask(err)
	}
	return result.Revision, nil
}
func ( c * Client ) AddDockerResource ( id * charm . URL , resourceName string , imageName , digest string ) ( revision int , err error ) { path := fmt . Sprintf ( " " , id . Path ( ) , resourceName ) var result params . ResourceUploadResponse if err := c . DoWithResponse ( " " , path , params . DockerResourceUploadRequest { Digest : digest , ImageName : imageName , } , & result ) ; err != nil { return 0 , errgo . Mask ( err ) } return result . Revision , nil }
AddDockerResource adds a reference to a docker image that is available in a docker
registry as a resource to the charm with the given id.
AddDockerResource adds a reference to a docker image that is available in a docker registry as a resource to the charm with the given id .