All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
deleteBranches | POST /api/v2/code-refs/repositories/{repo}/branch-delete-tasks | Delete branches |
deleteRepository | DELETE /api/v2/code-refs/repositories/{repo} | Delete repository |
getBranch | GET /api/v2/code-refs/repositories/{repo}/branches/{branch} | Get branch |
getBranches | GET /api/v2/code-refs/repositories/{repo}/branches | List branches |
getExtinctions | GET /api/v2/code-refs/extinctions | List extinctions |
getRepositories | GET /api/v2/code-refs/repositories | List repositories |
getRepository | GET /api/v2/code-refs/repositories/{repo} | Get repository |
getRootStatistic | GET /api/v2/code-refs/statistics | Get links to code reference repositories for each project |
getStatistics | GET /api/v2/code-refs/statistics/{projectKey} | Get code references statistics for flags |
patchRepository | PATCH /api/v2/code-refs/repositories/{repo} | Update repository |
postExtinction | POST /api/v2/code-refs/repositories/{repo}/branches/{branch}/extinction-events | Create extinction |
postRepository | POST /api/v2/code-refs/repositories | Create repository |
putBranch | PUT /api/v2/code-refs/repositories/{repo}/branches/{branch} | Upsert branch |
deleteBranches(repo, requestBody)
Delete branches
Asynchronously delete a number of branches.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name to delete branches for.
let requestBody = ["branch-to-be-deleted","another-branch-to-be-deleted"]; // [String] |
apiInstance.deleteBranches(repo, requestBody, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name to delete branches for. | |
requestBody | [String] |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
deleteRepository(repo)
Delete repository
Delete a repository with the specified name.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name
apiInstance.deleteRepository(repo, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
BranchRep getBranch(repo, branch, opts)
Get branch
Get a specific branch in a repository.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name
let branch = "branch_example"; // String | The url-encoded branch name
let opts = {
'projKey': "projKey_example", // String | Filter results to a specific project
'flagKey': "flagKey_example" // String | Filter results to a specific flag key
};
apiInstance.getBranch(repo, branch, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name | |
branch | String | The url-encoded branch name | |
projKey | String | Filter results to a specific project | [optional] |
flagKey | String | Filter results to a specific flag key | [optional] |
- Content-Type: Not defined
- Accept: application/json
BranchCollectionRep getBranches(repo)
List branches
Get a list of branches.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name
apiInstance.getBranches(repo, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name |
- Content-Type: Not defined
- Accept: application/json
ExtinctionCollectionRep getExtinctions(opts)
List extinctions
Get a list of all extinctions. LaunchDarkly creates an extinction event after you remove all code references to a flag. To learn more, read About extinction events.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let opts = {
'repoName': "repoName_example", // String | Filter results to a specific repository
'branchName': "branchName_example", // String | Filter results to a specific branch. By default, only the default branch will be queried for extinctions.
'projKey': "projKey_example", // String | Filter results to a specific project
'flagKey': "flagKey_example", // String | Filter results to a specific flag key
'from': 789, // Number | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`.
'to': 789 // Number | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`.
};
apiInstance.getExtinctions(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
repoName | String | Filter results to a specific repository | [optional] |
branchName | String | Filter results to a specific branch. By default, only the default branch will be queried for extinctions. | [optional] |
projKey | String | Filter results to a specific project | [optional] |
flagKey | String | Filter results to a specific flag key | [optional] |
from | Number | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`. | [optional] |
to | Number | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
RepositoryCollectionRep getRepositories(opts)
List repositories
Get a list of connected repositories. Optionally, you can include branch metadata with the `withBranches` query parameter. Embed references for the default branch with `ReferencesForDefaultBranch`. You can also filter the list of code references by project key and flag key.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let opts = {
'withBranches': "withBranches_example", // String | If set to any value, the endpoint returns repositories with associated branch data
'withReferencesForDefaultBranch': "withReferencesForDefaultBranch_example", // String | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
'projKey': "projKey_example", // String | A LaunchDarkly project key. If provided, this filters code reference results to the specified project.
'flagKey': "flagKey_example" // String | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
};
apiInstance.getRepositories(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
withBranches | String | If set to any value, the endpoint returns repositories with associated branch data | [optional] |
withReferencesForDefaultBranch | String | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch | [optional] |
projKey | String | A LaunchDarkly project key. If provided, this filters code reference results to the specified project. | [optional] |
flagKey | String | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch | [optional] |
- Content-Type: Not defined
- Accept: application/json
RepositoryRep getRepository(repo)
Get repository
Get a single repository by name.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name
apiInstance.getRepository(repo, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name |
- Content-Type: Not defined
- Accept: application/json
StatisticsRoot getRootStatistic()
Get links to code reference repositories for each project
Get links for all projects that have code references.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
apiInstance.getRootStatistic((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
StatisticCollectionRep getStatistics(projectKey, opts)
Get code references statistics for flags
Get statistics about all the code references across repositories for all flags in your project that have code references in the default branch, for example, `main`. Optionally, you can include the `flagKey` query parameter to limit your request to statistics about code references for a single flag. This endpoint returns the number of references to your flag keys in your repositories, as well as a link to each repository.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let projectKey = "projectKey_example"; // String | The project key
let opts = {
'flagKey': "flagKey_example" // String | Filter results to a specific flag key
};
apiInstance.getStatistics(projectKey, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
projectKey | String | The project key | |
flagKey | String | Filter results to a specific flag key | [optional] |
- Content-Type: Not defined
- Accept: application/json
RepositoryRep patchRepository(repo, patchOperation)
Update repository
Update a repository's settings. Updating repository settings uses a JSON patch or JSON merge patch representation of the desired changes. To learn more, read Updates.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name
let patchOperation = [{"op":"replace","path":"/defaultBranch","value":"main"}]; // [PatchOperation] |
apiInstance.patchRepository(repo, patchOperation, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name | |
patchOperation | [PatchOperation] |
- Content-Type: application/json
- Accept: application/json
postExtinction(repo, branch, extinction)
Create extinction
Create a new extinction.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name
let branch = "branch_example"; // String | The URL-encoded branch name
let extinction = [new LaunchDarklyApi.Extinction()]; // [Extinction] |
apiInstance.postExtinction(repo, branch, extinction, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name | |
branch | String | The URL-encoded branch name | |
extinction | [Extinction] |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
RepositoryRep postRepository(repositoryPost)
Create repository
Create a repository with the specified name.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repositoryPost = new LaunchDarklyApi.RepositoryPost(); // RepositoryPost |
apiInstance.postRepository(repositoryPost, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
repositoryPost | RepositoryPost |
- Content-Type: application/json
- Accept: application/json
putBranch(repo, branch, putBranch)
Upsert branch
Create a new branch if it doesn't exist, or update the branch if it already exists.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.CodeReferencesApi();
let repo = "repo_example"; // String | The repository name
let branch = "branch_example"; // String | The URL-encoded branch name
let putBranch = new LaunchDarklyApi.PutBranch(); // PutBranch |
apiInstance.putBranch(repo, branch, putBranch, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
repo | String | The repository name | |
branch | String | The URL-encoded branch name | |
putBranch | PutBranch |
null (empty response body)
- Content-Type: application/json
- Accept: application/json