Sha256: 0f0bccc7656cfde8e311991903f0ec1f88e6642bf3e2e2507536200feab17afa
Contents?: true
Size: 949 Bytes
Versions: 60
Compression:
Stored size: 949 Bytes
Contents
module CloudstackClient module Zone ## # Finds the zone with the specified name. def get_zone(name) params = { 'command' => 'listZones', 'available' => 'true' } json = send_request(params) networks = json['zone'] return nil unless networks networks.each { |z| if z['name'] == name then return z end } nil end ## # Finds the default zone for your account. def get_default_zone params = { 'command' => 'listZones', 'available' => 'true' } json = send_request(params) zones = json['zone'] return nil unless zones zones.first end ## # Lists all available zones. def list_zones params = { 'command' => 'listZones', 'available' => 'true' } json = send_request(params) json['zone'] || [] end end end
Version data entries
60 entries across 60 versions & 3 rubygems