Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Reboot an Amazon RDS DB instance using an Amazon SDK
The following code example shows how to reboot an Amazon RDS DB instance.
- Java
-
- SDK for Java 2.x
-
public static void rebootInstance(RdsClient rdsClient, String dbInstanceIdentifier ) {
try {
RebootDbInstanceRequest rebootDbInstanceRequest = RebootDbInstanceRequest.builder()
.dbInstanceIdentifier(dbInstanceIdentifier)
.build();
RebootDbInstanceResponse instanceResponse = rdsClient.rebootDBInstance(rebootDbInstanceRequest);
System.out.print("The database "+ instanceResponse.dbInstance().dbInstanceArn() +" was rebooted");
} catch (RdsException e) {
System.out.println(e.getLocalizedMessage());
System.exit(1);
}
}
For a complete list of Amazon SDK developer guides and code examples, see
Using this service with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.