Class: Scenarios
- Inherits:
-
Base
- Object
- Base
- Scenarios
- Defined in:
- lib/zapix/proxies/scenarios.rb
Instance Method Summary collapse
- #create(options) ⇒ Object
- #delete(options) ⇒ Object
- #exists?(options) ⇒ Boolean
- #get_id(options) ⇒ Object
Instance Method Details
#create(options) ⇒ Object
4 5 6 |
# File 'lib/zapix/proxies/scenarios.rb', line 4 def create() client.webcheck_create() unless exists?() end |
#delete(options) ⇒ Object
14 15 16 |
# File 'lib/zapix/proxies/scenarios.rb', line 14 def delete() client.webcheck_delete() end |
#exists?(options) ⇒ Boolean
18 19 20 21 22 23 24 25 |
# File 'lib/zapix/proxies/scenarios.rb', line 18 def exists?() result = client.webcheck_get({ 'countOutput' => true, 'filter' => {'name' => ['name'], 'hostid' => ['hostid']}}) result.to_i >= 1 ? true : false end |
#get_id(options) ⇒ Object
8 9 10 11 12 |
# File 'lib/zapix/proxies/scenarios.rb', line 8 def get_id() client.webcheck_get({ 'filter' => {'name' => ['name'], 'hostid' => ['hostid']}}) end |