SessionOperations Class
SessionOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.
Constructor
SessionOperations(client, config, serializer, deserializer)
Parameters
| Name | Description |
|---|---|
|
client
|
Client for service requests. |
|
config
|
Configuration of service client. |
|
serializer
|
An object model serializer. |
|
deserializer
|
An object model deserializer. |
Variables
| Name | Description |
|---|---|
|
models
|
Alias to model classes used in this operation group. |
Methods
| advance |
Advance the RL agent with the new state of the simulator, and returns an action computed by our policy. Simulatorsession is supposed to use the returned action for stepping inside the sim and thne getting the new state.false You can send the same state again, as long as you didn't get a Non-Idle Action back. Advance the RL agent with the new state of the simulator, and returns an action computed by our policy. Simulatorsession is supposed to use the returned action for stepping inside the sim and thne getting the new state.false You can send the same state again, as long as you didn't get a Non-Idle Action back. |
| create |
Registers a simulator with the Bonsai platform. Registers a simulator with the Bonsai platform. |
| delete |
Deletes the Simulator session. Deletes the Simulator session. |
| get |
Retrieves a simulator session corresponding to the sessionId. Retrieves a simulator session corresponding to the sessionId. |
| get_most_recent_action |
Gets the most recent action sent to the simulator to process. Gets the most recent action sent to the simulator to process. |
| list |
The deployment_mode appears in the query string. It can be one of Unspecified, Testing, or Hosted. If it has a 'neq:' prefix, that means "not;" e.g., {.../simulatorSessions?deployment_mode=neq:Hosted} means the response should not include simulators that are hosted. The session_status can be one of Attachable, Attached, Detaching, Rejected, and supports the neq: prefix. The collection appears in the query string The package appears in the query string The filter queries can appear together, like {.../simulatorSessions?deployment_mode=Hosted&collection=1234-455-33333}. Retrieves all of the simulators currently registered with all simulator gateways within this workspace. |
advance
Advance the RL agent with the new state of the simulator, and returns an action computed by our policy. Simulatorsession is supposed to use the returned action for stepping inside the sim and thne getting the new state.false You can send the same state again, as long as you didn't get a Non-Idle Action back.
Advance the RL agent with the new state of the simulator, and returns an action computed by our policy. Simulatorsession is supposed to use the returned action for stepping inside the sim and thne getting the new state.false You can send the same state again, as long as you didn't get a Non-Idle Action back.
advance(workspace_name, session_id, body, **kwargs)
Parameters
| Name | Description |
|---|---|
|
workspace_name
Required
|
The workspace identifier. |
|
session_id
Required
|
Unique identifier for the simulator. |
|
body
Required
|
The new state of the simulator. |
|
cls
Required
|
A custom type or function that will be passed the direct response |
Returns
| Type | Description |
|---|---|
|
Event, or the result of cls(response) |
create
Registers a simulator with the Bonsai platform.
Registers a simulator with the Bonsai platform.
create(workspace_name, body, **kwargs)
Parameters
| Name | Description |
|---|---|
|
workspace_name
Required
|
The workspace identifier. |
|
body
Required
|
Information and capabilities about the simulator. |
|
cls
Required
|
A custom type or function that will be passed the direct response |
Returns
| Type | Description |
|---|---|
|
SimulatorSessionResponse, or the result of cls(response) |
delete
Deletes the Simulator session.
Deletes the Simulator session.
delete(workspace_name, session_id, **kwargs)
Parameters
| Name | Description |
|---|---|
|
workspace_name
Required
|
The workspace identifier. |
|
session_id
Required
|
The session ID generated during registration. |
|
cls
Required
|
A custom type or function that will be passed the direct response |
Returns
| Type | Description |
|---|---|
|
None, or the result of cls(response) |
get
Retrieves a simulator session corresponding to the sessionId.
Retrieves a simulator session corresponding to the sessionId.
get(workspace_name, session_id, **kwargs)
Parameters
| Name | Description |
|---|---|
|
workspace_name
Required
|
The workspace identifier. |
|
session_id
Required
|
The sessionId of the simulator session to fetch. |
|
cls
Required
|
A custom type or function that will be passed the direct response |
Returns
| Type | Description |
|---|---|
|
SimulatorSessionResponse, or the result of cls(response) |
get_most_recent_action
Gets the most recent action sent to the simulator to process.
Gets the most recent action sent to the simulator to process.
get_most_recent_action(workspace_name, session_id, **kwargs)
Parameters
| Name | Description |
|---|---|
|
workspace_name
Required
|
The workspace identifier. |
|
session_id
Required
|
Unique identification of the simulator. |
|
cls
Required
|
A custom type or function that will be passed the direct response |
Returns
| Type | Description |
|---|---|
|
Event, or the result of cls(response) |
list
The deployment_mode appears in the query string. It can be one of Unspecified, Testing, or Hosted. If it has a 'neq:' prefix, that means "not;" e.g., {.../simulatorSessions?deployment_mode=neq:Hosted} means the response should not include simulators that are hosted.
The session_status can be one of Attachable, Attached, Detaching, Rejected, and supports the neq: prefix.
The collection appears in the query string
The package appears in the query string
The filter queries can appear together, like {.../simulatorSessions?deployment_mode=Hosted&collection=1234-455-33333}.
Retrieves all of the simulators currently registered with all simulator gateways within this workspace.
list(workspace_name, deployment_mode=None, session_status=None, collection=None, package=None, **kwargs)
Parameters
| Name | Description |
|---|---|
|
workspace_name
Required
|
The workspace identifier. |
|
deployment_mode
|
A specifier to filter on deployment mode. Default value: None
|
|
session_status
|
A specifier to filter on session status. Default value: None
|
|
collection
|
If present, only sessions in this collection. Default value: None
|
|
package
|
If present, only sessions in this package. Default value: None
|
|
cls
Required
|
A custom type or function that will be passed the direct response |
Returns
| Type | Description |
|---|---|
|
list of SimulatorSessionSummary, or the result of cls(response) |
Attributes
models
models = <module 'microsoft_bonsai_api.simulator.generated.models' from 'c:\\hostedtoolcache\\windows\\python\\3.6.8\\x64\\lib\\site-packages\\microsoft_bonsai_api\\simulator\\generated\\models\\__init__.py'>