LexModelBuildingService / Client / start_import

start_import#

LexModelBuildingService.Client.start_import(**kwargs)#

Starts a job to import a resource to Amazon Lex.

See also: AWS API Documentation

Request Syntax

response = client.start_import(
    payload=b'bytes',
    resourceType='BOT'|'INTENT'|'SLOT_TYPE',
    mergeStrategy='OVERWRITE_LATEST'|'FAIL_ON_CONFLICT',
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
Parameters:
  • payload (bytes) –

    [REQUIRED]

    A zip archive in binary format. The archive should contain one file, a JSON file containing the resource to import. The resource should match the type specified in the resourceType field.

  • resourceType (string) –

    [REQUIRED]

    Specifies the type of resource to export. Each resource also exports any resources that it depends on.

    • A bot exports dependent intents.

    • An intent exports dependent slot types.

  • mergeStrategy (string) –

    [REQUIRED]

    Specifies the action that the StartImport operation should take when there is an existing resource with the same name.

    • FAIL_ON_CONFLICT - The import operation is stopped on the first conflict between a resource in the import file and an existing resource. The name of the resource causing the conflict is in the failureReason field of the response to the GetImport operation. OVERWRITE_LATEST - The import operation proceeds even if there is a conflict with an existing resource. The $LASTEST version of the existing resource is overwritten with the data from the import file.

  • tags (list) –

    A list of tags to add to the imported bot. You can only add tags when you import a bot, you can’t add tags to an intent or slot type.

    • (dict) –

      A list of key/value pairs that identify a bot, bot alias, or bot channel. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

      • key (string) – [REQUIRED]

        The key for the tag. Keys are not case-sensitive and must be unique.

      • value (string) – [REQUIRED]

        The value associated with a key. The value may be an empty string but it can’t be null.

Return type:

dict

Returns:

Response Syntax

{
    'name': 'string',
    'resourceType': 'BOT'|'INTENT'|'SLOT_TYPE',
    'mergeStrategy': 'OVERWRITE_LATEST'|'FAIL_ON_CONFLICT',
    'importId': 'string',
    'importStatus': 'IN_PROGRESS'|'COMPLETE'|'FAILED',
    'tags': [
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    'createdDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    • name (string) –

      The name given to the import job.

    • resourceType (string) –

      The type of resource to import.

    • mergeStrategy (string) –

      The action to take when there is a merge conflict.

    • importId (string) –

      The identifier for the specific import job.

    • importStatus (string) –

      The status of the import job. If the status is FAILED, you can get the reason for the failure using the GetImport operation.

    • tags (list) –

      A list of tags added to the imported bot.

      • (dict) –

        A list of key/value pairs that identify a bot, bot alias, or bot channel. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

        • key (string) –

          The key for the tag. Keys are not case-sensitive and must be unique.

        • value (string) –

          The value associated with a key. The value may be an empty string but it can’t be null.

    • createdDate (datetime) –

      A timestamp for the date and time that the import job was requested.

Exceptions

  • LexModelBuildingService.Client.exceptions.LimitExceededException

  • LexModelBuildingService.Client.exceptions.InternalFailureException

  • LexModelBuildingService.Client.exceptions.BadRequestException