Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best method not found when passing credentials to a function #22

Closed
ahjones opened this issue Oct 2, 2013 · 1 comment
Closed

Best method not found when passing credentials to a function #22

ahjones opened this issue Oct 2, 2013 · 1 comment

Comments

@ahjones
Copy link
Contributor

ahjones commented Oct 2, 2013

Using Amazonica 0.1.21.

I'm not sure if this is an issue, or I'm just using the library awkwardly.

If I put my Amazon credentials into environment variable the following works fine:

(use 'amazonica.aws.s3)
(get-object-metadata {:bucket-name "ahjones-test" :key "foo"})

However, if I want to pass in credentials as the first parameter I get a message that says that the best method can't be found.

(def cred {:access-key "key" :access-secret "secret"})
(get-object-metadata cred {:bucket-name "ahjones-test" :key "foo"})

The exception:

IllegalArgumentException Could not determine best method to invoke for get-object-metadata using arguments ({:secret-key "secret", :access-key "key"} {:key "foo", :bucket-name "ahjones-test"})
    amazonica.core/intern-function/fn--1458 (core.clj:705)
    user/eval1649 (form-init5154478138353900686.clj:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core/eval (core.clj:2852)
    clojure.main/repl/read-eval-print--6588/fn--6591 (main.clj:259)
    clojure.main/repl/read-eval-print--6588 (main.clj:259)
    clojure.main/repl/fn--6597 (main.clj:277)
    clojure.main/repl (main.clj:277)
    clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--591 (interruptible_eval.clj:56)
    clojure.core/apply (core.clj:617)
    clojure.core/with-bindings* (core.clj:1788)

However this is OK

(get-object-metadata cred :bucket-name "ahjones-test" :key "foo")
mcohen01 added a commit that referenced this issue Oct 2, 2013
@mcohen01
Copy link
Owner

mcohen01 commented Oct 2, 2013

you should be able to pass key-value pairs or an explicit map, both with and without and explicit credentials map. the exception to this are some functions in the s3 ns whose java equivalents are "non-standard," in that their arguments are not a simple AWS *Request bean. A few of those don't resolve properly.

@mcohen01 mcohen01 closed this as completed Oct 2, 2013
mcohen01 added a commit that referenced this issue Oct 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants