Sha256: 0606b93736b87455528e84ae4e8f257e916d22c8ae5113566fc9d20e8345c0f9

Contents?: true

Size: 1.46 KB

Versions: 6

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 = HTTP_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

6 entries across 6 versions & 1 rubygems

Version Path
elasticsearch-api-1.0.13 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.12 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.11 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.10 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.9 lib/elasticsearch/api/actions/snapshot/delete.rb
elasticsearch-api-1.0.7 lib/elasticsearch/api/actions/snapshot/delete.rb