# Class: `Kernels` [@jupyterlite/kernel](../modules/jupyterlite_kernel.md).Kernels A class to handle requests to /api/kernels ## Implements - [`IKernels`](../modules/jupyterlite_kernel.md#ikernels) ## Constructors ### `constructor` > > **`new Kernels`**(`options`) Construct a new Kernels #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `options` | [`IOptions`](../interfaces/jupyterlite_kernel.Kernels.IOptions.md) | The instantiation options | #### Defined in [packages/kernel/src/kernels.ts:34](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L34) ## Properties ### `_clients` > > `Private` **`_clients`**: `ObservableMap`<`Client`\> #### Defined in [packages/kernel/src/kernels.ts:243](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L243) ### `_kernelClients` > > `Private` **`_kernelClients`**: `ObservableMap`<`Set`<`string`\>\> #### Defined in [packages/kernel/src/kernels.ts:244](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L244) ### `_kernels` > > `Private` **`_kernels`**: `ObservableMap`<[`IKernel`](../interfaces/jupyterlite_kernel.IKernel-1.md)\> #### Defined in [packages/kernel/src/kernels.ts:242](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L242) ### `_kernelspecs` > > `Private` **`_kernelspecs`**: [`IKernelSpecs`](../modules/jupyterlite_kernel.md#ikernelspecs) #### Defined in [packages/kernel/src/kernels.ts:245](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L245) ## Methods ### `get` > > **`get`**(`id`): `Promise`<`undefined` \| [`IKernel`](../interfaces/jupyterlite_kernel.IKernel-1.md)\> Get a kernel by id #### Parameters | Name | Type | | :------ | :------ | | `id` | `string` | #### Returns `Promise`<`undefined` \| [`IKernel`](../interfaces/jupyterlite_kernel.IKernel-1.md)\> #### Implementation of IKernels.get #### Defined in [packages/kernel/src/kernels.ts:238](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L238) ### `list` > > **`list`**(): `Promise`<`IModel`[]\> List the running kernels. #### Returns `Promise`<`IModel`[]\> #### Implementation of IKernels.list #### Defined in [packages/kernel/src/kernels.ts:219](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L219) ### `restart` > > **`restart`**(`kernelId`): `Promise`<`IModel`\> Restart a kernel. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `kernelId` | `string` | The kernel id. | #### Returns `Promise`<`IModel`\> #### Implementation of IKernels.restart #### Defined in [packages/kernel/src/kernels.ts:206](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L206) ### `shutdown` > > **`shutdown`**(`id`): `Promise`<`void`\> Shut down a kernel. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `id` | `string` | The kernel id. | #### Returns `Promise`<`void`\> #### Implementation of IKernels.shutdown #### Defined in [packages/kernel/src/kernels.ts:231](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L231) ### `startNew` > > **`startNew`**(`options`): `Promise`<`IModel`\> Start a new kernel. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `options` | [`IKernelOptions`](../interfaces/jupyterlite_kernel.Kernels.IKernelOptions.md) | The kernel start options. | #### Returns `Promise`<`IModel`\> #### Implementation of IKernels.startNew #### Defined in [packages/kernel/src/kernels.ts:44](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/kernel/src/kernels.ts#L44)