Reputation: 11
Maybe someone could help me with an issue while working with Amazon SDK for Ruby.
When trying to retrieve information with commands like "get_bucket_login"
or "get_bucket_location"
what I get as a response is:
<Seahorse::Client::Response:....>
According to the documentation, these requests should return strings. What am I missing? Someone found the same issue?
Upvotes: 1
Views: 742
Reputation: 10566
Seahorse is part of the core of the SDK: https://github.com/aws/aws-sdk-ruby/tree/master/aws-sdk-core/lib/seahorse
The clients of all the services are modeled to use the Base of this.
Now back to your question:
You get an "empty" response as in it does not conform to what the client base is used to.
=== for get_bucket_location ===
the way to get your bucket location is the following:
resp = s3.get_bucket_location(bucket: "mybucketname")
puts resp.data.location_constraint
empty string means US Standard, per documentation here: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html
the code that monkey patches this in is here: https://github.com/aws/aws-sdk-ruby/blob/53712d3e4583c982837fb3a301fa2c67226a05ff/aws-sdk-core/lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb
== for get_bucket_login ==
I don't see this method on the client. If it's logging instead of login, you can see the response structure in the documentation: http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Client.html#get_bucket_logging-instance_method
Upvotes: 1