Class: AliyunOpenSearch::Syncs
- Inherits:
-
Base
- Object
- Base
- AliyunOpenSearch::Syncs
show all
- Defined in:
- lib/aliyun_open_search/syncs.rb
Instance Attribute Summary
Attributes inherited from Base
#base_url, #basic_params
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
basic_params, escape, format_params, signature, signature_nonce, #uri
Constructor Details
#initialize(app_name) ⇒ Syncs
3
4
5
6
7
|
# File 'lib/aliyun_open_search/syncs.rb', line 3
def initialize(app_name)
super()
@base_url = "#{ENV["OPEN_SEARCH_HOST"]}/index/doc/#{app_name}"
end
|
Class Method Details
.request_method ⇒ Object
9
10
11
|
# File 'lib/aliyun_open_search/syncs.rb', line 9
def self.request_method
"POST"
end
|
Instance Method Details
#execute(custom_params) ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'lib/aliyun_open_search/syncs.rb', line 13
def execute(custom_params)
formatted_custom_params = Base.format_params(:post, custom_params)
params_with_signature = basic_params.merge(
"Signature" => Syncs.signature(basic_params.merge(formatted_custom_params))
)
Net::HTTP.post_form(uri(params_with_signature), formatted_custom_params)
end
|