Search in sources :

Example 26 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class MergeBranches method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <repoName> <targetBranch> <sourceReference> <destinationCommitId>\n\n" + "Where:\n" + "    repoName - the name of the repository.\n" + "    targetBranch -  the branch where the merge is applied.\n" + "    sourceReference  - the branch of the repository that contains the changes.\n" + "    destinationCommitId  - a full commit ID.\n";
    if (args.length != 4) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String repoName = args[0];
    String targetBranch = args[1];
    String sourceReference = args[2];
    String destinationCommitId = args[3];
    Region region = Region.US_EAST_1;
    CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
    merge(codeCommitClient, repoName, targetBranch, sourceReference, destinationCommitId);
    codeCommitClient.close();
}
Also used : CodeCommitClient(software.amazon.awssdk.services.codecommit.CodeCommitClient) Region(software.amazon.awssdk.regions.Region)

Example 27 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class CodeCommitTest method setUp.

@BeforeAll
public static void setUp() throws IOException, URISyntaxException {
    Region region = Region.US_EAST_1;
    codeCommitClient = CodeCommitClient.builder().region(region).build();
    try (InputStream input = CodeCommitClient.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
        newRepoName = prop.getProperty("newRepoName");
        existingRepoName = prop.getProperty("existingRepoName");
        newBranchName = prop.getProperty("newBranchName");
        existingBranchName = prop.getProperty("existingBranchName");
        branchCommitId = prop.getProperty("branchCommitId");
        filePath = prop.getProperty("filePath");
        name = prop.getProperty("name");
        repoPath = prop.getProperty("repoPath");
        email = prop.getProperty("email");
        targetBranch = prop.getProperty("targetBranch");
        prID = prop.getProperty("prID");
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}
Also used : CodeCommitClient(software.amazon.awssdk.services.codecommit.CodeCommitClient) Region(software.amazon.awssdk.regions.Region)

Example 28 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class DeleteDeploymentGroup method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <appName> <deploymentGroupName>\n\n" + "Where:\n" + "    appName - the name of the application. \n" + "    deploymentGroupName - the name of the deployment group. \n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String appName = args[0];
    String deploymentGroupName = args[1];
    Region region = Region.US_EAST_1;
    CodeDeployClient deployClient = CodeDeployClient.builder().region(region).build();
    delDeploymentGroup(deployClient, appName, deploymentGroupName);
    deployClient.close();
}
Also used : CodeDeployClient(software.amazon.awssdk.services.codedeploy.CodeDeployClient) Region(software.amazon.awssdk.regions.Region)

Example 29 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class CreatePipeline method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "   <name> <roleArn> <s3Bucket> <s3OuputBucket>\n\n" + "Where:\n" + "   name - the name of the pipeline to create. \n\n" + "   roleArn - the Amazon Resource Name (ARN) for AWS CodePipeline to use.  \n\n" + "   s3Bucket - the name of the Amazon S3 bucket where the code is located.  \n\n" + "   s3OuputBucket - the name of the Amazon S3 bucket where the code is deployed.  \n\n";
    if (args.length != 4) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String name = args[0];
    String roleArn = args[1];
    String s3Bucket = args[2];
    String s3OuputBucket = args[3];
    Region region = Region.US_EAST_1;
    CodePipelineClient pipelineClient = CodePipelineClient.builder().region(region).build();
    createNewPipeline(pipelineClient, name, roleArn, s3Bucket, s3OuputBucket);
    pipelineClient.close();
}
Also used : CodePipelineClient(software.amazon.awssdk.services.codepipeline.CodePipelineClient) Region(software.amazon.awssdk.regions.Region)

Example 30 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class ListPipelines method main.

public static void main(String[] args) {
    Region region = Region.US_EAST_1;
    CodePipelineClient pipelineClient = CodePipelineClient.builder().region(region).build();
    getAllPipelines(pipelineClient);
    pipelineClient.close();
}
Also used : CodePipelineClient(software.amazon.awssdk.services.codepipeline.CodePipelineClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

Region (software.amazon.awssdk.regions.Region)534 S3Client (software.amazon.awssdk.services.s3.S3Client)43 RekognitionClient (software.amazon.awssdk.services.rekognition.RekognitionClient)32 DynamoDbClient (software.amazon.awssdk.services.dynamodb.DynamoDbClient)31 IamClient (software.amazon.awssdk.services.iam.IamClient)23 PersonalizeClient (software.amazon.awssdk.services.personalize.PersonalizeClient)22 Ec2Client (software.amazon.awssdk.services.ec2.Ec2Client)20 Test (org.junit.Test)17 AwsCredentialsProvider (software.amazon.awssdk.auth.credentials.AwsCredentialsProvider)15 KmsClient (software.amazon.awssdk.services.kms.KmsClient)15 URI (java.net.URI)13 CodeCommitClient (software.amazon.awssdk.services.codecommit.CodeCommitClient)13 GlueClient (software.amazon.awssdk.services.glue.GlueClient)12 Properties (java.util.Properties)11 DynamoDbEnhancedClient (software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient)11 SesClient (software.amazon.awssdk.services.ses.SesClient)11 SdkBytes (software.amazon.awssdk.core.SdkBytes)9 Route53Client (software.amazon.awssdk.services.route53.Route53Client)9 CloudTrailClient (software.amazon.awssdk.services.cloudtrail.CloudTrailClient)8 CloudWatchClient (software.amazon.awssdk.services.cloudwatch.CloudWatchClient)8