GET Remote Image

GET /remotes/(sid)/image(path)

Uses an existing remote session to retrieve a remote image. The remote session must have been created using POST /remotes, and the session must have a running agent. Use POST /remotes/(sid)/browse(path) to lookup remote file paths. The returned file may be optionally cached on the server and retrieved using GET /projects/(pid)/cache/(key).

The caller may optionally choose to resize the image and / or convert it to another file type. Note that this can reduce performance significantly as the remote must then decompress, resample, and recompress the image before sending it to the client. Testing should be performed to verify that the bandwidth reduction of a smaller image is worth the increased latency.

Parameters:
  • sid (string) – Unique session identifier returned from POST /remotes.
  • path (string) – Remote filesystem absolute path to be retrieved.
Query Parameters:
 
  • content-type (string) – Optional image content type to return. Currently limited to image/jpeg or image/png. If the requested content type doesn’t match the content type of the remote image, it will be converted.
  • max-size (int) – Optional maximum image size in pixels along either dimension. Images larger than this size will be resized to fit while maintaining their aspect ratio.
  • max-width (int) – Optional maximum image width. Wider images will be resized to fit while maintaining their aspect ratio.
  • max-height (int) – Optional maximum image height. Taller images will be resized to fit while maintaining their aspect ratio.
  • cache – Optional cache identifier. Set to project to store the retrieved image in a project cache.
  • project – Project identifier. Required when cache is set to project.
  • key – Cached object key. Must be specified when cache is set to project.
Status Codes:
  • 200 OK – The requested file is returned in the body of the response.
  • 400 Bad Request – “Access denied” The session user doesn’t have permissions to access the file.
  • 400 Bad Request – “Agent required” This call requires a remote agent, but the current session isn’t running an agent.
  • 400 Bad Request – “Can’t read directory” The remote path is a directory instead of a file.
  • 400 Bad Request – “File not found” The remote path doesn’t exist.
  • 404 Not Found – The session doesn’t exist or has timed-out.
Response Headers:
 
  • Content-Type – image/jpeg or image/png, depending on the type of the remote file and optional conversion.
  • X-Slycat-Message – For errors, contains a human-readable description of the problem.
  • X-Slycat-Hint – For errors, contains an optional description of how to fix the problem.

Sample Request

GET /remotes/505d0e463d5ed4a32bb6b0fe9a000d36/image/home/fred/avatar.png?content-type=image/jpeg&max-width=64