- 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.
ListOnPremisesInstancesCommand
Gets a list of names for one or more on-premises instances.
Unless otherwise specified, both registered and deregistered on-premises instance names are listed. To list only registered or deregistered on-premises instance names, use the registration status parameter.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CodeDeployClient, ListOnPremisesInstancesCommand } from "@aws-sdk/client-codedeploy"; // ES Modules import
// const { CodeDeployClient, ListOnPremisesInstancesCommand } = require("@aws-sdk/client-codedeploy"); // CommonJS import
const client = new CodeDeployClient(config);
const input = { // ListOnPremisesInstancesInput
registrationStatus: "Registered" || "Deregistered",
tagFilters: [ // TagFilterList
{ // TagFilter
Key: "STRING_VALUE",
Value: "STRING_VALUE",
Type: "KEY_ONLY" || "VALUE_ONLY" || "KEY_AND_VALUE",
},
],
nextToken: "STRING_VALUE",
};
const command = new ListOnPremisesInstancesCommand(input);
const response = await client.send(command);
// { // ListOnPremisesInstancesOutput
// instanceNames: [ // InstanceNameList
// "STRING_VALUE",
// ],
// nextToken: "STRING_VALUE",
// };
ListOnPremisesInstancesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
nextToken | string | undefined | An identifier returned from the previous list on-premises instances call. It can be used to return the next set of on-premises instances in the list. |
registrationStatus | RegistrationStatus | undefined | The registration status of the on-premises instances:
|
tagFilters | TagFilter[] | undefined | The on-premises instance tags that are used to restrict the on-premises instance names returned. |
ListOnPremisesInstancesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
instanceNames | string[] | undefined | The list of matching on-premises instance names. |
nextToken | string | undefined | If a large amount of information is returned, an identifier is also returned. It can be used in a subsequent list on-premises instances call to return the next set of on-premises instances in the list. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidNextTokenException | client | The next token was specified in an invalid format. |
InvalidRegistrationStatusException | client | The registration status was specified in an invalid format. |
InvalidTagFilterException | client | The tag filter was specified in an invalid format. |
CodeDeployServiceException | Base exception class for all service exceptions from CodeDeploy service. |