There are more AWS SDK examples available in the AWS Doc SDK Examples
Use ListOnPremisesInstances with a CLI
The following code examples show how to use ListOnPremisesInstances.
- CLI
-
- AWS CLI
-
To get information about one or more on-premises instances
The following
list-on-premises-instancesexample retrieves a list of available on-premises instance names for instances that are registered in AWS CodeDeploy and also have the specified on-premises instance tag associated in AWS CodeDeploy with the instance.aws deploy list-on-premises-instances \ --registration-statusRegistered\ --tag-filtersKey=Name,Value=CodeDeployDemo-OnPrem,Type=KEY_AND_VALUEOutput:
{ "instanceNames": [ "AssetTag12010298EX" ] }-
For API details, see ListOnPremisesInstances
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example gets a list of available on-premises instance names.
Get-CDOnPremiseInstanceListOutput:
AssetTag12010298EX AssetTag12010298EX-2-
For API details, see ListOnPremisesInstances in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example gets a list of available on-premises instance names.
Get-CDOnPremiseInstanceListOutput:
AssetTag12010298EX AssetTag12010298EX-2-
For API details, see ListOnPremisesInstances in AWS Tools for PowerShell Cmdlet Reference (V5).
-