Skip to content

reboot_db_instance

reboot_db_instance(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional[String] = None,
    force_failover: Optional[BooleanOptional] = None,
) -> RebootDBInstanceResult

You might need to reboot your DB instance, usually for maintenance reasons. For example, if you make certain modifications, or if you change the DB parameter group associated with the DB instance, you must reboot the instance for the changes to take effect.

Rebooting a DB instance restarts the database engine service. Rebooting a DB instance results in a momentary outage, during which the DB instance status is set to rebooting.

For more information about rebooting, see Rebooting a DB Instance in the Amazon RDS User Guide.

This command doesn't apply to RDS Custom.

If your DB instance is part of a Multi-AZ DB cluster, you can reboot the DB cluster with the RebootDBCluster operation.

Parameters:

  • db_instance_identifier (Optional[String], default: None ) –

    The DB instance identifier. This parameter is stored as a lowercase string.

    Constraints:

    • Must match the identifier of an existing DBInstance.

  • force_failover (Optional[BooleanOptional], default: None ) –

    Specifies whether the reboot is conducted through a Multi-AZ failover.

    Constraint: You can't enable force failover if the instance isn't configured for Multi-AZ.

Raises:

Examples:

To reboot a DB instance The following example starts a reboot of the specified DB instance.

>>> client.reboot_db_instance(db_instance_identifier='test-mysql-instance')
Source code in docs_src/capo_rds/_services/rds.py
def reboot_db_instance(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional["capo_rds.types.string.String"] = None,
    force_failover: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_rds.types.reboot_db_instance_result.RebootDBInstanceResult":
    """<p>You might need to reboot your DB instance, usually for maintenance reasons. For example, if you make certain modifications, or if you change the DB parameter group associated with the DB instance, you must reboot the instance for the changes to take effect.</p> <p>Rebooting a DB instance restarts the database engine service. Rebooting a DB instance results in a momentary outage, during which the DB instance status is set to rebooting.</p> <p>For more information about rebooting, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RebootInstance.html">Rebooting a DB Instance</a> in the <i>Amazon RDS User Guide.</i> </p> <p>This command doesn't apply to RDS Custom.</p> <p>If your DB instance is part of a Multi-AZ DB cluster, you can reboot the DB cluster with the <code>RebootDBCluster</code> operation.</p>

    Args:
        db_instance_identifier: <p>The DB instance identifier. This parameter is stored as a lowercase string.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing DBInstance.</p> </li> </ul>
        force_failover: <p>Specifies whether the reboot is conducted through a Multi-AZ failover.</p> <p>Constraint: You can't enable force failover if the instance isn't configured for Multi-AZ.</p>

    Raises:
        capo_rds.errors.db_instance_not_found_fault.DBInstanceNotFoundFault: <p> <code>DBInstanceIdentifier</code> doesn't refer to an existing DB instance.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.kms_key_not_accessible_fault.KMSKeyNotAccessibleFault: <p>An error occurred accessing an Amazon Web Services KMS key.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To reboot a DB instance
        The following example starts a reboot of the specified DB instance.

        >>> client.reboot_db_instance(db_instance_identifier='test-mysql-instance')
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.reboot_db_instance_message.RebootDBInstanceMessage]",
    ) -> OperationResponse[
        "capo_rds.types.reboot_db_instance_result.RebootDBInstanceResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.reboot_db_instance

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.reboot_db_instance.reboot_db_instance(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_rds.types.reboot_db_instance_result.RebootDBInstanceResult",
    ) -> dict[str, Any]:
        import capo_rds.types.reboot_db_instance_result

        return capo_rds.types.reboot_db_instance_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("RebootDBInstance", redact_output=_redact_output),
    )
    input_: capo_rds.types.reboot_db_instance_message.RebootDBInstanceMessage = {}
    if db_instance_identifier is not None:
        input_["db_instance_identifier"] = db_instance_identifier
    if force_failover is not None:
        input_["force_failover"] = force_failover

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