Class: VagrantPlugins::Skytap::API::Vpn
Instance Attribute Summary
Attributes inherited from Resource
#attrs, #env
Class Method Summary
collapse
Instance Method Summary
collapse
#choice_for_setup, #connection_choice_class
Methods inherited from Resource
#delete, #initialize, #refresh, #reload, rest_name, short_name, #update, #url
#get_api_attribute, included
Class Method Details
.all(env, options = {}) ⇒ Object
35
36
37
38
39
|
# File 'lib/vagrant-skytap/api/vpn.rb', line 35
def all(env, options = {})
resp = env[:api_client].get('/vpns', options)
vpn_attrs = JSON.load(resp.body)
vpn_attrs.collect {|attrs| new(attrs, env)}
end
|
.fetch(env, url, options = {}) ⇒ Object
41
42
43
44
|
# File 'lib/vagrant-skytap/api/vpn.rb', line 41
def fetch(env, url, options = {})
resp = env[:api_client].get(url, options)
new(JSON.load(resp.body), env)
end
|
Instance Method Details
#nat_enabled? ⇒ Boolean
49
50
51
|
# File 'lib/vagrant-skytap/api/vpn.rb', line 49
def nat_enabled?
!!nat_local_subnet
end
|
57
58
59
|
# File 'lib/vagrant-skytap/api/vpn.rb', line 57
def subnet
Util::Subnet.new(local_subnet)
end
|
#subsumes?(network) ⇒ Boolean
53
54
55
|
# File 'lib/vagrant-skytap/api/vpn.rb', line 53
def subsumes?(network)
subnet.subsumes?(network.subnet)
end
|