

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à.

# Esempi di Network Manager che utilizzano AWS CLI
<a name="cli_networkmanager_code_examples"></a>

I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando AWS Command Line Interface with Network Manager.

Le *azioni* sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le azioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.

Ogni esempio include un link al codice sorgente completo, in cui vengono fornite le istruzioni su come configurare ed eseguire il codice nel contesto.

**Topics**
+ [Azioni](#actions)

## Azioni
<a name="actions"></a>

### `associate-customer-gateway`
<a name="networkmanager_AssociateCustomerGateway_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`associate-customer-gateway`.

**AWS CLI**  
**Come associare un gateway del cliente**  
L’esempio `associate-customer-gateway` seguente associa il gateway del cliente `cgw-11223344556677889` nella rete globale specificata al dispositivo `device-07f6fd08867abc123`.  

```
aws networkmanager associate-customer-gateway \
    --customer-gateway-arn arn:aws:ec2:us-west-2:123456789012:customer-gateway/cgw-11223344556677889  \
    --global-network-id global-network-01231231231231231 \
    --device-id device-07f6fd08867abc123 \
    --region us-west-2
```
Output:  

```
{
    "CustomerGatewayAssociation": {
        "CustomerGatewayArn": "arn:aws:ec2:us-west-2:123456789012:customer-gateway/cgw-11223344556677889",
        "GlobalNetworkId": "global-network-01231231231231231",
        "DeviceId": "device-07f6fd08867abc123",
        "State": "PENDING"
    }
}
```
Per ulteriori informazioni, consulta [Associazioni del gateway del cliente](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#cgw-association) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [AssociateCustomerGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/associate-customer-gateway.html)*Command Reference*. 

### `associate-link`
<a name="networkmanager_AssociateLink_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`associate-link`.

**AWS CLI**  
**Come associare un link**  
L’esempio `associate-link` seguente associa il link `link-11112222aaaabbbb1` al dispositivo `device-07f6fd08867abc123`. Il link e il dispositivo si trovano nella rete globale specificata.  

```
aws networkmanager associate-link \
    --global-network-id global-network-01231231231231231 \
    --device-id device-07f6fd08867abc123 \
    --link-id link-11112222aaaabbbb1 \
    --region us-west-2
```
Output:  

```
{
    "LinkAssociation": {
        "GlobalNetworkId": "global-network-01231231231231231",
        "DeviceId": "device-07f6fd08867abc123",
        "LinkId": "link-11112222aaaabbbb1",
        "LinkAssociationState": "PENDING"
    }
}
```
Per ulteriori informazioni, consulta [Associazioni di dispositivi e link](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#device-link-association) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [AssociateLink AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/associate-link.html)*Command Reference*. 

### `create-core-network`
<a name="networkmanager_CreateCoreNetwork_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-core-network`.

**AWS CLI**  
**Come creare una rete principale**  
L'`create-core-network`esempio seguente crea una rete principale utilizzando una descrizione e tag opzionali all'interno di una rete globale AWS Cloud WAN.  

```
aws networkmanager create-core-network \
    --global-network-id global-network-cdef-EXAMPLE22222 \
    --description "Main headquarters location" \
    --tags Key=Name,Value="New York City office"
```
Output:  

```
{
    "CoreNetwork": {
        "GlobalNetworkId": "global-network-cdef-EXAMPLE22222",
        "CoreNetworkId": "core-network-cdef-EXAMPLE33333",
        "CoreNetworkArn": "arn:aws:networkmanager::987654321012:core-network/core-network-cdef-EXAMPLE33333",
        "Description": "Main headquarters location",
        "CreatedAt": "2022-01-10T19:53:59+00:00",
        "State": "AVAILABLE",
        "Tags": [
            {
                "Key": "Name",
                "Value": "New York City office"
            }
        ]
    }
}
```
Per ulteriori informazioni, consulta [Reti di base e globali](https://docs.aws.amazon.com/network-manager/latest/cloudwan/cloudwan-core-network-policy.html) nella *Guida per l’utente di AWS Cloud WAN*.  
+  Per i dettagli sull'API, consulta [CreateCoreNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/create-core-network.html)*Command Reference*. 

### `create-device`
<a name="networkmanager_CreateDevice_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-device`.

**AWS CLI**  
**Come creare un dispositivo**  
L’esempio `create-device` seguente crea un dispositivo nella rete globale specificata. I dettagli del dispositivo includono una descrizione, il tipo, il fornitore, il modello e il numero di serie.  

```
aws networkmanager create-device
    --global-network-id global-network-01231231231231231 \
    --description "New York office device" \
    --type "office device" \
    --vendor "anycompany" \
    --model "abcabc" \
    --serial-number "1234" \
    --region us-west-2
```
Output:  

```
{
    "Device": {
        "DeviceId": "device-07f6fd08867abc123",
        "DeviceArn": "arn:aws:networkmanager::123456789012:device/global-network-01231231231231231/device-07f6fd08867abc123",
        "GlobalNetworkId": "global-network-01231231231231231",
        "Description": "New York office device",
        "Type": "office device",
        "Vendor": "anycompany",
        "Model": "abcabc",
        "SerialNumber": "1234",
        "CreatedAt": 1575554005.0,
        "State": "PENDING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di dispositivi](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-devices) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [CreateDevice AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/create-device.html)*Command Reference*. 

### `create-global-network`
<a name="networkmanager_CreateGlobalNetwork_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-global-network`.

**AWS CLI**  
**Come creare una rete globale**  
L’esempio `create-global-network` seguente crea una nuova rete globale. Lo stato iniziale al momento della creazione è `PENDING`.  

```
aws networkmanager create-global-network
```
Output:  

```
{
    "GlobalNetwork": {
        "GlobalNetworkId": "global-network-00a77fc0f722dae74",
        "GlobalNetworkArn": "arn:aws:networkmanager::987654321012:global-network/global-network-00a77fc0f722dae74",
        "CreatedAt": "2022-03-14T20:31:56+00:00",
        "State": "PENDING"
    }
}
```
+  Per i dettagli sull'API, consulta [CreateGlobalNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/create-global-network.html)*Command Reference*. 

### `create-link`
<a name="networkmanager_CreateLink_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-link`.

**AWS CLI**  
**Come creare un link**  
L’esempio `create-link` seguente crea un link nella rete globale specificata. Il link include una descrizione e i dettagli sul tipo di link, sulla larghezza di banda e sul provider. L’ID del sito indica il sito a cui è associato il link.  

```
aws networkmanager create-link \
    --global-network-id global-network-01231231231231231 \
    --description "VPN Link" \
    --type "broadband" \
    --bandwidth UploadSpeed=10,DownloadSpeed=20 \
    --provider "AnyCompany" \
    --site-id site-444555aaabbb11223 \
    --region us-west-2
```
Output:  

```
{
    "Link": {
        "LinkId": "link-11112222aaaabbbb1",
        "LinkArn": "arn:aws:networkmanager::123456789012:link/global-network-01231231231231231/link-11112222aaaabbbb1",
        "GlobalNetworkId": "global-network-01231231231231231",
        "SiteId": "site-444555aaabbb11223",
        "Description": "VPN Link",
        "Type": "broadband",
        "Bandwidth": {
            "UploadSpeed": 10,
            "DownloadSpeed": 20
        },
        "Provider": "AnyCompany",
        "CreatedAt": 1575555811.0,
        "State": "PENDING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di link](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-links) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [CreateLink AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/create-link.html)*Command Reference*. 

### `create-site`
<a name="networkmanager_CreateSite_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-site`.

**AWS CLI**  
**Come creare un sito**  
L’esempio `create-site` seguente crea un sito nella rete globale specificata. I dettagli del sito includono una descrizione e informazioni sulla posizione.  

```
aws networkmanager create-site \
    --global-network-id global-network-01231231231231231 \
    --description  "New York head office" \
    --location Latitude=40.7128,Longitude=-74.0060 \
    --region us-west-2
```
Output:  

```
{
    "Site": {
        "SiteId": "site-444555aaabbb11223",
        "SiteArn": "arn:aws:networkmanager::123456789012:site/global-network-01231231231231231/site-444555aaabbb11223",
        "GlobalNetworkId": "global-network-01231231231231231",
        "Description": "New York head office",
        "Location": {
            "Latitude": "40.7128",
            "Longitude": "-74.0060"
        },
        "CreatedAt": 1575554300.0,
        "State": "PENDING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di siti](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-sites) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [CreateSite AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/create-site.html)*Command Reference*. 

### `create-vpc-attachment`
<a name="networkmanager_CreateVpcAttachment_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-vpc-attachment`.

**AWS CLI**  
**Come creare un collegamento VPC**  
L'`create-vpc-attachment`esempio seguente crea un allegato VPC con IPv6 supporto in una rete centrale.  

```
aws networkmanager create-vpc-attachment \
    --core-network-id core-network-0fab62fe438d94db6 \
    --vpc-arn arn:aws:ec2:us-east-1:987654321012:vpc/vpc-09f37f69e2786eeb8  \
    --subnet-arns arn:aws:ec2:us-east-1:987654321012:subnet/subnet-04ca4e010857e7bb7 \
    --Ipv6Support=true
```
Output:  

```
{
    "VpcAttachment": {
        "Attachment": {
            "CoreNetworkId": "core-network-0fab62fe438d94db6",
            "AttachmentId": "attachment-05e1da6eba87a06e6",
            "OwnerAccountId": "987654321012",
            "AttachmentType": "VPC",
            "State": "CREATING",
            "EdgeLocation": "us-east-1",
            "ResourceArn": "arn:aws:ec2:us-east-1:987654321012:vpc/vpc-09f37f69e2786eeb8",
            "Tags": [],
            "CreatedAt": "2022-03-10T20:59:14+00:00",
            "UpdatedAt": "2022-03-10T20:59:14+00:00"
        },
        "SubnetArns": [
            "arn:aws:ec2:us-east-1:987654321012:subnet/subnet-04ca4e010857e7bb7"
        ],
        "Options": {
            "Ipv6Support": true
        }
    }
}
```
Per ulteriori informazioni, consulta [Creare un collegameto](https://docs.aws.amazon.com/vpc/latest/cloudwan/cloudwan-create-attachment.html) nella *Guida per l’utente di Cloud WAN*.  
+  Per i dettagli sull'API, vedere [CreateVpcAttachment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/create-vpc-attachment.html)in *AWS CLI Command Reference.* 

### `delete-attachment`
<a name="networkmanager_DeleteAttachment_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-attachment`.

**AWS CLI**  
**Come eliminare un collegamento**  
L’esempio `delete-attachment` seguente elimina un collegamento Connect.  

```
aws networkmanager delete-attachment \
    --attachment-id attachment-01feddaeae26ab68c
```
Output:  

```
{
    "Attachment": {
        "CoreNetworkId": "core-network-0f4b0a9d5ee7761d1",
        "AttachmentId": "attachment-01feddaeae26ab68c",
        "OwnerAccountId": "987654321012",
        "AttachmentType": "CONNECT",
        "State": "DELETING",
        "EdgeLocation": "us-east-1",
        "ResourceArn": "arn:aws:networkmanager::987654321012:attachment/attachment-02c3964448fedf5aa",
        "CreatedAt": "2022-03-15T19:18:41+00:00",
        "UpdatedAt": "2022-03-15T19:28:59+00:00"
    }
}
```
Per ulteriori informazioni, consulta [Eliminare i collegamenti](https://docs.aws.amazon.com/vpc/latest/cloudwan/cloudwan-attachments-working-with.html#cloudwan-attachments-deleting) nella *Guida per l’utente di Cloud WAN*.  
+  Per i dettagli sull'API, consulta [DeleteAttachment AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-attachment.html)*Command Reference*. 

### `delete-bucket-analytics-configuration`
<a name="networkmanager_DeleteBucketAnalyticsConfiguration_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-bucket-analytics-configuration`.

**AWS CLI**  
**Come eliminare una configurazione di analisi per un bucket**  
L’esempio `delete-bucket-analytics-configuration` seguente rimuove la configurazione di analisi per il bucket e l’ID specificati.  

```
aws s3api delete-bucket-analytics-configuration \
    --bucket amzn-s3-demo-bucket \
    --id 1
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [DeleteBucketAnalyticsConfiguration AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-bucket-analytics-configuration.html)*Command Reference*. 

### `delete-bucket-metrics-configuration`
<a name="networkmanager_DeleteBucketMetricsConfiguration_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-bucket-metrics-configuration`.

**AWS CLI**  
**Come eliminare una configurazione delle metriche per un bucket**  
L’esempio `delete-bucket-metrics-configuration` seguente rimuove la configurazione delle metriche per il bucket e l’ID specificati.  

```
aws s3api delete-bucket-metrics-configuration \
    --bucket amzn-s3-demo-bucket \
    --id 123
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [DeleteBucketMetricsConfiguration AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-bucket-metrics-configuration.html)*Command Reference*. 

### `delete-core-network`
<a name="networkmanager_DeleteCoreNetwork_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-core-network`.

**AWS CLI**  
**Come eliminare una rete principale**  
L’esempio `delete-core-network` seguente elimina una rete core da una rete globale Cloud WAN.  

```
aws networkmanager delete-core-network \
    --core-network-id core-network-0fab62fe438d94db6
```
Output:  

```
{
    "CoreNetwork": {
        "GlobalNetworkId": "global-network-0d59060f16a73bc41",
        "CoreNetworkId": "core-network-0fab62fe438d94db6",
        "Description": "Main headquarters location",
        "CreatedAt": "2021-12-09T18:31:11+00:00",
        "State": "DELETING",
        "Segments": [
            {
                "Name": "dev",
                "EdgeLocations": [
                    "us-east-1"
                ],
                "SharedSegments": []
            }
        ],
        "Edges": [
            {
                "EdgeLocation": "us-east-1",
                "Asn": 64512,
                "InsideCidrBlocks": []
            }
        ]
    }
}
```
Per ulteriori informazioni, consulta [Reti di base](https://docs.aws.amazon.com/vpc/latest/cloudwan/cloudwan-networks-working-with.html#cloudwan-core-networks) nella *Guida per l’utente di Cloud WAN*.  
+  Per i dettagli sull'API, consulta [DeleteCoreNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-core-network.html)*Command Reference*. 

### `delete-device`
<a name="networkmanager_DeleteDevice_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-device`.

**AWS CLI**  
**Come eliminare un dispositivo**  
L’esempio `delete-device` seguente elimina il dispositivo specificato dalla rete globale specificata.  

```
aws networkmanager delete-device \
    --global-network-id global-network-01231231231231231 \
    --device-id device-07f6fd08867abc123 \
    --region us-west-2
```
Output:  

```
{
    "Device": {
        "DeviceId": "device-07f6fd08867abc123",
        "DeviceArn": "arn:aws:networkmanager::123456789012:device/global-network-01231231231231231/device-07f6fd08867abc123",
        "GlobalNetworkId": "global-network-01231231231231231",
        "Description": "New York office device",
        "Type": "office device",
        "Vendor": "anycompany",
        "Model": "abcabc",
        "SerialNumber": "1234",
        "SiteId": "site-444555aaabbb11223",
        "CreatedAt": 1575554005.0,
        "State": "DELETING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di dispositivi](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-devices) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [DeleteDevice AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-device.html)*Command Reference*. 

### `delete-global-network`
<a name="networkmanager_DeleteGlobalNetwork_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-global-network`.

**AWS CLI**  
**Come eliminare una rete globale**  
L’esempio `delete-global-network` seguente elimina una rete globale.  

```
aws networkmanager delete-global-network \
    --global-network-id global-network-052bedddccb193b6b
```
Output:  

```
{
    "GlobalNetwork": {
        "GlobalNetworkId": "global-network-052bedddccb193b6b",
        "GlobalNetworkArn": "arn:aws:networkmanager::987654321012:global-network/global-network-052bedddccb193b6b",
        "CreatedAt": "2021-12-09T18:19:12+00:00",
        "State": "DELETING"
    }
}
```
+  Per i dettagli sull'API, consulta [DeleteGlobalNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-global-network.html)*Command Reference*. 

### `delete-link`
<a name="networkmanager_DeleteLink_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-link`.

**AWS CLI**  
**Come eliminare un link**  
L’esempio `delete-link` seguente elimina il link specificato dalla rete globale specificata.  

```
aws networkmanager delete-link \
    --global-network-id global-network-01231231231231231  \
    --link-id link-11112222aaaabbbb1 \
    --region us-west-2
```
Output:  

```
{
    "Link": {
        "LinkId": "link-11112222aaaabbbb1",
        "LinkArn": "arn:aws:networkmanager::123456789012:link/global-network-01231231231231231/link-11112222aaaabbbb1",
        "GlobalNetworkId": "global-network-01231231231231231",
        "SiteId": "site-444555aaabbb11223",
        "Description": "VPN Link",
        "Type": "broadband",
        "Bandwidth": {
            "UploadSpeed": 20,
            "DownloadSpeed": 20
        },
        "Provider": "AnyCompany",
        "CreatedAt": 1575555811.0,
        "State": "DELETING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di link](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-links) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [DeleteLink AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-link.html)*Command Reference*. 

### `delete-public-access-block`
<a name="networkmanager_DeletePublicAccessBlock_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-public-access-block`.

**AWS CLI**  
**Come eliminare la configurazione di blocco dell’accesso pubblico per un bucket**  
L’esempio `delete-public-access-block` seguente rimuove la configurazione del blocco dell’accesso pubblico per il bucket e l’ID specificati.  

```
aws s3api delete-public-access-block \
    --bucket amzn-s3-demo-bucket
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [DeletePublicAccessBlock AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-public-access-block.html)*Command Reference*. 

### `delete-site`
<a name="networkmanager_DeleteSite_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-site`.

**AWS CLI**  
**Come eliminare un sito**  
L’esempio `delete-site` seguente elimina il sito specificato (`site-444555aaabbb11223`) nella rete globale specificata.  

```
aws networkmanager delete-site \
    --global-network-id global-network-01231231231231231  \
    --site-id site-444555aaabbb11223 \
    --region us-west-2
```
Output:  

```
{
    "Site": {
        "SiteId": "site-444555aaabbb11223",
        "SiteArn": "arn:aws:networkmanager::123456789012:site/global-network-01231231231231231/site-444555aaabbb11223",
        "GlobalNetworkId": "global-network-01231231231231231",
        "Description": "New York head office",
        "Location": {
            "Latitude": "40.7128",
            "Longitude": "-74.0060"
        },
        "CreatedAt": 1575554300.0,
        "State": "DELETING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di siti](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-sites) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [DeleteSite AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/delete-site.html)*Command Reference*. 

### `deregister-transit-gateway`
<a name="networkmanager_DeregisterTransitGateway_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`deregister-transit-gateway`.

**AWS CLI**  
**Come annullare la registrazione di un gateway di transito da una rete globale**  
L’esempio `deregister-transit-gateway` seguente annulla la registrazione del gateway di transito specificato nella rete globale specificata.  

```
aws networkmanager deregister-transit-gateway \
    --global-network-id global-network-01231231231231231 \
    --transit-gateway-arn arn:aws:ec2:us-west-2:123456789012:transit-gateway/tgw-123abc05e04123abc \
    --region us-west-2
```
Output:  

```
{
    "TransitGatewayRegistration": {
        "GlobalNetworkId": "global-network-01231231231231231",
        "TransitGatewayArn": "arn:aws:ec2:us-west-2:123456789012:transit-gateway/tgw-123abc05e04123abc",
        "State": {
            "Code": "DELETING"
        }
    }
}
```
Per ulteriori informazioni, consulta [Registrazioni di Transit Gateway](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-registrations.html) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [DeregisterTransitGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/deregister-transit-gateway.html)*Command Reference*. 

### `describe-global-networks`
<a name="networkmanager_DescribeGlobalNetworks_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`describe-global-networks`.

**AWS CLI**  
**Come descrivere le reti globali**  
L’esempio `describe-global-networks` seguente descrive tutte le reti globali nell’account.  

```
aws networkmanager describe-global-networks \
    --region us-west-2
```
Output:  

```
{
    "GlobalNetworks": [
        {
            "GlobalNetworkId": "global-network-01231231231231231",
            "GlobalNetworkArn": "arn:aws:networkmanager::123456789012:global-network/global-network-01231231231231231",
            "Description": "Company 1 global network",
            "CreatedAt": 1575553525.0,
            "State": "AVAILABLE"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [DescribeGlobalNetworks AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/describe-global-networks.html)*Command Reference*. 

### `disassociate-customer-gateway`
<a name="networkmanager_DisassociateCustomerGateway_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`disassociate-customer-gateway`.

**AWS CLI**  
**Come dissociare un gateway del cliente**  
L’esempio `disassociate-customer-gateway` seguente dissocia il gateway del cliente specificato (`cgw-11223344556677889`) dalla rete globale specificata.  

```
aws networkmanager disassociate-customer-gateway \
    --global-network-id global-network-01231231231231231 \
    --customer-gateway-arn arn:aws:ec2:us-west-2:123456789012:customer-gateway/cgw-11223344556677889 \
    --region us-west-2
```
Output:  

```
{
    "CustomerGatewayAssociation": {
        "CustomerGatewayArn": "arn:aws:ec2:us-west-2:123456789012:customer-gateway/cgw-11223344556677889",
        "GlobalNetworkId": "global-network-01231231231231231",
        "DeviceId": "device-07f6fd08867abc123",
        "State": "DELETING"
    }
}
```
Per ulteriori informazioni, consulta [Associazioni del gateway del cliente](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#cgw-association) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [DisassociateCustomerGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/disassociate-customer-gateway.html)*Command Reference*. 

### `disassociate-link`
<a name="networkmanager_DisassociateLink_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`disassociate-link`.

**AWS CLI**  
**Come dissociare un link**  
L’esempio `disassociate-link` seguente dissocia il link specificato dal dispositivo `device-07f6fd08867abc123` nella rete globale specificata.  

```
aws networkmanager disassociate-link \
    --global-network-id global-network-01231231231231231 \
    --device-id device-07f6fd08867abc123 \
    --link-id link-11112222aaaabbbb1 \
    --region us-west-2
```
Output:  

```
{
    "LinkAssociation": {
        "GlobalNetworkId": "global-network-01231231231231231",
        "DeviceId": "device-07f6fd08867abc123",
        "LinkId": "link-11112222aaaabbbb1",
        "LinkAssociationState": "DELETING"
    }
}
```
Per ulteriori informazioni, consulta [Associazioni di dispositivi e link](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#device-link-association) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [DisassociateLink AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/disassociate-link.html)*Command Reference*. 

### `get-bucket-analytics-configuration`
<a name="networkmanager_GetBucketAnalyticsConfiguration_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-bucket-analytics-configuration`.

**AWS CLI**  
**Come recuperare la configurazione di analisi per un bucket con un ID specifico**  
L’esempio `get-bucket-analytics-configuration` seguente visualizza la configurazione di analisi per il bucket e l’ID specificati.  

```
aws s3api get-bucket-analytics-configuration \
    --bucket amzn-s3-demo-bucket \
    --id 1
```
Output:  

```
{
    "AnalyticsConfiguration": {
        "StorageClassAnalysis": {},
        "Id": "1"
    }
}
```
+  Per i dettagli sull'API, consulta [GetBucketAnalyticsConfiguration AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-bucket-analytics-configuration.html)*Command Reference*. 

### `get-bucket-metrics-configuration`
<a name="networkmanager_GetBucketMetricsConfiguration_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-bucket-metrics-configuration`.

**AWS CLI**  
**Come recuperare la configurazione delle metriche per un bucket con un ID specifico**  
L’esempio `get-bucket-metrics-configuration` seguente visualizza la configurazione delle metriche per il bucket e l’ID specificati.  

```
aws s3api get-bucket-metrics-configuration \
    --bucket amzn-s3-demo-bucket \
    --id 123
```
Output:  

```
{
    "MetricsConfiguration": {
        "Filter": {
            "Prefix": "logs"
        },
        "Id": "123"
    }
}
```
+  Per i dettagli sull'API, consulta [GetBucketMetricsConfiguration AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-bucket-metrics-configuration.html)*Command Reference*. 

### `get-customer-gateway-associations`
<a name="networkmanager_GetCustomerGatewayAssociations_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-customer-gateway-associations`.

**AWS CLI**  
**Come ottenere le associazioni del gateway del cliente**  
L’esempio `get-customer-gateway-associations` seguente ottiene le associazioni del gateway del cliente per la rete globale specificata.  

```
aws networkmanager get-customer-gateway-associations \
    --global-network-id global-network-01231231231231231 \
    --region us-west-2
```
Output:  

```
{
    "CustomerGatewayAssociations": [
        {
            "CustomerGatewayArn": "arn:aws:ec2:us-west-2:123456789012:customer-gateway/cgw-11223344556677889",
            "GlobalNetworkId": "global-network-01231231231231231",
            "DeviceId": "device-07f6fd08867abc123",
            "State": "AVAILABLE"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [GetCustomerGatewayAssociations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-customer-gateway-associations.html)*Command Reference*. 

### `get-devices`
<a name="networkmanager_GetDevices_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-devices`.

**AWS CLI**  
**Come ottenere i tuoi dispositivi**  
L’esempio `get-devices` seguente ottiene i dispositivi nella rete globale specificata.  

```
aws networkmanager get-devices \
    --global-network-id global-network-01231231231231231 \
    --region us-west-2
```
Output:  

```
{
    "Devices": [
        {
            "DeviceId": "device-07f6fd08867abc123",
            "DeviceArn": "arn:aws:networkmanager::123456789012:device/global-network-01231231231231231/device-07f6fd08867abc123",
            "GlobalNetworkId": "global-network-01231231231231231",
            "Description": "NY office device",
            "Type": "office device",
            "Vendor": "anycompany",
            "Model": "abcabc",
            "SerialNumber": "1234",
            "CreatedAt": 1575554005.0,
            "State": "AVAILABLE"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [GetDevices AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-devices.html)*Command Reference*. 

### `get-link-associations`
<a name="networkmanager_GetLinkAssociations_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-link-associations`.

**AWS CLI**  
**Come ottenere le associazioni dei link**  
L’esempio `get-link-associations` seguente ottiene le associazioni dei link nella rete globale specificata.  

```
aws networkmanager get-link-associations \
    --global-network-id global-network-01231231231231231 \
    --region us-west-2
```
Output:  

```
{
    "LinkAssociations": [
        {
            "GlobalNetworkId": "global-network-01231231231231231",
            "DeviceId": "device-07f6fd08867abc123",
            "LinkId": "link-11112222aaaabbbb1",
            "LinkAssociationState": "AVAILABLE"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [GetLinkAssociations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-link-associations.html)*Command Reference*. 

### `get-links`
<a name="networkmanager_GetLinks_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-links`.

**AWS CLI**  
**Come ottenere i tuoi link**  
L’esempio `get-links` seguente ottiene i link nella rete globale specificata.  

```
aws networkmanager get-links \
    --global-network-id global-network-01231231231231231 \
    --region us-west-2
```
Output:  

```
{
    "Links": [
        {
            "LinkId": "link-11112222aaaabbbb1",
            "LinkArn": "arn:aws:networkmanager::123456789012:link/global-network-01231231231231231/link-11112222aaaabbbb1",
            "GlobalNetworkId": "global-network-01231231231231231",
            "SiteId": "site-444555aaabbb11223",
            "Description": "VPN Link",
            "Type": "broadband",
            "Bandwidth": {
                "UploadSpeed": 10,
                "DownloadSpeed": 20
            },
            "Provider": "AnyCompany",
            "CreatedAt": 1575555811.0,
            "State": "AVAILABLE"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [GetLinks AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-links.html)*Command Reference*. 

### `get-object-retention`
<a name="networkmanager_GetObjectRetention_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-object-retention`.

**AWS CLI**  
**Come recuperare la configurazione di conservazione degli oggetti per un oggetto**  
L’esempio `get-object-retention` seguente recupera la configurazione di conservazione degli oggetti per il bucket specificato.  

```
aws s3api get-object-retention \
    --bucket amzn-s3-demo-bucket-with-object-lock \
    --key doc1.rtf
```
Output:  

```
{
    "Retention": {
        "Mode": "GOVERNANCE",
        "RetainUntilDate": "2025-01-01T00:00:00.000Z"
    }
}
```
+  Per i dettagli sull'API, consulta [GetObjectRetention AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-object-retention.html)*Command Reference*. 

### `get-public-access-block`
<a name="networkmanager_GetPublicAccessBlock_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-public-access-block`.

**AWS CLI**  
**Come impostare o modificare la configurazione di blocco dell’accesso pubblico per un bucket**  
L’esempio `get-public-access-block` seguente visualizza la configurazione del blocco dell’accesso pubblico per il bucket specificato.  

```
aws s3api get-public-access-block --bucket amzn-s3-demo-bucket
```
Output:  

```
{
    "PublicAccessBlockConfiguration": {
        "IgnorePublicAcls": true,
        "BlockPublicPolicy": true,
        "BlockPublicAcls": true,
        "RestrictPublicBuckets": true
    }
}
```
+  Per i dettagli sull'API, consulta [GetPublicAccessBlock AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-public-access-block.html)*Command Reference*. 

### `get-sites`
<a name="networkmanager_GetSites_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-sites`.

**AWS CLI**  
**Come ottenere i tuoi siti**  
L’esempio `get-sites` seguente ottiene i siti nella rete globale specificata.  

```
aws networkmanager get-sites \
    --global-network-id global-network-01231231231231231 \
    --region us-west-2
```
Output:  

```
{
    "Sites": [
        {
            "SiteId": "site-444555aaabbb11223",
            "SiteArn": "arn:aws:networkmanager::123456789012:site/global-network-01231231231231231/site-444555aaabbb11223",
            "GlobalNetworkId": "global-network-01231231231231231",
            "Description": "NY head office",
            "Location": {
                "Latitude": "40.7128",
                "Longitude": "-74.0060"
            },
            "CreatedAt": 1575554528.0,
            "State": "AVAILABLE"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [GetSites AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-sites.html)*Command Reference*. 

### `get-transit-gateway-registrations`
<a name="networkmanager_GetTransitGatewayRegistrations_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-transit-gateway-registrations`.

**AWS CLI**  
**Come ottenere le registrazioni dei gateway di transito**  
L’esempio `get-transit-gateway-registrations` seguente ottiene i gateway di transito registrati nella rete globale specificata.  

```
aws networkmanager get-transit-gateway-registrations \
    --global-network-id global-network-01231231231231231 \
    --region us-west-2
```
Output:  

```
{
    "TransitGatewayRegistrations": [
        {
            "GlobalNetworkId": "global-network-01231231231231231",
            "TransitGatewayArn": "arn:aws:ec2:us-west-2:123456789012:transit-gateway/tgw-123abc05e04123abc",
            "State": {
                "Code": "AVAILABLE"
            }
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [GetTransitGatewayRegistrations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-transit-gateway-registrations.html)*Command Reference*. 

### `get-vpc-attachment`
<a name="networkmanager_GetVpcAttachment_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-vpc-attachment`.

**AWS CLI**  
**Per ottenere un allegato VPC**  
L’esempio `get-vpc-attachment` seguente restituisce informazioni su un collegamento VPC.  

```
aws networkmanager get-vpc-attachment \
    --attachment-id  attachment-03b7ea450134787da
```
Output:  

```
{
    "VpcAttachment": {
        "Attachment": {
            "CoreNetworkId": "core-network-0522de1b226a5d7b3",
            "AttachmentId": "attachment-03b7ea450134787da",
            "OwnerAccountId": "987654321012",
            "AttachmentType": "VPC",
            "State": "CREATING",
            "EdgeLocation": "us-east-1",
            "ResourceArn": "arn:aws:ec2:us-east-1:987654321012:vpc/vpc-a7c4bbda",
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "DevVPC"
                }
            ],
            "CreatedAt": "2022-03-11T17:48:58+00:00",
            "UpdatedAt": "2022-03-11T17:48:58+00:00"
        },
        "SubnetArns": [
            "arn:aws:ec2:us-east-1:987654321012:subnet/subnet-202cde6c",
            "arn:aws:ec2:us-east-1:987654321012:subnet/subnet-e5022dba",
            "arn:aws:ec2:us-east-1:987654321012:subnet/subnet-2387ae02",
            "arn:aws:ec2:us-east-1:987654321012:subnet/subnet-cda9dffc"
        ],
        "Options": {
            "Ipv6Support": false
        }
    }
}
```
Per ulteriori informazioni, consulta [Collegamenti](https://docs.aws.amazon.com/vpc/latest/cloudwan/cloudwan-attachments-working-with.html) nella *Guida per l’utente di Cloud WAN*.  
+  Per i dettagli sull'API, consulta [GetVpcAttachment AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/get-vpc-attachment.html)*Command Reference.* 

### `list-bucket-analytics-configurations`
<a name="networkmanager_ListBucketAnalyticsConfigurations_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-bucket-analytics-configurations`.

**AWS CLI**  
**Come recuperare un elenco di configurazioni di analisi per un bucket**  
L’esempio `list-bucket-analytics-configurations` seguente recupera un elenco di configurazioni di analisi per il bucket specificato.  

```
aws s3api list-bucket-analytics-configurations \
    --bucket amzn-s3-demo-bucket
```
Output:  

```
{
    "AnalyticsConfigurationList": [
        {
            "StorageClassAnalysis": {},
            "Id": "1"
        }
    ],
    "IsTruncated": false
}
```
+  Per i dettagli sull'API, consulta [ListBucketAnalyticsConfigurations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/list-bucket-analytics-configurations.html)*Command Reference*. 

### `list-bucket-metrics-configurations`
<a name="networkmanager_ListBucketMetricsConfigurations_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-bucket-metrics-configurations`.

**AWS CLI**  
**Come recuperare un elenco di configurazioni di analisi per un bucket**  
L’esempio `list-bucket-metrics-configurations` seguente recupera un elenco di configurazioni di metriche per il bucket specificato.  

```
aws s3api list-bucket-metrics-configurations \
    --bucket amzn-s3-demo-bucket
```
Output:  

```
{
    "IsTruncated": false,
    "MetricsConfigurationList": [
        {
            "Filter": {
                "Prefix": "logs"
            },
            "Id": "123"
        },
        {
            "Filter": {
                "Prefix": "tmp"
            },
            "Id": "234"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [ListBucketMetricsConfigurations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/list-bucket-metrics-configurations.html)*Command Reference*. 

### `list-tags-for-resource`
<a name="networkmanager_ListTagsForResource_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-tags-for-resource`.

**AWS CLI**  
**Come elencare i tag per una risorsa**  
L’esempio `list-tags-for-resource` seguente elenca i tag per la risorsa dispositivo specificata (`device-07f6fd08867abc123`).  

```
aws networkmanager list-tags-for-resource \
    --resource-arn arn:aws:networkmanager::123456789012:device/global-network-01231231231231231/device-07f6fd08867abc123 \
    --region us-west-2
```
Output:  

```
{
    "TagList": [
        {
            "Key": "Network",
            "Value": "Northeast"
        }
    ]
}
```
+  Per i dettagli sull'API, consulta [ListTagsForResource AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/list-tags-for-resource.html)*Command Reference*. 

### `put-bucket-metrics-configuration`
<a name="networkmanager_PutBucketMetricsConfiguration_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`put-bucket-metrics-configuration`.

**AWS CLI**  
**Come eliminare una configurazione delle metriche per un bucket**  
L’esempio `put-bucket-metrics-configuration` seguente imposta una configurazione della metrica con ID 123 per il bucket specificato.  

```
aws s3api put-bucket-metrics-configuration \
    --bucket amzn-s3-demo-bucket \
    --id 123 \
    --metrics-configuration '{"Id": "123", "Filter": {"Prefix": "logs"}}'
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [PutBucketMetricsConfiguration AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/put-bucket-metrics-configuration.html)*Command Reference*. 

### `put-object-retention`
<a name="networkmanager_PutObjectRetention_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`put-object-retention`.

**AWS CLI**  
**Come impostare la configurazione di conservazione degli oggetti per un oggetto**  
L’esempio `put-object-retention` seguente imposta una configurazione di conservazione degli oggetti per l’oggetto specificato fino al giorno 01/01/2025.  

```
aws s3api put-object-retention \
    --bucket amzn-s3-demo-bucket-with-object-lock \
    --key doc1.rtf \
    --retention '{ "Mode": "GOVERNANCE", "RetainUntilDate": "2025-01-01T00:00:00" }'
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [PutObjectRetention AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/put-object-retention.html)*Command Reference*. 

### `put-public-access-block`
<a name="networkmanager_PutPublicAccessBlock_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`put-public-access-block`.

**AWS CLI**  
**Come impostare la configurazione di blocco dell’accesso pubblico per un bucket**  
L’esempio `put-public-access-block` seguente imposta una configurazione di blocco dell’accesso pubblico restrittiva per il bucket specificato.  

```
aws s3api put-public-access-block \
    --bucket amzn-s3-demo-bucket \
    --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [PutPublicAccessBlock AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/put-public-access-block.html)*Command Reference*. 

### `register-transit-gateway`
<a name="networkmanager_RegisterTransitGateway_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`register-transit-gateway`.

**AWS CLI**  
**Come registrare un gateway di transito in una rete globale**  
L’esempio `register-transit-gateway` seguente registra il gateway di transito `tgw-123abc05e04123abc` nella rete globale specificata.  

```
aws networkmanager register-transit-gateway \
    --global-network-id global-network-01231231231231231 \
    --transit-gateway-arn arn:aws:ec2:us-west-2:123456789012:transit-gateway/tgw-123abc05e04123abc \
    --region us-west-2
```
Output:  

```
{
    "TransitGatewayRegistration": {
        "GlobalNetworkId": "global-network-01231231231231231",
        "TransitGatewayArn": "arn:aws:ec2:us-west-2:123456789012:transit-gateway/tgw-123abc05e04123abc",
        "State": {
            "Code": "PENDING"
        }
    }
}
```
Per ulteriori informazioni, consulta [Registrazioni di Transit Gateway](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-registrations.html) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [RegisterTransitGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/register-transit-gateway.html)*Command Reference*. 

### `reject-attachment`
<a name="networkmanager_RejectAttachment_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`reject-attachment`.

**AWS CLI**  
**Come rifiutare un collegamento**  
L’esempio `reject-attachment` seguente rifiuta una richiesta di collegamento VPC.  

```
aws networkmanager reject-attachment \
    --attachment-id  attachment-03b7ea450134787da
```
Output:  

```
{
    "Attachment": {
        "CoreNetworkId": "core-network-0522de1b226a5d7b3",
        "AttachmentId": "attachment-03b7ea450134787da",
        "OwnerAccountId": "987654321012",
        "AttachmentType": "VPC",
        "State": "AVAILABLE",
        "EdgeLocation": "us-east-1",
        "ResourceArn": "arn:aws:ec2:us-east-1:987654321012:vpc/vpc-a7c4bbda",
        "CreatedAt": "2022-03-11T17:48:58+00:00",
        "UpdatedAt": "2022-03-11T17:51:25+00:00"
    }
}
```
Per ulteriori informazioni, consulta [Accettazione dei collegamenti](https://docs.aws.amazon.com/vpc/latest/cloudwan/cloudwan-attachments-working-with.html#cloudwan-attachments-acceptance) nella *Guida per l’utente di Cloud WAN*.  
+  Per i dettagli sull'API, consulta [RejectAttachment AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/reject-attachment.html)*Command Reference*. 

### `start-route-analysis`
<a name="networkmanager_StartRouteAnalysis_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`start-route-analysis`.

**AWS CLI**  
**Come avviare l’analisi delle route**  
L’esempio `start-route-analysis` seguente avvia l’analisi tra un’origine e una destinazione, inclusa l’opzione `include-return-path` facoltativa.  

```
aws networkmanager start-route-analysis \
    --global-network-id global-network-00aa0aaa0b0aaa000 \
    --source TransitGatewayAttachmentArn=arn:aws:ec2:us-east-1:503089527312:transit-gateway-attachment/tgw-attach-0d4a2d491bf68c093,IpAddress=10.0.0.0 \
    --destination TransitGatewayAttachmentArn=arn:aws:ec2:us-west-1:503089527312:transit-gateway-attachment/tgw-attach-002577f30bb181742,IpAddress=11.0.0.0 \
    --include-return-path
```
Output:  

```
{
    "RouteAnalysis": {
        "GlobalNetworkId": "global-network-00aa0aaa0b0aaa000
        "OwnerAccountId": "1111222233333",
        "RouteAnalysisId": "a1873de1-273c-470c-1a2bc2345678",
        "StartTimestamp": 1695760154.0,
        "Status": "RUNNING",
        "Source": {
            "TransitGatewayAttachmentArn": "arn:aws:ec2:us-east-1:111122223333:transit-gateway-attachment/tgw-attach-1234567890abcdef0,
            "TransitGatewayArn": "arn:aws:ec2:us-east-1:111122223333:transit-gateway/tgw-abcdef01234567890",
            "IpAddress": "10.0.0.0"
        },
        "Destination": {
            "TransitGatewayAttachmentArn": "arn:aws:ec2:us-west-1:555555555555:transit-gateway-attachment/tgw-attach-021345abcdef6789",
            "TransitGatewayArn": "arn:aws:ec2:us-west-1:111122223333:transit-gateway/tgw-09876543210fedcba0",
            "IpAddress": "11.0.0.0"
        },
        "IncludeReturnPath": true,
        "UseMiddleboxes": false
    }
}
```
Per ulteriori informazioni, consulta [Strumento di analisi delle route](https://docs.aws.amazon.com/network-manager/latest/tgwnm/route-analyzer.html) nella *Guida per l’utente di Reti globali AWS per gateway di transito*.  
+  Per i dettagli sull'API, consulta [StartRouteAnalysis AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/start-route-analysis.html)*Command Reference*. 

### `tag-resource`
<a name="networkmanager_TagResource_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`tag-resource`.

**AWS CLI**  
**Come applicare tag a una risorsa**  
L’esempio `tag-resource` seguente applica il tag `Network=Northeast` al dispositivo `device-07f6fd08867abc123`.  

```
aws networkmanager tag-resource \
    --resource-arn arn:aws:networkmanager::123456789012:device/global-network-01231231231231231/device-07f6fd08867abc123 \
    --tags Key=Network,Value=Northeast \
    --region us-west-2
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [TagResource AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/tag-resource.html)*Command Reference*. 

### `untag-resource`
<a name="networkmanager_UntagResource_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`untag-resource`.

**AWS CLI**  
**Come rimuovere tag da una risorsa**  
L’esempio `untag-resource` seguente rimuove il tag con la chiave `Network` dal dispositivo `device-07f6fd08867abc123`.  

```
aws networkmanager untag-resource \
    --resource-arn arn:aws:networkmanager::123456789012:device/global-network-01231231231231231/device-07f6fd08867abc123 ]
    --tag-keys Network \
    --region us-west-2
```
Questo comando non produce alcun output.  
+  Per i dettagli sull'API, consulta [UntagResource AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/untag-resource.html)*Command Reference*. 

### `update-device`
<a name="networkmanager_UpdateDevice_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`update-device`.

**AWS CLI**  
**Come aggiornare un dispositivo**  
L’esempio `update-device` seguente aggiorna il dispositivo `device-07f6fd08867abc123` specificando un ID del sito per il dispositivo.  

```
aws networkmanager update-device \
    --global-network-id global-network-01231231231231231 \
    --device-id device-07f6fd08867abc123 \
    --site-id site-444555aaabbb11223 \
    --region us-west-2
```
Output:  

```
{
    "Device": {
        "DeviceId": "device-07f6fd08867abc123",
        "DeviceArn": "arn:aws:networkmanager::123456789012:device/global-network-01231231231231231/device-07f6fd08867abc123",
        "GlobalNetworkId": "global-network-01231231231231231",
        "Description": "NY office device",
        "Type": "Office device",
        "Vendor": "anycompany",
        "Model": "abcabc",
        "SerialNumber": "1234",
        "SiteId": "site-444555aaabbb11223",
        "CreatedAt": 1575554005.0,
        "State": "UPDATING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di dispositivi](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-devices) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [UpdateDevice AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/update-device.html)*Command Reference*. 

### `update-global-network`
<a name="networkmanager_UpdateGlobalNetwork_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`update-global-network`.

**AWS CLI**  
**Come aggiornare una rete globale**  
L’esempio `update-global-network` seguente aggiorna la descrizione per la rete globale `global-network-01231231231231231`.  

```
aws networkmanager update-global-network \
    --global-network-id global-network-01231231231231231 \
    --description "Head offices" \
    --region us-west-2
```
Output:  

```
{
    "GlobalNetwork": {
        "GlobalNetworkId": "global-network-01231231231231231",
        "GlobalNetworkArn": "arn:aws:networkmanager::123456789012:global-network/global-network-01231231231231231",
        "Description": "Head offices",
        "CreatedAt": 1575553525.0,
        "State": "UPDATING"
    }
}
```
Per ulteriori informazioni, consulta [Reti globali](https://docs.aws.amazon.com/vpc/latest/tgw/global-networks.html) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [UpdateGlobalNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/update-global-network.html)*Command Reference*. 

### `update-link`
<a name="networkmanager_UpdateLink_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`update-link`.

**AWS CLI**  
**Come aggiornare un link**  
L’esempio `update-link` seguente aggiorna le informazioni sulla larghezza di banda per il link `link-11112222aaaabbbb1`.  

```
aws networkmanager update-link \
    --global-network-id global-network-01231231231231231 \
    --link-id link-11112222aaaabbbb1 \
    --bandwidth  UploadSpeed=20,DownloadSpeed=20 \
    --region us-west-2
```
Output:  

```
{
    "Link": {
        "LinkId": "link-11112222aaaabbbb1",
        "LinkArn": "arn:aws:networkmanager::123456789012:link/global-network-01231231231231231/link-11112222aaaabbbb1",
        "GlobalNetworkId": "global-network-01231231231231231",
        "SiteId": "site-444555aaabbb11223",
        "Description": "VPN Link",
        "Type": "broadband",
        "Bandwidth": {
            "UploadSpeed": 20,
            "DownloadSpeed": 20
        },
        "Provider": "AnyCompany",
        "CreatedAt": 1575555811.0,
        "State": "UPDATING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di link](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-links) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [UpdateLink AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/update-link.html)*Command Reference*. 

### `update-site`
<a name="networkmanager_UpdateSite_cli_topic"></a>

Il seguente esempio di codice mostra come utilizzare`update-site`.

**AWS CLI**  
**Come aggiornare un sito**  
L’esempio `update-site` seguente aggiorna la descrizione per il sito `site-444555aaabbb11223` nella rete globale specificata.  

```
aws networkmanager update-site \
    --global-network-id global-network-01231231231231231 \
    --site-id site-444555aaabbb11223 \
    --description "New York Office site" \
    --region us-west-2
```
Output:  

```
{
    "Site": {
        "SiteId": "site-444555aaabbb11223",
        "SiteArn": "arn:aws:networkmanager::123456789012:site/global-network-01231231231231231/site-444555aaabbb11223",
        "GlobalNetworkId": "global-network-01231231231231231",
        "Description": "New York Office site",
        "Location": {
            "Latitude": "40.7128",
            "Longitude": "-74.0060"
        },
        "CreatedAt": 1575554528.0,
        "State": "UPDATING"
    }
}
```
Per ulteriori informazioni, consulta [Utilizzo di siti](https://docs.aws.amazon.com/vpc/latest/tgw/on-premises-networks.html#working-with-sites) nella *Guida di Transit Gateway network manager*.  
+  Per i dettagli sull'API, consulta [UpdateSite AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/networkmanager/update-site.html)*Command Reference*. 