use of software.amazon.awssdk.services.personalize.model.IngestionMode 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();
}
Aggregations