Method: NexosisApi::Client::Models#get_model

Defined in:
lib/nexosis_api/client/models.rb

#get_model(model_id) ⇒ NexosisApi::ModelSummary

Get the details of the particular model requested by id

Parameters:

  • model_id (String)

    The unique identifier for the model returned by a create-model session

Returns:

Raises:

  • (ArgumentError)

Since:

  • 1.3.0


37
38
39
40
41
42
43
44
45
46
# File 'lib/nexosis_api/client/models.rb', line 37

def get_model(model_id)
  raise ArgumentError, 'Retrieving a model requires that model_id be specified and it is currently null.' if model_id.nil?
  model_url = "/models/#{model_id}"
  response = self.class.get(model_url, @options)
  if (response.success?)
    NexosisApi::ModelSummary.new(response.parsed_response)
  else
    raise HttpException.new("There was a problem getting your model: #{response.code}.", "Could not get model #{model_id}", response)
  end
end