Sha256: c62a1045c62b32c28be5af1f065a695b25122869be9499b4876b21541a1bb9ea

Contents?: true

Size: 880 Bytes

Versions: 45

Compression:

Stored size: 880 Bytes

Contents

class Shelly::Client
  def application_logs(cloud, options = {})
    get("/apps/#{cloud}/application_logs#{query(options)}")
  end

  def application_logs_tail(cloud)
    url = get("/apps/#{cloud}/application_logs/tail")["url"]
    options = {
      :url            => url,
      :method         => :get,
      :timeout        => 60 * 60 * 24,
      :block_response => Proc.new { |r| r.read_body { |c| yield(c) } }
    }.merge(http_basic_auth_options)
    RestClient::Request.execute(options)
  end

  def download_application_logs_attributes(code_name, options)
    attributes = get("/apps/#{code_name}/application_logs/download#{query(options)}")
    headers = RestClient::Request.execute({
      :method => :get,
      :url => "#{attributes["url"]}/headers"
    }.merge(http_basic_auth_options)).headers

    attributes.merge("size" => headers[:content_lenght].to_i)
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
shelly-0.4.30 lib/shelly/client/application_logs.rb
shelly-0.4.29 lib/shelly/client/application_logs.rb
shelly-0.4.29.pre lib/shelly/client/application_logs.rb
shelly-0.4.28 lib/shelly/client/application_logs.rb
shelly-0.4.28.pre2 lib/shelly/client/application_logs.rb
shelly-0.4.28.pre lib/shelly/client/application_logs.rb
shelly-0.4.27 lib/shelly/client/application_logs.rb
shelly-0.4.26 lib/shelly/client/application_logs.rb
shelly-0.4.26.pre lib/shelly/client/application_logs.rb
shelly-0.4.25 lib/shelly/client/application_logs.rb
shelly-0.4.24 lib/shelly/client/application_logs.rb
shelly-0.4.23 lib/shelly/client/application_logs.rb
shelly-0.4.23.pre lib/shelly/client/application_logs.rb
shelly-0.4.22 lib/shelly/client/application_logs.rb
shelly-0.4.21 lib/shelly/client/application_logs.rb
shelly-0.4.19 lib/shelly/client/application_logs.rb
shelly-0.4.18 lib/shelly/client/application_logs.rb
shelly-0.4.17 lib/shelly/client/application_logs.rb
shelly-0.4.16 lib/shelly/client/application_logs.rb
shelly-0.4.15 lib/shelly/client/application_logs.rb