Amazon Personalize

2021/04/26 - Amazon Personalize - 3 new api methods

Changes  Added support for exporting data imported into an Amazon Personalize dataset to a specified data source (Amazon S3 bucket).

DescribeDatasetExportJob (new) Link ¶

Describes the dataset export job created by CreateDatasetExportJob , including the export job status.

See also: AWS API Documentation

Request Syntax

client.describe_dataset_export_job(
    datasetExportJobArn='string'
)
type datasetExportJobArn

string

param datasetExportJobArn

[REQUIRED]

The Amazon Resource Name (ARN) of the dataset export job to describe.

rtype

dict

returns

Response Syntax

{
    'datasetExportJob': {
        'jobName': 'string',
        'datasetExportJobArn': 'string',
        'datasetArn': 'string',
        'ingestionMode': 'BULK'|'PUT'|'ALL',
        'roleArn': 'string',
        'status': 'string',
        'jobOutput': {
            's3DataDestination': {
                'path': 'string',
                'kmsKeyArn': 'string'
            }
        },
        'creationDateTime': datetime(2015, 1, 1),
        'lastUpdatedDateTime': datetime(2015, 1, 1),
        'failureReason': 'string'
    }
}

Response Structure

  • (dict) --

    • datasetExportJob (dict) --

      Information about the dataset export job, including the status.

      The status is one of the following values:

      • CREATE PENDING

      • CREATE IN_PROGRESS

      • ACTIVE

      • CREATE FAILED

      • jobName (string) --

        The name of the export job.

      • datasetExportJobArn (string) --

        The Amazon Resource Name (ARN) of the dataset export job.

      • datasetArn (string) --

        The Amazon Resource Name (ARN) of the dataset to export.

      • ingestionMode (string) --

        The data to export, based on how you imported the data. You can choose to export BULK data that you imported using a dataset import job, PUT data that you imported incrementally (using the console, PutEvents, PutUsers and PutItems operations), or ALL for both types. The default value is PUT .

      • roleArn (string) --

        The Amazon Resource Name (ARN) of the AWS Identity and Access Management service role that has permissions to add data to your output Amazon S3 bucket.

      • status (string) --

        The status of the dataset export job.

        A dataset export job can be in one of the following states:

        • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

      • jobOutput (dict) --

        The path to the Amazon S3 bucket where the job's output is stored. For example:

        s3://bucket-name/folder-name/

        • s3DataDestination (dict) --

          The configuration details of an Amazon S3 input or output bucket.

          • path (string) --

            The file path of the Amazon S3 bucket.

          • kmsKeyArn (string) --

            The Amazon Resource Name (ARN) of the Amazon Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files of a batch inference job.

      • creationDateTime (datetime) --

        The creation date and time (in Unix time) of the dataset export job.

      • lastUpdatedDateTime (datetime) --

        The date and time (in Unix time) the status of the dataset export job was last updated.

      • failureReason (string) --

        If a dataset export job fails, provides the reason why.

ListDatasetExportJobs (new) Link ¶

Returns a list of dataset export jobs that use the given dataset. When a dataset is not specified, all the dataset export jobs associated with the account are listed. The response provides the properties for each dataset export job, including the Amazon Resource Name (ARN). For more information on dataset export jobs, see CreateDatasetExportJob . For more information on datasets, see CreateDataset .

See also: AWS API Documentation

Request Syntax

client.list_dataset_export_jobs(
    datasetArn='string',
    nextToken='string',
    maxResults=123
)
type datasetArn

string

param datasetArn

The Amazon Resource Name (ARN) of the dataset to list the dataset export jobs for.

type nextToken

string

param nextToken

A token returned from the previous call to ListDatasetExportJobs for getting the next set of dataset export jobs (if they exist).

type maxResults

integer

param maxResults

The maximum number of dataset export jobs to return.

rtype

dict

returns

Response Syntax

{
    'datasetExportJobs': [
        {
            'datasetExportJobArn': 'string',
            'jobName': 'string',
            'status': 'string',
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1),
            'failureReason': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • datasetExportJobs (list) --

      The list of dataset export jobs.

      • (dict) --

        Provides a summary of the properties of a dataset export job. For a complete listing, call the DescribeDatasetExportJob API.

        • datasetExportJobArn (string) --

          The Amazon Resource Name (ARN) of the dataset export job.

        • jobName (string) --

          The name of the dataset export job.

        • status (string) --

          The status of the dataset export job.

          A dataset export job can be in one of the following states:

          • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

        • creationDateTime (datetime) --

          The date and time (in Unix time) that the dataset export job was created.

        • lastUpdatedDateTime (datetime) --

          The date and time (in Unix time) that the dataset export job status was last updated.

        • failureReason (string) --

          If a dataset export job fails, the reason behind the failure.

    • nextToken (string) --

      A token for getting the next set of dataset export jobs (if they exist).

CreateDatasetExportJob (new) Link ¶

Creates a job that exports data from your dataset to an Amazon S3 bucket. To allow Amazon Personalize to export the training data, you must specify an service-linked AWS Identity and Access Management (IAM) role that gives Amazon Personalize PutObject permissions for your Amazon S3 bucket. For information, see Dataset export job permissions requirements in the Amazon Personalize developer guide.

Status

A dataset export job can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

To get the status of the export job, call DescribeDatasetExportJob , and specify the Amazon Resource Name (ARN) of the dataset export job. The dataset export is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the job failed.

See also: AWS API Documentation

Request Syntax

client.create_dataset_export_job(
    jobName='string',
    datasetArn='string',
    ingestionMode='BULK'|'PUT'|'ALL',
    roleArn='string',
    jobOutput={
        's3DataDestination': {
            'path': 'string',
            'kmsKeyArn': 'string'
        }
    }
)
type jobName

string

param jobName

[REQUIRED]

The name for the dataset export job.

type datasetArn

string

param datasetArn

[REQUIRED]

The Amazon Resource Name (ARN) of the dataset that contains the data to export.

type ingestionMode

string

param ingestionMode

The data to export, based on how you imported the data. You can choose to export only BULK data that you imported using a dataset import job, only PUT data that you imported incrementally (using the console, PutEvents, PutUsers and PutItems operations), or ALL for both types. The default value is PUT .

type roleArn

string

param roleArn

[REQUIRED]

The Amazon Resource Name (ARN) of the AWS Identity and Access Management service role that has permissions to add data to your output Amazon S3 bucket.

type jobOutput

dict

param jobOutput

[REQUIRED]

The path to the Amazon S3 bucket where the job's output is stored.

  • s3DataDestination (dict) -- [REQUIRED]

    The configuration details of an Amazon S3 input or output bucket.

    • path (string) -- [REQUIRED]

      The file path of the Amazon S3 bucket.

    • kmsKeyArn (string) --

      The Amazon Resource Name (ARN) of the Amazon Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files of a batch inference job.

rtype

dict

returns

Response Syntax

{
    'datasetExportJobArn': 'string'
}

Response Structure

  • (dict) --

    • datasetExportJobArn (string) --

      The Amazon Resource Name (ARN) of the dataset export job.