Skip to content

Latest commit

 

History

History
590 lines (474 loc) · 26 KB

SdkKeysBetaApi.md

File metadata and controls

590 lines (474 loc) · 26 KB

SdkKeysBetaApi

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

Method HTTP request Description
deleteSdkKeyByKey DELETE /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey} Delete SDK key
getProjectSdkKeys GET /api/v2/projects/{projectKey}/sdk-keys Get all project SDK keys
getSdkKeyByKey GET /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey} Get SDK key
getSdkKeys GET /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys Get all environment SDK keys
patchSdkKeyByKey PATCH /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey} Update SDK key
postSdkKey POST /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys Create SDK key
putSdkKeyViews PUT /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey}/views Replace SDK key views

deleteSdkKeyByKey

deleteSdkKeyByKey(ldAPIVersion, projectKey, environmentKey, sdkKeyKey)

Delete SDK key

Delete a specific SDK key by its key.

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.SdkKeysBetaApi;

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");

    SdkKeysBetaApi apiInstance = new SdkKeysBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String environmentKey = "production"; // String | 
    String sdkKeyKey = "my-sdk-key"; // String | The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.
    try {
      apiInstance.deleteSdkKeyByKey(ldAPIVersion, projectKey, environmentKey, sdkKeyKey);
    } catch (ApiException e) {
      System.err.println("Exception when calling SdkKeysBetaApi#deleteSdkKeyByKey");
      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
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
environmentKey String
sdkKeyKey String The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

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 SDK key deleted -
400 Bad request -
403 Forbidden -
404 Not found -
409 Conflict -
500 Internal server error -

getProjectSdkKeys

SdkKeys getProjectSdkKeys(ldAPIVersion, projectKey, filter, limit, offset, expand, sort)

Get all project SDK keys

Get all SDK keys for a given project across environments.

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.SdkKeysBetaApi;

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");

    SdkKeysBetaApi apiInstance = new SdkKeysBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String filter = "filter_example"; // String | A queryfilter expression to apply to the list of SDK keys. Supports the following fields and operators: `kind` (`equals`, `anyOf`; values: \"sdk\", \"mobile\"), `active` (`equals`, `anyOf`; values: `true`, `false`), `environmentKey` (`equals`, `anyOf`; values: environment keys), `viewKey` (`equals`, `anyOf`; values: view key strings — returns only SDK keys linked to the specified view(s)), `name` (`equals` only; returns SDK keys whose name or key contains the value, matched case-insensitively). Example: `kind anyOf [\"sdk\",\"mobile\"], environmentKey anyOf [\"production\",\"test\"], viewKey equals my-view, name equals \"production\"`.
    Integer limit = 56; // Integer | The number of SDK keys to return. Defaults to 20. Maximum is 100.
    Integer offset = 56; // Integer | The number of SDK keys to skip. Used for pagination.
    String expand = "expand_example"; // String | A comma-separated list of fields to expand in the response. Supported fields: `environmentSummary`, `viewSummaries`.
    String sort = "createdAt"; // String | A sort to apply to the list of SDK keys. Supported fields: `createdAt` and `environmentKey`. Prefix `createdAt` with `-` to sort in descending order (for example, `-createdAt`). `environmentKey` orders keys by environment key ascending, then by creation time ascending within each environment, so each page is environment-contiguous.
    try {
      SdkKeys result = apiInstance.getProjectSdkKeys(ldAPIVersion, projectKey, filter, limit, offset, expand, sort);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SdkKeysBetaApi#getProjectSdkKeys");
      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
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
filter String A queryfilter expression to apply to the list of SDK keys. Supports the following fields and operators: `kind` (`equals`, `anyOf`; values: "sdk", "mobile"), `active` (`equals`, `anyOf`; values: `true`, `false`), `environmentKey` (`equals`, `anyOf`; values: environment keys), `viewKey` (`equals`, `anyOf`; values: view key strings — returns only SDK keys linked to the specified view(s)), `name` (`equals` only; returns SDK keys whose name or key contains the value, matched case-insensitively). Example: `kind anyOf ["sdk","mobile"], environmentKey anyOf ["production","test"], viewKey equals my-view, name equals "production"`. [optional]
limit Integer The number of SDK keys to return. Defaults to 20. Maximum is 100. [optional]
offset Integer The number of SDK keys to skip. Used for pagination. [optional]
expand String A comma-separated list of fields to expand in the response. Supported fields: `environmentSummary`, `viewSummaries`. [optional]
sort String A sort to apply to the list of SDK keys. Supported fields: `createdAt` and `environmentKey`. Prefix `createdAt` with `-` to sort in descending order (for example, `-createdAt`). `environmentKey` orders keys by environment key ascending, then by creation time ascending within each environment, so each page is environment-contiguous. [optional] [enum: createdAt, -createdAt, environmentKey]

Return type

SdkKeys

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

getSdkKeyByKey

SdkKey getSdkKeyByKey(ldAPIVersion, projectKey, environmentKey, sdkKeyKey)

Get SDK key

Get a specific SDK key by its key.

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.SdkKeysBetaApi;

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");

    SdkKeysBetaApi apiInstance = new SdkKeysBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String environmentKey = "production"; // String | 
    String sdkKeyKey = "my-sdk-key"; // String | The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.
    try {
      SdkKey result = apiInstance.getSdkKeyByKey(ldAPIVersion, projectKey, environmentKey, sdkKeyKey);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SdkKeysBetaApi#getSdkKeyByKey");
      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
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
environmentKey String
sdkKeyKey String The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

Return type

SdkKey

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

getSdkKeys

SdkKeysForGetSdkKeys getSdkKeys(ldAPIVersion, projectKey, environmentKey, filter, limit, offset, sort)

Get all environment SDK keys

Get all SDK keys for a given project and environment. Can filter by kind.

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.SdkKeysBetaApi;

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");

    SdkKeysBetaApi apiInstance = new SdkKeysBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String environmentKey = "production"; // String | 
    String filter = "filter_example"; // String | A filter to apply to the list of SDK keys. Supports the following fields and operators: `kind` (equals \"sdk\" or \"mobile\"), `active` (equals true or false). Format: `field:value`. Example: `kind:sdk`.
    Integer limit = 56; // Integer | The number of SDK keys to return. Defaults to 20. Maximum is 100.
    Integer offset = 56; // Integer | The number of SDK keys to skip. Used for pagination.
    String sort = "createdAt"; // String | A sort to apply to the list of SDK keys. Supported field: `createdAt`. Prefix the field with `-` to sort in descending order (for example, `-createdAt`).
    try {
      SdkKeysForGetSdkKeys result = apiInstance.getSdkKeys(ldAPIVersion, projectKey, environmentKey, filter, limit, offset, sort);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SdkKeysBetaApi#getSdkKeys");
      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
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
environmentKey String
filter String A filter to apply to the list of SDK keys. Supports the following fields and operators: `kind` (equals "sdk" or "mobile"), `active` (equals true or false). Format: `field:value`. Example: `kind:sdk`. [optional]
limit Integer The number of SDK keys to return. Defaults to 20. Maximum is 100. [optional]
offset Integer The number of SDK keys to skip. Used for pagination. [optional]
sort String A sort to apply to the list of SDK keys. Supported field: `createdAt`. Prefix the field with `-` to sort in descending order (for example, `-createdAt`). [optional] [enum: createdAt, -createdAt]

Return type

SdkKeysForGetSdkKeys

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

patchSdkKeyByKey

SdkKey patchSdkKeyByKey(ldAPIVersion, projectKey, environmentKey, sdkKeyKey, sdkKeyPatch, version)

Update SDK key

Update a an existing SDK key by its identifying key.

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.SdkKeysBetaApi;

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");

    SdkKeysBetaApi apiInstance = new SdkKeysBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String environmentKey = "production"; // String | 
    String sdkKeyKey = "my-sdk-key"; // String | The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.
    SdkKeyPatch sdkKeyPatch = new SdkKeyPatch(); // SdkKeyPatch | An array of patches for updating an existing SDK key. The following fields are supported: `name`, `description`, `expiry`.
    Integer version = 56; // Integer | The version of the SDK key for optimistic locking. If provided, the update will only succeed if the current version matches.
    try {
      SdkKey result = apiInstance.patchSdkKeyByKey(ldAPIVersion, projectKey, environmentKey, sdkKeyKey, sdkKeyPatch, version);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SdkKeysBetaApi#patchSdkKeyByKey");
      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
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
environmentKey String
sdkKeyKey String The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.
sdkKeyPatch SdkKeyPatch An array of patches for updating an existing SDK key. The following fields are supported: `name`, `description`, `expiry`.
version Integer The version of the SDK key for optimistic locking. If provided, the update will only succeed if the current version matches. [optional]

Return type

SdkKey

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
409 Conflict -
500 Internal server error -

postSdkKey

SdkKey postSdkKey(ldAPIVersion, projectKey, environmentKey, sdkKeyPost)

Create SDK key

Create a new server-side or mobile SDK key. Deleted SDK keys are retained for 180 days. During that period you cannot reuse the `key` of a deleted SDK key, even though the deleted key no longer appears in the list of SDK keys for the environment.

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.SdkKeysBetaApi;

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");

    SdkKeysBetaApi apiInstance = new SdkKeysBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String environmentKey = "production"; // String | 
    SdkKeyPost sdkKeyPost = new SdkKeyPost(); // SdkKeyPost | Parameters for creating a new SDK key
    try {
      SdkKey result = apiInstance.postSdkKey(ldAPIVersion, projectKey, environmentKey, sdkKeyPost);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SdkKeysBetaApi#postSdkKey");
      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
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
environmentKey String
sdkKeyPost SdkKeyPost Parameters for creating a new SDK key

Return type

SdkKey

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 SDK key created -
400 Bad request -
403 Forbidden -
404 Not found -
409 Conflict -
500 Internal server error -

putSdkKeyViews

SdkKeyForPutSdkKeyViews putSdkKeyViews(ldAPIVersion, projectKey, environmentKey, sdkKeyKey, sdkKeyViewsPut, expand)

Replace SDK key views

Replace the set of views associated with an SDK key. The `viewKeys` field is required. To remove all views from the SDK key, pass an empty `viewKeys` array.

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.SdkKeysBetaApi;

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");

    SdkKeysBetaApi apiInstance = new SdkKeysBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "projectKey_example"; // String | 
    String environmentKey = "environmentKey_example"; // String | 
    String sdkKeyKey = "sdkKeyKey_example"; // String | 
    SdkKeyViewsPut sdkKeyViewsPut = new SdkKeyViewsPut(); // SdkKeyViewsPut | 
    String expand = "expand_example"; // String | A comma-separated list of fields to expand in the response. Supported fields: `viewSummaries`.
    try {
      SdkKeyForPutSdkKeyViews result = apiInstance.putSdkKeyViews(ldAPIVersion, projectKey, environmentKey, sdkKeyKey, sdkKeyViewsPut, expand);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SdkKeysBetaApi#putSdkKeyViews");
      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
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
environmentKey String
sdkKeyKey String
sdkKeyViewsPut SdkKeyViewsPut
expand String A comma-separated list of fields to expand in the response. Supported fields: `viewSummaries`. [optional]

Return type

SdkKeyForPutSdkKeyViews

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -