Module: Elasticsearch::API::Snapshot::Actions
- Included in:
- SnapshotClient
- Defined in:
- lib/elasticsearch/api/namespace/snapshot.rb,
lib/elasticsearch/api/actions/snapshot/get.rb,
lib/elasticsearch/api/actions/snapshot/clone.rb,
lib/elasticsearch/api/actions/snapshot/create.rb,
lib/elasticsearch/api/actions/snapshot/delete.rb,
lib/elasticsearch/api/actions/snapshot/status.rb,
lib/elasticsearch/api/actions/snapshot/restore.rb,
lib/elasticsearch/api/actions/snapshot/get_repository.rb,
lib/elasticsearch/api/actions/snapshot/create_repository.rb,
lib/elasticsearch/api/actions/snapshot/delete_repository.rb,
lib/elasticsearch/api/actions/snapshot/verify_repository.rb,
lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb,
lib/elasticsearch/api/actions/snapshot/repository_analyze.rb
Instance Method Summary collapse
-
#cleanup_repository(arguments = {}) ⇒ Object
Removes stale data from repository.
-
#clone(arguments = {}) ⇒ Object
Clones indices from one snapshot into another snapshot in the same repository.
-
#create(arguments = {}) ⇒ Object
Creates a snapshot in a repository.
-
#create_repository(arguments = {}) ⇒ Object
Creates a repository.
-
#delete(arguments = {}) ⇒ Object
Deletes one or more snapshots.
-
#delete_repository(arguments = {}) ⇒ Object
Deletes a repository.
-
#get(arguments = {}) ⇒ Object
Returns information about a snapshot.
-
#get_repository(arguments = {}) ⇒ Object
Returns information about a repository.
-
#repository_analyze(arguments = {}) ⇒ Object
Analyzes a repository for correctness and performance.
-
#restore(arguments = {}) ⇒ Object
Restores a snapshot.
-
#status(arguments = {}) ⇒ Object
Returns information about the status of a snapshot.
-
#verify_repository(arguments = {}) ⇒ Object
Verifies a repository.
Instance Method Details
#cleanup_repository(arguments = {}) ⇒ Object
Removes stale data from repository.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb', line 31 def cleanup_repository(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_POST path = "_snapshot/#{Utils.__listify(_repository)}/_cleanup" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#clone(arguments = {}) ⇒ Object
Clones indices from one snapshot into another snapshot in the same repository.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/snapshot/clone.rb', line 33 def clone(arguments = {}) 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) ) end |
#create(arguments = {}) ⇒ Object
Creates a snapshot in a repository.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/elasticsearch/api/actions/snapshot/create.rb', line 33 def create(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] raise ArgumentError, "Required argument 'snapshot' missing" unless arguments[:snapshot] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _repository = arguments.delete(:repository) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_PUT path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#create_repository(arguments = {}) ⇒ Object
Creates a repository.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/elasticsearch/api/actions/snapshot/create_repository.rb', line 33 def create_repository(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_PUT path = "_snapshot/#{Utils.__listify(_repository)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#delete(arguments = {}) ⇒ Object
Deletes one or more snapshots.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch/api/actions/snapshot/delete.rb', line 31 def delete(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] raise ArgumentError, "Required argument 'snapshot' missing" unless arguments[:snapshot] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_DELETE path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) } else Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end end |
#delete_repository(arguments = {}) ⇒ Object
Deletes a repository.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch/api/actions/snapshot/delete_repository.rb', line 31 def delete_repository(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_DELETE path = "_snapshot/#{Utils.__listify(_repository)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) } else Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end end |
#get(arguments = {}) ⇒ Object
Returns information about a snapshot.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/elasticsearch/api/actions/snapshot/get.rb', line 35 def get(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] raise ArgumentError, "Required argument 'snapshot' missing" unless arguments[:snapshot] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_GET path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) } else Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end end |
#get_repository(arguments = {}) ⇒ Object
Returns information about a repository.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/snapshot/get_repository.rb', line 31 def get_repository(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_GET path = if _repository "_snapshot/#{Utils.__listify(_repository)}" else "_snapshot" end params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) } else Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end end |
#repository_analyze(arguments = {}) ⇒ Object
Analyzes a repository for correctness and performance
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/snapshot/repository_analyze.rb', line 40 def repository_analyze(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_POST path = "_snapshot/#{Utils.__listify(_repository)}/_analyze" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#restore(arguments = {}) ⇒ Object
Restores a snapshot.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/elasticsearch/api/actions/snapshot/restore.rb', line 33 def restore(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] raise ArgumentError, "Required argument 'snapshot' missing" unless arguments[:snapshot] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _repository = arguments.delete(:repository) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_POST path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}/_restore" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#status(arguments = {}) ⇒ Object
Returns information about the status of a snapshot.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/elasticsearch/api/actions/snapshot/status.rb', line 32 def status(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_GET path = if _repository && _snapshot "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}/_status" elsif _repository "_snapshot/#{Utils.__listify(_repository)}/_status" else "_snapshot/_status" end params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) } else Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end end |
#verify_repository(arguments = {}) ⇒ Object
Verifies a repository.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot/verify_repository.rb', line 31 def verify_repository(arguments = {}) raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_POST path = "_snapshot/#{Utils.__listify(_repository)}/_verify" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |