0

I am currently using jpmml openscoring REST API..

I have successfully installed Maven and built the uber-JAR file and I am also able to access

http://localhost:8080/OpenScoring/rules.pmml 

I am confused with the instructions given at

https://github.com/jpmml/openscoring.

It says the sample curl invocation is

curl -X GET htttp://localhost:8080/openscoring/model

but I am getting a 404 error when I try to implement this. What does model mean here?

I am getting an output when I implement this:

curl -X GET htttp://localhost:8080/Openscoring/rules.pmml
Anik Islam Abhi
  • 25,137
  • 8
  • 58
  • 80
Raj
  • 35
  • 1
  • 9
  • They have a nice Description of all their REST Endpoints in their readme.md file a few blocks above The example you've mentioned. Getting a 404 either means you have no models or you have typo within the url. Maybe the first l in localhost was missing. – andih Oct 29 '14 at 05:54
  • No the l is not missing. I deliberately removed it while writing here because because stackoverflow was not accepting links with localhost:8080 in them. It you observe closely,I have also written htttp insted of http – Raj Oct 29 '14 at 06:01
  • Have deployed any models? What happens if you try to deploy one? It's the same URL using a `PUT` instead of a `GET` and requires according to documentation admin privileges. About your question what `model` means here. It's just the endpoint of the ReST resource . If you call the openscoring service using a `GET` it returns (should) all models. The documentation does not say what it returns in the case that no models are deployed. – andih Oct 29 '14 at 07:13
  • Currently,I do not have admin privileges.The document says, I can use /model/{id} end point for POST in-spite of not having admin privileges. But when I use POST with /model/{id} end point, I am getting an error. but when I use post with just OpenScoring/rules.pmml as the end point I am getting a result – Raj Oct 29 '14 at 07:45
  • If all the URLs given as example work without the `model`it seems that the documentation does not describe (correctly) your version - simply ignore `model`. What happens if you try the client examples at the end of the documentation. Do they work with or without the `model` in the urls? – andih Oct 29 '14 at 08:59
  • Now the problem has been solved. I just moved my rules.pmml to c:\users\username folder and now everything is fine. and yes as you said model is just an Endpoint of REST source. I am sorry for wasting your time with my stupid mistake – Raj Oct 29 '14 at 11:22

2 Answers2

0

The /model/ part of the path identifies the resource type. The general formula for the path component of Openscoring service URLs is /<context path>/<resource type>/<resource identifier>/<action>

In your case (assuming that the model identifier is rules.pmml), the correct path component would be /openscoring/model/rules.pmml.

user1808924
  • 4,563
  • 2
  • 17
  • 20
  • Sorry, but that's wrong. `/model` is something, I would call it, "list of models". `/model/${id}`is the resource / represenation of a single model an `/model/${id}/schema` is the resource of the data schema of a concrete model identified by `id`. It's not an action. – andih Oct 29 '14 at 07:25
0

I was getting a 404 error as I did not put my rules.pmml file in the directory which my command prompt pointed to.(This was a very silly mistake)

And thanks to the user Anik Islam Abhi in the comments, I found out what model in the invocation

curl -X GET htttp://localhost:8080/openscoring/model meant.

model is just an Endpoint of the REST source but not a directory in the openscoring folder or any kind of path.

Raj
  • 35
  • 1
  • 9