use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class UpdateTable method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " UpdateTable <tableName> <readCapacity> <writeCapacity>\n\n" + "Where:\n" + " tableName - the Amazon DynamoDB table to update (for example, Music3).\n" + " readCapacity - the new read capacity of the table (for example, 16).\n" + " writeCapacity - the new write capacity of the table (for example, 10).\n\n" + "Example:\n" + " UpdateTable Music3 16 10\n";
if (args.length != 3) {
System.out.println(USAGE);
System.exit(1);
}
String tableName = args[0];
Long readCapacity = Long.parseLong(args[1]);
Long writeCapacity = Long.parseLong(args[2]);
Region region = Region.US_WEST_2;
DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
updateDynamoDBTable(ddb, tableName, readCapacity, writeCapacity);
ddb.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class CloudWatchTest method setUp.
@BeforeAll
public static void setUp() throws IOException {
Region region = Region.US_WEST_2;
;
cw = CloudWatchClient.builder().region(region).build();
cloudWatchLogsClient = CloudWatchLogsClient.builder().region(region).build();
cwe = CloudWatchEventsClient.builder().region(region).build();
try (InputStream input = CloudWatchTest.class.getClassLoader().getResourceAsStream("config.properties")) {
Properties prop = new Properties();
if (input == null) {
System.out.println("Sorry, unable to find config.properties");
return;
}
// load a properties file from class path, inside static method
prop.load(input);
// Populate the data members required for all tests
logGroup = prop.getProperty("logGroup");
alarmName = prop.getProperty("alarmName");
streamName = prop.getProperty("streamName");
ruleResource = prop.getProperty("ruleResource");
metricId = prop.getProperty("metricId");
filterName = prop.getProperty("filterName");
destinationArn = prop.getProperty("destinationArn");
roleArn = prop.getProperty("roleArn");
filterPattern = prop.getProperty("filterPattern");
instanceId = prop.getProperty("instanceId");
ruleName = prop.getProperty("ruleName");
ruleArn = prop.getProperty("ruleArn");
namespace = prop.getProperty("namespace");
} catch (IOException ex) {
ex.printStackTrace();
}
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class CreatePullRequest method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <repoName> <destinationReference> <sourceReference> \n\n" + "Where:\n" + " repoName - the name of the repository.\n" + " destinationReference - the branch of the repository where the pull request changes are merged.\n" + " sourceReference - the branch of the repository that contains the changes for the pull request.\n";
if (args.length != 3) {
System.out.println(USAGE);
System.exit(1);
}
String repoName = args[0];
String destinationReference = args[1];
String sourceReference = args[2];
Region region = Region.US_EAST_1;
CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
String prId = createPR(codeCommitClient, repoName, destinationReference, sourceReference);
System.out.println("The pull request id is " + prId);
codeCommitClient.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class DeleteBranch method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <repoName> <branchName> \n\n" + "Where:\n" + " repoName - the name of the repository.\n" + " branchName - the name of the branch. \n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String repoName = args[0];
String branchName = args[1];
Region region = Region.US_EAST_1;
CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
deleteSpecificBranch(codeCommitClient, repoName, branchName);
codeCommitClient.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class DescribePullRequestEvents method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <prId> \n\n" + "Where:\n" + " prId - the id of the pull request. \n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String prId = args[0];
Region region = Region.US_EAST_1;
CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
describePREvents(codeCommitClient, prId);
codeCommitClient.close();
}
Aggregations