Hi Michael,

You have port 80 listed in configuration, default port is 8080.

Tom

On Mon, Apr 8, 2013 at 5:35 PM, Michael Holt <mah...@nla.com> wrote:

>  I have a small script that I am trying to set up that can read usage
> stats in Ruby Fog. The script is largely pieced together from examples from
> the Basho site and Fog github project. The script is below.****
>
> ** **
>
> The issue I am running into is the following error:****
>
> <Error>****
>
>                 <Code>AccessDenied</Code>****
>
>                 <Message>Access Denied</Message>****
>
>
> <Resource>/riak-cs/usage/OJIPWXM698VYGEMGZLIV/bx/20130401T000000Z/20130430T235959Z.abj.20130407T213209Z.20130408T213209Z</Resource>
> ****
>
>                 <RequestId></RequestId>****
>
> </Error>****
>
> ** **
>
> The list user (users = provisioning.list_users.body) works. The key and
> secret is for the admin user.****
>
> ** **
>
> Why would I get an Access Denied for the admin user?****
>
> ** **
>
> --------------RUBY CODE-------------****
>
> require 'rubygems'****
>
> require 'fog'****
>
> ** **
>
> def show_usage(usage, key)****
>
>         utilization = usage.get_usage(  "/usage/#{key}",****
>
>                         :types          => [:access, :storage]****
>
>                         )****
>
> ** **
>
>         objects = 0****
>
>         bytes = 0****
>
> ** **
>
>         # Retrieve Storage information****
>
>         utilization.body['Storage']['Samples'][0].each do |k,v|****
>
>                 # Sum the # of objects and bytes stored from each user
> bucket for per tenant totals****
>
>                 if v.is_a?(Hash) # To ignore StartTime & EndTime****
>
>                         objects += v['Objects']****
>
>                         bytes   += v['Bytes']****
>
>                 end****
>
>         end****
>
> ** **
>
>         puts "  showUsage objects:       #{objects}"****
>
>         puts "  showUsage bytes:         #{bytes}"****
>
> end****
>
> ** **
>
> configuration = {****
>
>   :riakcs_access_key_id     => "OJIPWXM698VYGEMGZLIV",****
>
>   :riakcs_secret_access_key => "fTbOq8WIBiHrUnHxBgRLDIOyo4yK2Qysrx3vjA==",
> ****
>
>   :host                     => 'localhost',****
>
>   :port                     => 80,****
>
>   :scheme                   => "http"****
>
> }****
>
> ** **
>
> Excon.defaults[:ssl_verify_peer] = false****
>
> ** **
>
> # Requests for User Provision and Usage information****
>
> provisioning = Fog::RiakCS::Provisioning.new(configuration)****
>
> usage        = Fog::RiakCS::Usage.new(configuration)****
>
> ** **
>
>                                    ****
>
> users = provisioning.list_users.body****
>
> ** **
>
> # The following block of code displays all available information for every
> user****
>
> users.each do | user |****
>
> ** **
>
>   utilization =
> usage.get_usage("/usage/#{user['key_id']}/bx/20130401T000000Z/20130430T235959Z",
> :types => [:access, :storage])****
>
> ** **
>
>   puts
> "§=================================================================================§"
> ****
>
>   puts "  name:         #{user['name']}"****
>
>   puts "  display_name: #{user['display_name']}"****
>
>   puts "  email:        #{user['email']}"****
>
>   puts "  id:           #{user['id']}"****
>
>   puts "  key_id:       #{user['key_id']}"****
>
>   puts "  key_secret:   #{user['key_secret']}"****
>
>   puts "  status:       #{user['status']}"****
>
>   show_usage usage, user['key_id']****
>
> end****
>
> puts
> "§=================================================================================§"
> ****
>
> ** **
>
> --****
>
> Michael Holt****
>
> ** **
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
@tsantero <https://twitter.com/#!/tsantero>
Technical Evangelist
Basho Technologies
347-571-3995
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to