Sha256: aa55827cf504fb08ad836d3992cc01c93e67d16c9356db2af1addf30633cb494

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

module Fog
  module Network
    class HuaweiCloud
      class Real
        def delete_ipsec_policy(ipsec_policy_id)
          request(
            :expects => 204,
            :method  => 'DELETE',
            :path    => "vpn/ipsecpolicies/#{ipsec_policy_id}"
          )
        end
      end

      class Mock
        def delete_ipsec_policy(ipsec_policy_id)
          response = Excon::Response.new
          if list_ipsec_policies.body['ipsecpolicies'].collect { |r| r['id'] }.include? ipsec_policy_id
            data[:ipsec_policies].delete(ipsec_policy_id)
            response.status = 204
            response
          else
            raise Fog::Network::HuaweiCloud::NotFound
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/network/huaweicloud/requests/delete_ipsec_policy.rb
fog-huaweicloud-0.0.2 lib/fog/network/huaweicloud/requests/delete_ipsec_policy.rb
fog-huaweicloud-0.1.3 lib/fog/network/huaweicloud/requests/delete_ipsec_policy.rb
fog-huaweicloud-0.1.2 lib/fog/network/huaweicloud/requests/delete_ipsec_policy.rb