File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
elasticsearch-api/lib/elasticsearch/api/actions/connector Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -29,15 +29,13 @@ module Actions
29
29
# support SLA of official GA features.
30
30
#
31
31
# @option arguments [Hash] :headers Custom HTTP headers
32
- # @option arguments [Hash] :body The connector configuration. (*Required*)
32
+ # @option arguments [Hash] :body The connector configuration.
33
33
#
34
34
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-api.html
35
35
#
36
36
def post ( arguments = { } )
37
37
request_opts = { endpoint : arguments [ :endpoint ] || 'connector.post' }
38
38
39
- raise ArgumentError , "Required argument 'body' missing" unless arguments [ :body ]
40
-
41
39
arguments = arguments . clone
42
40
headers = arguments . delete ( :headers ) || { }
43
41
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ module Actions
30
30
#
31
31
# @option arguments [String] :connector_id The unique identifier of the connector to be created or updated.
32
32
# @option arguments [Hash] :headers Custom HTTP headers
33
- # @option arguments [Hash] :body The connector configuration. (*Required*)
33
+ # @option arguments [Hash] :body The connector configuration.
34
34
#
35
35
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-api.html
36
36
#
@@ -42,9 +42,6 @@ def put(arguments = {})
42
42
end
43
43
request_opts [ :defined_params ] = defined_params unless defined_params . empty?
44
44
45
- raise ArgumentError , "Required argument 'body' missing" unless arguments [ :body ]
46
- raise ArgumentError , "Required argument 'connector_id' missing" unless arguments [ :connector_id ]
47
-
48
45
arguments = arguments . clone
49
46
headers = arguments . delete ( :headers ) || { }
50
47
@@ -53,7 +50,11 @@ def put(arguments = {})
53
50
_connector_id = arguments . delete ( :connector_id )
54
51
55
52
method = Elasticsearch ::API ::HTTP_PUT
56
- path = "_connector/#{ Utils . __listify ( _connector_id ) } "
53
+ path = if _connector_id
54
+ "_connector/#{ Utils . __listify ( _connector_id ) } "
55
+ else
56
+ '_connector'
57
+ end
57
58
params = { }
58
59
59
60
Elasticsearch ::API ::Response . new (
You can’t perform that action at this time.
0 commit comments