Skip to content

get_default_credit_specification

get_default_credit_specification(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    instance_family: Optional[UnlimitedSupportedInstanceFamily] = None,
) -> GetDefaultCreditSpecificationResult

Describes the default credit option for CPU usage of a burstable performance instance family.

For more information, see Burstable performance instances in the Amazon EC2 User Guide.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • instance_family (Optional[UnlimitedSupportedInstanceFamily], default: None ) –

    The instance family.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def get_default_credit_specification(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_family: Optional[
        "capo_ec2.types.unlimited_supported_instance_family.UnlimitedSupportedInstanceFamily"
    ] = None,
) -> "capo_ec2.types.get_default_credit_specification_result.GetDefaultCreditSpecificationResult":
    """<p>Describes the default credit option for CPU usage of a burstable performance instance family.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        instance_family: <p>The instance family.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.get_default_credit_specification_request.GetDefaultCreditSpecificationRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.get_default_credit_specification_result.GetDefaultCreditSpecificationResult"
    ]:
        import capo_ec2._operations.amazon_ec2.get_default_credit_specification

        output, http_response = (
            capo_ec2._operations.amazon_ec2.get_default_credit_specification.get_default_credit_specification(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetDefaultCreditSpecification")
    )
    input_: capo_ec2.types.get_default_credit_specification_request.GetDefaultCreditSpecificationRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if instance_family is not None:
        input_["instance_family"] = instance_family

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