Class: Heroku::Api::Postgres::Client
- Inherits:
-
Object
- Object
- Heroku::Api::Postgres::Client
- Defined in:
- lib/heroku/api/postgres/client.rb
Instance Attribute Summary collapse
-
#api_host ⇒ Object
Returns the value of attribute api_host.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#heroku_client ⇒ Object
Returns the value of attribute heroku_client.
-
#oauth_client_key ⇒ Object
Returns the value of attribute oauth_client_key.
Instance Method Summary collapse
- #backups ⇒ Object
- #credentials ⇒ Object
- #databases ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #perform_get_request(path, options = {}) ⇒ Object
- #perform_post_request(path, params = {}, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
23 24 25 |
# File 'lib/heroku/api/postgres/client.rb', line 23 def initialize @api_host = 'https://postgres-api.heroku.com' end |
Instance Attribute Details
#api_host ⇒ Object
Returns the value of attribute api_host.
21 22 23 |
# File 'lib/heroku/api/postgres/client.rb', line 21 def api_host @api_host end |
#api_key ⇒ Object
Returns the value of attribute api_key.
21 22 23 |
# File 'lib/heroku/api/postgres/client.rb', line 21 def api_key @api_key end |
#heroku_client ⇒ Object
Returns the value of attribute heroku_client.
21 22 23 |
# File 'lib/heroku/api/postgres/client.rb', line 21 def heroku_client @heroku_client end |
#oauth_client_key ⇒ Object
Returns the value of attribute oauth_client_key.
21 22 23 |
# File 'lib/heroku/api/postgres/client.rb', line 21 def oauth_client_key @oauth_client_key end |
Instance Method Details
#backups ⇒ Object
27 28 29 |
# File 'lib/heroku/api/postgres/client.rb', line 27 def backups @backups ||= Backups.new(self) end |
#credentials ⇒ Object
35 36 37 |
# File 'lib/heroku/api/postgres/client.rb', line 35 def credentials @credentials ||= Credentials.new(self) end |
#databases ⇒ Object
31 32 33 |
# File 'lib/heroku/api/postgres/client.rb', line 31 def databases @databases ||= Databases.new(self) end |
#perform_get_request(path, options = {}) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/heroku/api/postgres/client.rb', line 39 def perform_get_request(path, = {}) url = build_uri(path, **) req = Net::HTTP::Get.new(url) add_auth_headers(req) response = start_request(req, url) parse_response(response) end |
#perform_post_request(path, params = {}, options = {}) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/heroku/api/postgres/client.rb', line 47 def perform_post_request(path, params = {}, = {}) url = build_uri(path, **) req = Net::HTTP::Post.new(url) add_auth_headers(req) req.body = params.to_json response = start_request(req, url) parse_response(response) end |