UpdateFeature - CloudWatch Evidently

UpdateFeature

Updates an existing feature.

You can't use this operation to update the tags of an existing feature. Instead, use TagResource.

Request Syntax

PATCH /projects/project/features/feature HTTP/1.1 Content-type: application/json { "addOrUpdateVariations": [ { "name": "string", "value": { ... } } ], "defaultVariation": "string", "description": "string", "entityOverrides": { "string" : "string" }, "evaluationStrategy": "string", "removeVariations": [ "string" ] }

URI Request Parameters

The request uses the following URI parameters.

feature

The name of the feature to be updated.

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

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

Required: Yes

project

The name or ARN of the project that contains the feature to be updated.

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.

addOrUpdateVariations

To update variation configurations for this feature, or add new ones, specify this structure. In this array, include any variations that you want to add or update. If the array includes a variation name that already exists for this feature, it is updated. If it includes a new variation name, it is added as a new variation.

Type: Array of VariationConfig objects

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

Required: No

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.

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

Specified 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.

This parameter is limited to 2500 overrides or a total of 40KB. The 40KB limit includes an overhead of 6 bytes per override.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 2500 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

removeVariations

Removes a variation from the feature. If the variation you specify doesn't exist, then this makes no change and does not report an error.

This operation fails if you try to remove a variation that is part of an ongoing launch or experiment.

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 5 items.

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

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

Required: No

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": { ... } } ] } }

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 updated 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: