Class: Zona::VDC
- Inherits:
-
OZonesElement
- Object
- JSONElement
- OZonesElement
- Zona::VDC
- Defined in:
- zona/VDCElement.rb
Overview
This class describes a single VDC element. It can be used to allocate, delete, add hosts, remove hosts and retrieve full information for a VDC.
Constant Summary
- VDC_KIND =
String describing the kind of this resource Should become part of the requests to server: get /vdc/…
"vdc"
Instance Attribute Summary
Attributes inherited from OZonesElement
Class Method Summary (collapse)
-
+ (Hash, Zona::Error) build_json(pe_id = nil)
Builds minimal JSON description for a VDC.
Instance Method Summary (collapse)
- - (Object) add_datastores(ds_array, options = {}) (also: #add_datastore)
-
- (Zona::Error) add_hosts(hosts_array, options = {})
(also: #add_host)
Adds hosts to a VDC.
- - (Object) add_networks(net_array, options = {}) (also: #add_network)
-
- (Zona::Error) allocate(template)
Allocates a new element from a JSON description.
-
- (Zona::Error) allocate_hash(template)
Allocates a new element from a hash description.
- - (Object) del_datastores(ds_array) (also: #del_datastore)
-
- (Zona::Error) del_hosts(hosts_array)
(also: #del_host)
Delete hosts from a VDC.
- - (Object) del_networks(net_array) (also: #del_network)
-
- (Zona::Error) delete
Deletes current element.
-
- (Zona::Error) info
Retrieves details about this object and fills in the information hash.
-
- (String) initialize(hash, client)
constructor
Initializes a VDC object instance.
Methods inherited from OZonesElement
Methods inherited from JSONElement
Constructor Details
- (String) initialize(hash, client)
Initializes a VDC object instance
45 46 47 |
# File 'zona/VDCElement.rb', line 45 def initialize(hash, client) super(hash, client) end |
Class Method Details
+ (Hash, Zona::Error) build_json(pe_id = nil)
Builds minimal JSON description for a VDC
32 33 34 35 36 37 38 39 |
# File 'zona/VDCElement.rb', line 32 def self.build_json(pe_id=nil) if pe_id json = "{\"VDC\":{\"ID\":#{pe_id}}}" else json = '{"VDC":{}}' end OZonesJSON.build_json(json,:VDC) end |
Instance Method Details
- (Object) add_datastores(ds_array, options = {}) Also known as: add_datastore
92 93 94 |
# File 'zona/VDCElement.rb', line 92 def add_datastores(ds_array,={}) addresource(:DATASTORES, ds_array, ) end |
- (Zona::Error) add_hosts(hosts_array, options = {}) Also known as: add_host
Adds hosts to a VDC. The specified hosts are added to the VDC’s current ones. in the zone to be added which already belong to other VDCs
84 85 86 |
# File 'zona/VDCElement.rb', line 84 def add_hosts(hosts_array,={}) addresource(:HOSTS, hosts_array, ) end |
- (Object) add_networks(net_array, options = {}) Also known as: add_network
88 89 90 |
# File 'zona/VDCElement.rb', line 88 def add_networks(net_array,={}) addresource(:NETWORKS, net_array, ) end |
- (Zona::Error) allocate(template)
Allocates a new element from a JSON description
66 67 68 |
# File 'zona/VDCElement.rb', line 66 def allocate(template) super(VDC_KIND,template) end |
- (Zona::Error) allocate_hash(template)
Allocates a new element from a hash description
59 60 61 |
# File 'zona/VDCElement.rb', line 59 def allocate_hash(template) super(VDC_KIND,template) end |
- (Object) del_datastores(ds_array) Also known as: del_datastore
108 109 110 |
# File 'zona/VDCElement.rb', line 108 def del_datastores(ds_array) delresource(:DATASTORES, ds_array) end |
- (Zona::Error) del_hosts(hosts_array) Also known as: del_host
Delete hosts from a VDC. The specified hosts are removed from the VDC. to be removed. If a host is not in the VDC, then it is ignored.
100 101 102 |
# File 'zona/VDCElement.rb', line 100 def del_hosts(hosts_array) delresource(:HOSTS, hosts_array) end |
- (Object) del_networks(net_array) Also known as: del_network
104 105 106 |
# File 'zona/VDCElement.rb', line 104 def del_networks(net_array) delresource(:NETWORKS, net_array) end |
- (Zona::Error) delete
Deletes current element
72 73 74 |
# File 'zona/VDCElement.rb', line 72 def delete super(VDC_KIND) end |
- (Zona::Error) info
Retrieves details about this object and fills in the information hash
52 53 54 |
# File 'zona/VDCElement.rb', line 52 def info super(VDC_KIND,:VDC) end |