- 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.
ListDomainsCommand
Lists the domains.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { SageMakerClient, ListDomainsCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
// const { SageMakerClient, ListDomainsCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
const client = new SageMakerClient(config);
const input = { // ListDomainsRequest
NextToken: "STRING_VALUE",
MaxResults: Number("int"),
};
const command = new ListDomainsCommand(input);
const response = await client.send(command);
// { // ListDomainsResponse
// Domains: [ // DomainList
// { // DomainDetails
// DomainArn: "STRING_VALUE",
// DomainId: "STRING_VALUE",
// DomainName: "STRING_VALUE",
// Status: "Deleting" || "Failed" || "InService" || "Pending" || "Updating" || "Update_Failed" || "Delete_Failed",
// CreationTime: new Date("TIMESTAMP"),
// LastModifiedTime: new Date("TIMESTAMP"),
// Url: "STRING_VALUE",
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListDomainsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
MaxResults | number | undefined | This parameter defines the maximum number of results that can be return in a single response. The |
NextToken | string | undefined | If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results. |
ListDomainsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Domains | DomainDetails[] | undefined | The list of domains. |
NextToken | string | undefined | If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
SageMakerServiceException | Base exception class for all service exceptions from SageMaker service. |