Method: Elasticsearch::API::MachineLearning::Actions#put_trained_model_vocabulary
- Defined in:
- lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb
#put_trained_model_vocabulary(arguments = {}) ⇒ Object
Creates a trained model vocabulary
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb', line 33 def put_trained_model_vocabulary(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_vocabulary' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/trained_models/#{Utils.__listify(_model_id)}/vocabulary" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |