Sha256: 41a190ff1dfd15b490975d3029ba8fd7701405c28419f21f11f92c06770565b7

Contents?: true

Size: 1.5 KB

Versions: 83

Compression:

Stored size: 1.5 KB

Contents

module Fog
  module Compute
    class IBM
      class Real

        # Requests a new static IP address to be created
        #
        # ==== Parameters
        # * location_id<~String> - id of location
        # * offering_id<~String> - id for offering
        # * vlan_id<~String> - id of vlan
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'location'<~String>: location of new address
        #     * 'offeringId'<~String>: offering id of new address
        #     * 'id'<~String>: id
        #     * 'ip'<~String>: returns string of spaces (ip not yet allocated right after creation)
        #     * 'state'<~Integer>: status of address (0 when new)
        def create_address(location, offering_id, options={})
          request(
            :method   => 'POST',
            :expects  => 200,
            :path     => '/addresses',
            :body     => {
              'offeringID' => offering_id,
              'location'   => location,
              'vlanID'     => options[:vlan_id]
            }
          )
        end

      end

      class Mock

        def create_address(location_id, offering_id="20001223", options={})
          address         = Fog::IBM::Mock.create_address(location_id, offering_id, options)
          self.data[:addresses][address['id']] = address
          response        = Excon::Response.new
          response.status = 200
          response.body   = address
          response
        end

      end
    end
  end
end

Version data entries

83 entries across 83 versions & 14 rubygems

Version Path
fog-1.22.0 lib/fog/ibm/requests/compute/create_address.rb
fog-1.21.0 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/ibm/requests/compute/create_address.rb
fog-1.20.0 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/ibm/requests/compute/create_address.rb
fog-1.19.0 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/ibm/requests/compute/create_address.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/ibm/requests/compute/create_address.rb