CreateFeature - CloudWatch Evidently

CreateFeature

Creates an Evidently feature that you want to launch or test. You can define up to five variations of a feature, and use these variations in your launches and experiments. A feature must be created in a project. For information about creating a project, see CreateProject.

Don't use this operation to update an existing feature. Instead, use UpdateFeature.

Request Syntax

POST /projects/project/features HTTP/1.1 Content-type: application/json { "defaultVariation": "string", "description": "string", "entityOverrides": { "string" : "string" }, "evaluationStrategy": "string", "name": "string", "tags": { "string" : "string" }, "variations": [ { "name": "string", "value": { "boolValue": boolean, "doubleValue": number, "longValue": number, "stringValue": "string" } } ] }

URI Request Parameters

The request uses the following URI parameters.

project

The name or ARN of the project that is to contain the new feature.

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: ([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)

Required: Yes

Request Body

The request accepts the following data in JSON format.

defaultVariation

The name of the variation to use as the default variation. The default variation is served to users who are not allocated to any ongoing launches or experiments of this feature.

This variation must also be listed in the variations structure.

If you omit defaultVariation, the first variation listed in the variations structure is used as the default variation.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 127.

Pattern: ^[-a-zA-Z0-9._]*$

Required: No

description

An optional description of the feature.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 160.

Pattern: .*

Required: No

entityOverrides

Specify users that should always be served a specific variation of a feature. Each user is specified by a key-value pair . For each key, specify a user by entering their user ID, account ID, or some other identifier. For the value, specify the name of the variation that they are to be served.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 20 items.

Key Length Constraints: Minimum length of 1. Maximum length of 512.

Key Pattern: .*

Value Length Constraints: Minimum length of 1. Maximum length of 127.

Value Pattern: ^[-a-zA-Z0-9._]*$

Required: No

evaluationStrategy

Specify ALL_RULES to activate the traffic allocation specified by any ongoing launches or experiments. Specify DEFAULT_VARIATION to serve the default variation to all users instead.

Type: String

Valid Values: ALL_RULES | DEFAULT_VARIATION

Required: No

name

The name for the new feature.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 127.

Pattern: ^[-a-zA-Z0-9._]*$

Required: Yes

tags

Assigns one or more tags (key-value pairs) to the feature.

Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.

Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters.

You can associate as many as 50 tags with a feature.

For more information, see Tagging AWS resources.

Type: String to string map

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Required: No

variations

An array of structures that contain the configuration of the feature's different variations.

Type: Array of VariationConfig objects

Array Members: Minimum number of 1 item. Maximum number of 5 items.

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "feature": { "arn": "string", "createdTime": number, "defaultVariation": "string", "description": "string", "entityOverrides": { "string" : "string" }, "evaluationRules": [ { "name": "string", "type": "string" } ], "evaluationStrategy": "string", "lastUpdatedTime": number, "name": "string", "project": "string", "status": "string", "tags": { "string" : "string" }, "valueType": "string", "variations": [ { "name": "string", "value": { "boolValue": boolean, "doubleValue": number, "longValue": number, "stringValue": "string" } } ] } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

feature

A structure that contains information about the new feature.

Type: Feature object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient permissions to perform this action.

HTTP Status Code: 403

ConflictException

A resource was in an inconsistent state during an update or a deletion.

HTTP Status Code: 409

ResourceNotFoundException

The request references a resource that does not exist.

HTTP Status Code: 404

ServiceQuotaExceededException

The request would cause a service quota to be exceeded.

HTTP Status Code: 402

ValidationException

The value of a parameter in the request caused an error.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: