algolia 3.0.0.alpha.15 → 3.0.0.alpha.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +10 -167
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/ingestion_client.rb +267 -196
- data/lib/algolia/api/monitoring_client.rb +49 -49
- data/lib/algolia/api/query_suggestions_client.rb +14 -14
- data/lib/algolia/api/recommend_client.rb +22 -22
- data/lib/algolia/api/search_client.rb +8 -8
- data/lib/algolia/api/usage_client.rb +329 -0
- data/lib/algolia/models/analytics/get_status_response.rb +1 -1
- data/lib/algolia/models/ingestion/auth_algolia.rb +3 -2
- data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
- data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
- data/lib/algolia/models/ingestion/auth_algolia_partial.rb +3 -2
- data/lib/algolia/models/ingestion/auth_api_key.rb +2 -1
- data/lib/algolia/models/ingestion/auth_api_key_partial.rb +2 -1
- data/lib/algolia/models/ingestion/auth_basic.rb +3 -1
- data/lib/algolia/models/ingestion/auth_basic_partial.rb +3 -1
- data/lib/algolia/models/ingestion/auth_google_service_account.rb +3 -3
- data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +3 -3
- data/lib/algolia/models/ingestion/auth_input.rb +1 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
- data/lib/algolia/models/ingestion/auth_o_auth.rb +18 -8
- data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +18 -8
- data/lib/algolia/models/ingestion/authentication.rb +5 -5
- data/lib/algolia/models/ingestion/authentication_create.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/authentication_search.rb +1 -1
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- data/lib/algolia/models/ingestion/authentication_update.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/big_commerce_channel.rb +2 -2
- data/lib/algolia/models/ingestion/big_commerce_metafield.rb +2 -2
- data/lib/algolia/models/ingestion/commercetools_custom_fields.rb +1 -1
- data/lib/algolia/models/ingestion/delete_response.rb +1 -1
- data/lib/algolia/models/ingestion/destination.rb +6 -6
- data/lib/algolia/models/ingestion/destination_create.rb +3 -3
- data/lib/algolia/models/ingestion/destination_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/destination_index_name.rb +2 -2
- data/lib/algolia/models/ingestion/destination_index_prefix.rb +1 -1
- data/lib/algolia/models/ingestion/destination_search.rb +1 -1
- data/lib/algolia/models/ingestion/destination_type.rb +1 -2
- data/lib/algolia/models/ingestion/destination_update.rb +3 -3
- data/lib/algolia/models/ingestion/destination_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/docker_source_discover.rb +2 -2
- data/lib/algolia/models/ingestion/event.rb +3 -3
- data/lib/algolia/models/ingestion/list_tasks_response.rb +1 -1
- data/lib/algolia/models/ingestion/mapping_format_schema.rb +32 -0
- data/lib/algolia/models/ingestion/mapping_input.rb +24 -3
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +3 -3
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +2 -2
- data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +1 -1
- data/lib/algolia/models/ingestion/pagination.rb +65 -0
- data/lib/algolia/models/ingestion/platform.rb +2 -1
- data/lib/algolia/models/ingestion/run.rb +7 -7
- data/lib/algolia/models/ingestion/run_response.rb +3 -3
- data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +2 -2
- data/lib/algolia/models/ingestion/schedule_trigger.rb +4 -4
- data/lib/algolia/models/ingestion/schedule_trigger_input.rb +2 -2
- data/lib/algolia/models/ingestion/source.rb +4 -4
- data/lib/algolia/models/ingestion/source_big_commerce.rb +1 -1
- data/lib/algolia/models/ingestion/source_big_query.rb +5 -5
- data/lib/algolia/models/ingestion/source_commercetools.rb +2 -2
- data/lib/algolia/models/ingestion/source_create.rb +2 -1
- data/lib/algolia/models/ingestion/source_create_response.rb +3 -2
- data/lib/algolia/models/ingestion/source_csv.rb +3 -3
- data/lib/algolia/models/ingestion/source_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +3 -3
- data/lib/algolia/models/ingestion/source_json.rb +2 -2
- data/lib/algolia/models/ingestion/source_type.rb +5 -3
- data/lib/algolia/models/ingestion/source_update.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +2 -3
- data/lib/algolia/models/ingestion/source_update_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_update_response.rb +3 -2
- data/lib/algolia/models/ingestion/streaming_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/streaming_utils_input.rb +1 -1
- data/lib/algolia/models/ingestion/subscription_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/task.rb +7 -7
- data/lib/algolia/models/ingestion/task_create.rb +5 -5
- data/lib/algolia/models/ingestion/task_create_response.rb +3 -3
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/ingestion/task_update.rb +4 -4
- data/lib/algolia/models/ingestion/task_update_response.rb +3 -3
- data/lib/algolia/models/ingestion/trigger.rb +1 -0
- data/lib/algolia/models/ingestion/trigger_update_input.rb +2 -2
- data/lib/algolia/models/ingestion/window.rb +3 -3
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/clicked_filters.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/converted_filters.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +3 -1
- data/lib/algolia/models/insights/viewed_filters.rb +1 -1
- data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
- data/lib/algolia/models/monitoring/{get_inventory403_response.rb → get_servers403_response.rb} +3 -3
- data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
- data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
- data/lib/algolia/models/monitoring/server.rb +2 -2
- data/lib/algolia/models/monitoring/time_inner.rb +1 -1
- data/lib/algolia/models/query-suggestions/app_id.rb +197 -0
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +4 -4
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +2 -2
- data/lib/algolia/models/query-suggestions/languages.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +2 -3
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +23 -34
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +18 -20
- data/lib/algolia/models/query-suggestions/source_index.rb +3 -5
- data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +36 -7
- data/lib/algolia/models/recommend/base_search_params.rb +1 -1
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +1 -1
- data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
- data/lib/algolia/models/recommend/condition.rb +12 -62
- data/lib/algolia/models/recommend/consequence.rb +32 -54
- data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
- data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +9 -12
- data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
- data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
- data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
- data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +5 -5
- data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
- data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
- data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
- data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
- data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
- data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
- data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
- data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
- data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
- data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
- data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +35 -15
- data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
- data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
- data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +39 -19
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +25 -44
- data/lib/algolia/models/recommend/search_params_object.rb +6 -6
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
- data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
- data/lib/algolia/models/recommend/trending_facets.rb +243 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +50 -10
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +42 -16
- data/lib/algolia/models/search/add_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_index_settings.rb +4 -4
- data/lib/algolia/models/search/base_search_params.rb +1 -1
- data/lib/algolia/models/search/base_search_params_without_query.rb +1 -1
- data/lib/algolia/models/search/browse_params_object.rb +6 -6
- data/lib/algolia/models/search/consequence_params.rb +6 -6
- data/lib/algolia/models/search/created_at_response.rb +1 -1
- data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
- data/lib/algolia/models/search/delete_by_params.rb +1 -1
- data/lib/algolia/models/search/delete_source_response.rb +1 -1
- data/lib/algolia/models/search/deleted_at_response.rb +1 -1
- data/lib/algolia/models/search/fetched_index.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/index_settings.rb +9 -9
- data/lib/algolia/models/search/index_settings_as_search_params.rb +5 -5
- data/lib/algolia/models/search/log.rb +1 -1
- data/lib/algolia/models/search/remove_user_id_response.rb +1 -1
- data/lib/algolia/models/search/replace_source_response.rb +1 -1
- data/lib/algolia/models/search/save_object_response.rb +1 -1
- data/lib/algolia/models/search/save_synonym_response.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +6 -6
- data/lib/algolia/models/search/search_for_hits.rb +6 -6
- data/lib/algolia/models/search/search_params_object.rb +6 -6
- data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/update_api_key_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
- data/lib/algolia/models/search/updated_rule_response.rb +1 -1
- data/lib/algolia/models/search/user_hit.rb +1 -1
- data/lib/algolia/models/search/user_id.rb +1 -1
- data/lib/algolia/models/usage/error_base.rb +205 -0
- data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
- data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → usage/get_usage400_response.rb} +13 -14
- data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
- data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
- data/lib/algolia/models/usage/granularity.rb +33 -0
- data/lib/algolia/models/usage/statistic.rb +116 -0
- data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
- data/lib/algolia/version.rb +1 -1
- metadata +37 -26
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
- data/lib/algolia/models/recommend/consequence_query.rb +0 -97
- data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
@@ -0,0 +1,329 @@
|
|
1
|
+
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
+
|
3
|
+
module Algolia
|
4
|
+
class UsageClient
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(config = nil)
|
8
|
+
raise '`config` is missing.' if config.nil?
|
9
|
+
raise '`app_id` is missing.' if config.app_id.nil? || config.app_id == ''
|
10
|
+
raise '`api_key` is missing.' if config.api_key.nil? || config.api_key == ''
|
11
|
+
|
12
|
+
@api_client = Algolia::ApiClient.new(config)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.create(app_id, api_key, opts = {})
|
16
|
+
hosts = []
|
17
|
+
hosts << Transport::StatefulHost.new("#{app_id}-dsn.algolia.net", accept: CallType::READ)
|
18
|
+
hosts << Transport::StatefulHost.new("#{app_id}.algolia.net", accept: CallType::WRITE)
|
19
|
+
|
20
|
+
hosts += 1.upto(3).map do |i|
|
21
|
+
Transport::StatefulHost.new("#{app_id}-#{i}.algolianet.com", accept: CallType::READ | CallType::WRITE)
|
22
|
+
end.shuffle
|
23
|
+
|
24
|
+
config = Algolia::Configuration.new(app_id, api_key, hosts, 'Usage', opts)
|
25
|
+
create_with_config(config)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.create_with_config(config)
|
29
|
+
new(config)
|
30
|
+
end
|
31
|
+
|
32
|
+
# This method allow you to send requests to the Algolia REST API.
|
33
|
+
|
34
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
35
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
36
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
37
|
+
# @return [Http::Response] the response
|
38
|
+
def custom_delete_with_http_info(path, parameters = nil, request_options = {})
|
39
|
+
# verify the required parameter 'path' is set
|
40
|
+
if @api_client.config.client_side_validation && path.nil?
|
41
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
|
42
|
+
end
|
43
|
+
|
44
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
45
|
+
query_params = {}
|
46
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
47
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
48
|
+
header_params = {}
|
49
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
50
|
+
|
51
|
+
post_body = request_options[:debug_body]
|
52
|
+
|
53
|
+
new_options = request_options.merge(
|
54
|
+
:operation => :'UsageClient.custom_delete',
|
55
|
+
:header_params => header_params,
|
56
|
+
:query_params => query_params,
|
57
|
+
:body => post_body,
|
58
|
+
:use_read_transporter => false
|
59
|
+
)
|
60
|
+
|
61
|
+
@api_client.call_api(:DELETE, path, new_options)
|
62
|
+
end
|
63
|
+
|
64
|
+
# This method allow you to send requests to the Algolia REST API.
|
65
|
+
|
66
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
67
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
68
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
69
|
+
# @return [Object]
|
70
|
+
def custom_delete(path, parameters = nil, request_options = {})
|
71
|
+
response = custom_delete_with_http_info(path, parameters, request_options)
|
72
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
73
|
+
end
|
74
|
+
|
75
|
+
# This method allow you to send requests to the Algolia REST API.
|
76
|
+
|
77
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
78
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
79
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
80
|
+
# @return [Http::Response] the response
|
81
|
+
def custom_get_with_http_info(path, parameters = nil, request_options = {})
|
82
|
+
# verify the required parameter 'path' is set
|
83
|
+
if @api_client.config.client_side_validation && path.nil?
|
84
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
|
85
|
+
end
|
86
|
+
|
87
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
88
|
+
query_params = {}
|
89
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
90
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
91
|
+
header_params = {}
|
92
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
93
|
+
|
94
|
+
post_body = request_options[:debug_body]
|
95
|
+
|
96
|
+
new_options = request_options.merge(
|
97
|
+
:operation => :'UsageClient.custom_get',
|
98
|
+
:header_params => header_params,
|
99
|
+
:query_params => query_params,
|
100
|
+
:body => post_body,
|
101
|
+
:use_read_transporter => false
|
102
|
+
)
|
103
|
+
|
104
|
+
@api_client.call_api(:GET, path, new_options)
|
105
|
+
end
|
106
|
+
|
107
|
+
# This method allow you to send requests to the Algolia REST API.
|
108
|
+
|
109
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
110
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
111
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
112
|
+
# @return [Object]
|
113
|
+
def custom_get(path, parameters = nil, request_options = {})
|
114
|
+
response = custom_get_with_http_info(path, parameters, request_options)
|
115
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
116
|
+
end
|
117
|
+
|
118
|
+
# This method allow you to send requests to the Algolia REST API.
|
119
|
+
|
120
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
121
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
122
|
+
# @param body [Object] Parameters to send with the custom request.
|
123
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
124
|
+
# @return [Http::Response] the response
|
125
|
+
def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
|
126
|
+
# verify the required parameter 'path' is set
|
127
|
+
if @api_client.config.client_side_validation && path.nil?
|
128
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
|
129
|
+
end
|
130
|
+
|
131
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
132
|
+
query_params = {}
|
133
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
134
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
135
|
+
header_params = {}
|
136
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
137
|
+
|
138
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
|
139
|
+
|
140
|
+
new_options = request_options.merge(
|
141
|
+
:operation => :'UsageClient.custom_post',
|
142
|
+
:header_params => header_params,
|
143
|
+
:query_params => query_params,
|
144
|
+
:body => post_body,
|
145
|
+
:use_read_transporter => false
|
146
|
+
)
|
147
|
+
|
148
|
+
@api_client.call_api(:POST, path, new_options)
|
149
|
+
end
|
150
|
+
|
151
|
+
# This method allow you to send requests to the Algolia REST API.
|
152
|
+
|
153
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
154
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
155
|
+
# @param body [Object] Parameters to send with the custom request.
|
156
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
157
|
+
# @return [Object]
|
158
|
+
def custom_post(path, parameters = nil, body = nil, request_options = {})
|
159
|
+
response = custom_post_with_http_info(path, parameters, body, request_options)
|
160
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
161
|
+
end
|
162
|
+
|
163
|
+
# This method allow you to send requests to the Algolia REST API.
|
164
|
+
|
165
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
166
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
167
|
+
# @param body [Object] Parameters to send with the custom request.
|
168
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
169
|
+
# @return [Http::Response] the response
|
170
|
+
def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
|
171
|
+
# verify the required parameter 'path' is set
|
172
|
+
if @api_client.config.client_side_validation && path.nil?
|
173
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
|
174
|
+
end
|
175
|
+
|
176
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
177
|
+
query_params = {}
|
178
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
179
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
180
|
+
header_params = {}
|
181
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
182
|
+
|
183
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
|
184
|
+
|
185
|
+
new_options = request_options.merge(
|
186
|
+
:operation => :'UsageClient.custom_put',
|
187
|
+
:header_params => header_params,
|
188
|
+
:query_params => query_params,
|
189
|
+
:body => post_body,
|
190
|
+
:use_read_transporter => false
|
191
|
+
)
|
192
|
+
|
193
|
+
@api_client.call_api(:PUT, path, new_options)
|
194
|
+
end
|
195
|
+
|
196
|
+
# This method allow you to send requests to the Algolia REST API.
|
197
|
+
|
198
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
199
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
200
|
+
# @param body [Object] Parameters to send with the custom request.
|
201
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
202
|
+
# @return [Object]
|
203
|
+
def custom_put(path, parameters = nil, body = nil, request_options = {})
|
204
|
+
response = custom_put_with_http_info(path, parameters, body, request_options)
|
205
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
206
|
+
end
|
207
|
+
|
208
|
+
# Retrieves the selected usage statistics for one index.
|
209
|
+
|
210
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
211
|
+
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
212
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
213
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
214
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
215
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
216
|
+
# @return [Http::Response] the response
|
217
|
+
def get_index_usage_with_http_info(statistic, index_name, start_date, end_date, granularity = nil, request_options = {})
|
218
|
+
# verify the required parameter 'statistic' is set
|
219
|
+
if @api_client.config.client_side_validation && statistic.nil?
|
220
|
+
raise ArgumentError, "Parameter `statistic` is required when calling `get_index_usage`."
|
221
|
+
end
|
222
|
+
# verify the required parameter 'index_name' is set
|
223
|
+
if @api_client.config.client_side_validation && index_name.nil?
|
224
|
+
raise ArgumentError, "Parameter `index_name` is required when calling `get_index_usage`."
|
225
|
+
end
|
226
|
+
# verify the required parameter 'start_date' is set
|
227
|
+
if @api_client.config.client_side_validation && start_date.nil?
|
228
|
+
raise ArgumentError, "Parameter `start_date` is required when calling `get_index_usage`."
|
229
|
+
end
|
230
|
+
# verify the required parameter 'end_date' is set
|
231
|
+
if @api_client.config.client_side_validation && end_date.nil?
|
232
|
+
raise ArgumentError, "Parameter `end_date` is required when calling `get_index_usage`."
|
233
|
+
end
|
234
|
+
|
235
|
+
path = '/1/usage/{statistic}/{indexName}'.sub('{' + 'statistic' + '}', Transport.encode_uri(statistic.to_s)).sub('{' + 'indexName' + '}',
|
236
|
+
Transport.encode_uri(index_name.to_s))
|
237
|
+
query_params = {}
|
238
|
+
query_params[:startDate] = start_date
|
239
|
+
query_params[:endDate] = end_date
|
240
|
+
query_params[:granularity] = granularity unless granularity.nil?
|
241
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
242
|
+
header_params = {}
|
243
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
244
|
+
|
245
|
+
post_body = request_options[:debug_body]
|
246
|
+
|
247
|
+
new_options = request_options.merge(
|
248
|
+
:operation => :'UsageClient.get_index_usage',
|
249
|
+
:header_params => header_params,
|
250
|
+
:query_params => query_params,
|
251
|
+
:body => post_body,
|
252
|
+
:use_read_transporter => false
|
253
|
+
)
|
254
|
+
|
255
|
+
@api_client.call_api(:GET, path, new_options)
|
256
|
+
end
|
257
|
+
|
258
|
+
# Retrieves the selected usage statistics for one index.
|
259
|
+
|
260
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
261
|
+
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
262
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
263
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
264
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
265
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
266
|
+
# @return [GetUsage200Response]
|
267
|
+
def get_index_usage(statistic, index_name, start_date, end_date, granularity = nil, request_options = {})
|
268
|
+
response = get_index_usage_with_http_info(statistic, index_name, start_date, end_date, granularity, request_options)
|
269
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Usage::GetUsage200Response')
|
270
|
+
end
|
271
|
+
|
272
|
+
# Retrieves usage statistics evaluated over a specified period.
|
273
|
+
|
274
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
275
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
276
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
277
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
278
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
279
|
+
# @return [Http::Response] the response
|
280
|
+
def get_usage_with_http_info(statistic, start_date, end_date, granularity = nil, request_options = {})
|
281
|
+
# verify the required parameter 'statistic' is set
|
282
|
+
if @api_client.config.client_side_validation && statistic.nil?
|
283
|
+
raise ArgumentError, "Parameter `statistic` is required when calling `get_usage`."
|
284
|
+
end
|
285
|
+
# verify the required parameter 'start_date' is set
|
286
|
+
if @api_client.config.client_side_validation && start_date.nil?
|
287
|
+
raise ArgumentError, "Parameter `start_date` is required when calling `get_usage`."
|
288
|
+
end
|
289
|
+
# verify the required parameter 'end_date' is set
|
290
|
+
if @api_client.config.client_side_validation && end_date.nil?
|
291
|
+
raise ArgumentError, "Parameter `end_date` is required when calling `get_usage`."
|
292
|
+
end
|
293
|
+
|
294
|
+
path = '/1/usage/{statistic}'.sub('{' + 'statistic' + '}', Transport.encode_uri(statistic.to_s))
|
295
|
+
query_params = {}
|
296
|
+
query_params[:startDate] = start_date
|
297
|
+
query_params[:endDate] = end_date
|
298
|
+
query_params[:granularity] = granularity unless granularity.nil?
|
299
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
300
|
+
header_params = {}
|
301
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
302
|
+
|
303
|
+
post_body = request_options[:debug_body]
|
304
|
+
|
305
|
+
new_options = request_options.merge(
|
306
|
+
:operation => :'UsageClient.get_usage',
|
307
|
+
:header_params => header_params,
|
308
|
+
:query_params => query_params,
|
309
|
+
:body => post_body,
|
310
|
+
:use_read_transporter => false
|
311
|
+
)
|
312
|
+
|
313
|
+
@api_client.call_api(:GET, path, new_options)
|
314
|
+
end
|
315
|
+
|
316
|
+
# Retrieves usage statistics evaluated over a specified period.
|
317
|
+
|
318
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
319
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
320
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
321
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
322
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
323
|
+
# @return [GetUsage200Response]
|
324
|
+
def get_usage(statistic, start_date, end_date, granularity = nil, request_options = {})
|
325
|
+
response = get_usage_with_http_info(statistic, start_date, end_date, granularity, request_options)
|
326
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Usage::GetUsage200Response')
|
327
|
+
end
|
328
|
+
end
|
329
|
+
end
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetStatusResponse
|
9
|
-
#
|
9
|
+
# Date and time when the object was updated, in RFC 3339 format.
|
10
10
|
attr_accessor :updated_at
|
11
11
|
|
12
12
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,11 +5,12 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
+
# Credentials for authenticating with Algolia.
|
8
9
|
class AuthAlgolia
|
9
|
-
# Algolia
|
10
|
+
# Algolia application ID.
|
10
11
|
attr_accessor :app_id
|
11
12
|
|
12
|
-
# Algolia API
|
13
|
+
# Algolia API key with the ACL: `addObject`, `deleteObject`, `settings`, `editSettings`, `listIndexes`, `deleteIndex`. This field is `null` in the API response.
|
13
14
|
attr_accessor :api_key
|
14
15
|
|
15
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|