1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/ecloud/models/compute/backup_internet_services.rb

43 lines
950 B
Ruby
Raw Normal View History

require 'fog/ecloud/models/compute/backup_internet_service'
module Fog
module Compute
class Ecloud
class BackupInternetServices < Fog::Ecloud::Collection
2012-06-07 12:50:11 -04:00
identity :href
2012-06-07 12:50:11 -04:00
model Fog::Compute::Ecloud::BackupInternetService
def all
data = service.get_backup_internet_services(href).body
2012-06-07 12:50:11 -04:00
load(data)
end
def get(uri)
if data = service.get_backup_internet_service(uri)
2012-06-07 12:50:11 -04:00
new(data.body)
end
rescue Fog::Errors::NotFound
nil
end
2012-06-07 12:50:11 -04:00
def from_data(data)
new(data)
end
def create(options)
options[:uri] = href + "/action/createBackupInternetService"
options[:enabled] ||= true
data = service.backup_internet_service_create(options)
2012-06-07 12:50:11 -04:00
new(data)
end
def internet_service_id
href.scan(/\d+/)[0]
end
end
end
end
end