Class: VagrantPlugins::Skytap::API::PublishSet
Instance Attribute Summary collapse
Attributes inherited from Resource
#attrs, #env
Instance Method Summary
collapse
Methods inherited from Resource
#refresh, #reload, resource_name, #url
#get_api_attribute, included
Constructor Details
#initialize(attrs, environment, env) ⇒ PublishSet
11
12
13
14
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 11
def initialize(attrs, environment, env)
super
@environment = environment
end
|
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
8
9
10
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 8
def environment
@environment
end
|
Instance Method Details
30
31
32
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 30
def delete
api_client.delete(url)
end
|
#password_protected? ⇒ Boolean
16
17
18
19
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 16
def password_protected?
get_api_attribute('password').present?
end
|
21
22
23
24
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 21
def vm_ids
vm_refs = get_api_attribute("vms").collect{|ref| ref['vm_ref']}
vm_refs.collect{|ref| ref.match(/\/vms\/(\d+)/)}.compact.map{|match| match[1]}
end
|
26
27
28
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 26
def vms
environment.get_vms_by_id(vm_ids)
end
|