Sha256: 10df669f3530c1cc8b1fe9285f056d8ea08a854ed61d4b73f2a7a09629e88562

Contents?: true

Size: 1.3 KB

Versions: 29

Compression:

Stored size: 1.3 KB

Contents

module Fog
  module Compute
    class Ecloud
      class Real
        include Shared

        def backup_internet_service_edit(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 => 202,
            :method => "PUT",
            :headers => {},
            :uri => data[:uri],
            :parse => true
          )
        end

        private

        def generate_backup_internet_service_request(data)
          xml = Builder::XmlMarkup.new
          xml.BackupInternetService(: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

29 entries across 27 versions & 6 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-ecloud-0.1.1/lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
fog-ecloud-0.3.0 lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
fog-ecloud-0.2.0 lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
fog-ecloud-0.1.3 lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
fog-ecloud-0.1.2 lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
fog-ecloud-0.1.1 lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
fog-ecloud-0.1.0 lib/fog/compute/ecloud/requests/backup_internet_service_edit.rb
fog-ecloud-0.0.2 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
fog-ecloud-0.0.1 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
fog-1.25.0 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
nsidc-fog-1.24.1 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
fog-1.24.0 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
ns-fog-1.22.11 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
ns-fog-1.22.10 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
ns-fog-1.22.9 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb
ns-fog-1.22.8 lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb