我想使用 Oracle Java Cloud SDK 进行 Oracle Cloud Database Backup。帮我做这个!
问问题
183 次
2 回答
1
乔说的。CLIENT
在他的例子中是DatabaseClient
:
于 2018-02-05T15:43:52.980 回答
1
这是一些示例代码来执行此操作:
private static Backup createBackup(String databaseId) throws Exception {
DatabaseWaiters waiters = CLIENT.getWaiters();
String displayName = "db-backup";
CreateBackupRequest createBackupRequest =
CreateBackupRequest.builder()
.createBackupDetails(
CreateBackupDetails.builder()
.databaseId(databaseId)
.displayName(displayName)
.build())
.build();
CreateBackupResponse createBackupResponse = CLIENT.createBackup(createBackupRequest);
Backup backup = createBackupResponse.getBackup();
waiters.forBackup(
GetBackupRequest.builder().backupId(backup.getId()).build(),
Backup.LifecycleState.Active,
new MaxTimeTerminationStrategy(60 * 60 * 1000),
new ExponentialBackoffDelayStrategy(60 * 1000))
.execute();
return backup;
}
于 2018-02-02T19:01:46.473 回答