All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| createLayer | POST /api/v2/projects/{projectKey}/layers | Create layer |
| getLayers | GET /api/v2/projects/{projectKey}/layers | Get layers |
| updateLayer | PATCH /api/v2/projects/{projectKey}/layers/{layerKey} | Update layer |
LayerRep createLayer(layerPost)
Create a layer. Experiments running in the same layer are granted mutually-exclusive traffic.
import {
LayersApi,
Configuration,
LayerPost
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new LayersApi(configuration);
let projectKey: string; //The project key (default to undefined)
let layerPost: LayerPost; //
const { status, data } = await apiInstance.createLayer(
projectKey,
layerPost
);| Name | Type | Description | Notes |
|---|---|---|---|
| layerPost | LayerPost | ||
| projectKey | [string] | The project key | defaults to undefined |
LayerRep
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Layer response | - |
| 400 | Invalid request | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LayerCollectionRep getLayers()
Get a collection of all layers for a project
import {
LayersApi,
Configuration
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new LayersApi(configuration);
let projectKey: string; //The project key (default to undefined)
let filter: string; //A comma-separated list of filters. This endpoint only accepts filtering by `experimentKey`. The filter returns layers which include that experiment for the selected environment(s). For example: `filter=reservations.experimentKey contains expKey`. (optional) (default to undefined)
const { status, data } = await apiInstance.getLayers(
projectKey,
filter
);| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | [string] | The project key | defaults to undefined |
| filter | [string] | A comma-separated list of filters. This endpoint only accepts filtering by `experimentKey`. The filter returns layers which include that experiment for the selected environment(s). For example: `filter=reservations.experimentKey contains expKey`. | (optional) defaults to undefined |
LayerCollectionRep
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Layer Collection response | - |
| 400 | Invalid request | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LayerRep updateLayer(layerPatchInput)
Update a layer by adding, changing, or removing traffic reservations for experiments, or by changing layer name or description. Updating a layer uses the semantic patch format. To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch to your Content-Type header. To learn more, read Updates using semantic patch. ### Instructions Semantic patch requests support the following kind instructions for updating layers.
Click to expand instructions for updating layers
#### updateName Updates the layer name. ##### Parameters -name: The new layer name. Here's an example: json { \"instructions\": [{ \"kind\": \"updateName\", \"name\": \"New name\" }] } #### updateDescription Updates the layer description. ##### Parameters - description: The new description. Here's an example: json { \"instructions\": [{ \"kind\": \"updateDescription\", \"description\": \"New description\" }] } #### updateExperimentReservation Adds or updates a traffic reservation for an experiment in a layer. ##### Parameters - experimentKey: The key of the experiment whose reservation you are adding to or updating in the layer. - reservationPercent: The amount of traffic in the layer to reserve. Must be an integer. Zero is allowed until iteration start. Here's an example: json { \"environmentKey\": \"production\", \"instructions\": [{ \"kind\": \"updateExperimentReservation\", \"experimentKey\": \"exp-key\", \"reservationPercent\": 10 }] } #### removeExperiment Removes a traffic reservation for an experiment from a layer. ##### Parameters - experimentKey: The key of the experiment whose reservation you want to remove from the layer. Here's an example: json { \"environmentKey\": \"production\", \"instructions\": [{ \"kind\": \"removeExperiment\", \"experimentKey\": \"exp-key\" }] } import {
LayersApi,
Configuration,
LayerPatchInput
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new LayersApi(configuration);
let projectKey: string; //The project key (default to undefined)
let layerKey: string; //The layer key (default to undefined)
let layerPatchInput: LayerPatchInput; //
const { status, data } = await apiInstance.updateLayer(
projectKey,
layerKey,
layerPatchInput
);| Name | Type | Description | Notes |
|---|---|---|---|
| layerPatchInput | LayerPatchInput | ||
| projectKey | [string] | The project key | defaults to undefined |
| layerKey | [string] | The layer key | defaults to undefined |
LayerRep
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Layer response | - |
| 400 | Invalid request | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]