CloudWatchEvidently / Client / create_segment
create_segment#
- CloudWatchEvidently.Client.create_segment(**kwargs)#
Use this operation to define a segment of your audience. A segment is a portion of your audience that share one or more characteristics. Examples could be Chrome browser users, users in Europe, or Firefox browser users in Europe who also fit other criteria that your application collects, such as age.
Using a segment in an experiment limits that experiment to evaluate only the users who match the segment criteria. Using one or more segments in a launch allows you to define different traffic splits for the different audience segments.
For more information about segment pattern syntax, see Segment rule pattern syntax.
The pattern that you define for a segment is matched against the value of
evaluationContext
, which is passed into Evidently in the EvaluateFeature operation, when Evidently assigns a feature variation to a user.See also: AWS API Documentation
Request Syntax
response = client.create_segment( description='string', name='string', pattern='string', tags={ 'string': 'string' } )
- Parameters:
description (string) – An optional description for this segment.
name (string) –
[REQUIRED]
A name for the segment.
pattern (string) –
[REQUIRED]
The pattern to use for the segment. For more information about pattern syntax, see Segment rule pattern syntax.
tags (dict) –
Assigns one or more tags (key-value pairs) to the segment.
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 Amazon Web Services and are interpreted strictly as strings of characters.
You can associate as many as 50 tags with a segment.
For more information, see Tagging Amazon Web Services resources.
(string) –
(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'segment': { 'arn': 'string', 'createdTime': datetime(2015, 1, 1), 'description': 'string', 'experimentCount': 123, 'lastUpdatedTime': datetime(2015, 1, 1), 'launchCount': 123, 'name': 'string', 'pattern': 'string', 'tags': { 'string': 'string' } } }
Response Structure
(dict) –
segment (dict) –
A structure that contains the complete information about the segment that was just created.
arn (string) –
The ARN of the segment.
createdTime (datetime) –
The date and time that this segment was created.
description (string) –
The customer-created description for this segment.
experimentCount (integer) –
The number of experiments that this segment is used in. This count includes all current experiments, not just those that are currently running.
lastUpdatedTime (datetime) –
The date and time that this segment was most recently updated.
launchCount (integer) –
The number of launches that this segment is used in. This count includes all current launches, not just those that are currently running.
name (string) –
The name of the segment.
pattern (string) –
The pattern that defines the attributes to use to evalute whether a user session will be in the segment. For more information about the pattern syntax, see Segment rule pattern syntax.
tags (dict) –
The list of tag keys and values associated with this launch.
(string) –
(string) –
Exceptions