Skip to content

Latest commit

 

History

History
418 lines (334 loc) · 18.9 KB

ScheduledChangesApi.md

File metadata and controls

418 lines (334 loc) · 18.9 KB

ScheduledChangesApi

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

Method HTTP request Description
deleteFlagConfigScheduledChanges DELETE /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id} Delete scheduled changes workflow
getFeatureFlagScheduledChange GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id} Get a scheduled change
getFlagConfigScheduledChanges GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes List scheduled changes
patchFlagConfigScheduledChange PATCH /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id} Update scheduled changes workflow
postFlagConfigScheduledChanges POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes Create scheduled changes workflow

deleteFlagConfigScheduledChanges

deleteFlagConfigScheduledChanges(projectKey, featureFlagKey, environmentKey, id)

Delete scheduled changes workflow

Delete a scheduled changes workflow.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ScheduledChangesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ScheduledChangesApi apiInstance = new ScheduledChangesApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    String id = "id_example"; // String | The scheduled change id
    try {
      apiInstance.deleteFlagConfigScheduledChanges(projectKey, featureFlagKey, environmentKey, id);
    } catch (ApiException e) {
      System.err.println("Exception when calling ScheduledChangesApi#deleteFlagConfigScheduledChanges");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The scheduled change id

Return type

null (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 -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
409 Status conflict -
429 Rate limited -

getFeatureFlagScheduledChange

FeatureFlagScheduledChange getFeatureFlagScheduledChange(projectKey, featureFlagKey, environmentKey, id)

Get a scheduled change

Get a scheduled change that will be applied to the feature flag by ID.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ScheduledChangesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ScheduledChangesApi apiInstance = new ScheduledChangesApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    String id = "id_example"; // String | The scheduled change id
    try {
      FeatureFlagScheduledChange result = apiInstance.getFeatureFlagScheduledChange(projectKey, featureFlagKey, environmentKey, id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ScheduledChangesApi#getFeatureFlagScheduledChange");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The scheduled change id

Return type

FeatureFlagScheduledChange

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Scheduled changes response -
401 Invalid access token -
404 Invalid resource identifier -
429 Rate limited -

getFlagConfigScheduledChanges

FeatureFlagScheduledChanges getFlagConfigScheduledChanges(projectKey, featureFlagKey, environmentKey)

List scheduled changes

Get a list of scheduled changes that will be applied to the feature flag.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ScheduledChangesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ScheduledChangesApi apiInstance = new ScheduledChangesApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    try {
      FeatureFlagScheduledChanges result = apiInstance.getFlagConfigScheduledChanges(projectKey, featureFlagKey, environmentKey);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ScheduledChangesApi#getFlagConfigScheduledChanges");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key

Return type

FeatureFlagScheduledChanges

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Scheduled changes collection response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -

patchFlagConfigScheduledChange

FeatureFlagScheduledChange patchFlagConfigScheduledChange(projectKey, featureFlagKey, environmentKey, id, flagScheduledChangesInput, ignoreConflicts)

Update scheduled changes workflow

Update a scheduled change, overriding existing instructions with the new ones. Updating a scheduled change 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 scheduled changes. <details> <summary>Click to expand instructions for <strong>updating scheduled changes</strong></summary> #### deleteScheduledChange Removes the scheduled change. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;deleteScheduledChange&quot; }] } ``` #### replaceScheduledChangesInstructions Removes the existing scheduled changes and replaces them with the new instructions. ##### Parameters - `value`: An array of the new actions to perform when the execution date for these scheduled changes arrives. Supported scheduled actions are `turnFlagOn` and `turnFlagOff`. Here's an example that replaces the scheduled changes with new instructions to turn flag targeting off: ```json { &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;replaceScheduledChangesInstructions&quot;, &quot;value&quot;: [ {&quot;kind&quot;: &quot;turnFlagOff&quot;} ] } ] } ``` #### updateScheduledChangesExecutionDate Updates the execution date for the scheduled changes. ##### Parameters - `value`: the new execution date, in Unix milliseconds. Here's an example: ```json { &quot;instructions&quot;: [ { &quot;kind&quot;: &quot;updateScheduledChangesExecutionDate&quot;, &quot;value&quot;: 1754092860000 } ] } ``` </details>

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ScheduledChangesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ScheduledChangesApi apiInstance = new ScheduledChangesApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    String id = "id_example"; // String | The scheduled change ID
    FlagScheduledChangesInput flagScheduledChangesInput = new FlagScheduledChangesInput(); // FlagScheduledChangesInput | 
    Boolean ignoreConflicts = true; // Boolean | Whether to succeed (`true`) or fail (`false`) when these new instructions conflict with existing scheduled changes
    try {
      FeatureFlagScheduledChange result = apiInstance.patchFlagConfigScheduledChange(projectKey, featureFlagKey, environmentKey, id, flagScheduledChangesInput, ignoreConflicts);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ScheduledChangesApi#patchFlagConfigScheduledChange");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The scheduled change ID
flagScheduledChangesInput FlagScheduledChangesInput
ignoreConflicts Boolean Whether to succeed (`true`) or fail (`false`) when these new instructions conflict with existing scheduled changes [optional]

Return type

FeatureFlagScheduledChange

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Scheduled changes response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
409 Status conflict -
429 Rate limited -

postFlagConfigScheduledChanges

FeatureFlagScheduledChange postFlagConfigScheduledChanges(projectKey, featureFlagKey, environmentKey, postFlagScheduledChangesInput, ignoreConflicts)

Create scheduled changes workflow

Create scheduled changes for a feature flag. If the `ignoreConficts` query parameter is false and there are conflicts between these instructions and existing scheduled changes, the request will fail. If the parameter is true and there are conflicts, the request will succeed.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ScheduledChangesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ScheduledChangesApi apiInstance = new ScheduledChangesApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    PostFlagScheduledChangesInput postFlagScheduledChangesInput = new PostFlagScheduledChangesInput(); // PostFlagScheduledChangesInput | 
    Boolean ignoreConflicts = true; // Boolean | Whether to succeed (`true`) or fail (`false`) when these instructions conflict with existing scheduled changes
    try {
      FeatureFlagScheduledChange result = apiInstance.postFlagConfigScheduledChanges(projectKey, featureFlagKey, environmentKey, postFlagScheduledChangesInput, ignoreConflicts);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ScheduledChangesApi#postFlagConfigScheduledChanges");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
postFlagScheduledChangesInput PostFlagScheduledChangesInput
ignoreConflicts Boolean Whether to succeed (`true`) or fail (`false`) when these instructions conflict with existing scheduled changes [optional]

Return type

FeatureFlagScheduledChange

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Scheduled changes response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
409 Status conflict -
429 Rate limited -