Skip to content

create_workload_estimate

create_workload_estimate(
    name: WorkloadEstimateName,
    *,
    config_overrides: Optional[BCMPricingCalculatorClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    rate_type: Optional[WorkloadEstimateRateType] = None,
    tags: Optional[Tags] = None,
) -> CreateWorkloadEstimateResponse

Creates a new workload estimate to model costs for a specific workload.

Parameters:

  • name (WorkloadEstimateName) –

    A descriptive name for the workload estimate.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure idempotency of the request.

  • rate_type (Optional[WorkloadEstimateRateType], default: None ) –

    The type of pricing rates for the estimate. You can only use a rate type that your Pricing Calculator rate preferences allow. If you use billing transfer as a bill source account, you can only use BEFORE_DISCOUNTS.

  • tags (Optional[Tags], default: None ) –

    The tags to apply to the workload estimate.

Raises:

  • AccessDeniedException –

    The request is denied because you don't have sufficient permissions to perform this operation. Verify that you have the required permissions and try again.

  • InternalServerException –

    An internal error has occurred. Retry your request, but if the problem persists, contact Amazon Web Services support.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input provided fails to satisfy the constraints specified by an Amazon Web Services service.

  • ConflictException –

    The request couldn't be processed because the resource is in a conflicting state. Verify the resource's current state and retry the request.

  • DataUnavailableException –

    The requested data is currently unavailable.

  • ServiceQuotaExceededException –

    The request would cause you to exceed your service quota.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_bcm_pricing_calculator/_services/bcm_pricing_calculator.py
def create_workload_estimate(
    self,
    name: "capo_bcm_pricing_calculator.types.workload_estimate_name.WorkloadEstimateName",
    *,
    config_overrides: Optional[BCMPricingCalculatorClientConfig] = None,
    client_token: Optional[
        "capo_bcm_pricing_calculator.types.client_token.ClientToken"
    ] = None,
    rate_type: Optional[
        "capo_bcm_pricing_calculator.types.workload_estimate_rate_type.WorkloadEstimateRateType"
    ] = None,
    tags: Optional["capo_bcm_pricing_calculator.types.tags.Tags"] = None,
) -> "capo_bcm_pricing_calculator.types.create_workload_estimate_response.CreateWorkloadEstimateResponse":
    """<p> Creates a new workload estimate to model costs for a specific workload. </p>

    Args:
        name: <p> A descriptive name for the workload estimate. </p>
        client_token: <p> A unique, case-sensitive identifier to ensure idempotency of the request. </p>
        rate_type: <p> The type of pricing rates for the estimate. You can only use a rate type that your Pricing Calculator rate preferences allow. If you use billing transfer as a bill source account, you can only use BEFORE_DISCOUNTS. </p>
        tags: <p> The tags to apply to the workload estimate. </p>

    Raises:
        capo_bcm_pricing_calculator.errors.access_denied_exception.AccessDeniedException: <p> The request is denied because you don't have sufficient permissions to perform this operation. Verify that you have the required permissions and try again. </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.conflict_exception.ConflictException: <p> The request couldn't be processed because the resource is in a conflicting state. Verify the resource's current state and retry the request. </p>
        capo_bcm_pricing_calculator.errors.data_unavailable_exception.DataUnavailableException: <p> The requested data is currently unavailable. </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.
    """

    def _handler(
        req: "OperationRequest[capo_bcm_pricing_calculator.types.create_workload_estimate_request.CreateWorkloadEstimateRequest]",
    ) -> OperationResponse[
        "capo_bcm_pricing_calculator.types.create_workload_estimate_response.CreateWorkloadEstimateResponse"
    ]:
        import capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.create_workload_estimate

        output, http_response = (
            capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.create_workload_estimate.create_workload_estimate(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkloadEstimate")
    )
    input_: capo_bcm_pricing_calculator.types.create_workload_estimate_request.CreateWorkloadEstimateRequest = {
        "name": name
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if rate_type is not None:
        input_["rate_type"] = rate_type
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output