Sha256: 2a541a3e9818900a9ea02ac837581c54ed7bdaf44cb881ec86ccf2b9102a9f71

Contents?: true

Size: 954 Bytes

Versions: 6

Compression:

Stored size: 954 Bytes

Contents

require File.expand_path("../backup_internet_service", __FILE__)

module Fog
  module Compute
    class Ecloud
      class BackupInternetServices < Fog::Ecloud::Collection
        identity :href

        model Fog::Compute::Ecloud::BackupInternetService

        def all
          data = service.get_backup_internet_services(href).body
          load(data)
        end

        def get(uri)
          if data = service.get_backup_internet_service(uri)
            new(data.body)
          end
        rescue Fog::Errors::NotFound
          nil
        end

        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)
          new(data)
        end

        def internet_service_id
          href.scan(/\d+/)[0]
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-ecloud-0.1.1/lib/fog/compute/ecloud/models/backup_internet_services.rb
fog-ecloud-0.2.0 lib/fog/compute/ecloud/models/backup_internet_services.rb
fog-ecloud-0.1.3 lib/fog/compute/ecloud/models/backup_internet_services.rb
fog-ecloud-0.1.2 lib/fog/compute/ecloud/models/backup_internet_services.rb
fog-ecloud-0.1.1 lib/fog/compute/ecloud/models/backup_internet_services.rb
fog-ecloud-0.1.0 lib/fog/compute/ecloud/models/backup_internet_services.rb