Weitere AWS-SDK-Beispiele sind im GitHub-Repository Beispiele für AWS Doc SDKs
Verwendung von CancelCapacityReservation mit einer CLI
Die folgenden Code-Beispiele zeigen, wie CancelCapacityReservation verwendet wird.
- CLI
-
- AWS CLI
-
So stornieren Sie eine Kapazitätsreservierung
Im folgenden
cancel-capacity-reservation-Beispiel wird die angegebene Kapazitätsreservierung storniert.aws ec2 cancel-capacity-reservation \ --capacity-reservation-idcr-1234abcd56EXAMPLEAusgabe:
{ "Return": true }Weitere Informationen finden Sie unter Stornieren einer Kapazitätsreservierung im Amazon-EC2-Benutzerhandbuch.
-
Weitere API-Informationen finden Sie unter CancelCapacityReservation
in der AWS CLI-Befehlsreferenz.
-
- PowerShell
-
- Tools für PowerShell V4
-
Beispiel 1: In diesem Beispiel wird die Kapazitätsreservierung cr-0c1f2345db6f7cdba storniert
Remove-EC2CapacityReservation -CapacityReservationId cr-0c1f2345db6f7cdbaAusgabe:
Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2CapacityReservation (CancelCapacityReservation)" on target "cr-0c1f2345db6f7cdba". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y True-
Weitere API-Informationen finden Sie unter CancelCapacityReservation in der AWS -Tools für PowerShell-Cmdlet-Referenz (V4).
-
- Tools für PowerShell V5
-
Beispiel 1: In diesem Beispiel wird die Kapazitätsreservierung cr-0c1f2345db6f7cdba storniert
Remove-EC2CapacityReservation -CapacityReservationId cr-0c1f2345db6f7cdbaAusgabe:
Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2CapacityReservation (CancelCapacityReservation)" on target "cr-0c1f2345db6f7cdba". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y True-
Weitere API-Informationen finden Sie unter CancelCapacityReservation in der AWS -Tools für PowerShell-Cmdlet-Referenz (V5).
-