Sha256: 52a7d1bfae2cc67004dc2889cf2191c06f9790cdd313f4828a031592f6c3d20e

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 KB

Contents

module Fog
  module Storage
    class Aliyun
      class Real
        # Delete an existing object
        #
        # ==== Parameters
        # * object<~String> - Name of object to delete
        #
        def delete_object(object, options = {})
          bucket = options[:bucket]
          bucket ||= @aliyun_oss_bucket
          location = get_bucket_location(bucket)
          endpoint = 'http://' + location + '.aliyuncs.com'
          resource = bucket + '/' + object
          request(
            expects: 204,
            method: 'DELETE',
            path: object,
            bucket: bucket,
            resource: resource,
            endpoint: endpoint
          )
        end

        def abort_multipart_upload(bucket, object, endpoint, uploadid)
          if nil == endpoint
            location = get_bucket_location(bucket)
            endpoint = 'http://' + location + '.aliyuncs.com'
          end
          path = object + '?uploadId=' + uploadid
          resource = bucket + '/' + path

          ret = request(
            expects: 204,
            method: 'DELETE',
            path: path,
            bucket: bucket,
            resource: resource,
            endpoint: endpoint
          )
        end
      end

      class Mock
        def delete_object(object, options = {})
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
fog-aliyun-0.3.0 lib/fog/aliyun/requests/storage/delete_object.rb
fog-aliyun-0.2.2 lib/fog/aliyun/requests/storage/delete_object.rb
fog-xiaozhu-0.2.2 lib/fog/aliyun/requests/storage/delete_object.rb
fog-xiaozhu-0.2.1 lib/fog/aliyun/requests/storage/delete_object.rb
fog-aliyun-0.2.1 lib/fog/aliyun/requests/storage/delete_object.rb
fog-aliyun-0.2.0 lib/fog/aliyun/requests/storage/delete_object.rb