Class: SnapDeploy::Provider::Heroku::API::Addon

Inherits:
Object
  • Object
show all
Defined in:
lib/snap_deploy/provider/heroku/api.rb

Overview

Add-ons represent add-ons that have been provisioned for an app.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Addon

Returns a new instance of Addon.



469
470
471
# File 'lib/snap_deploy/provider/heroku/api.rb', line 469

def initialize(client)
  @client = client
end

Instance Method Details

#create(app_id_or_app_name, body) ⇒ Object

Create a new add-on.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



477
478
479
# File 'lib/snap_deploy/provider/heroku/api.rb', line 477

def create(app_id_or_app_name, body)
  @client.addon.create(app_id_or_app_name, body)
end

#delete(app_id_or_app_name, addon_id_or_addon_name) ⇒ Object

Delete an existing add-on.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • addon_id_or_addon_name:

    unique identifier of add-on or name of the add-on unique within its app



485
486
487
# File 'lib/snap_deploy/provider/heroku/api.rb', line 485

def delete(app_id_or_app_name, addon_id_or_addon_name)
  @client.addon.delete(app_id_or_app_name, addon_id_or_addon_name)
end

#info(app_id_or_app_name, addon_id_or_addon_name) ⇒ Object

Info for an existing add-on.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • addon_id_or_addon_name:

    unique identifier of add-on or name of the add-on unique within its app



493
494
495
# File 'lib/snap_deploy/provider/heroku/api.rb', line 493

def info(app_id_or_app_name, addon_id_or_addon_name)
  @client.addon.info(app_id_or_app_name, addon_id_or_addon_name)
end

#list(app_id_or_app_name) ⇒ Object

List existing add-ons.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



500
501
502
# File 'lib/snap_deploy/provider/heroku/api.rb', line 500

def list(app_id_or_app_name)
  @client.addon.list(app_id_or_app_name)
end

#update(app_id_or_app_name, addon_id_or_addon_name, body) ⇒ Object

Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • addon_id_or_addon_name:

    unique identifier of add-on or name of the add-on unique within its app

  • body:

    the object to pass as the request payload



509
510
511
# File 'lib/snap_deploy/provider/heroku/api.rb', line 509

def update(app_id_or_app_name, addon_id_or_addon_name, body)
  @client.addon.update(app_id_or_app_name, addon_id_or_addon_name, body)
end