Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK
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 ReleaseHosts
con una CLI
Gli esempi di codice seguenti mostrano come utilizzare ReleaseHosts
.
- CLI
-
- AWS CLI
-
Per rilasciare un host dedicato dal tuo account
Per rilasciare un host dedicato dal tuo account. Le istanze presenti sull'host devono essere interrotte o terminate prima che l'host possa essere rilasciato.
Comando:
aws ec2 release-hosts --host-id=h-0029d6e3cacf1b3da
Output:
{ "Successful": [ "h-0029d6e3cacf1b3da" ], "Unsuccessful": [] }
-
Per i dettagli sull'API, consulta AWS CLI Command ReleaseHosts
Reference.
-
- PowerShell
-
- Strumenti per PowerShell V4
-
Esempio 1: Questo esempio rilascia l'ID host specificato h-0badafd1dcb2f3456
Remove-EC2Host -HostId h-0badafd1dcb2f3456
Output:
Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2Host (ReleaseHosts)" on target "h-0badafd1dcb2f3456". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Successful Unsuccessful ---------- ------------ {h-0badafd1dcb2f3456} {}
-
Per i dettagli sull'API, vedere in Cmdlet Reference (V4). ReleaseHostsAWS Strumenti per PowerShell
-
- Strumenti per V5 PowerShell
-
Esempio 1: Questo esempio rilascia l'ID host specificato h-0badafd1dcb2f3456
Remove-EC2Host -HostId h-0badafd1dcb2f3456
Output:
Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2Host (ReleaseHosts)" on target "h-0badafd1dcb2f3456". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Successful Unsuccessful ---------- ------------ {h-0badafd1dcb2f3456} {}
-
Per i dettagli sull'API, vedere in Cmdlet Reference (V5). ReleaseHostsAWS Strumenti per PowerShell
-