Sha256: 52d578f92aaccc2af2eba5b32ccfc33dcd1f122eaa090da5dc50f1cbd61e60b6

Contents?: true

Size: 1.38 KB

Versions: 53

Compression:

Stored size: 1.38 KB

Contents

module Fog
  module Compute
    class RackspaceV2
      class Real
        
        # Reverts server resize operation
        # @param [String] server_id
        # @return [Excon::Response] response
        # @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::RackspaceV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::RackspaceV2::ServiceError]
        # @note All resizes are automatically confirmed after 24 hours if you do not explicitly confirm or revert the resize.
        # @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/Revert_Resized_Server-d1e4024.html
        # @see Server#resize
        #
        # * Status Transition:
        #   * VERIFY_RESIZE -> ACTIVE
        #   * VERIFY_RESIZE -> ERROR (on error)
        def revert_resize_server(server_id)
          data = {
            'revertResize' => nil
          }

          request(
            :body => Fog::JSON.encode(data),
            :expects => [202],
            :method => 'POST',
            :path => "servers/#{server_id}/action"
          )
        end
      end

      class Mock
        def revert_resize_server(server_id)
          server = self.data[:servers][server_id]
          server["status"] = "ACTIVE"
          response(:status => 202)
        end
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
fog-maestrodev-1.18.0.20131205181604 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
gapinc-fog-1.12.1.2.1 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-1.18.0 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-1.17.0 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-1.16.0 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb