2013-06-24 13:46:30 +02:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
2013-08-27 11:19:54 +02:00
|
|
|
class VcloudDirector
|
2013-06-24 13:46:30 +02:00
|
|
|
|
2013-08-27 11:19:54 +02:00
|
|
|
class VmCustomization < Model
|
2013-09-16 18:13:09 +01:00
|
|
|
|
2013-06-24 13:46:30 +02:00
|
|
|
identity :id
|
2013-09-16 18:13:09 +01:00
|
|
|
|
2013-06-24 13:46:30 +02:00
|
|
|
attribute :type
|
|
|
|
attribute :href
|
|
|
|
attribute :enabled
|
|
|
|
attribute :change_sid
|
|
|
|
attribute :join_domain_enabled
|
2013-06-28 15:03:38 +02:00
|
|
|
attribute :use_org_settings
|
2013-06-24 13:46:30 +02:00
|
|
|
attribute :admin_password_enabled
|
|
|
|
attribute :reset_password_required
|
|
|
|
attribute :virtual_machine_id
|
|
|
|
attribute :computer_name
|
|
|
|
attribute :has_customization_script
|
2013-09-16 18:13:09 +01:00
|
|
|
|
2013-10-01 08:43:28 +01:00
|
|
|
# bug: for some reason if the customization_script has /r, is showed
|
|
|
|
# here as /n. Looks likes is something in excon
|
2013-06-28 15:03:38 +02:00
|
|
|
def script
|
|
|
|
attributes[:customization_script]
|
|
|
|
end
|
2013-09-16 18:13:09 +01:00
|
|
|
|
2013-06-28 15:03:38 +02:00
|
|
|
def script=(new_script)
|
|
|
|
attributes[:customization_script] = new_script
|
2013-06-24 13:46:30 +02:00
|
|
|
end
|
2013-09-16 18:13:09 +01:00
|
|
|
|
2013-06-28 15:03:38 +02:00
|
|
|
def save
|
2013-10-01 08:43:28 +01:00
|
|
|
response = service.put_guest_customization_section_vapp(id, attributes)
|
2013-07-05 19:10:43 +02:00
|
|
|
service.process_task(response.body)
|
2013-07-01 17:27:12 +02:00
|
|
|
end
|
2013-09-16 18:13:09 +01:00
|
|
|
|
2013-06-24 13:46:30 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2013-09-16 18:13:09 +01:00
|
|
|
end
|