Quantcast

Using the rest api to load the desired state

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using the rest api to load the desired state

rantav
I'd like to use the rest api to load a new desired state (update existing desired state).

Reading on this page https://github.com/linkedin/glu/wiki/Console there's a description of the console's rest API. I know it's a work in progress and that there's a CLI in the works.
Here's my question though:
The description for PUT /system/model says: Body contains a query string rootUrl=file:/xxx&release=yyy.

Perhaps it's my misunderstanding, but I was expecting a method (POST or PUT) which will let me upload a json document to the console to use as the desired state. If I understand correctly, the PUT /system/model will look for a URL. (rootUrl). Is this a URL of where such a json document should exist? Is there another method that simply puts a new desired state?
What is the recommended way to use the console's API to load a json document describing the desired state?

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using the rest api to load the desired state

frenchyan
Administrator
You are entirely correct. The method should be a POST and allow for the system in the body rather than providing a query string with the root. In its current state it is not even going to work for 2 reasons:

1) the cli is broken on trunk (I created and pushed a console-cli branch last week which contains the work in progress to have the cli working)
2) the rest_upload_model (@line 103 @ https://github.com/linkedin/glu/blob/console-cli/console/org.linkedin.glu.console-webapp/grails-app/controllers/org/linkedin/glu/console/controllers/ModelController.groovy ) is currently only accepting uri that are file:


      if(rootDir.scheme == 'file')
        rootDir = rootDir.path
      else
      {
        response.sendError HttpServletResponse.SC_BAD_REQUEST
        return
      }

so it is really wrong.

Having the cli working and support any kind of uri and also a BODY with the content is clearly on my short list of things to do.

Thanks
Yan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using the rest api to load the desired state

rantav
ok, so I suppose I just need to wait...
I have a related question about how to continue from here but I'll open another discussion for it.
thanks
Loading...