Sha256: fa03db26a975893698de0e0ab02153c40d5817fac7db5804d0f863ece190c4de

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

module Heroku
  class API

    # DELETE /apps/:app/addons/:addon
    def delete_addon(app, addon)
      request(
        :expects  => 200,
        :method   => :delete,
        :path     => "/apps/#{escape app}/addons/#{addon}"
      )
    end

    # GET /addons
    # GET /apps/:app/addons
    def get_addons(app=nil)
      path = if app
        "/apps/#{escape app}/addons"
      else
        "/addons"
      end
      request(
        :expects  => 200,
        :method   => :get,
        :path     => path
      )
    end

    # POST /apps/:app/addons/:addon
    def post_addon(app, addon, config = {})
      request(
        :expects  => 200,
        :method   => :post,
        :path     => "/apps/#{escape app}/addons/#{addon}",
        :query    => addon_params(config)
      )
    end

    # PUT /apps/:app/addons/:addon
    def put_addon(app, addon, config = {})
      request(
        :expects  => 200,
        :method   => :put,
        :path     => "/apps/#{escape app}/addons/#{addon}",
        :query    => addon_params(config)
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pogoapp-api-0.3.8 lib/heroku/api/addons.rb