Module: OpenSearch::API::Common::Client
- Included in:
- OpenSearch::API::Cat::CatClient, OpenSearch::API::Cluster::ClusterClient, DanglingIndices::DanglingIndicesClient, Features::FeaturesClient, Http::HttpClient, Indices::IndicesClient, Ingest::IngestClient, Nodes::NodesClient, Remote::RemoteClient, RemoteStore::RemoteStoreClient, Security::SecurityClient, Shutdown::ShutdownClient, Snapshot::SnapshotClient, Tasks::TasksClient
- Defined in:
- lib/opensearch/api/namespace/common.rb
Defined Under Namespace
Modules: Base
Instance Method Summary collapse
-
#perform_request(method, path, params = {}, body = nil, headers = nil) ⇒ Object
Delegates the ‘perform_request` method to the wrapped client.
- #perform_request_complex_ignore404(method, path, params, body, headers, arguments) ⇒ Object
- #perform_request_ping(method, path, params, body, headers) ⇒ Object
- #perform_request_simple_ignore404(method, path, params, body, headers) ⇒ Object
Instance Method Details
#perform_request(method, path, params = {}, body = nil, headers = nil) ⇒ Object
Delegates the ‘perform_request` method to the wrapped client
45 46 47 |
# File 'lib/opensearch/api/namespace/common.rb', line 45 def perform_request(method, path, params = {}, body = nil, headers = nil) client.perform_request method, path, params, body, headers end |
#perform_request_complex_ignore404(method, path, params, body, headers, arguments) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/opensearch/api/namespace/common.rb', line 55 def perform_request_complex_ignore404(method, path, params, body, headers, arguments) if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { perform_request(method, path, params, body, headers).body } else perform_request(method, path, params, body, headers).body end end |
#perform_request_ping(method, path, params, body, headers) ⇒ Object
63 64 65 66 67 68 |
# File 'lib/opensearch/api/namespace/common.rb', line 63 def perform_request_ping(method, path, params, body, headers) perform_request(method, path, params, body, headers).status == 200 rescue StandardError => e raise e unless e.class.to_s =~ /NotFound|ConnectionFailed/ || e. =~ /Not\s*Found|404|ConnectionFailed/i false end |
#perform_request_simple_ignore404(method, path, params, body, headers) ⇒ Object
49 50 51 52 53 |
# File 'lib/opensearch/api/namespace/common.rb', line 49 def perform_request_simple_ignore404(method, path, params, body, headers) Utils.__rescue_from_not_found do perform_request(method, path, params, body, headers).status == 200 end end |