Sha256: 148429fb560e080fc2a564abfc6230c4317ce5e457439ec1c848812386ec9c85
Contents?: true
Size: 706 Bytes
Versions: 13
Compression:
Stored size: 706 Bytes
Contents
require 'fog/core/collection' require 'fog/cloudstack/models/compute/zone' module Fog module Compute class Cloudstack class Zones < Fog::Collection model Fog::Compute::Cloudstack::Zone def all(filters={}) options = { 'templatefilter' => 'self' }.merge(filters) data = connection.list_zones(options)["listzonesresponse"]["zone"] || [] load(data) end def get(zone_id) if zone = connection.list_zones('id' => zone_id)["listzonesresponse"]["zone"].first new(zone) end rescue Fog::Compute::Cloudstack::BadRequest nil end end end end end
Version data entries
13 entries across 13 versions & 7 rubygems