

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

# Utilizzare `DescribeCustomerGateways` con una CLI
<a name="example_ec2_DescribeCustomerGateways_section"></a>

Gli esempi di codice seguenti mostrano come utilizzare `DescribeCustomerGateways`.

------
#### [ CLI ]

**AWS CLI**  
**Come descrivere i gateway del cliente**  
Questo esempio descrive i gateway del cliente.  
Comando:  

```
aws ec2 describe-customer-gateways
```
Output:  

```
{
    "CustomerGateways": [
        {
            "CustomerGatewayId": "cgw-b4dc3961",
            "IpAddress": "203.0.113.12",
            "State": "available",
            "Type": "ipsec.1",
            "BgpAsn": "65000"
        },
        {
            "CustomerGatewayId": "cgw-0e11f167",
            "IpAddress": "12.1.2.3",
            "State": "available",
            "Type": "ipsec.1",
            "BgpAsn": "65534"
        }
    ]
}
```
**Come descrivere un gateway del cliente specifico**  
Questo esempio descrive il gateway del cliente specificato.  
Comando:  

```
aws ec2 describe-customer-gateways --customer-gateway-ids cgw-0e11f167
```
Output:  

```
{
    "CustomerGateways": [
        {
            "CustomerGatewayId": "cgw-0e11f167",
            "IpAddress": "12.1.2.3",
            "State": "available",
            "Type": "ipsec.1",
            "BgpAsn": "65534"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [DescribeCustomerGateways AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-customer-gateways.html)*Command Reference.* 

------
#### [ PowerShell ]

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio descrive il gateway del cliente specificato.**  

```
Get-EC2CustomerGateway -CustomerGatewayId cgw-1a2b3c4d
```
**Output:**  

```
BgpAsn            : 65534
CustomerGatewayId : cgw-1a2b3c4d
IpAddress         : 203.0.113.12
State             : available
Tags              : {}
Type              : ipsec.1
```
**Esempio 2: questo esempio descrive qualsiasi gateway del cliente il cui stato è “pending” (In sospeso) o “available” (Disponibile).**  

```
$filter = New-Object Amazon.EC2.Model.Filter
$filter.Name = "state"
$filter.Values = @( "pending", "available" )

Get-EC2CustomerGateway -Filter $filter
```
**Esempio 3: questo esempio descrive tutti i gateway del cliente specificato.**  

```
Get-EC2CustomerGateway
```
+  Per i dettagli sull'API, vedere [DescribeCustomerGateways](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

**Strumenti per V5 PowerShell **  
**Esempio 1: questo esempio descrive il gateway del cliente specificato.**  

```
Get-EC2CustomerGateway -CustomerGatewayId cgw-1a2b3c4d
```
**Output:**  

```
BgpAsn            : 65534
CustomerGatewayId : cgw-1a2b3c4d
IpAddress         : 203.0.113.12
State             : available
Tags              : {}
Type              : ipsec.1
```
**Esempio 2: questo esempio descrive qualsiasi gateway del cliente il cui stato è “pending” (In sospeso) o “available” (Disponibile).**  

```
$filter = New-Object Amazon.EC2.Model.Filter
$filter.Name = "state"
$filter.Values = @( "pending", "available" )

Get-EC2CustomerGateway -Filter $filter
```
**Esempio 3: questo esempio descrive tutti i gateway del cliente specificato.**  

```
Get-EC2CustomerGateway
```
+  Per i dettagli sull'API, vedere [DescribeCustomerGateways](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

------

Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, vedere. [Crea EC2 risorse Amazon utilizzando un AWS SDK](sdk-general-information-section.md) Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.