Class: PlatformAPI::LogDrain
- Inherits:
-
Object
- Object
- PlatformAPI::LogDrain
- 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
-
#create(app_id_or_app_name, body = {}) ⇒ Object
Create a new log drain.
-
#delete(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token) ⇒ Object
Delete an existing log drain.
-
#info(app_id_or_app_name, log_drain_id_or_log_drain_url_or_log_drain_token) ⇒ Object
Info for existing log drain.
-
#initialize(client) ⇒ LogDrain
constructor
A new instance of LogDrain.
-
#list(app_id_or_app_name) ⇒ Object
List existing log drains.
-
#list_by_addon(addon_id_or_addon_name) ⇒ Object
List existing log drains for an add-on.
-
#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.
Constructor Details
#initialize(client) ⇒ LogDrain
Returns a new instance of LogDrain.
1879 1880 1881 |
# File 'lib/platform-api/client.rb', line 1879 def initialize(client) @client = client end |
Instance Method Details
#create(app_id_or_app_name, body = {}) ⇒ Object
Create a new log drain.
1887 1888 1889 |
# File 'lib/platform-api/client.rb', line 1887 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.
1904 1905 1906 |
# File 'lib/platform-api/client.rb', line 1904 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.
1912 1913 1914 |
# File 'lib/platform-api/client.rb', line 1912 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.
1926 1927 1928 |
# File 'lib/platform-api/client.rb', line 1926 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.
1919 1920 1921 |
# File 'lib/platform-api/client.rb', line 1919 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.
1896 1897 1898 |
# File 'lib/platform-api/client.rb', line 1896 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 |