Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As an HTTP client, I can create an HTM model in a RESTful way #5

Closed
rhyolight opened this issue Dec 8, 2015 · 6 comments · Fixed by #15
Closed

As an HTTP client, I can create an HTM model in a RESTful way #5

rhyolight opened this issue Dec 8, 2015 · 6 comments · Fixed by #15

Comments

@rhyolight
Copy link
Contributor

Very simple endpoints:

  • POST /models: create model
    • body [JSON] example:
      • modelParams: same structure as the NuPIC / HTM.Java model params (sorry, we have no real spec for this, you'll just have to look at some example code)
      • predictedField [optional]: the string name of the field to be predicted (not necessary for anomaly models)
    • returns [JSON]: model id to identify the model instance for future calls ({"id":"asdf"})

Errors should return a non 200 status code representing the error as well as possible.

@rhyolight rhyolight changed the title As an HTTP client, I can start an HTM model and use it over HTTP in a RESTful way As an HTTP client, I can start an HTM model in a RESTful way Dec 8, 2015
@rhyolight
Copy link
Contributor Author

I updated the URLs in the description spec above to be more RESTful.

@rhyolight rhyolight changed the title As an HTTP client, I can start an HTM model in a RESTful way As an HTTP client, I can create an HTM model in a RESTful way Dec 8, 2015
@fergalbyrne
Copy link

Suggestion: There's an underlying default model spec (use Grok), so passing an empty JSON map gives you that. The JSON you give just overrides this map (using a merge).

@rhyolight
Copy link
Contributor Author

@fergalbyrne Yes, great idea. I will put that in another ticket.

@JonnoFTW
Copy link
Collaborator

JonnoFTW commented Dec 9, 2015

Does the api need to include the predicted field? Currently it's in the URL as /create/{predicted_field}. Doesn't seem very RESTy though.

@rhyolight
Copy link
Contributor Author

No, the predicted field is within the model params. (I was wrong, see example model params in next comment)

@rhyolight
Copy link
Contributor Author

Example POST payload here: https://gist.github.com/rhyolight/20c937c15e5ae3333f89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants