16
16
"github.com/juju/juju/resource/cmd"
19
// DeployResourcesFunc is the function type of DeployResources.
20
type DeployResourcesFunc func(
22
chID charmstore.CharmID,
23
csMac *macaroon.Macaroon,
24
filesAndRevisions map[string]string,
25
resources map[string]charmresource.Meta,
26
conn base.APICallCloser,
27
) (ids map[string]string, err error)
19
29
// DeployResources uploads the bytes for the given files to the server and
20
30
// creates pending resource metadata for the all resource mentioned in the
21
31
// metadata. It returns a map of resource name to pending resource IDs.
22
func DeployResources(applicationID string, chID charmstore.CharmID, csMac *macaroon.Macaroon, filesAndRevisions map[string]string, resources map[string]charmresource.Meta, conn base.APICallCloser) (ids map[string]string, err error) {
34
chID charmstore.CharmID,
35
csMac *macaroon.Macaroon,
36
filesAndRevisions map[string]string,
37
resources map[string]charmresource.Meta,
38
conn base.APICallCloser,
39
) (ids map[string]string, err error) {
41
if len(filesAndRevisions)+len(resources) == 0 {
23
46
client, err := NewAPIClient(conn)
25
48
return nil, errors.Trace(err)