create_experiment_definition
async
¶
create_experiment_definition(
application_identifier: Identifier,
name: NameWithReservedAwsPrefix,
configuration_profile_identifier: Identifier,
environment_identifier: Identifier,
flag_key: FlagKey,
treatments: TreatmentInputList,
control: TreatmentInput,
audience_rule: Rule,
*,
config_overrides: Optional[AsyncAppConfigClientConfig] = None,
hypothesis: Optional[Description] = None,
audience_description: Optional[Description] = None,
launch_criteria: Optional[Description] = None,
tags: Optional[TagMap] = None,
) -> ExperimentDefinition
Creates an experiment definition in AppConfig. An experiment definition describes the purpose, scope, and operational configuration of an experiment, including the target audience, feature flag, and treatment configurations.
Parameters:
-
application_identifier(Identifier) –The application ID or name.
-
name(NameWithReservedAwsPrefix) –A name for the experiment definition.
-
configuration_profile_identifier(Identifier) –The configuration profile ID or name that stores the feature flag.
-
environment_identifier(Identifier) –The environment ID or name where the experiment will run.
-
flag_key(FlagKey) –The key of the existing feature flag to use with the experiment.
-
treatments(TreatmentInputList) –A list of treatments to evaluate during the experiment. Each treatment defines a distinct variation compared to the control.
-
control(TreatmentInput) –The control treatment that represents the baseline experience for comparison.
-
audience_rule(Rule) –A rule that defines which users are eligible to be assigned to treatments during the experiment.
-
hypothesis(Optional[Description], default:None) –A description of the goal or hypothesis the experiment is designed to validate.
-
audience_description(Optional[Description], default:None) –A description of the intended audience for the experiment.
-
launch_criteria(Optional[Description], default:None) –Information about the conditions under which you would launch the winning treatment.
-
tags(Optional[TagMap], default:None) –The tags to assign to the experiment definition. Tags help organize and categorize your AppConfig resources.
Raises:
-
BadRequestException–The input fails to satisfy the constraints specified by an Amazon Web Services service.
-
ConflictException–The request could not be processed because of conflict in the current state of the resource.
-
InternalServerException–There was an internal failure in the AppConfig service.
-
ResourceNotFoundException–The requested resource could not be found.
-
ServiceQuotaExceededException–The number of one more AppConfig resources exceeds the maximum allowed. Verify that your environment doesn't exceed the following service quotas:
Applications: 100 max
To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota increase. For more information about quotas and to request an increase, see Service quotas for AppConfig in the Amazon Web Services General Reference.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create an experiment definition The following CreateExperimentDefinition example creates an experiment definition that tests a feature flag with a 50/50 traffic split.
>>> await client.create_experiment_definition(application_identifier='339ohji', configuration_profile_identifier='ur8hx2f', environment_identifier='54j1r29', name='Example-Experiment-Definition', flag_key='my-feature-flag', treatments=[{'Weight': 50, 'FlagValue': {'Enabled': True}}], control={'Weight': 50, 'FlagValue': {'Enabled': False}}, audience_rule='(eq $country "US")')
Source code in docs_src/capo_appconfig/_services/async_app_config.py
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | |