You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Umesh Bhatt <um...@nuvepro.com> on 2019/09/19 03:36:42 UTC

Restful API for guacamole

Hi,

I want to integrate Guacamole with my application and want to use APIs to create and delete users/connections.
Is there Restful API to create user/connection and delete user/connection dynamically?

Regards,
Umesh

RE: Restful API for guacamole

Posted by Umesh Bhatt <um...@nuvepro.com>.
Hi,

Thanks, but I am not contributing anything. I am just trying to use Restful APIs.
I have noticed that Postman adds some header which was causing the issue for me. 
I tried with another Restful client (ARC - Advanced Rest Client) and it worked for me, you can also try same.

Regards,
Umesh


-----Original Message-----
From: mitsugoya <ma...@infoperso.me> 
Sent: Wednesday, October 23, 2019 4:28 PM
To: user@guacamole.apache.org
Subject: RE: Restful API for guacamole

Hi Umesh,

First thanks for the work you've been puting with documenting this API.

I would like to use it to automate a lot of things but i'm struggling with this one :
PATCH
{{url}}/guacamole/api/session/data/mysql/users/{{User}}/permissions?token={{Token}}

i'm also using postman, did check all headers but can't figure out why this call is not working, I always get internal server error when all other calls work without issue.

Do you by any chance have a curl request (that way I can figure what's wrong with my request) that works for this specific call ?

Many Thanks ;)

Regards,
Mitsugoya



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


RE: Restful API for guacamole

Posted by mitsugoya <ma...@infoperso.me>.
Hi Umesh,

First thanks for the work you've been puting with documenting this API.

I would like to use it to automate a lot of things but i'm struggling with
this one :
PATCH
{{url}}/guacamole/api/session/data/mysql/users/{{User}}/permissions?token={{Token}}

i'm also using postman, did check all headers but can't figure out why this
call is not working, I always get internal server error when all other calls
work without issue.

Do you by any chance have a curl request (that way I can figure what's wrong
with my request) that works for this specific call ?

Many Thanks ;)

Regards,
Mitsugoya



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


RE: Restful API for guacamole

Posted by Umesh Bhatt <um...@nuvepro.com>.
Hi,

Yes, you are correct it seems Postman app is adding a header though it is not showing in UI. Yesterday it worked and today it is again behaving strangely.

Now I tried with another restful client app and it is working fine. Thanks for info.

Regards,
Umesh

From: Nick Couchman <vn...@apache.org>
Sent: Tuesday, October 22, 2019 6:51 AM
To: user@guacamole.apache.org
Subject: Re: Restful API for guacamole

On Mon, Oct 21, 2019 at 12:52 AM Umesh Bhatt <um...@nuvepro.com>> wrote:
Hi,

Any inputs on this?

Regards,
Umesh
From: Umesh Bhatt
Sent: Thursday, October 17, 2019 9:23 AM
To: user@guacamole.apache.org<ma...@guacamole.apache.org>
Subject: RE: Restful API for guacamole

Hi,

I am making call from Postman REST client app.

I was able to try this in the Postman app and can do it without any error.  I suspect that, when you make your GET call to the activeConnection URL, you may still have the login parameters specified in the body of the Postman request.  In fact, when I try this in Postman - leaving the form parameters and leaving the encoding as "applicatino/x-www-form-urlencoded" in the GET request - I can reproduce the error behavior you're seeing.

When I am able to successfully make this work, I use one tab in Postman for the login, and a separate (new) one for the active connection request.

Here is the Postman code for the login request:

POST /guacamole/api/tokens HTTP/1.1
Host: 192.168.1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: PostmanRuntime/7.18.0
Accept: */*
Cache-Control: no-cache
Postman-Token: [redacted]
Host: 192.168.1.1
Accept-Encoding: gzip, deflate
Content-Length: 37
Connection: keep-alive
cache-control: no-cache

username=chips&password=avacado

And here is the Postman code for the active connection request:

GET /guacamole/api/session/data/postgresql/activeConnections?token=[redacted] HTTP/1.1
Host: 192.168.1.1
User-Agent: PostmanRuntime/7.18.0
Accept: */*
Cache-Control: no-cache
Postman-Token: [redacted]
Host: 192.168.1.1
Accept-Encoding: gzip, deflate
Connection: keep-alive
cache-control: no-cache
-Nick

Re: Restful API for guacamole

Posted by Nick Couchman <vn...@apache.org>.
On Mon, Oct 21, 2019 at 12:52 AM Umesh Bhatt <um...@nuvepro.com> wrote:

> Hi,
>
>
>
> Any inputs on this?
>
>
>
> Regards,
>
> Umesh
>
> *From:* Umesh Bhatt
> *Sent:* Thursday, October 17, 2019 9:23 AM
> *To:* user@guacamole.apache.org
> *Subject:* RE: Restful API for guacamole
>
>
>
> Hi,
>
>
>
> I am making call from Postman REST client app.
>

I was able to try this in the Postman app and can do it without any error.
I suspect that, when you make your GET call to the activeConnection URL,
you may still have the login parameters specified in the body of the
Postman request.  In fact, when I try this in Postman - leaving the form
parameters and leaving the encoding as "applicatino/x-www-form-urlencoded"
in the GET request - I can reproduce the error behavior you're seeing.

When I am able to successfully make this work, I use one tab in Postman for
the login, and a separate (new) one for the active connection request.

Here is the Postman code for the login request:

POST /guacamole/api/tokens HTTP/1.1
Host: 192.168.1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: PostmanRuntime/7.18.0
Accept: */*
Cache-Control: no-cache
Postman-Token: [redacted]
Host: 192.168.1.1
Accept-Encoding: gzip, deflate
Content-Length: 37
Connection: keep-alive
cache-control: no-cache

username=chips&password=avacado

And here is the Postman code for the active connection request:

GET
/guacamole/api/session/data/postgresql/activeConnections?token=[redacted]
HTTP/1.1
Host: 192.168.1.1
User-Agent: PostmanRuntime/7.18.0
Accept: */*
Cache-Control: no-cache
Postman-Token: [redacted]
Host: 192.168.1.1
Accept-Encoding: gzip, deflate
Connection: keep-alive
cache-control: no-cache

-Nick

>

RE: Restful API for guacamole

Posted by Umesh Bhatt <um...@nuvepro.com>.
Hi,

Any inputs on this?

Regards,
Umesh
From: Umesh Bhatt
Sent: Thursday, October 17, 2019 9:23 AM
To: user@guacamole.apache.org
Subject: RE: Restful API for guacamole

Hi,

I am making call from Postman REST client app.

GET   http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=F22A048F1324D38FCE64874428EAF99B1999C34036115D036796E8D5CC214CBB<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=F22A048F1324D38FCE64874428EAF99B1999C34036115D036796E8D5CC214CBB>


Error in log I am getting as following:

Oct 16, 2019 6:29:40 PM com.sun.jersey.spi.container.servlet.WebComponent filterFormParameters
WARNING: A servlet request, to the URI http://172.22.16.113:8080/guacamole/api/session/data/postgresql/activeConnections?token=F22A048F1324D38FCE64874428EAF99B1999C34036115D036796E8D5CC214CBB, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
18:29:40.993 [http-bio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper - An internal error occurred, but did not contain an error message. Enable debug-level logging for details.
18:29:41.130 [http-bio-8080-exec-3] DEBUG o.a.g.rest.RESTExceptionMapper - Unexpected error in REST endpoint.
javax.ws.rs.WebApplicationException: null
                at com.sun.jersey.server.impl.uri.rules.TerminatingRule.accept(TerminatingRule.java:66) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [jersey-servlet-1.17.1.jar:1.17.1]
                at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [jersey-servlet-1.17.1.jar:1.17.1]
                at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [jersey-servlet-1.17.1.jar:1.17.1]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) [tomcat-servlet-api-3.0.jar:na]
                at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) [guice-servlet-3.0.jar:na]
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) [tomcat-coyote-7.0.68.jar:7.0.68]
                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) [tomcat-coyote-7.0.68.jar:7.0.68]
                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [tomcat-coyote-7.0.68.jar:7.0.68]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_222]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_222]
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote-7.0.68.jar:7.0.68]
                at java.lang.Thread.run(Thread.java:748) [na:1.8.0_222]

From: Nick Couchman <vn...@apache.org>>
Sent: Wednesday, October 16, 2019 7:18 PM
To: user@guacamole.apache.org<ma...@guacamole.apache.org>
Subject: Re: Restful API for guacamole



On Tue, Oct 15, 2019 at 6:34 AM Umesh Bhatt <um...@nuvepro.com>> wrote:
Hi,

This is GET call and there is no FormParam in this call only QueryParam.

Following is the error I am seeing in catalina.out.
WARNING: A servlet request, to the URI http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18>, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
15:56:29.260 [http-bio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper - An internal error occurred, but did not contain an error message. Enable debug-level logging for details.

Two things
1) Can you show the code or command you're using to issue the request?
2) Can you enable debug mode and see what other messages might be generated?

http://guacamole.apache.org/doc/gug/configuring-guacamole.html#webapp-logging

-Nick

RE: Restful API for guacamole

Posted by Umesh Bhatt <um...@nuvepro.com>.
Hi,

I am making call from Postman REST client app.

GET   http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=F22A048F1324D38FCE64874428EAF99B1999C34036115D036796E8D5CC214CBB


Error in log I am getting as following:

Oct 16, 2019 6:29:40 PM com.sun.jersey.spi.container.servlet.WebComponent filterFormParameters
WARNING: A servlet request, to the URI http://172.22.16.113:8080/guacamole/api/session/data/postgresql/activeConnections?token=F22A048F1324D38FCE64874428EAF99B1999C34036115D036796E8D5CC214CBB, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
18:29:40.993 [http-bio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper - An internal error occurred, but did not contain an error message. Enable debug-level logging for details.
18:29:41.130 [http-bio-8080-exec-3] DEBUG o.a.g.rest.RESTExceptionMapper - Unexpected error in REST endpoint.
javax.ws.rs.WebApplicationException: null
                at com.sun.jersey.server.impl.uri.rules.TerminatingRule.accept(TerminatingRule.java:66) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [jersey-server-1.17.1.jar:1.17.1]
                at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [jersey-servlet-1.17.1.jar:1.17.1]
                at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [jersey-servlet-1.17.1.jar:1.17.1]
                at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [jersey-servlet-1.17.1.jar:1.17.1]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) [tomcat-servlet-api-3.0.jar:na]
                at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) [guice-servlet-3.0.jar:na]
                at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) [guice-servlet-3.0.jar:na]
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) [tomcat-catalina-7.0.68.jar:7.0.68]
                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) [tomcat-coyote-7.0.68.jar:7.0.68]
                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) [tomcat-coyote-7.0.68.jar:7.0.68]
                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [tomcat-coyote-7.0.68.jar:7.0.68]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_222]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_222]
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote-7.0.68.jar:7.0.68]
                at java.lang.Thread.run(Thread.java:748) [na:1.8.0_222]

From: Nick Couchman <vn...@apache.org>
Sent: Wednesday, October 16, 2019 7:18 PM
To: user@guacamole.apache.org
Subject: Re: Restful API for guacamole



On Tue, Oct 15, 2019 at 6:34 AM Umesh Bhatt <um...@nuvepro.com>> wrote:
Hi,

This is GET call and there is no FormParam in this call only QueryParam.

Following is the error I am seeing in catalina.out.
WARNING: A servlet request, to the URI http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18>, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
15:56:29.260 [http-bio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper - An internal error occurred, but did not contain an error message. Enable debug-level logging for details.

Two things
1) Can you show the code or command you're using to issue the request?
2) Can you enable debug mode and see what other messages might be generated?

http://guacamole.apache.org/doc/gug/configuring-guacamole.html#webapp-logging

-Nick

Re: Restful API for guacamole

Posted by Nick Couchman <vn...@apache.org>.
On Tue, Oct 15, 2019 at 6:34 AM Umesh Bhatt <um...@nuvepro.com> wrote:

> Hi,
>
>
>
> This is GET call and there is no FormParam in this call only QueryParam.
>
>
>
> Following is the error I am seeing in catalina.out.
>
> WARNING: A servlet request, to the URI http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18,
> contains form parameters in the request body but the request body has been
> consumed by the servlet or a servlet filter accessing the request
> parameters. Only resource methods using @FormParam will work as expected.
> Resource methods consuming the request body by other means will not work as
> expected.
>
> 15:56:29.260 [http-bio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper -
> An internal error occurred, but did not contain an error message. Enable
> debug-level logging for details.
>

Two things
1) Can you show the code or command you're using to issue the request?
2) Can you enable debug mode and see what other messages might be generated?

http://guacamole.apache.org/doc/gug/configuring-guacamole.html#webapp-logging

-Nick

>

RE: Restful API for guacamole

Posted by Umesh Bhatt <um...@nuvepro.com>.
Hi,

Any inputs on what am I missing?

Regards,
Umesh
From: Umesh Bhatt
Sent: Tuesday, October 15, 2019 4:04 PM
To: user@guacamole.apache.org
Subject: RE: Restful API for guacamole

Hi,

This is GET call and there is no FormParam in this call only QueryParam.

Following is the error I am seeing in catalina.out.
WARNING: A servlet request, to the URI http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18>, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
15:56:29.260 [http-bio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper - An internal error occurred, but did not contain an error message. Enable debug-level logging for details.

Regards,
Umesh

From: Nick Couchman <vn...@apache.org>>
Sent: Tuesday, October 15, 2019 4:01 PM
To: user@guacamole.apache.org<ma...@guacamole.apache.org>
Subject: Re: Restful API for guacamole

On Tue, Oct 15, 2019 at 6:26 AM Umesh Bhatt <um...@nuvepro.com>> wrote:
Hi,

I am using with my server (1.0.0) to get a token but unable to use that token for getting active connections and other details.

To get a Token:

POST
http://<GUACAMOLE_SERVER>/guacamole/api/tokens<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/tokens>

form data1: username
form data2: password

This API returns a new token but when I want to use it, fails with following error.

GET
http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=57964FF786C7F4E0B5DE75E5C202782081842173A885828D5433F73A6951590F><RETRIEVED_TOKEN>

Error:
{
    "message": "Unexpected internal error",
    "translatableMessage": {
        "key": "Unexpected internal error",
        "variables": null
    },
    "statusCode": null,
    "expected": null,
    "type": "INTERNAL_ERROR"
}

Is there an error in catalina.out (or wherever your Java application server logs errors) that provides any further detail?

-Nick

RE: Restful API for guacamole

Posted by Umesh Bhatt <um...@nuvepro.com>.
Hi,

This is GET call and there is no FormParam in this call only QueryParam.

Following is the error I am seeing in catalina.out.
WARNING: A servlet request, to the URI http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=8C9FD128866B8965C8485C42DA3CF7C9EBC4C15F0FC99D2CE4495A06EFF02B18, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
15:56:29.260 [http-bio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper - An internal error occurred, but did not contain an error message. Enable debug-level logging for details.

Regards,
Umesh

From: Nick Couchman <vn...@apache.org>
Sent: Tuesday, October 15, 2019 4:01 PM
To: user@guacamole.apache.org
Subject: Re: Restful API for guacamole

On Tue, Oct 15, 2019 at 6:26 AM Umesh Bhatt <um...@nuvepro.com>> wrote:
Hi,

I am using with my server (1.0.0) to get a token but unable to use that token for getting active connections and other details.

To get a Token:

POST
http://<GUACAMOLE_SERVER>/guacamole/api/tokens<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/tokens>

form data1: username
form data2: password

This API returns a new token but when I want to use it, fails with following error.

GET
http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=57964FF786C7F4E0B5DE75E5C202782081842173A885828D5433F73A6951590F><RETRIEVED_TOKEN>

Error:
{
    "message": "Unexpected internal error",
    "translatableMessage": {
        "key": "Unexpected internal error",
        "variables": null
    },
    "statusCode": null,
    "expected": null,
    "type": "INTERNAL_ERROR"
}

Is there an error in catalina.out (or wherever your Java application server logs errors) that provides any further detail?

-Nick

Re: Restful API for guacamole

Posted by Nick Couchman <vn...@apache.org>.
On Tue, Oct 15, 2019 at 6:26 AM Umesh Bhatt <um...@nuvepro.com> wrote:

> Hi,
>
>
>
> I am using with my server (1.0.0) to get a token but unable to use that
> token for getting active connections and other details.
>
>
>
> To get a Token:
>
>
>
> POST
>
> http://<GUACAMOLE_SERVER>/guacamole/api/tokens
>
>
>
> form data1: username
>
> form data2: password
>
>
>
> This API returns a new token but when I want to use it, fails with
> following error.
>
>
>
> GET
>
>
> http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=
> <http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=57964FF786C7F4E0B5DE75E5C202782081842173A885828D5433F73A6951590F>
> <RETRIEVED_TOKEN>
>
>
>
> Error:
>
> {
>
>     "message": "Unexpected internal error",
>
>     "translatableMessage": {
>
>         "key": "Unexpected internal error",
>
>         "variables": null
>
>     },
>
>     "statusCode": null,
>
>     "expected": null,
>
>     "type": "INTERNAL_ERROR"
>
> }
>
>
Is there an error in catalina.out (or wherever your Java application server
logs errors) that provides any further detail?

-Nick

>

RE: Restful API for guacamole

Posted by Umesh Bhatt <um...@nuvepro.com>.
Hi,

I am using with my server (1.0.0) to get a token but unable to use that token for getting active connections and other details.

To get a Token:

POST
http://<GUACAMOLE_SERVER>/guacamole/api/tokens<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/tokens>

form data1: username
form data2: password

This API returns a new token but when I want to use it, fails with following error.

GET
http://<GUACAMOLE_SERVER>/guacamole/api/session/data/postgresql/activeConnections?token=<http://%3cGUACAMOLE_SERVER%3e/guacamole/api/session/data/postgresql/activeConnections?token=57964FF786C7F4E0B5DE75E5C202782081842173A885828D5433F73A6951590F><RETRIEVED_TOKEN>

Error:
{
    "message": "Unexpected internal error",
    "translatableMessage": {
        "key": "Unexpected internal error",
        "variables": null
    },
    "statusCode": null,
    "expected": null,
    "type": "INTERNAL_ERROR"
}

Can you pls tell me if I need to copy any jar or something else to make it work?

Regards,
Umesh


From: Richard Lancaster <ri...@osirium.com>
Sent: Thursday, September 19, 2019 2:06 PM
To: user@guacamole.apache.org
Subject: Re: Restful API for guacamole

There's an unmerged PR with documentation for the Rest API provided by Guacamole: https://github.com/apache/guacamole-manual/pull/123.
I hope this is helpful.

Thanks,
Richard
________________________________
From: Umesh Bhatt <um...@nuvepro.com>>
Sent: 19 September 2019 04:36
To: user@guacamole.apache.org<ma...@guacamole.apache.org> <us...@guacamole.apache.org>>
Subject: Restful API for guacamole


Hi,



I want to integrate Guacamole with my application and want to use APIs to create and delete users/connections.

Is there Restful API to create user/connection and delete user/connection dynamically?



Regards,

Umesh

Re: Restful API for guacamole

Posted by Richard Lancaster <ri...@osirium.com>.
There's an unmerged PR with documentation for the Rest API provided by Guacamole: https://github.com/apache/guacamole-manual/pull/123.
I hope this is helpful.

Thanks,
Richard
________________________________
From: Umesh Bhatt <um...@nuvepro.com>
Sent: 19 September 2019 04:36
To: user@guacamole.apache.org <us...@guacamole.apache.org>
Subject: Restful API for guacamole


Hi,



I want to integrate Guacamole with my application and want to use APIs to create and delete users/connections.

Is there Restful API to create user/connection and delete user/connection dynamically?



Regards,

Umesh