[lxc-users] lxd rest api / http method patch doesn't work

Stéphane Graber stgraber at ubuntu.com
Fri Aug 12 13:09:26 UTC 2016


Absolutely, you just need to use GET and PUT instead of patch, so
re-sending the whole thing with the bits you want changed updated.

PATCH is mostly a convenience around that process which then allows you
to just tell LXD what you want it to change rather than have to pass it
the whole thing again, makes things easier for folks poking at the API
with curl or similar tools.

On Thu, Aug 11, 2016 at 10:58:08PM -0700, Stan wrote:
> Hi Stéphane,
> 
> Thanks for the information! 
> 
> Is it possible to update container's configuration with rest api in lxd
> 2.0?
> 
> -- 
>   Stan
>   me at rooty.name
> 
> On Thu, Aug 11, 2016, at 10:10 PM, Stéphane Graber wrote:
> > On Thu, Aug 11, 2016 at 09:08:03PM -0700, Stan wrote:
> > > Hi,
> > > 
> > > According to this manual page:
> > > https://github.com/lxc/lxd/blob/master/doc/rest-api.md I can update
> > > container's configuration by using http PATH method call. 
> > > 
> > > So I was trying to send PATH to
> > > 'https://10.30.31.92:8443/1.0/containers/i-02204369' where "i-02204369"
> > > the name of my container.
> > > 
> > > I'm getting 404 response from lxd API: "u'{"error":"not
> > > found","error_code":404,"type":"error"}'".
> > > 
> > > # lxd --version
> > > 2.0.3
> > > 
> > > Can somebody confirm that it's broken/not implemented in 2.0.3? Or I'm
> > > doing something wrong?
> > 
> > 
> > That feature is in the current git branch and will be in LXD 2.1 but as
> > it's a new feature, it will not make it to our stable LTS branch (2.0)
> > which only gets bugfixes and security fixes.
> > 
> > Support for the feature can be checked by looking for the "patch" API
> > extension as reported by GET /1.0/
> > 
> > -- 
> > Stéphane Graber
> > Ubuntu developer
> > http://www.ubuntu.com
> > _______________________________________________
> > lxc-users mailing list
> > lxc-users at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-users
> > Email had 1 attachment:
> > + signature.asc
> >   1k (application/pgp-signature)
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160812/4e4a30f0/attachment.sig>


More information about the lxc-users mailing list