Class: Hoverfly

Inherits:
Object
  • Object
show all
Extended by:
HoverflyAPI
Defined in:
lib/client.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from HoverflyAPI

clear_cached_data, get_cached_data, get_config_info, get_current_destination, get_current_middleware, get_current_mode, get_current_simulation_schema, get_current_simulations, get_logs, get_upstream_proxy, get_usage, get_version, update_destination, update_middleware, update_mode, update_simulations

Class Attribute Details

.admin_portObject (readonly)

Returns the value of attribute admin_port.



5
6
7
# File 'lib/client.rb', line 5

def admin_port
  @admin_port
end

.proxy_portObject (readonly)

Returns the value of attribute proxy_port.



5
6
7
# File 'lib/client.rb', line 5

def proxy_port
  @proxy_port
end

Class Method Details

.import(file_list, meta = {}) ⇒ Object



19
20
21
# File 'lib/client.rb', line 19

def import(file_list, meta = {})
  update_simulations(to_simulation(file_list, meta))
end

.middleware(middleware_location) ⇒ Object



15
16
17
# File 'lib/client.rb', line 15

def middleware(middleware_location)
  update_middleware({ binary: '', script: '', remote: '' }.merge(middleware_location))
end

.set_ports(admin:, proxy:) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/client.rb', line 7

def set_ports(admin:, proxy:)
  @admin_port = admin
  @proxy_port = proxy
  HoverflyAPI.default_options.update(verify: false)
  HoverflyAPI.format :json
  HoverflyAPI.base_uri "http://localhost:#{@admin_port}"
end