- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListNotebookSessionsCommand
Lists, in descending order, the sessions that have been created in a notebook that are in an active state like CREATING
, CREATED
, IDLE
or BUSY
. Newer sessions are listed first; older sessions are listed later.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { AthenaClient, ListNotebookSessionsCommand } from "@aws-sdk/client-athena"; // ES Modules import
// const { AthenaClient, ListNotebookSessionsCommand } = require("@aws-sdk/client-athena"); // CommonJS import
const client = new AthenaClient(config);
const input = { // ListNotebookSessionsRequest
NotebookId: "STRING_VALUE", // required
MaxResults: Number("int"),
NextToken: "STRING_VALUE",
};
const command = new ListNotebookSessionsCommand(input);
const response = await client.send(command);
// { // ListNotebookSessionsResponse
// NotebookSessionsList: [ // NotebookSessionsList // required
// { // NotebookSessionSummary
// SessionId: "STRING_VALUE",
// CreationTime: new Date("TIMESTAMP"),
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListNotebookSessionsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
NotebookId Required | string | undefined | The ID of the notebook to list sessions for. |
MaxResults | number | undefined | The maximum number of notebook sessions to return. |
NextToken | string | undefined | A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the |
ListNotebookSessionsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
NotebookSessionsList Required | NotebookSessionSummary[] | undefined | A list of the sessions belonging to the notebook. |
NextToken | string | undefined | A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServerException | server | Indicates a platform issue, which may be due to a transient condition or outage. |
InvalidRequestException | client | Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range. |
ResourceNotFoundException | client | A resource, such as a workgroup, was not found. |
AthenaServiceException | Base exception class for all service exceptions from Athena service. |