Skip to main content

bot_versions

Creates, updates, deletes, gets or lists a bot_versions resource.

Overview

Namebot_versions
TypeResource
Idaws.lex_models.bot_versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the bot. (pattern: <code>^([A-Za-z]_?)+$</code>)
created_datestring (date-time)The date that the bot was created.
descriptionstringA description of the bot.
last_updated_datestring (date-time)The date that the bot was updated. When you create a bot, the creation date and last updated date are the same.
statusstringThe status of the bot. (BUILDING, READY, READY_BASIC_TESTING, FAILED, NOT_BUILT)
versionstringThe version of the bot. For a new bot, the version is always $LATEST. (pattern: <code>$LATEST|[0-9]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_bot_versionsselectname, regionnextToken, maxResultsGets information about all of the versions of a bot. The GetBotVersions operation returns a BotMetadata object for each version of a bot. For example, if a bot has three numbered versions, the GetBotVersions operation returns four BotMetadata objects in the response, one for each numbered version and one for the $LATEST version. The GetBotVersions operation always returns at least one version, the $LATEST version. This operation requires permissions for the lex:GetBotVersions action.
create_bot_versioninsertname, regionCreates a new version of the bot based on the $LATEST version. If the $LATEST version of this resource hasn't changed since you created the last version, Amazon Lex doesn't create a new version. It returns the last created version. You can update only the $LATEST version of the bot. You can't update the numbered versions that you create with the CreateBotVersion operation. When you create the first version of a bot, Amazon Lex sets the version to 1. Subsequent versions increment by 1. For more information, see versioning-intro. This operation requires permission for the lex:CreateBotVersion action.
delete_bot_versiondeletename, version, regionDeletes a specific version of a bot. To delete all versions of a bot, use the DeleteBot operation. This operation requires permissions for the lex:DeleteBotVersion action.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name of the bot.
regionstringAWS region (default: us-east-1)
versionstringThe version of the bot to delete. You cannot delete the $LATEST version of the bot. To delete the $LATEST version, use the DeleteBot operation.
maxResultsintegerThe maximum number of bot versions to return in the response. The default is 10.
nextTokenstringA pagination token for fetching the next page of bot versions. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of versions, specify the pagination token in the next request.

SELECT examples

Gets information about all of the versions of a bot. The GetBotVersions operation returns a BotMetadata object for each version of a bot. For example, if a bot has three numbered versions, the GetBotVersions operation returns four BotMetadata objects in the response, one for each numbered version and one for the $LATEST version. The GetBotVersions operation always returns at least one version, the $LATEST version. This operation requires permissions for the lex:GetBotVersions action.

SELECT
name,
created_date,
description,
last_updated_date,
status,
version
FROM aws.lex_models.bot_versions
WHERE name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;

INSERT examples

Creates a new version of the bot based on the $LATEST version. If the $LATEST version of this resource hasn't changed since you created the last version, Amazon Lex doesn't create a new version. It returns the last created version. You can update only the $LATEST version of the bot. You can't update the numbered versions that you create with the CreateBotVersion operation. When you create the first version of a bot, Amazon Lex sets the version to 1. Subsequent versions increment by 1. For more information, see versioning-intro. This operation requires permission for the lex:CreateBotVersion action.

INSERT INTO aws.lex_models.bot_versions (
checksum,
name,
region
)
SELECT
'{{ checksum }}',
'{{ name }}',
'{{ region }}'
RETURNING
name,
abort_statement,
checksum,
child_directed,
clarification_prompt,
created_date,
description,
detect_sentiment,
enable_model_improvements,
failure_reason,
idle_session_ttl_in_seconds,
intents,
last_updated_date,
locale,
status,
version,
voice_id
;

DELETE examples

Deletes a specific version of a bot. To delete all versions of a bot, use the DeleteBot operation. This operation requires permissions for the lex:DeleteBotVersion action.

DELETE FROM aws.lex_models.bot_versions
WHERE name = '{{ name }}' --required
AND version = '{{ version }}' --required
AND region = '{{ region }}' --required
;