# fuchsia.session

<br />

Added: 7

## **PROTOCOLS**

## Launcher

*Defined in [fuchsia.session/launcher.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/launcher.fidl;l=11)*

A protocol used to launch sessions.

<br />

### Launch

Launches the session detailed in `configuration`.

If a session is currently running, the component associated with the running
session will be destroyed.

- `configuration` describes the session to launch.

<!-- -->

- error `LaunchError.INVALID_ARGS` if `configuration.session_url` is not set.
- error `LaunchError.NOT_FOUND` if `configuration.session_url` could not be resolved.
- error `LaunchError.DESTROY_COMPONENT_FAILED` if an existing session component could not be destroyed. The existing session remains running at this point.
- error `LaunchError.CREATE_COMPONENT_FAILED` if the session component could not be started. No session will be running at this point.

#### Request

| Name | Type |
|---|---|
| `configuration` | `https://fuchsia.dev/reference/fidl/fuchsia.session#LaunchConfiguration` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Launcher_Launch_Result` |

## Lifecycle

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=11)*

A protocol used to control the session's lifecycle.
Added: 13

<br />

### Restart

Restarts the session.

This stops the existing session and starts a new session with the same
session URL as the previous one.

Returns once the new session component has been created and started.

- error `LifecycleError.NOT_FOUND` if there is no existing session.
- error `LifecycleError.RESOLVE_COMPONENT_FAILED` if the session URL could not be resolved to a component.
- error `LifecycleError.DESTROY_COMPONENT_FAILED` if the session component could not be destroyed. The previous session will continue to exist at this point and the component may be running.
- error `LifecycleError.CREATE_COMPONENT_FAILED` if the session component could not be started. No session will be running at this point.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Lifecycle_Restart_Result` |

### Start

Starts the session.

Returns after the session component has been created and started.

- error `LifecycleError.NOT_FOUND` if `session_url` has not been provided and there is no configured default session URL.
- error `LifecycleError.ALREADY_STARTED` if a session has already been started.
- error `LifecycleError.RESOLVE_COMPONENT_FAILED` if `session_url` could not be resolved to a component.
- error `LifecycleError.DESTROY_COMPONENT_FAILED` if an existing session component could not be destroyed. The existing session remains running at this point.
- error `LifecycleError.CREATE_COMPONENT_FAILED` if the session component could not be started. No session will be running at this point.

#### Request

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.session#LifecycleStartRequest` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Lifecycle_Start_Result` |

### Stop

Stops the session.

Returns after the session component has been destroyed.

- error `LifecycleError.NOT_FOUND` if the session has not been started.
- error `LifecycleError.DESTROY_COMPONENT_FAILED` if the session component could not be destroyed. The previous session will continue to exist at this point and the component may be running.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Lifecycle_Stop_Result` |

## Restarter

*Defined in [fuchsia.session/restarter.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/restarter.fidl;l=8)*

A protocol used to restart the currently running session.

<br />

### Restart

Restarts the session.

- error `RestartError.NOT_RUNNING` if there is no currently running session to restart.
- error `RestartError.DESTROY_COMPONENT_FAILED` if an existing session component could not be destroyed. The existing session remains running at this point.
- error `RestartError.CREATE_COMPONENT_FAILED` if the session component could not be started. No session will be running at this point.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Restarter_Restart_Result` |

## **STRUCTS**

### Launcher_Launch_Response

*Defined in [fuchsia.session/launcher.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/launcher.fidl;l=27)*

\<EMPTY\>

### Lifecycle_Restart_Response

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=57)*

\<EMPTY\>

### Lifecycle_Start_Response

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=30)*

\<EMPTY\>

### Lifecycle_Stop_Response

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=40)*

\<EMPTY\>

### Restarter_Restart_Response

*Defined in [fuchsia.session/restarter.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/restarter.fidl;l=17)*

\<EMPTY\>

## **ENUMS**

### LaunchError [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.session/launcher.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/launcher.fidl;l=31)*

An error that occurs when launching a session.

<br />

| Name | Value | Description |
|---|---|---|
| ### INVALID_ARGS | `1` | The session's `LaunchConfiguration` is malformed. |
| ### NOT_FOUND | `2` | There was an error resolving the session's component URL. |
| ### DESTROY_COMPONENT_FAILED | `3` | The session component could not be destroyed. |
| ### CREATE_COMPONENT_FAILED | `4` | The session component could not be created. |

### LifecycleError [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=62)*

An error that occurs when updating the lifecycle a session.
Added: 13

<br />

| Name | Value | Description |
|---|---|---|
| ### NOT_FOUND | `1` | The session has not been started or there is no default session URL configured. |
| ### ALREADY_STARTED | `2` | The session has already been started. |
| ### RESOLVE_COMPONENT_FAILED | `3` | The session component could not be resolved. |
| ### CREATE_COMPONENT_FAILED | `4` | The session component could not be created. |
| ### DESTROY_COMPONENT_FAILED | `5` | The session component could not be destroyed. |

### RestartError [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.session/restarter.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/restarter.fidl;l=21)*

An error that occurs when restarting a session.

<br />

| Name | Value | Description |
|---|---|---|
| ### NOT_RUNNING | `1` | There is no currently running session to restart. |
| ### NOT_FOUND | `2` | There was an error resolving the session's component URL. |
| ### DESTROY_COMPONENT_FAILED | `3` | The session component could not be destroyed. |
| ### CREATE_COMPONENT_FAILED | `4` | The session component could not be created. |

## **TABLES**

### LaunchConfiguration

*Defined in [fuchsia.session/launcher.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/launcher.fidl;l=46)*

Describes a session to launch.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `session_url` | `string:4096` | The component URL of the session. |
| ### 2 | `config_capabilities` | `vector<https://fuchsia.dev/reference/fuchsia.component.decl//https://fuchsia.dev/reference/fuchsia.component.decl#Configuration>` | Configuration capabilities that will be offered to the session. In the intended use case, the session component would use a particular configuration capability with `transitional` availability. When such a transitional capability is not offered to the session, the config value from the package will be used. When it is offered using `config_capabilities`, then the config value specified here will be used. As such, one may override config values of the session component that are set up following this pattern. Added: HEAD |

### LifecycleStartRequest

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=25)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `session_url` | `string:4096` | The component URL of the session. Optional. If omitted, uses the default configured session URL, if available. |

## **UNIONS**

### Launcher_Launch_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.session/launcher.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/launcher.fidl;l=27)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Launcher_Launch_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.session#LaunchError` |   |

<br />

### Lifecycle_Restart_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=57)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Lifecycle_Restart_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.session#LifecycleError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Lifecycle_Start_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=30)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Lifecycle_Start_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.session#LifecycleError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Lifecycle_Stop_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.session/lifecycle.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/lifecycle.fidl;l=40)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Lifecycle_Stop_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.session#LifecycleError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Restarter_Restart_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.session/restarter.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.session/restarter.fidl;l=17)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.session#Restarter_Restart_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.session#RestartError` |   |

<br />