- 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.
ListWorkspacesCommand
Returns a list of Amazon Managed Grafana workspaces in the account, with some information about each workspace. For more complete information about one workspace, use DescribeWorkspace .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { GrafanaClient, ListWorkspacesCommand } from "@aws-sdk/client-grafana"; // ES Modules import
// const { GrafanaClient, ListWorkspacesCommand } = require("@aws-sdk/client-grafana"); // CommonJS import
const client = new GrafanaClient(config);
const input = { // ListWorkspacesRequest
maxResults: Number("int"),
nextToken: "STRING_VALUE",
};
const command = new ListWorkspacesCommand(input);
const response = await client.send(command);
// { // ListWorkspacesResponse
// workspaces: [ // WorkspaceList // required
// { // WorkspaceSummary
// created: new Date("TIMESTAMP"), // required
// description: "STRING_VALUE",
// endpoint: "STRING_VALUE", // required
// grafanaVersion: "STRING_VALUE", // required
// id: "STRING_VALUE", // required
// modified: new Date("TIMESTAMP"), // required
// name: "STRING_VALUE",
// notificationDestinations: [ // NotificationDestinationsList
// "STRING_VALUE",
// ],
// status: "STRING_VALUE", // required
// authentication: { // AuthenticationSummary
// providers: [ // AuthenticationProviders // required
// "STRING_VALUE",
// ],
// samlConfigurationStatus: "STRING_VALUE",
// },
// tags: { // TagMap
// "<keys>": "STRING_VALUE",
// },
// licenseType: "STRING_VALUE",
// grafanaToken: "STRING_VALUE",
// },
// ],
// nextToken: "STRING_VALUE",
// };
ListWorkspacesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
maxResults | number | undefined | The maximum number of workspaces to include in the results. |
nextToken | string | undefined | The token for the next set of workspaces to return. (You receive this token from a previous |
ListWorkspacesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
workspaces Required | WorkspaceSummary[] | undefined | An array of structures that contain some information about the workspaces in the account. |
nextToken | string | undefined | The token to use when requesting the next set of workspaces. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient permissions to perform this action. |
InternalServerException | server | Unexpected error while processing the request. Retry the request. |
ThrottlingException | client | The request was denied because of request throttling. Retry the request. |
GrafanaServiceException | Base exception class for all service exceptions from Grafana service. |