Module: Marqo::UrlHelpers

Defined in:
lib/marqo/helpers/url_helpers.rb

Class Method Summary collapse

Class Method Details

.base_document_endpoint(endpoint, index_name) ⇒ Object



29
30
31
# File 'lib/marqo/helpers/url_helpers.rb', line 29

def base_document_endpoint(endpoint, index_name)
  URI.join(endpoint, 'indexes/', "#{index_name}/", 'documents')
end

.create_index_endpoint(endpoint, index_name) ⇒ Object



9
10
11
# File 'lib/marqo/helpers/url_helpers.rb', line 9

def create_index_endpoint(endpoint, index_name)
  URI.join(endpoint, 'indexes/', index_name)
end

.delete_document_endpoint(endpoint, index_name) ⇒ Object



21
22
23
# File 'lib/marqo/helpers/url_helpers.rb', line 21

def delete_document_endpoint(endpoint, index_name)
  URI.join(endpoint, 'indexes/', "#{index_name}/", 'documents/', 'delete-batch')
end

.delete_index_endpoint(endpoint, index_name) ⇒ Object



13
14
15
# File 'lib/marqo/helpers/url_helpers.rb', line 13

def delete_index_endpoint(endpoint, index_name)
  URI.join(endpoint, 'indexes/', index_name)
end

.device_cpu_endpoint(endpoint) ⇒ Object



45
46
47
# File 'lib/marqo/helpers/url_helpers.rb', line 45

def device_cpu_endpoint(endpoint)
  URI.join(endpoint, 'device/', 'cpu')
end

.device_cuda_endpoint(endpoint) ⇒ Object



49
50
51
# File 'lib/marqo/helpers/url_helpers.rb', line 49

def device_cuda_endpoint(endpoint)
  URI.join(endpoint, 'device/', 'cuda')
end

.find_document_endpoint(endpoint, index_name, document_id) ⇒ Object



25
26
27
# File 'lib/marqo/helpers/url_helpers.rb', line 25

def find_document_endpoint(endpoint, index_name, document_id)
  URI.join(endpoint, 'indexes/', "#{index_name}/", 'documents/', document_id)
end

.health_endpoint(endpoint, index_name) ⇒ Object



37
38
39
# File 'lib/marqo/helpers/url_helpers.rb', line 37

def health_endpoint(endpoint, index_name)
  URI.join(endpoint, 'indexes/', "#{index_name}/", "health")
end

.index_endpoint(endpoint) ⇒ Object



5
6
7
# File 'lib/marqo/helpers/url_helpers.rb', line 5

def index_endpoint(endpoint)
  URI.join(endpoint, 'indexes')
end

.models_endpoint(endpoint) ⇒ Object



41
42
43
# File 'lib/marqo/helpers/url_helpers.rb', line 41

def models_endpoint(endpoint)
  URI.join(endpoint, 'models')
end

.refresh_endpoint(endpoint, index_name) ⇒ Object



17
18
19
# File 'lib/marqo/helpers/url_helpers.rb', line 17

def refresh_endpoint(endpoint, index_name)
  URI.join(endpoint, 'indexes/', "#{index_name}/", "refresh")
end

.search_endpoint(endpoint, index_name) ⇒ Object



33
34
35
# File 'lib/marqo/helpers/url_helpers.rb', line 33

def search_endpoint(endpoint, index_name)
  URI.join(endpoint, 'indexes/', "#{index_name}/", 'search')
end