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

See ListDomainsCommandInput for more details

Parameter
Type
Description
MaxResults
number | undefined

This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

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

See ListDomainsCommandOutput for details

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
SageMakerServiceException
Base exception class for all service exceptions from SageMaker service.