Class: PlatformAPI::LogDrain

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

Overview

Log drains provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ LogDrain

Returns a new instance of LogDrain.



2063
2064
2065
# File 'lib/platform-api/client.rb', line 2063

def initialize(client)
  @client = client
end

Instance Method Details

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

Create a new log drain.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



2071
2072
2073
# File 'lib/platform-api/client.rb', line 2071

def create(app_id_or_app_name, body = {})
  @client.log_drain.create(app_id_or_app_name, body)
end

#delete(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token) ⇒ Object

Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • log_drain_id_or_log_drain_url_or_log_drain_token:

    unique identifier of this log drain or url associated with the log drain or token associated with the log drain



2088
2089
2090
# File 'lib/platform-api/client.rb', line 2088

def delete(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token)
  @client.log_drain.delete(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token)
end

#info(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token) ⇒ Object

Info for existing log drain.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • log_drain_id_or_log_drain_url_or_log_drain_token:

    unique identifier of this log drain or url associated with the log drain or token associated with the log drain



2096
2097
2098
# File 'lib/platform-api/client.rb', line 2096

def info(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token)
  @client.log_drain.info(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token)
end

#list(app_id_or_app_name) ⇒ Object

List existing log drains.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



2110
2111
2112
# File 'lib/platform-api/client.rb', line 2110

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

#list_by_addon(addon_id_or_addon_name) ⇒ Object

List existing log drains for an add-on.

Parameters:

  • addon_id_or_addon_name:

    unique identifier of add-on or globally unique name of the add-on



2103
2104
2105
# File 'lib/platform-api/client.rb', line 2103

def list_by_addon(addon_id_or_addon_name)
  @client.log_drain.list_by_addon(addon_id_or_addon_name)
end

#update(addon_id_or_addon_name, log_drain_id_or_log_drain_url_or_log_drain_token, body = {}) ⇒ Object

Update an add-on owned log drain.

Parameters:

  • addon_id_or_addon_name:

    unique identifier of add-on or globally unique name of the add-on

  • log_drain_id_or_log_drain_url_or_log_drain_token:

    unique identifier of this log drain or url associated with the log drain or token associated with the log drain

  • body:

    the object to pass as the request payload



2080
2081
2082
# File 'lib/platform-api/client.rb', line 2080

def update(addon_id_or_addon_name, log_drain_id_or_log_drain_url_or_log_drain_token, body = {})
  @client.log_drain.update(addon_id_or_addon_name, log_drain_id_or_log_drain_url_or_log_drain_token, body)
end