On Thursday, January 2, 2014 9:11:39 PM UTC, Jedrin wrote:
> I've used the various amazon cloud stuff a bit but don't totally understand
> it ..
> I have a test program below that prints out files and directories I have on
> the cloud which has worked fine for me.
>
>
> When I go to the amazon console, I have to log in using an email address,
> then it shows me my buckets on the cloud.
>
>
An amazon account has several sets of credentials. One is a username/password
that allows you to login to the console, and another is an api key/secret key
that allows you to make api calls (this is what fog uses). If you log into the
amazon web console then it can show you your api key (from memory the account
menu in the top right has a link to something like security credentials)
It is also possible to create users that can only access the console or only
make api requests (and if you do embed credentials in a script best practice is
to create a user with restricted access). You're best off asking the person
that sent you the credentials
Fred
> A guy I started working for at a company emailed me my user name, ID, and
> secret access key for their cloud stuff .. Using my program I can see the
> stuff on the cloud but how can I log into it from the amazon web based
> console ? Since he did not send me an email or password but only a user name,
> ID and secret access key .. I am not sure how I can log in through amazon to
> look at it ?
>
>
>
>
>
> require 'rubygems'
> require 'fog'
>
>
> AWS_ACCESS_KEY_ID = "****************"
>
> AWS_SECRET_ACCESS_KEY = "******"
>
>
>
>
>
>
> # create a connection
> @con = Fog::Storage.new({
> :provider => 'AWS',
> :aws_access_key_id => AWS_ACCESS_KEY_ID,
> :aws_secret_access_key => AWS_SECRET_ACCESS_KEY
> })
>
>
> cnt = 0
> @con.directories.each do|dir|
> puts '-------------'
> puts dir.inspect
> puts "\n\n"
> puts dir.files.inspect
> cnt += 1
> sleep 2
> puts cnt.to_s
> exit if cnt > 25
> end
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/182f6bc6-4e66-4d4a-ae82-f8ddca6b3d9c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.