POST Remotes
- POST /api/remotes
Creates a new remote connection from the Slycat server to another host. The caller must supply a remote hostname, username, and password.
If the connection is created successfully, a unique session ID is returned. The client must use the session ID in subsequent requests.
- Request Headers:
Content-Type – application/json
- Request JSON Object:
hostname (string) – Remote hostname.
username (string) – Remote host username.
password (string) – Remote host password.
agent (boolean) – (optional) Create an agent when the connection is established. By default, agents are created automatically if the hostname has an agent configuration. Use this parameter to explicitly require / prevent agent creation.
- Status Codes:
200 OK – The connection was created successfully.
400 Bad Request – “Missing agent configuration” The server isn’t configured to start an agent on the given hostname.
403 Forbidden – “Remote authentication failed” Authentication of the provided username and password failed.
500 Internal Server Error – “Missing agent configuration” The server isn’t properly configured to start an agent on the given hostname.
500 Internal Server Error – “Agent startup failed” The server couldn’t start an agent on the given hostname.
500 Internal Server Error – “Remote connection failed” Unknown failure making the remote connection.
- Response Headers:
Content-Type – application/json
- Response JSON Object:
sid (string) – Unique remote session identifier.
Sample Request
POST /remotes HTTP/1.1 Host: localhost:8092 Content-Length: 45 Accept-Encoding: gzip, deflate, compress Accept: */* User-Remote: python-requests/1.2.0 CPython/2.7.3 Linux/2.6.32-358.2.1.el6.x86_64 content-type: application/json Authorization: Basic c2x5Y2F0OnNseWNhdA== {"hostname":"example.com", "username":"fred", "password":"foobar"}
Sample Response
HTTP/1.1 200 OK. Date: Thu, 11 Apr 2013 21:30:16 GMT Content-Length: 42 Content-Type: application/json Location: http://localhost:8092/projects/505d0e463d5ed4a32bb6b0fe9a000d36 Server: CherryPy/3.2.2 {"sid": "505d0e463d5ed4a32bb6b0fe9a000d36"}