clone

in elasticsearch-api/lib/elasticsearch/api/actions/snapshot/clone.rb [49:81]


        def clone(arguments = {})
          request_opts = { endpoint: arguments[:endpoint] || 'snapshot.clone' }

          defined_params = [:repository, :snapshot, :target_snapshot].each_with_object({}) do |variable, set_variables|
            set_variables[variable] = arguments[variable] if arguments.key?(variable)
          end
          request_opts[:defined_params] = defined_params unless defined_params.empty?

          raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
          raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
          raise ArgumentError, "Required argument 'snapshot' missing" unless arguments[:snapshot]
          raise ArgumentError, "Required argument 'target_snapshot' missing" unless arguments[:target_snapshot]

          arguments = arguments.clone
          headers = arguments.delete(:headers) || {}

          body = arguments.delete(:body)

          _repository = arguments.delete(:repository)

          _snapshot = arguments.delete(:snapshot)

          _target_snapshot = arguments.delete(:target_snapshot)

          method = Elasticsearch::API::HTTP_PUT
          path   = "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}/_clone/#{Utils.listify(_target_snapshot)}"
          params = Utils.process_params(arguments)

          Elasticsearch::API::Response.new(
            perform_request(method, path, params, body, headers, request_opts)
          )
        end