Sha256: 7e364a2bd4c1912a2ff9e1356fa959975dba9f8dec612f40ac26a3937984f2c1

Contents?: true

Size: 1.33 KB

Versions: 77

Compression:

Stored size: 1.33 KB

Contents

module Fog
  module Compute
    class Ecloud
      class Real
        include Shared

        def backup_internet_service_create(data)
          validate_data([:name, :protocol, :enabled, :persistence], data)
          unless data[:persistence][:type]
            raise ArgumentError.new("Required data missing: :persistence[:type]")
          end          

          request(
            :body => generate_backup_internet_service_request(data),
            :expects => 201,
            :method => "POST",
            :headers => {},
            :uri => data[:uri],
            :parse => true
          )
        end

        private

        def generate_backup_internet_service_request(data)
          xml = Builder::XmlMarkup.new
          xml.CreateBackupInternetService(:name => data[:name]) do
            xml.Protocol data[:protocol]
            xml.Enabled data[:enabled]
            if data[:description]
              xml.Description data[:description]
            end
            xml.Persistence do
              xml.Type data[:persistence][:type]
              if data[:persistence][:timeout]
                xml.Timeout data[:persistence][:timeout]
              end
            end
            if data[:redirect_url]
              xml.RedirectUrl data[:redirect_url]
            end
          end
        end
      end
    end
  end
end          

Version data entries

77 entries across 77 versions & 12 rubygems

Version Path
fog-1.15.0 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
gapinc-fog-1.14.0 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-1.14.0 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-1.13.0 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
gapinc-fog-1.12.1.2 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
gapinc-fog-1.12.1.1 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
gapinc-fog-1.12.1a lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
gapinc-fog-1.12.1 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-1.12.1 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-1.12.0 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
hpfog-0.0.20 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-nirvanix-1.8.2 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-1.11.1 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-1.11.0 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-nirvanix-1.8.1 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-1.10.1 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb
fog-parser-fix-1.6.1 lib/fog/ecloud/requests/compute/backup_internet_service_create.rb