Class: Etna::Clients::Polyphemus
- Inherits:
-
Object
- Object
- Etna::Clients::Polyphemus
- Defined in:
- lib/etna/clients/polyphemus/client.rb,
lib/etna/clients/polyphemus/models.rb,
lib/etna/clients/polyphemus/workflows/set_configuration_workflow.rb
Defined Under Namespace
Classes: ConfigurationRequest, ConfigurationResponse, EnvironmentConfiguration, SetConfigurationWorkflow
Instance Method Summary collapse
- #configuration(configuration_request = ConfigurationRequest.new) ⇒ Object
-
#initialize(host:, token:, ignore_ssl: false, persistent: true) ⇒ Polyphemus
constructor
A new instance of Polyphemus.
Constructor Details
#initialize(host:, token:, ignore_ssl: false, persistent: true) ⇒ Polyphemus
Returns a new instance of Polyphemus.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/etna/clients/polyphemus/client.rb', line 10 def initialize(host:, token:, ignore_ssl: false, persistent: true) raise 'Polyphemus client configuration is missing host.' unless host raise 'Polyphemus client configuration is missing token.' unless token @etna_client = ::Etna::Client.new( host, token, routes_available: false, persistent: persistent, ignore_ssl: ignore_ssl) end |
Instance Method Details
#configuration(configuration_request = ConfigurationRequest.new) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/etna/clients/polyphemus/client.rb', line 21 def configuration(configuration_request = ConfigurationRequest.new) json = nil @etna_client.get( "/configuration", configuration_request) do |res| json = JSON.parse(res.body, symbolize_names: true) end ConfigurationResponse.new(json) end |