- 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.
ListManagedAccountsCommand
List Managed Accounts.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { MgnClient, ListManagedAccountsCommand } from "@aws-sdk/client-mgn"; // ES Modules import
// const { MgnClient, ListManagedAccountsCommand } = require("@aws-sdk/client-mgn"); // CommonJS import
const client = new MgnClient(config);
const input = { // ListManagedAccountsRequest
maxResults: Number("int"),
nextToken: "STRING_VALUE",
};
const command = new ListManagedAccountsCommand(input);
const response = await client.send(command);
// { // ListManagedAccountsResponse
// items: [ // ManagedAccounts // required
// { // ManagedAccount
// accountId: "STRING_VALUE",
// },
// ],
// nextToken: "STRING_VALUE",
// };
ListManagedAccountsCommand Input
See ListManagedAccountsCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
maxResults | number | undefined | List managed accounts request max results. |
nextToken | string | undefined | List managed accounts request next token. |
ListManagedAccountsCommand Output
See ListManagedAccountsCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
items Required | ManagedAccount[] | undefined | List managed accounts response items. |
nextToken | string | undefined | List managed accounts response next token. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
UninitializedAccountException | client | Uninitialized account exception. |
ValidationException | client | Validate exception. |
MgnServiceException | Base exception class for all service exceptions from Mgn service. |