User guide
ModifyClusterRequest request = new ModifyClusterRequest()
.withClusterIdentifier(clusterIdentifier)
.withPreferredMaintenanceWindow("wed:07:30-wed:08:00");
client.modifyCluster(request);
System.out.println("Modified cluster " + clusterIdentifier);
}
private static void printResult(DescribeClustersResult result)
{
if (result == null)
{
System.out.println("Describe clusters result is null.");
return;
}
System.out.println("Cluster property:");
System.out.format("Preferred Maintenance Window: %s\n", res
ult.getClusters().get(0).getPreferredMaintenanceWindow());
}
private static void waitForClusterReady() throws InterruptedException {
Boolean clusterReady = false;
System.out.println("Wating for cluster to become available.");
while (!clusterReady) {
DescribeClustersResult result = client.describeClusters(new Describe
ClustersRequest()
.withClusterIdentifier(clusterIdentifier));
String status = (result.getClusters()).get(0).getClusterStatus();
if (status.equalsIgnoreCase("available")) {
clusterReady = true;
}
else {
System.out.print(".");
Thread.sleep(sleepTime*1000);
}
}
}
}
Manage Clusters Using the Amazon Redshift
CLI and API
You can use the following Amazon Redshift CLI operations to manage clusters.
• create-cluster
• delete-cluster
• describe-clusters
• describe-cluster-versions
• describe-orderable-cluster-options
• modify-cluster
• reboot-cluster
API Version 2012-12-01
31
Amazon Redshift Management Guide
Manage Clusters Using the Amazon Redshift CLI and
API