Class: CloudParty::Nodes::Zones
- Inherits:
-
Object
- Object
- CloudParty::Nodes::Zones
- Includes:
- Context, HTTParty
- Defined in:
- lib/cloud_party/nodes/zones.rb
Class Method Summary collapse
Instance Method Summary collapse
- #delete(id) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(options = {}) ⇒ Zones
constructor
A new instance of Zones.
- #list_zones ⇒ Object
Methods included from Context
Constructor Details
#initialize(options = {}) ⇒ Zones
Returns a new instance of Zones.
30 31 32 33 |
# File 'lib/cloud_party/nodes/zones.rb', line 30 def initialize( = {}) super() @options = end |
Class Method Details
.set_id_by_name(zone) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cloud_party/nodes/zones.rb', line 16 def self.set_id_by_name(zone) = { match: 'all', name: zone, order: 'name' } if @options.nil? @options = else @options.merge!() end @@zone = CloudParty::Responses::Zones.new(:get, '/zones', get('/zones', query: @options), @options).result.first.fetch(:id, nil) end |
Instance Method Details
#delete(id) ⇒ Object
38 39 40 |
# File 'lib/cloud_party/nodes/zones.rb', line 38 def delete(id) CloudParty::Responses::Zones.new(:delete, '/zones/:id', self.class.delete("")) end |
#get(id) ⇒ Object
41 42 43 |
# File 'lib/cloud_party/nodes/zones.rb', line 41 def get(id) CloudParty::Responses::Zones.new(:get, '/zones/:id', self.class.get("/zones/#{id}"), @options) end |
#list_zones ⇒ Object
35 36 37 |
# File 'lib/cloud_party/nodes/zones.rb', line 35 def list_zones CloudParty::Responses::Zones.new(:get, '/zones', self.class.get('/zones'), @options) end |