Update a newly added or existing usage lines. You can update the usage amounts and usage group based on a usage ID and a Workload estimate ID.
The BatchUpdateWorkloadEstimateUsage operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission bcm-pricing-calculator:UpdateWorkloadEstimateUsage in your policies.
Parameters:
-
workload_estimate_id
(ResourceId)
–
The ID of the Workload estimate for which you want to modify the usage lines.
-
usage
(BatchUpdateWorkloadEstimateUsageEntries)
–
List of usage line amounts and usage group that you want to update in a Workload estimate identified by the usage ID.
Raises:
Source code in docs_src/capo_bcm_pricing_calculator/_services/async_bcm_pricing_calculator.py
| async def batch_update_workload_estimate_usage(
self,
workload_estimate_id: "capo_bcm_pricing_calculator.types.resource_id.ResourceId",
usage: "capo_bcm_pricing_calculator.types.batch_update_workload_estimate_usage_entries.BatchUpdateWorkloadEstimateUsageEntries",
*,
config_overrides: Optional[AsyncBCMPricingCalculatorClientConfig] = None,
) -> "capo_bcm_pricing_calculator.types.batch_update_workload_estimate_usage_response.BatchUpdateWorkloadEstimateUsageResponse":
"""<p> Update a newly added or existing usage lines. You can update the usage amounts and usage group based on a usage ID and a Workload estimate ID. </p> <note> <p>The <code>BatchUpdateWorkloadEstimateUsage</code> operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission <code>bcm-pricing-calculator:UpdateWorkloadEstimateUsage</code> in your policies.</p> </note>
Args:
workload_estimate_id: <p> The ID of the Workload estimate for which you want to modify the usage lines. </p>
usage: <p> List of usage line amounts and usage group that you want to update in a Workload estimate identified by the usage ID. </p>
Raises:
capo_bcm_pricing_calculator.errors.access_denied_exception.AccessDeniedException: <p> You do not have sufficient access to perform this action. </p>
capo_bcm_pricing_calculator.errors.internal_server_exception.InternalServerException: <p> An internal error has occurred. Retry your request, but if the problem persists, contact Amazon Web Services support. </p>
capo_bcm_pricing_calculator.errors.throttling_exception.ThrottlingException: <p> The request was denied due to request throttling. </p>
capo_bcm_pricing_calculator.errors.validation_exception.ValidationException: <p> The input provided fails to satisfy the constraints specified by an Amazon Web Services service. </p>
capo_bcm_pricing_calculator.errors.data_unavailable_exception.DataUnavailableException: <p> The requested data is currently unavailable. </p>
capo_bcm_pricing_calculator.errors.resource_not_found_exception.ResourceNotFoundException: <p> The specified resource was not found. </p>
capo_bcm_pricing_calculator.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> The request would cause you to exceed your service quota. </p>
capo_bcm_pricing_calculator.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_bcm_pricing_calculator.types.batch_update_workload_estimate_usage_request.BatchUpdateWorkloadEstimateUsageRequest]",
) -> AsyncOperationResponse[
"capo_bcm_pricing_calculator.types.batch_update_workload_estimate_usage_response.BatchUpdateWorkloadEstimateUsageResponse"
]:
import capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.batch_update_workload_estimate_usage
(
output,
http_response,
) = await capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.batch_update_workload_estimate_usage.async_batch_update_workload_estimate_usage(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("BatchUpdateWorkloadEstimateUsage")
)
input_: capo_bcm_pricing_calculator.types.batch_update_workload_estimate_usage_request.BatchUpdateWorkloadEstimateUsageRequest = {
"workload_estimate_id": workload_estimate_id,
"usage": usage,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|