Skip to end of metadata
Go to start of metadata

You can use these REST API methods to query details about IPSec VPN and Sauce Connect tunnels. Please note that the URL hostname and authorization credentials are different for each Sauce data center.

Sauce datacenterURL hostnameAuthorization credentials
US virtual devices and desktops cloudhttps://saucelabs.com/Username and access key can be found under User Profile > User Settings section at https://saucelabs.com/
EU virtual devices and desktops cloudhttps://eu-central-1.saucelabs.com/Username and access key can be found under User Profile > User Settings section at https://eu-central-1.saucelabs.com/
US real devices cloudhttps://us1.api.testobject.com/sc/Username and API key can be found under account settings at https://app.testobject.com/
EU real devices cloudhttps://eu1.api.testobject.com/sc/Username and API key can be found under account settings at https://app.testobject.com/

Get Tunnels

Retrieves all running tunnels for a specific user

GET /rest/v1/:username/tunnels
curl -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/tunnels
Example response in JSON list format
["fc2c9e60747f420d8b37d67bfc808e48", "50cad41d2e7f44158313222da6dfecda"]
 Click here to see details on response fields...

The response is a comma separated list of tunnel id's currently active for the given username

Get Tunnel

Get information for a tunnel given its ID

GET /rest/v1/USERNAME/tunnels/TUNNEL_ID
curl -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/tunnels/TUNNEL_ID
Example response in JSON dictionary format
{"status": "running", "direct_domains": null, "vm_version": null, "last_connected": 1488228665, "shutdown_time": null, "ssh_port": 443, "launch_time": 1488228346, "user_shutdown": null, "use_caching_proxy": null, "creation_time": 1488228343, "domain_names": ["sauce-connect.proxy"], "shared_tunnel": false, "tunnel_identifier": null, "host": "maki79019.miso.saucelabs.com", "no_proxy_caching": false, "owner": "acampbell", "use_kgp": true, "extra_info": null, "no_ssl_bump_domains": null, "id": "50cad41d2e7f44158313222da6dfecda", "metadata": {"hostname": "Andrews-MacBook-Air-2.local", "git_version": "4c4d452-n -dirty", "platform": "Darwin 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan  9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64", "command": "/Users/acampbell/Documents/sc-4.4.3-osx/bin/sc -u acampbell -k **** --pidfile currentA --se-port 4445 ", "build": "3214", "release": "4.4.3", "nofile_limit": 10240}}
 Click here to see details on response fields...

(warning) All time based fields below are represented in Unix time

 ValueMeaning
status

server side state of Sauce Connect Proxy. In order, the possible values are 'new','booting','deploying','running','halting','terminated'

This field doesn't reflect the state of the end-to-end connection and should not be used for monitoring tunnel health. Status can remain 'running' even after a firewall cuts off all traffic from the Sauce Connect client.

direct_domainsuser submitted value, see Sauce Connect Command Line Reference for details (--direct-domains)
vm_versionuser submitted value, see Sauce Connect Command Line Reference for details (--vm-version)
last_connectedlast time the client side instance of Sauce Connect Proxy successfully called a private REST api endpoint to 'check in'
shutdown_timetime when the server side instance of Sauce Connect Proxy completed shutdown
ssh_portdeprecated field
launch_timetime when the server side instance of Sauce Connect Proxy enters the 'new' status
user_shutdownBoolean value; 'true' if the REST api was used to close the tunnel, 'false' for any other reason.
use_caching_proxydeprecated field
creation_timetime when the server side instance of Sauce Connect Proxy enters the 'running' status
domain_namesdeprecated field
shared_tunneluser submitted value, see Sauce Connect Command Line Reference for details (--shared-tunnel)
tunnel_identifieruser submitted value, see Sauce Connect Command Line Reference for details (--tunnel-identifier)
hosthostname of the machine running the server side instance of Sauce Connect Proxy
no_proxy_cachinguser submitted value, see Sauce Connect Command Line Reference for details (--no-proxy-caching)
owneruser submitted value, see Sauce Connect Command Line Reference for details (--user)
use_kgpdeprecated field
extra_infofor Sauce Labs developer use only
no_ssl_bump_domainsuser submitted value, see Sauce Connect Command Line Reference for details (--no-ssl-bump-domains)
ididentification number associated with the server side instance of Sauce Connect Proxy
metadatametadata about the host operating system where the client side instance of Sauce Connect Proxy is running
git_versionthe git release number associated with the client side version of Sauce Connect Proxy
platformbasic information about the host operating system where the client side instance of Sauce Connect Proxy is running
commandlist of arguments submitted when starting the client side instance of Sauce Connect Proxy
buildclient side build value of the Sauce Connect Proxy version running
releaseclient side release value of the Sauce Connect Proxy version running
nofile_limitthe ulimit value associated with the client side process of Sauce Connect Proxy, we suggest at least 8000

Get Tunnel Info: Number of Running Jobs

Get the number of jobs that are running through the tunnel over the past 60 seconds.  

GET /rest/v1/USERNAME/tunnels/TUNNEL_ID/num_jobs
curl -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/tunnels/TUNNEL_ID/num_jobs

Delete Tunnel

Shuts down a tunnel given its ID. Note that this method is not available for IPSec VPN tunnels.

DELETE /rest/v1/USERNAME/tunnels/TUNNEL_ID
curl -X DELETE -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/tunnels/TUNNEL_ID
Example response in JSON dictionary format
{"jobs_running": 0, "result": true, "id": "50cad41d2e7f44158313222da6dfecda"}
 Click here to see details on response fields...
 ValueMeaning
ididentification number associated with the server side instance of Sauce Connect Proxy
jobs_runningthe number of tests actively using the tunnel when the delete request was received
resultboolean: 'true' if request to close tunnel was successfully received, 'false' if it was not