Skip to content

Latest commit

 

History

History
337 lines (239 loc) · 11.7 KB

File metadata and controls

337 lines (239 loc) · 11.7 KB

FlagTriggersApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
createTriggerWorkflow POST /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey} Create flag trigger
deleteTriggerWorkflow DELETE /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id} Delete flag trigger
getTriggerWorkflowById GET /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id} Get flag trigger by ID
getTriggerWorkflows GET /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey} List flag triggers
patchTriggerWorkflow PATCH /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id} Update flag trigger

createTriggerWorkflow

TriggerWorkflowRep createTriggerWorkflow(triggerPost)

Create a new flag trigger.

Example

import {
    FlagTriggersApi,
    Configuration,
    TriggerPost
} from 'launchdarkly-api-typescript';

const configuration = new Configuration();
const apiInstance = new FlagTriggersApi(configuration);

let projectKey: string; //The project key (default to undefined)
let environmentKey: string; //The environment key (default to undefined)
let featureFlagKey: string; //The feature flag key (default to undefined)
let triggerPost: TriggerPost; //

const { status, data } = await apiInstance.createTriggerWorkflow(
    projectKey,
    environmentKey,
    featureFlagKey,
    triggerPost
);

Parameters

Name Type Description Notes
triggerPost TriggerPost
projectKey [string] The project key defaults to undefined
environmentKey [string] The environment key defaults to undefined
featureFlagKey [string] The feature flag key defaults to undefined

Return type

TriggerWorkflowRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Flag trigger response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteTriggerWorkflow

deleteTriggerWorkflow()

Delete a flag trigger by ID.

Example

import {
    FlagTriggersApi,
    Configuration
} from 'launchdarkly-api-typescript';

const configuration = new Configuration();
const apiInstance = new FlagTriggersApi(configuration);

let projectKey: string; //The project key (default to undefined)
let environmentKey: string; //The environment key (default to undefined)
let featureFlagKey: string; //The feature flag key (default to undefined)
let id: string; //The flag trigger ID (default to undefined)

const { status, data } = await apiInstance.deleteTriggerWorkflow(
    projectKey,
    environmentKey,
    featureFlagKey,
    id
);

Parameters

Name Type Description Notes
projectKey [string] The project key defaults to undefined
environmentKey [string] The environment key defaults to undefined
featureFlagKey [string] The feature flag key defaults to undefined
id [string] The flag trigger ID defaults to undefined

Return type

void (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Action succeeded -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTriggerWorkflowById

TriggerWorkflowRep getTriggerWorkflowById()

Get a flag trigger by ID.

Example

import {
    FlagTriggersApi,
    Configuration
} from 'launchdarkly-api-typescript';

const configuration = new Configuration();
const apiInstance = new FlagTriggersApi(configuration);

let projectKey: string; //The project key (default to undefined)
let featureFlagKey: string; //The feature flag key (default to undefined)
let environmentKey: string; //The environment key (default to undefined)
let id: string; //The flag trigger ID (default to undefined)

const { status, data } = await apiInstance.getTriggerWorkflowById(
    projectKey,
    featureFlagKey,
    environmentKey,
    id
);

Parameters

Name Type Description Notes
projectKey [string] The project key defaults to undefined
featureFlagKey [string] The feature flag key defaults to undefined
environmentKey [string] The environment key defaults to undefined
id [string] The flag trigger ID defaults to undefined

Return type

TriggerWorkflowRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Flag trigger response -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTriggerWorkflows

TriggerWorkflowCollectionRep getTriggerWorkflows()

Get a list of all flag triggers.

Example

import {
    FlagTriggersApi,
    Configuration
} from 'launchdarkly-api-typescript';

const configuration = new Configuration();
const apiInstance = new FlagTriggersApi(configuration);

let projectKey: string; //The project key (default to undefined)
let environmentKey: string; //The environment key (default to undefined)
let featureFlagKey: string; //The feature flag key (default to undefined)

const { status, data } = await apiInstance.getTriggerWorkflows(
    projectKey,
    environmentKey,
    featureFlagKey
);

Parameters

Name Type Description Notes
projectKey [string] The project key defaults to undefined
environmentKey [string] The environment key defaults to undefined
featureFlagKey [string] The feature flag key defaults to undefined

Return type

TriggerWorkflowCollectionRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Flag trigger collection response -
401 Invalid access token -
403 Forbidden -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patchTriggerWorkflow

TriggerWorkflowRep patchTriggerWorkflow(flagTriggerInput)

Update a flag trigger. Updating a flag trigger 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 flag triggers.

Click to expand instructions for updating flag triggers #### replaceTriggerActionInstructions Removes the existing trigger action and replaces it with the new instructions. ##### Parameters - value: An array of the new kinds of actions to perform when triggering. Supported flag actions are turnFlagOn and turnFlagOff. Here's an example that replaces the existing action with new instructions to turn flag targeting off: json { \"instructions\": [ { \"kind\": \"replaceTriggerActionInstructions\", \"value\": [ {\"kind\": \"turnFlagOff\"} ] } ] } #### cycleTriggerUrl Generates a new URL for this trigger. You must update any clients using the trigger to use this new URL. Here's an example: json { \"instructions\": [{ \"kind\": \"cycleTriggerUrl\" }] } #### disableTrigger Disables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use enableTrigger. Here's an example: json { \"instructions\": [{ \"kind\": \"disableTrigger\" }] } #### enableTrigger Enables the trigger. If you previously disabled the trigger, it begins running again. Here's an example: json { \"instructions\": [{ \"kind\": \"enableTrigger\" }] }

Example

import {
    FlagTriggersApi,
    Configuration,
    FlagTriggerInput
} from 'launchdarkly-api-typescript';

const configuration = new Configuration();
const apiInstance = new FlagTriggersApi(configuration);

let projectKey: string; //The project key (default to undefined)
let environmentKey: string; //The environment key (default to undefined)
let featureFlagKey: string; //The feature flag key (default to undefined)
let id: string; //The flag trigger ID (default to undefined)
let flagTriggerInput: FlagTriggerInput; //

const { status, data } = await apiInstance.patchTriggerWorkflow(
    projectKey,
    environmentKey,
    featureFlagKey,
    id,
    flagTriggerInput
);

Parameters

Name Type Description Notes
flagTriggerInput FlagTriggerInput
projectKey [string] The project key defaults to undefined
environmentKey [string] The environment key defaults to undefined
featureFlagKey [string] The feature flag key defaults to undefined
id [string] The flag trigger ID defaults to undefined

Return type

TriggerWorkflowRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Flag trigger response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
409 Status conflict -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]