Preview a reservation purchase with configurations that match those of your Dedicated Host. You must have active Dedicated Hosts in your account before you purchase a reservation.
This is a preview of the PurchaseHostReservation action and does not result in the offering being purchased.
Parameters:
-
host_id_set
(Optional[RequestHostIdSet], default:
None
)
–
The IDs of the Dedicated Hosts with which the reservation is associated.
-
offering_id
(Optional[OfferingId], default:
None
)
–
The offering ID of the reservation.
Raises:
Source code in docs_src/capo_ec2/_services/async_ec2.py
| async def get_host_reservation_purchase_preview(
self,
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
host_id_set: Optional[
"capo_ec2.types.request_host_id_set.RequestHostIdSet"
] = None,
offering_id: Optional["capo_ec2.types.offering_id.OfferingId"] = None,
) -> "capo_ec2.types.get_host_reservation_purchase_preview_result.GetHostReservationPurchasePreviewResult":
"""<p>Preview a reservation purchase with configurations that match those of your Dedicated Host. You must have active Dedicated Hosts in your account before you purchase a reservation.</p> <p>This is a preview of the <a>PurchaseHostReservation</a> action and does not result in the offering being purchased.</p>
Args:
host_id_set: <p>The IDs of the Dedicated Hosts with which the reservation is associated.</p>
offering_id: <p>The offering ID of the reservation.</p>
Raises:
capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_ec2.types.get_host_reservation_purchase_preview_request.GetHostReservationPurchasePreviewRequest]",
) -> AsyncOperationResponse[
"capo_ec2.types.get_host_reservation_purchase_preview_result.GetHostReservationPurchasePreviewResult"
]:
import capo_ec2._operations.amazon_ec2.get_host_reservation_purchase_preview
(
output,
http_response,
) = await capo_ec2._operations.amazon_ec2.get_host_reservation_purchase_preview.async_get_host_reservation_purchase_preview(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetHostReservationPurchasePreview")
)
input_: capo_ec2.types.get_host_reservation_purchase_preview_request.GetHostReservationPurchasePreviewRequest = {}
if host_id_set is not None:
input_["host_id_set"] = host_id_set
if offering_id is not None:
input_["offering_id"] = offering_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|