Sha256: 536d59c1b771a1565b4886b28b2928f6b7d6d47e5fc7a0f1021f4d6ce00d83bd

Contents?: true

Size: 696 Bytes

Versions: 4

Compression:

Stored size: 696 Bytes

Contents

module Fog
  module Compute
    class HuaweiCloud
      class Real
        def delete_snapshot(snapshot_id)
          request(
            :expects => 202,
            :method  => 'DELETE',
            :path    => "os-snapshots/#{snapshot_id}"
          )
        end
      end

      class Mock
        def delete_snapshot(snapshot_id)
          response = Excon::Response.new
          response.status = 204
          if list_snapshots_detail.body['snapshots'].find { |snap| snap['id'] == snapshot_id }
            data[:snapshots].delete(snapshot_id)
          else
            raise Fog::Compute::HuaweiCloud::NotFound
          end
          response
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/compute/huaweicloud/requests/delete_snapshot.rb
fog-huaweicloud-0.0.2 lib/fog/compute/huaweicloud/requests/delete_snapshot.rb
fog-huaweicloud-0.1.3 lib/fog/compute/huaweicloud/requests/delete_snapshot.rb
fog-huaweicloud-0.1.2 lib/fog/compute/huaweicloud/requests/delete_snapshot.rb