v1

latestOpenAPI 3.1.02026-07-249116259.8 KB

Create feature flag definition in environment

Configures a feature flag definition for a specific environment. Provide the feature flag configuration in the JSON body; path parameters specify the project, feature flag, and environment.

post/splits/ws/{workspace-id}/{feature-flag-name}/environments/{environment-id-or-name}

Path parameters

workspace-idstring required

The ID of the project (workspace) of the feature flag. After migration to Harness, get this value using the Get Projects (Workspaces) endpoint and the Harness project name.

feature-flag-namestring required

The case-sensitive name of the feature flag

environment-id-or-namestring required

The ID or case-sensitive name of the FME environment where you want to create the feature flag definition

Response

200

namestring
killedboolean
defaultTreatmentstring
baselineTreatmentstring
trafficAllocationinteger
creationTimeinteger
lastUpdateTimeinteger

Example response

{
  "name": "paywall_beta",
  "environment": {
    "type": "Environment",
    "id": "dde603a0-30f1-11e7-ba78-12395d4a9634",
    "name": "Production"
  },
  "trafficType": {
    "type": "TRAFFIC_TYPE",
    "id": "4d3405a0-9ca5-11e5-9706-16a11fb02dec",
    "name": "user"
  },
  "treatments": [
    {
      "name": "on",
      "configurations": "{\"color\":\"red\"}"
    }
  ],
  "defaultTreatment": "off",
  "baselineTreatment": "off",
  "trafficAllocation": 100,
  "rules": [
    {
      "buckets": [
        {
          "treatment": "on",
          "size": 50
        }
      ],
      "condition": {
        "combiner": "AND",
        "matchers": [
          {
            "type": "IN_SEGMENT",
            "string": "employees"
          }
        ]
      }
    }
  ],
  "defaultRule": [
    {
      "treatment": "off",
      "size": 100
    }
  ],
  "creationTime": 1508522181447,
  "lastUpdateTime": 1508522181447
}