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.



395
396
397
# File 'lib/platform-api/client.rb', line 395

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



403
404
405
# File 'lib/platform-api/client.rb', line 403

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



411
412
413
# File 'lib/platform-api/client.rb', line 411

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



419
420
421
# File 'lib/platform-api/client.rb', line 419

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



426
427
428
# File 'lib/platform-api/client.rb', line 426

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



435
436
437
# File 'lib/platform-api/client.rb', line 435

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