Class: PlatformAPI::Addon

Inherits:
Object
  • Object
show all
Defined in:
lib/platform-api/client.rb

Overview

Add-ons represent add-ons that have been provisioned and attached to one or more apps.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Addon



770
771
772
# File 'lib/platform-api/client.rb', line 770

def initialize(client)
  @client = client
end

Instance Method Details

#create(app_id_or_app_name, body = {}) ⇒ Object

Create a new add-on.



778
779
780
# File 'lib/platform-api/client.rb', line 778

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.



786
787
788
# File 'lib/platform-api/client.rb', line 786

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(addon_id_or_addon_name) ⇒ Object

Info for an existing add-on.



793
794
795
# File 'lib/platform-api/client.rb', line 793

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

#listObject

List all existing add-ons.



798
799
800
# File 'lib/platform-api/client.rb', line 798

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

#list_by_app(app_id_or_app_name) ⇒ Object

List existing add-ons for an app.



805
806
807
# File 'lib/platform-api/client.rb', line 805

def list_by_app(app_id_or_app_name)
  @client.addon.list_by_app(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.



814
815
816
# File 'lib/platform-api/client.rb', line 814

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