Sha256: cfe8e4da5560628e8b4905551198f0d0dfbff3eba18fa4b012a01f7bc3cf9640

Contents?: true

Size: 1.53 KB

Versions: 14

Compression:

Stored size: 1.53 KB

Contents

# frozen_string_literal: true

module Fog
  module Compute
    class Aliyun
      class Real
        # Disassociate an avalable eip IP address to the given instance.
        #
        # ==== Parameters
        # * server_id<~String> - id of the instance
        # * allocationId<~String> - id of the EIP
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'RequestId'<~String> - Id of the request
        #
        # {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.201.106.DGkmH7#/pub/ecs/open-api/network&associateeipaddresss]
        def unassociate_eip_address(server_id, allocationId, options = {})
          _action = 'UnassociateEipAddress'
          _sigNonce = randonStr
          _time = Time.new.utc

          type = options['instance_type']

          _parameters = defaultParameters(_action, _sigNonce, _time)
          _pathURL = defaultAliyunUri(_action, _sigNonce, _time)

          _parameters['InstanceId'] = server_id
          _pathURL += '&InstanceId=' + server_id

          _parameters['AllocationId'] = allocationId
          _pathURL += '&AllocationId=' + allocationId

          if type
            _parameters['InstanceType'] = type
            _pathURL += 'InstanceType=' + type
          end

          _signature = sign(@aliyun_accesskey_secret, _parameters)
          _pathURL += '&Signature=' + _signature

          request(
            expects: [200, 204],
            method: 'GET',
            path: _pathURL
          )
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-aliyun-0.4.0 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.19 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.18 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.17 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.16 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.15 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.13 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.12 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.11 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.10 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.9 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.8 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.7 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb
fog-aliyun-0.3.6 lib/fog/aliyun/requests/compute/unassociate_eip_address.rb