Class: OVH::Provisioner::APIObject::Vrack
- Inherits:
-
OVH::Provisioner::APIObject
- Object
- OVH::Provisioner::APIObject
- OVH::Provisioner::APIObject::Vrack
- Defined in:
- lib/ovh/provisioner/api_object/vrack.rb
Overview
Represent a VRack
Instance Attribute Summary collapse
-
#dedicated_servers ⇒ Object
readonly
Returns the value of attribute dedicated_servers.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Instance Method Summary collapse
Instance Attribute Details
#dedicated_servers ⇒ Object (readonly)
Returns the value of attribute dedicated_servers.
24 25 26 |
# File 'lib/ovh/provisioner/api_object/vrack.rb', line 24 def dedicated_servers @dedicated_servers end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
24 25 26 |
# File 'lib/ovh/provisioner/api_object/vrack.rb', line 24 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/ovh/provisioner/api_object/vrack.rb', line 24 def name @name end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
24 25 26 |
# File 'lib/ovh/provisioner/api_object/vrack.rb', line 24 def tasks @tasks end |
Instance Method Details
#add(api_object) ⇒ Object
26 27 28 29 30 |
# File 'lib/ovh/provisioner/api_object/vrack.rb', line 26 def add(api_object) path = path_from(api_object) ok, msg = parse_task(post(path, path => api_object.id)) "#{api_object.id}: #{ok ? 'ok' : 'failed'}\n #{msg}" end |
#remove(api_object) ⇒ Object
32 33 34 35 36 |
# File 'lib/ovh/provisioner/api_object/vrack.rb', line 32 def remove(api_object) path = "#{path_from(api_object)}/#{api_object.id}" ok, msg = parse_task(delete(path)) "#{api_object.id}: #{ok ? 'ok' : 'failed'}\n #{msg}" end |
#to_s ⇒ Object
38 39 40 41 42 |
# File 'lib/ovh/provisioner/api_object/vrack.rb', line 38 def to_s "#{name}: #{id}#{" - #{description}" unless description.empty?}" \ "#{list_to_s(:dedicated_servers)}" \ "#{list_to_s(:tasks)}" end |