Search in sources :

Example 16 with PersonalizeClient

use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.

the class CreateCampaign method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    CreateCampaign <solutionVersionArn> <name>\n\n" + "Where:\n" + "    solutionVersionArn - The ARN of the solution version.\n\n" + "    name - The name of the Amazon Personalization campaign.\n\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String solutionVersionArn = args[0];
    String name = args[1];
    Region region = Region.US_EAST_1;
    PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
    createPersonalCompaign(personalizeClient, solutionVersionArn, name);
    personalizeClient.close();
}
Also used : PersonalizeClient(software.amazon.awssdk.services.personalize.PersonalizeClient) Region(software.amazon.awssdk.regions.Region)

Example 17 with PersonalizeClient

use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.

the class CreateDatasetExportJob method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    CreateDatasetExportJob <name, datasetArn, ingestionMode, roleArn, s3BucketPath>\n\n" + "Where:\n" + "    jobName - The name for the dataset export job.\n" + "    datasetArn - The Amazon Resource Name (ARN) of the dataset that contains the data to export.\n" + "    ingestionMode - The data to export, based on how you imported the data.\n" + "    roleArn - The Amazon Resource Name (ARN) of the IAM service role that" + "has permissions to add data to your output Amazon S3 bucket.\n" + "    s3BucketPath - The path to your output bucket\n" + "    kmsKeyArn - The ARN for your KMS key\n\n";
    if (args.length != 6) {
        System.out.println(USAGE);
        System.exit(1);
    }
    IngestionMode ingestionMode = IngestionMode.ALL;
    String jobName = args[0];
    String datasetArn = args[1];
    if (args[2].toLowerCase().equals("put")) {
        ingestionMode = IngestionMode.PUT;
    } else if (args[2].toLowerCase().equals("bulk")) {
        ingestionMode = IngestionMode.BULK;
    }
    String roleArn = args[3];
    String s3BucketPath = args[4];
    String kmsKeyArn = args[5];
    Region region = Region.US_WEST_2;
    PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
    createDatasetExportJob(personalizeClient, jobName, datasetArn, ingestionMode, roleArn, s3BucketPath, kmsKeyArn);
    personalizeClient.close();
}
Also used : PersonalizeClient(software.amazon.awssdk.services.personalize.PersonalizeClient) IngestionMode(software.amazon.awssdk.services.personalize.model.IngestionMode) Region(software.amazon.awssdk.regions.Region)

Example 18 with PersonalizeClient

use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.

the class CreateDatasetImportJob method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    CreateDatasetImportJob <datasetArn, s3BucketPath, jobName, roleArn>\n\n" + "Where:\n" + "    datasetArn - The Amazon Resource Name (ARN) of the destination dataset.\n" + "    s3BucketPath - The path to the Amazon S3 bucket where the data that you " + "want to upload to your dataset is stored.\n" + "    jobName - The name for the dataset import job.\n" + "    roleArn - The ARN of the IAM service-linked role that" + "has permissions to add data to your output Amazon S3 bucket.\n\n";
    if (args.length != 4) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String datasetArn = args[0];
    String s3BucketPath = args[1];
    String jobName = args[2];
    String roleArn = args[3];
    // Change to the region where your resources are located
    Region region = Region.US_WEST_2;
    PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
    String datasetImportJobArn = createPersonalizeDatasetImportJob(personalizeClient, jobName, datasetArn, s3BucketPath, roleArn);
    System.out.println("Dataset import job ARN: " + datasetImportJobArn);
    personalizeClient.close();
}
Also used : PersonalizeClient(software.amazon.awssdk.services.personalize.PersonalizeClient) Region(software.amazon.awssdk.regions.Region)

Example 19 with PersonalizeClient

use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.

the class CreateFilter method main.

public static void main(String[] args) {
    final String USAGE = "Usage:\n" + "    CreateFilter <filterName, datasetGroupArn, filterExpression, schemaArn>\n\n" + "Where:\n" + "   filterName - The name for the filter.\n" + "   datasetGroupArn - The Amazon Resource Name (ARN) for the destination dataset group.\n" + "   filterExpression - The expression for the filter.\n\n";
    if (args.length != 3) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String filterName = args[0];
    String datasetGroupArn = args[1];
    String filterExpression = args[2];
    // Change to the region where your resources are located
    Region region = Region.US_WEST_2;
    PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
    String filterArn = createFilter(personalizeClient, filterName, datasetGroupArn, filterExpression);
    System.out.println("Filter ARN: " + filterArn);
    personalizeClient.close();
}
Also used : PersonalizeClient(software.amazon.awssdk.services.personalize.PersonalizeClient) Region(software.amazon.awssdk.regions.Region)

Example 20 with PersonalizeClient

use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.

the class CreateSolution method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    CreateSolution <datasetGroupArn> <solutionName> <recipeArn>\n\n" + "Where:\n" + "    datasetGroupArn - The ARN of the dataset group.\n\n" + "    solutionName - The name of the Amazon Personalization campaign.\n\n" + "    recipeArn - The ARN of the recipe.\n\n";
    if (args.length != 3) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String datasetGroupArn = args[0];
    String solutionName = args[1];
    String recipeArn = args[2];
    // Change to the region where your resources are located
    Region region = Region.US_EAST_1;
    PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
    String solutionArn = createPersonalizeSolution(personalizeClient, datasetGroupArn, solutionName, recipeArn);
    System.out.println("The Amazon Personalize solution ARN is " + solutionArn);
    personalizeClient.close();
}
Also used : PersonalizeClient(software.amazon.awssdk.services.personalize.PersonalizeClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

PersonalizeClient (software.amazon.awssdk.services.personalize.PersonalizeClient)23 Region (software.amazon.awssdk.regions.Region)22 DatasetProvider (com.amazonaws.personalize.client.datasets.DatasetProvider)1 MovieLensDatasetProvider (com.amazonaws.personalize.client.datasets.MovieLensDatasetProvider)1 CampaignManager (com.amazonaws.personalize.client.resource.CampaignManager)1 EventTrackerManager (com.amazonaws.personalize.client.resource.EventTrackerManager)1 IamClient (software.amazon.awssdk.services.iam.IamClient)1 IngestionMode (software.amazon.awssdk.services.personalize.model.IngestionMode)1 PersonalizeEventsClient (software.amazon.awssdk.services.personalizeevents.PersonalizeEventsClient)1 PersonalizeRuntimeClient (software.amazon.awssdk.services.personalizeruntime.PersonalizeRuntimeClient)1 S3Client (software.amazon.awssdk.services.s3.S3Client)1