File tree 1 file changed +6
-7
lines changed
elasticsearch-api/lib/elasticsearch/api/actions/security
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,12 @@ def create_service_token(arguments = {})
47
47
48
48
_name = arguments . delete ( :name )
49
49
50
- if _namespace && _service && _name
51
- method = Elasticsearch ::API ::HTTP_PUT
52
- path = "_security/service/#{ Utils . __listify ( _namespace ) } /#{ Utils . __listify ( _service ) } /credential/token/#{ Utils . __listify ( _name ) } "
53
- else
54
- method = Elasticsearch ::API ::HTTP_POST
55
- path = "_security/service/#{ Utils . __listify ( _namespace ) } /#{ Utils . __listify ( _service ) } /credential/token"
56
- end
50
+ method = _name ? Elasticsearch ::API ::HTTP_PUT : Elasticsearch ::API ::HTTP_POST
51
+ path = if _namespace && _service && _name
52
+ "_security/service/#{ Utils . __listify ( _namespace ) } /#{ Utils . __listify ( _service ) } /credential/token/#{ Utils . __listify ( _name ) } "
53
+ else
54
+ "_security/service/#{ Utils . __listify ( _namespace ) } /#{ Utils . __listify ( _service ) } /credential/token"
55
+ end
57
56
params = Utils . process_params ( arguments )
58
57
59
58
Elasticsearch ::API ::Response . new (
You can’t perform that action at this time.
0 commit comments