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 for an app.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Addon

Returns a new instance of Addon.



406
407
408
# File 'lib/platform-api/client.rb', line 406

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



414
415
416
# File 'lib/platform-api/client.rb', line 414

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



422
423
424
# File 'lib/platform-api/client.rb', line 422

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



430
431
432
# File 'lib/platform-api/client.rb', line 430

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



437
438
439
# File 'lib/platform-api/client.rb', line 437

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



446
447
448
# File 'lib/platform-api/client.rb', line 446

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