All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
deleteCustomRole | DELETE /api/v2/roles/{customRoleKey} | Delete custom role |
getCustomRole | GET /api/v2/roles/{customRoleKey} | Get custom role |
getCustomRoles | GET /api/v2/roles | List custom roles |
patchCustomRole | PATCH /api/v2/roles/{customRoleKey} | Update custom role |
postCustomRole | POST /api/v2/roles | Create custom role |
deleteCustomRole(customRoleKey)
Delete custom role
Delete a custom role by key
// 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.CustomRolesApi;
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");
CustomRolesApi apiInstance = new CustomRolesApi(defaultClient);
String customRoleKey = "customRoleKey_example"; // String | The custom role key
try {
apiInstance.deleteCustomRole(customRoleKey);
} catch (ApiException e) {
System.err.println("Exception when calling CustomRolesApi#deleteCustomRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
customRoleKey | String | The custom role key |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | Action succeeded | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
CustomRole getCustomRole(customRoleKey)
Get custom role
Get a single custom role by key or ID
// 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.CustomRolesApi;
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");
CustomRolesApi apiInstance = new CustomRolesApi(defaultClient);
String customRoleKey = "customRoleKey_example"; // String | The custom role key or ID
try {
CustomRole result = apiInstance.getCustomRole(customRoleKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CustomRolesApi#getCustomRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
customRoleKey | String | The custom role key or ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Custom role response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
CustomRoles getCustomRoles(limit, offset)
List custom roles
Get a complete list of custom roles. Custom roles let you create flexible policies providing fine-grained access control to everything in LaunchDarkly, from feature flags to goals, environments, and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs. Custom roles are available to customers on our enterprise plans. If you're interested in learning more about our enterprise plans, contact [email protected].
// 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.CustomRolesApi;
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");
CustomRolesApi apiInstance = new CustomRolesApi(defaultClient);
Long limit = 56L; // Long | The maximum number of custom roles to return. Defaults to 20.
Long offset = 56L; // Long | Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.
try {
CustomRoles result = apiInstance.getCustomRoles(limit, offset);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CustomRolesApi#getCustomRoles");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
limit | Long | The maximum number of custom roles to return. Defaults to 20. | [optional] |
offset | Long | Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Custom roles collection response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
429 | Rate limited | - |
CustomRole patchCustomRole(customRoleKey, patchWithComment)
Update custom role
Update a single custom role. Updating a custom role uses a JSON patch or JSON merge patch representation of the desired changes. To learn more, read Updates.<br/><br/>To add an element to the `policy` array, set the `path` to `/policy` and then append `/<array index>`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array.
// 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.CustomRolesApi;
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");
CustomRolesApi apiInstance = new CustomRolesApi(defaultClient);
String customRoleKey = "customRoleKey_example"; // String | The custom role key
PatchWithComment patchWithComment = new PatchWithComment(); // PatchWithComment |
try {
CustomRole result = apiInstance.patchCustomRole(customRoleKey, patchWithComment);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CustomRolesApi#patchCustomRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
customRoleKey | String | The custom role key | |
patchWithComment | PatchWithComment |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Custom role response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
409 | Status conflict | - |
429 | Rate limited | - |
CustomRole postCustomRole(customRolePost)
Create custom role
Create a new custom role
// 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.CustomRolesApi;
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");
CustomRolesApi apiInstance = new CustomRolesApi(defaultClient);
CustomRolePost customRolePost = new CustomRolePost(); // CustomRolePost |
try {
CustomRole result = apiInstance.postCustomRole(customRolePost);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CustomRolesApi#postCustomRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
customRolePost | CustomRolePost |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Custom role response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
409 | Status conflict | - |
429 | Rate limited | - |