Sha256: 9160d169132363093082ed74c4e504c5cf9a6fbc3fa5d218e514c7ada0bdd7bb

Contents?: true

Size: 996 Bytes

Versions: 4

Compression:

Stored size: 996 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 ServiceError => e
          raise e unless e.status_code == 404
          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

4 entries across 2 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/models/backup_internet_services.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/models/backup_internet_services.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/models/backup_internet_services.rb
fog-ecloud-0.3.0 lib/fog/compute/ecloud/models/backup_internet_services.rb