You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by "J. Christopher Little" <jc...@gmail.com> on 2021/04/28 22:29:54 UTC
rest api
Are there any examples lying around for using the guacamole api in python
(or really any scripting language)?
Re: rest api
Posted by Peter De Tender <pe...@pdtit.be>.
Hey,
Sorry for the short delay, here are the steps I'm using in Azure LogicApps, but it's basically firing off Rest API Calls, so any such tool could help (Postman,...)
1. Get Guac Token
* POST http://104.40.xxx.xxx:8080/guacamole/api/tokens
2. Create new Guac User
* @http://104.40.xxx.xxx:8080/guacamole/<http://104.40.xxx.xxx:8080/guacamole/api/tokens>api/session/data/mysql/users?token=?'authToken'
where I'm using this as JSON syntax for the user creation:
{
"attributes": {
"access-window-end": "",
"access-window-start": "",
"disabled": "",
"expired": "",
"timezone": "",
"valid-from": "",
"valid-until": ""
},
"password": "C0mpl3xPa55w.rd",
"username": "Display Name"
}
3. Create new Guac Connection
* @http://104.40.xxx.xxx:8080/guacamole/<http://104.40.xxx.xxx:8080/guacamole/api/tokens>api/session/data/mysql/connections?token==?'authToken'
and this JSON
{
"activeConnections": 0,
"attributes": {
"failover-only": null,
"guacd-encryption": null,
"guacd-hostname": null,
"guacd-port": null,
"max-connections": null,
"max-connections-per-user": null,
"weight": null
},
"identifier": "",
"lastActive": 1588436949000,
"name": "<user display name>",
"parameters": {
"client-name": "",
"clipboard-encoding": "",
"color-depth": "",
"console": "",
"console-audio": "",
"create-drive-path": "",
"create-recording-path": "",
"cursor": "",
"dest-port": "",
"disable-audio": "",
"disable-auth": "",
"disable-bitmap-caching": "",
"disable-copy": "",
"disable-glyph-caching": "",
"disable-offscreen-caching": "",
"disable-paste": "",
"domain": "",
"dpi": "",
"drive-name": "",
"drive-path": "",
"enable-audio": "",
"enable-audio-input": "",
"enable-desktop-composition": "",
"enable-drive": "",
"enable-font-smoothing": "",
"enable-full-window-drag": "",
"enable-menu-animations": "",
"enable-printing": "",
"enable-sftp": "",
"enable-theming": "",
"enable-wallpaper": "",
"gateway-domain": "",
"gateway-hostname": "",
"gateway-password": "",
"gateway-port": "",
"gateway-username": "",
"height": "",
"hostname": "<enter public ip of the VM here>",
"ignore-cert": "true",
"initial-program": "",
"load-balance-info": "",
"password": "C0mpl3xPa55w.rd",
"port": "3389",
"preconnection-blob": "",
"preconnection-id": "",
"printer-name": "",
"read-only": "",
"recording-exclude-mouse": "",
"recording-exclude-output": "",
"recording-include-keys": "",
"recording-name": "",
"recording-path": "",
"remote-app": "",
"remote-app-args": "",
"remote-app-dir": "",
"resize-method": "",
"security": "nla",
"server-layout": "",
"sftp-directory": "",
"sftp-host-key": "",
"sftp-hostname": "",
"sftp-passphrase": "",
"sftp-password": "",
"sftp-port": "",
"sftp-private-key": "",
"sftp-root-directory": "",
"sftp-server-alive-interval": "",
"sftp-username": "",
"static-channels": "",
"swap-red-blue": "",
"timezone": "",
"username": "@{body('Get_user')?['displayName']}",
"width": ""
},
"parentIdentifier": "ROOT",
"protocol": "rdp"
}
1. Link Connection to User
* @http://104.40.xxx.xxx:8080/guacamole/<http://104.40.xxx.xxx:8080/guacamole/api/tokens>api/session/data/mysql/users/username/permissions?token=?authToken
and the following JSON
[
{
"op": "add",
"path": "/connectionPermissions/Connection/<Connectionidentifier>,
"value": "READ"
}
I hope this helps, ping me when having any questions,
kind regards, Peter
________________________________
From: Peter De Tender <pe...@pdtit.be>
Sent: Thursday, April 29, 2021 19:14
To: user@guacamole.apache.org <us...@guacamole.apache.org>; jchristopherlittle@gmail.com <jc...@gmail.com>
Subject: Re: rest api
I'm using Rest API to create users, connections and some other base settings.
I'll share some examples later tonight or tomorrow,
Thanks Peter
Get Outlook for Android<https://aka.ms/ghei36>
________________________________
From: Nick Couchman <vn...@apache.org>
Sent: Thursday, April 29, 2021 2:57:17 PM
To: user@guacamole.apache.org <us...@guacamole.apache.org>; jchristopherlittle@gmail.com <jc...@gmail.com>
Subject: Re: rest api
There are a few examples lurking about. Someone has written a PowerShell extension that's been posted to the list in a couple of different places. I've written a really small sample of Python code:
https://github.com/necouchman/guacamole-python
We are working on trying to document the REST API a little bit better - until we have that completed, the best place to go is to the Developer Console in the web browser, specifically the "Network" section. If you follow the calls made while browsing around the UI and doing things there (creating, updating, and deleting, users, groups, connections, adjusting permissions, etc.) you can see all of the various REST calls that are made.
If you have specific questions or run into issues, feel free to post back here and ask them.
-Nick
On Wed, Apr 28, 2021 at 6:30 PM J. Christopher Little <jc...@gmail.com>> wrote:
Are there any examples lying around for using the guacamole api in python (or really any scripting language)?
Re: rest api
Posted by Craig Sawyer <cs...@yumaed.org>.
I decided to share what I came up with, it's available here:
https://github.com/csawyerYumaed/pyguacamole
It lets you see if a user exists, adds a connection and a user and
gives permissions to a user to use said connection.
Tested once against Guacamole 1.3.0, python 3.6.9 and requests v2.25.1
On Thu, Apr 29, 2021 at 9:25 PM Navneet Singh <na...@dlx.solutions> wrote:
>
> Thank you Peter.
>
>
>
> Looking forward to your examples.
>
>
>
> From: Peter De Tender <pe...@pdtit.be>
> Reply-To: <us...@guacamole.apache.org>
> Date: Thursday, April 29, 2021 at 1:25 PM
> To: "user@guacamole.apache.org" <us...@guacamole.apache.org>, "jchristopherlittle@gmail.com" <jc...@gmail.com>
> Subject: Re: rest api
>
>
>
> I'm using Rest API to create users, connections and some other base settings.
>
> I'll share some examples later tonight or tomorrow,
>
> Thanks Peter
>
> Get Outlook for Android
>
>
>
> ________________________________
>
> From: Nick Couchman <vn...@apache.org>
> Sent: Thursday, April 29, 2021 2:57:17 PM
> To: user@guacamole.apache.org <us...@guacamole.apache.org>; jchristopherlittle@gmail.com <jc...@gmail.com>
> Subject: Re: rest api
>
>
>
> There are a few examples lurking about. Someone has written a PowerShell extension that's been posted to the list in a couple of different places. I've written a really small sample of Python code:
>
>
>
> https://github.com/necouchman/guacamole-python
>
>
>
> We are working on trying to document the REST API a little bit better - until we have that completed, the best place to go is to the Developer Console in the web browser, specifically the "Network" section. If you follow the calls made while browsing around the UI and doing things there (creating, updating, and deleting, users, groups, connections, adjusting permissions, etc.) you can see all of the various REST calls that are made.
>
>
>
> If you have specific questions or run into issues, feel free to post back here and ask them.
>
>
>
> -Nick
>
>
>
> On Wed, Apr 28, 2021 at 6:30 PM J. Christopher Little <jc...@gmail.com> wrote:
>
> Are there any examples lying around for using the guacamole api in python (or really any scripting language)?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org
Re: rest api
Posted by Navneet Singh <na...@dlx.solutions>.
Thank you Peter.
Looking forward to your examples.
From: Peter De Tender <pe...@pdtit.be>
Reply-To: <us...@guacamole.apache.org>
Date: Thursday, April 29, 2021 at 1:25 PM
To: "user@guacamole.apache.org" <us...@guacamole.apache.org>, "jchristopherlittle@gmail.com" <jc...@gmail.com>
Subject: Re: rest api
I'm using Rest API to create users, connections and some other base settings.
I'll share some examples later tonight or tomorrow,
Thanks Peter
Get Outlook for Android
From: Nick Couchman <vn...@apache.org>
Sent: Thursday, April 29, 2021 2:57:17 PM
To: user@guacamole.apache.org <us...@guacamole.apache.org>; jchristopherlittle@gmail.com <jc...@gmail.com>
Subject: Re: rest api
There are a few examples lurking about. Someone has written a PowerShell extension that's been posted to the list in a couple of different places. I've written a really small sample of Python code:
https://github.com/necouchman/guacamole-python
We are working on trying to document the REST API a little bit better - until we have that completed, the best place to go is to the Developer Console in the web browser, specifically the "Network" section. If you follow the calls made while browsing around the UI and doing things there (creating, updating, and deleting, users, groups, connections, adjusting permissions, etc.) you can see all of the various REST calls that are made.
If you have specific questions or run into issues, feel free to post back here and ask them.
-Nick
On Wed, Apr 28, 2021 at 6:30 PM J. Christopher Little <jc...@gmail.com> wrote:
Are there any examples lying around for using the guacamole api in python (or really any scripting language)?
Re: rest api
Posted by Peter De Tender <pe...@pdtit.be>.
I'm using Rest API to create users, connections and some other base settings.
I'll share some examples later tonight or tomorrow,
Thanks Peter
Get Outlook for Android<https://aka.ms/ghei36>
________________________________
From: Nick Couchman <vn...@apache.org>
Sent: Thursday, April 29, 2021 2:57:17 PM
To: user@guacamole.apache.org <us...@guacamole.apache.org>; jchristopherlittle@gmail.com <jc...@gmail.com>
Subject: Re: rest api
There are a few examples lurking about. Someone has written a PowerShell extension that's been posted to the list in a couple of different places. I've written a really small sample of Python code:
https://github.com/necouchman/guacamole-python
We are working on trying to document the REST API a little bit better - until we have that completed, the best place to go is to the Developer Console in the web browser, specifically the "Network" section. If you follow the calls made while browsing around the UI and doing things there (creating, updating, and deleting, users, groups, connections, adjusting permissions, etc.) you can see all of the various REST calls that are made.
If you have specific questions or run into issues, feel free to post back here and ask them.
-Nick
On Wed, Apr 28, 2021 at 6:30 PM J. Christopher Little <jc...@gmail.com>> wrote:
Are there any examples lying around for using the guacamole api in python (or really any scripting language)?
Re: rest api
Posted by Nick Couchman <vn...@apache.org>.
There are a few examples lurking about. Someone has written a PowerShell
extension that's been posted to the list in a couple of different places.
I've written a really small sample of Python code:
https://github.com/necouchman/guacamole-python
We are working on trying to document the REST API a little bit better -
until we have that completed, the best place to go is to the Developer
Console in the web browser, specifically the "Network" section. If you
follow the calls made while browsing around the UI and doing things there
(creating, updating, and deleting, users, groups, connections, adjusting
permissions, etc.) you can see all of the various REST calls that are made.
If you have specific questions or run into issues, feel free to post back
here and ask them.
-Nick
On Wed, Apr 28, 2021 at 6:30 PM J. Christopher Little <
jchristopherlittle@gmail.com> wrote:
> Are there any examples lying around for using the guacamole api in python
> (or really any scripting language)?
>