2013-06-24 07:46:30 -04:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Vcloudng
|
|
|
|
|
|
|
|
class VmCustomization < Fog::Model
|
|
|
|
|
2013-07-01 11:27:12 -04:00
|
|
|
|
2013-06-24 07:46:30 -04:00
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :type
|
|
|
|
attribute :href
|
|
|
|
attribute :enabled
|
|
|
|
attribute :change_sid
|
|
|
|
attribute :join_domain_enabled
|
2013-06-28 09:03:38 -04:00
|
|
|
attribute :use_org_settings
|
2013-06-24 07:46:30 -04:00
|
|
|
attribute :admin_password_enabled
|
|
|
|
attribute :reset_password_required
|
|
|
|
attribute :virtual_machine_id
|
|
|
|
attribute :computer_name
|
|
|
|
attribute :has_customization_script
|
2013-06-28 09:03:38 -04:00
|
|
|
|
|
|
|
def script
|
|
|
|
attributes[:customization_script]
|
|
|
|
end
|
|
|
|
|
|
|
|
def script=(new_script)
|
|
|
|
attributes[:customization_script] = new_script
|
2013-06-24 07:46:30 -04:00
|
|
|
end
|
|
|
|
|
2013-06-28 09:03:38 -04:00
|
|
|
def save
|
2013-07-04 07:24:25 -04:00
|
|
|
response = service.put_vm_customization(id, attributes)
|
|
|
|
task = response.body
|
|
|
|
task[:id] = task[:href].split('/').last
|
|
|
|
attributes[:customization_task] = service.tasks.new(task)
|
2013-07-01 11:27:12 -04:00
|
|
|
end
|
|
|
|
|
2013-06-24 07:46:30 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|