2012-04-02 13:25:03 +02:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class XenServer
|
2012-12-22 23:21:33 +00:00
|
|
|
|
2012-04-02 13:25:03 +02:00
|
|
|
class PBD < Fog::Model
|
|
|
|
# API Reference here:
|
2013-12-10 23:05:42 -02:00
|
|
|
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PBD
|
2012-12-22 23:21:33 +00:00
|
|
|
|
2012-04-02 13:25:03 +02:00
|
|
|
identity :reference
|
2012-12-22 23:21:33 +00:00
|
|
|
|
2012-04-02 13:25:03 +02:00
|
|
|
attribute :uuid
|
|
|
|
attribute :__host, :aliases => :host
|
|
|
|
attribute :__sr, :aliases => :SR
|
2013-01-04 22:29:38 +01:00
|
|
|
attribute :currently_attached
|
2013-12-10 23:05:42 -02:00
|
|
|
attribute :device_config
|
|
|
|
attribute :other_config
|
2012-04-02 13:25:03 +02:00
|
|
|
|
|
|
|
def sr
|
2012-12-22 23:21:33 +00:00
|
|
|
service.storage_repositories.get __sr
|
2012-04-02 13:25:03 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def storage_repository
|
|
|
|
sr
|
|
|
|
end
|
|
|
|
|
|
|
|
def host
|
2012-12-22 23:21:33 +00:00
|
|
|
service.hosts.get __host
|
2012-04-02 13:25:03 +02:00
|
|
|
end
|
2012-12-31 00:49:39 +01:00
|
|
|
|
|
|
|
def unplug
|
2013-01-08 00:14:13 +01:00
|
|
|
service.unplug_pbd reference
|
2012-12-31 00:49:39 +01:00
|
|
|
end
|
2012-04-02 13:25:03 +02:00
|
|
|
|
|
|
|
end
|
2012-12-22 23:21:33 +00:00
|
|
|
|
2012-04-02 13:25:03 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|