Class: Hoverfly
Class Attribute Summary collapse
Class Method Summary
collapse
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_destinitation, update_middleware, update_mode, update_simulations
Class Attribute Details
.target ⇒ Object
Returns the value of attribute target.
5
6
7
|
# File 'lib/client.rb', line 5
def target
@target
end
|
Class Method Details
.import(file_list) ⇒ Object
29
30
31
|
# File 'lib/client.rb', line 29
def import(file_list)
update_simulations(to_simulation(file_list))
end
|
.middleware(middleware_location) ⇒ Object
25
26
27
|
# File 'lib/client.rb', line 25
def middleware(middleware_location)
update_middleware({binary: '', script: '', remote: ''}.merge(middleware_location))
end
|
.start(target, ports = {}) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/client.rb', line 7
def start(target, ports = {})
@target = target
admin_port = ports.fetch(:admin, 8888)
proxy_port = ports.fetch(:proxy, 8500)
puts "Starting target #{target} with admin #{admin_port} and proxy #{proxy_port}"
system "hoverctl targets create #{@target}"
system "hoverctl start --admin-port #{admin_port} --proxy-port #{proxy_port} -t #{@target}"
HoverflyAPI.default_options.update(verify: false)
HoverflyAPI.format :json
HoverflyAPI.base_uri "http://localhost:#{admin_port}"
end
|
.stop ⇒ Object
19
20
21
22
23
|
# File 'lib/client.rb', line 19
def stop
puts "Stopping target #{Hoverfly.target} with base URL #{HoverflyAPI.base_uri}"
system "hoverctl stop -t #{@target}"
system "hoverctl targets delete #{@target} -f"
end
|