AppConfig / Client / create_experiment_definition

create_experiment_definition

AppConfig.Client.create_experiment_definition(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.create_experiment_definition(
    ApplicationIdentifier='string',
    Name='string',
    ConfigurationProfileIdentifier='string',
    EnvironmentIdentifier='string',
    FlagKey='string',
    Treatments=[
        {
            'Weight': ...,
            'Description': 'string',
            'FlagValue': {
                'Enabled': True|False,
                'AttributeValues': {
                    'string': {
                        'StringValue': 'string',
                        'NumberValue': 123.0,
                        'BooleanValue': True|False,
                        'StringArray': [
                            'string',
                        ],
                        'NumberArray': [
                            123.0,
                        ]
                    }
                }
            }
        },
    ],
    Control={
        'Weight': ...,
        'Description': 'string',
        'FlagValue': {
            'Enabled': True|False,
            'AttributeValues': {
                'string': {
                    'StringValue': 'string',
                    'NumberValue': 123.0,
                    'BooleanValue': True|False,
                    'StringArray': [
                        'string',
                    ],
                    'NumberArray': [
                        123.0,
                    ]
                }
            }
        }
    },
    AudienceRule='string',
    Hypothesis='string',
    AudienceDescription='string',
    LaunchCriteria='string',
    Tags={
        'string': 'string'
    }
)
Parameters:
  • ApplicationIdentifier (string) –

    [REQUIRED]

    The application ID or name.

  • Name (string) –

    [REQUIRED]

    A name for the experiment definition.

  • ConfigurationProfileIdentifier (string) –

    [REQUIRED]

    The configuration profile ID or name that stores the feature flag.

  • EnvironmentIdentifier (string) –

    [REQUIRED]

    The environment ID or name where the experiment will run.

  • FlagKey (string) –

    [REQUIRED]

    The key of the existing feature flag to use with the experiment.

  • Treatments (list) –

    [REQUIRED]

    A list of treatments to evaluate during the experiment. Each treatment defines a distinct variation compared to the control.

    • (dict) –

      Input structure for defining a treatment when creating or updating an experiment definition.

      • Weight (float) – [REQUIRED]

        The traffic allocation weight for this treatment.

      • Description (string) –

        A description of the treatment.

      • FlagValue (dict) – [REQUIRED]

        The feature flag value to serve to users assigned to this treatment.

        • Enabled (boolean) – [REQUIRED]

          Whether the feature flag is enabled for this treatment.

        • AttributeValues (dict) –

          The attribute values associated with this flag value.

          • (string) –

            • (dict) –

              A value for a feature flag attribute. Only one of the members can be set.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: StringValue, NumberValue, BooleanValue, StringArray, NumberArray.

              • StringValue (string) –

                A string value for the attribute.

              • NumberValue (float) –

                A numeric value for the attribute.

              • BooleanValue (boolean) –

                A Boolean value for the attribute.

              • StringArray (list) –

                An array of string values for the attribute.

                • (string) –

              • NumberArray (list) –

                An array of numeric values for the attribute.

                • (float) –

  • Control (dict) –

    [REQUIRED]

    The control treatment that represents the baseline experience for comparison.

    • Weight (float) – [REQUIRED]

      The traffic allocation weight for this treatment.

    • Description (string) –

      A description of the treatment.

    • FlagValue (dict) – [REQUIRED]

      The feature flag value to serve to users assigned to this treatment.

      • Enabled (boolean) – [REQUIRED]

        Whether the feature flag is enabled for this treatment.

      • AttributeValues (dict) –

        The attribute values associated with this flag value.

        • (string) –

          • (dict) –

            A value for a feature flag attribute. Only one of the members can be set.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: StringValue, NumberValue, BooleanValue, StringArray, NumberArray.

            • StringValue (string) –

              A string value for the attribute.

            • NumberValue (float) –

              A numeric value for the attribute.

            • BooleanValue (boolean) –

              A Boolean value for the attribute.

            • StringArray (list) –

              An array of string values for the attribute.

              • (string) –

            • NumberArray (list) –

              An array of numeric values for the attribute.

              • (float) –

  • AudienceRule (string) –

    [REQUIRED]

    A rule that defines which users are eligible to be assigned to treatments during the experiment.

  • Hypothesis (string) – A description of the goal or hypothesis the experiment is designed to validate.

  • AudienceDescription (string) – A description of the intended audience for the experiment.

  • LaunchCriteria (string) – Information about the conditions under which you would launch the winning treatment.

  • Tags (dict) –

    The tags to assign to the experiment definition. Tags help organize and categorize your AppConfig resources.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'ApplicationId': 'string',
    'Id': 'string',
    'Name': 'string',
    'Hypothesis': 'string',
    'Status': 'ACTIVE'|'IDLE'|'ARCHIVED',
    'ConfigurationProfileId': 'string',
    'EnvironmentId': 'string',
    'FlagKey': 'string',
    'AudienceRule': 'string',
    'AudienceDescription': 'string',
    'LaunchCriteria': 'string',
    'Treatments': [
        {
            'Key': 'string',
            'Weight': ...,
            'Description': 'string',
            'FlagValue': {
                'Enabled': True|False,
                'AttributeValues': {
                    'string': {
                        'StringValue': 'string',
                        'NumberValue': 123.0,
                        'BooleanValue': True|False,
                        'StringArray': [
                            'string',
                        ],
                        'NumberArray': [
                            123.0,
                        ]
                    }
                }
            }
        },
    ],
    'Control': {
        'Key': 'string',
        'Weight': ...,
        'Description': 'string',
        'FlagValue': {
            'Enabled': True|False,
            'AttributeValues': {
                'string': {
                    'StringValue': 'string',
                    'NumberValue': 123.0,
                    'BooleanValue': True|False,
                    'StringArray': [
                        'string',
                    ],
                    'NumberArray': [
                        123.0,
                    ]
                }
            }
        }
    },
    'CreatedAt': datetime(2015, 1, 1),
    'UpdatedAt': datetime(2015, 1, 1),
    'KmsKeyIdentifier': 'string'
}

Response Structure

  • (dict) –

    Describes an experiment definition, including the target audience, feature flag, treatments, and current status.

    • ApplicationId (string) –

      The application ID.

    • Id (string) –

      The experiment definition ID.

    • Name (string) –

      The name of the experiment definition.

    • Hypothesis (string) –

      The hypothesis that the experiment is designed to validate.

    • Status (string) –

      The current status of the experiment definition. Valid values: ACTIVE, IDLE, ARCHIVED.

    • ConfigurationProfileId (string) –

      The configuration profile ID associated with the experiment.

    • EnvironmentId (string) –

      The environment ID where the experiment runs.

    • FlagKey (string) –

      The key of the feature flag used by the experiment.

    • AudienceRule (string) –

      The rule that defines which users are eligible to be assigned to treatments.

    • AudienceDescription (string) –

      A description of the intended audience for the experiment.

    • LaunchCriteria (string) –

      The conditions under which the winning treatment should be launched.

    • Treatments (list) –

      The list of treatments defined for the experiment.

      • (dict) –

        Describes a treatment in an experiment, including its traffic allocation weight and feature flag value.

        • Key (string) –

          The unique key that identifies this treatment.

        • Weight (float) –

          The traffic allocation weight for this treatment.

        • Description (string) –

          A description of the treatment.

        • FlagValue (dict) –

          The feature flag value served to users assigned to this treatment.

          • Enabled (boolean) –

            Whether the feature flag is enabled for this treatment.

          • AttributeValues (dict) –

            The attribute values associated with this flag value.

            • (string) –

              • (dict) –

                A value for a feature flag attribute. Only one of the members can be set.

                Note

                This is a Tagged Union structure. Only one of the following top level keys will be set: StringValue, NumberValue, BooleanValue, StringArray, NumberArray. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                
                • StringValue (string) –

                  A string value for the attribute.

                • NumberValue (float) –

                  A numeric value for the attribute.

                • BooleanValue (boolean) –

                  A Boolean value for the attribute.

                • StringArray (list) –

                  An array of string values for the attribute.

                  • (string) –

                • NumberArray (list) –

                  An array of numeric values for the attribute.

                  • (float) –

    • Control (dict) –

      The control treatment used as the baseline for comparison.

      • Key (string) –

        The unique key that identifies this treatment.

      • Weight (float) –

        The traffic allocation weight for this treatment.

      • Description (string) –

        A description of the treatment.

      • FlagValue (dict) –

        The feature flag value served to users assigned to this treatment.

        • Enabled (boolean) –

          Whether the feature flag is enabled for this treatment.

        • AttributeValues (dict) –

          The attribute values associated with this flag value.

          • (string) –

            • (dict) –

              A value for a feature flag attribute. Only one of the members can be set.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: StringValue, NumberValue, BooleanValue, StringArray, NumberArray. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • StringValue (string) –

                A string value for the attribute.

              • NumberValue (float) –

                A numeric value for the attribute.

              • BooleanValue (boolean) –

                A Boolean value for the attribute.

              • StringArray (list) –

                An array of string values for the attribute.

                • (string) –

              • NumberArray (list) –

                An array of numeric values for the attribute.

                • (float) –

    • CreatedAt (datetime) –

      The date and time the experiment definition was created, in ISO 8601 format.

    • UpdatedAt (datetime) –

      The date and time the experiment definition was last updated, in ISO 8601 format.

    • KmsKeyIdentifier (string) –

      The Amazon Resource Name (ARN) of the KMS key used to encrypt experiment data.

Exceptions