Sha256: dff1e665b83410397d6f105b0b09eca0fded21c791f60b904d0fb07bd4e47107

Contents?: true

Size: 1.46 KB

Versions: 8

Compression:

Stored size: 1.46 KB

Contents

module Elasticsearch
  module API
    module Snapshot
      module Actions

        # Delete a snapshot from the repository
        #
        # @note Will also abort a currently running snapshot.
        #
        # @example Delete the `snapshot-1` snapshot
        #
        #     client.snapshot.delete repository: 'my-backups', snapshot: 'snapshot-1'
        #
        # @option arguments [String] :repository A repository name (*Required*)
        # @option arguments [String] :snapshot A snapshot name (*Required*)
        # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
        #
        # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html
        #
        def delete(arguments={})
          raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
          raise ArgumentError, "Required argument 'snapshot' missing"   unless arguments[:snapshot]

          valid_params = [
            :master_timeout ]

          repository = arguments.delete(:repository)
          snapshot   = arguments.delete(:snapshot)

          method = 'DELETE'
          path   = Utils.__pathify( '_snapshot', Utils.__escape(repository), Utils.__listify(snapshot) )

          params = Utils.__validate_and_extract_params arguments, valid_params
          body   = nil

          perform_request(method, path, params, body).body
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
elasticsearch-api-1.0.6 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.5 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.4 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.2 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.1 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.0 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.0.rc2 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.0.rc1 lib/elasticsearch/api/actions/snapshot/delete.rb