The Winning Variant Native App allows users to manage experimentation resources directly inside of Snowflake by use of stored procedures created during installation.

Roles

A user must be assigned of the following application roles to execute any of the procedures described on this page:

  • admin
  • editor

Resource Kinds

All references to kind below must be one of:

  • lab
  • subjecttype
  • experiment

Read more about Resource Kinds.

List Resources

Each of the following “list” commands returns a table with the following columns:

ColumnDescriptionData Type
kindThe resource kind.VARCHAR
idID of the resource.VARCHAR
nameName of the resource.VARCHAR
statusResource statusVARCHAR
descriptionResource descriptionVARCHAR
resource_versionCurrent resource versionINT
CALL <application_name>.experimentation.list_resources('<kind>' [, <status>, ...]);

Returns a list of all resources of the given kind. status must be one of ResourceStatus.

Examples

Get YAML for a single resource

CALL <application_name>.experimentation.get_resource_yaml('<kind>', '<id>');

Returns a table with the following columns:

ColumnDescriptionData Type
kindThe resource kind.VARCHAR
idID of the resource.VARCHAR
yamlThe full configuration (YAML) for a single resource.VARCHAR

Examples

CALL <application_name>.experimentation.get_resource_yaml('experiment', 'my-experiment');

Create or update resource

CALL <application_name>.experimentation.apply_resource('<kind>', '<yaml>');

If the resource with the id specified exists, it gets updated, otherwise it will be created.

Examples

-- Create a new lab with id `marketing`
CALL <application_name>.experimentation.apply_resource('lab', """
schemaVersion: 1
kind: lab
metadata:
  id: marketing
  status: active
  name: Marketing
  description: All marketing and top-of-funnel experiments.""");

-- Update the name of the lab we just created
CALL <application_name>.experimentation.apply_resource('lab', """
schemaVersion: 1
kind: lab
metadata:
  id: marketing
  status: active
  name: Marketing Organization
  description: All marketing and top-of-funnel experiments.""");