I am writing to request assistance regarding the POST /1.0/sessions endpoint in the Anbox Streaming Gateway as documented in the Swagger UI (Swagger UI). I have encountered two main issues:
Lack of Documentation for Request Body: In the Swagger UI, the POST /1.0/sessions request is shown, but the request body is not documented, resulting in an empty object. Could you please provide detailed documentation on the required structure and parameters for the request body?
Starting an Application with ADB Ports Exposed: Additionally, I would like to know if there is a way to start an application with ADB ports exposed using this endpoint, aiming to achieve the equivalent of the -s +adb flag in the amc launch command… If so, could you provide guidance or examples on how to achieve this?
// Screen represents a session screen specification
type Screen struct {
// Width of the screen
Width int `json:"width" minimum:"1" example:"1280"`
// Height of the screen
Height int `json:"height" minimum:"1" example:"720"`
// FPS the video stream will use
FPS int `json:"fps" minimum:"1" example:"25"`
// Display density Android will be configured with. See https://developer.android.com/training/multiscreen/screendensities
// for more details
Density int `json:"density" minimum:"72" default:"240" example:"240"`
}
// SessionPost is used to create a new session for the specified application
// and configuration
type SessionPost struct {
// Region the session should be created in. If left empty a region is randomly
// selected.
Region string `json:"region,omitempty" example:"us-west-1"`
// Application the session should be created for
App string `json:"app" example:"com.foo.bar"`
// Which specific version of the application to launch for the session. If
// not specified, the last published version is launched.
AppVersion *int `json:"app_version,omitempty" example:"0"`
// Definition of the screen dimensions. The maximum allowd screen resolution is
// 4k (3840 x 2160).
Screen Screen `json:"screen"`
// Makes the session joinable by another client after the initial client left.
// Requires idle_time_min to be set.
Joinable bool `json:"joinable" example:"true"`
// Time in minutes a session stays idle without any client connected. The
// value "0" is special and causes the container to stay alive until the
// session is terminated by an API call or the container decide on its own
// to shutdown.
IdleTimeMin *int `json:"idle_time_min,omitempty" example:"5"`
// Extra data passed as part of the userdata to the container
ExtraData json.RawMessage `json:"extra_data,omitempty" example:"userid=123"`
// Ephemeral controls whether the session should be deleted after the client
// disconnects or not. If the containers runs into an error, the session is kept
// if with Ephemeral set to true.
Ephemeral *bool `json:"ephemeral,omitempty" example:"false" default:"true"`
}
Is it possible to set an idle time for the instance using this new API, similar to how it is currently done with the session.idle_time_min field in the Anbox Streaming SDK? If not, is this something that needs to be managed manually?
For 1., there is currently no plan to add this new API to the Anbox Streaming SDK.
For 2., it’s currently not possible with this new API. You will need to manage this manually, or you first create an application with the services you want (see POST /1.0/applications), and then create a session from that application.
In both cases, please file a request in our bug tracker if you want us to add these features to future versions.
Thank you so much for the detailed clarifications and your kindness in addressing my questions. I greatly appreciate the time you took to help me understand the new API and its features.