Skip to content

Latest commit

 

History

History
1006 lines (795 loc) · 35.9 KB

CodeReferencesApi.md

File metadata and controls

1006 lines (795 loc) · 35.9 KB

CodeReferencesApi

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

deleteBranches(repo, requestBody)

Delete branches

Asynchronously delete a number of branches.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name to delete branches for.
    List<String> requestBody = ["branch-to-be-deleted","another-branch-to-be-deleted"]; // List<String> | 
    try {
      apiInstance.deleteBranches(repo, requestBody);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#deleteBranches");
      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
repo String The repository name to delete branches for.
requestBody List<String>

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

deleteRepository

deleteRepository(repo)

Delete repository

Delete a repository with the specified name.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name
    try {
      apiInstance.deleteRepository(repo);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#deleteRepository");
      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
repo String The repository name

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 -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

getBranch

BranchRep getBranch(repo, branch, projKey, flagKey)

Get branch

Get a specific branch in a repository.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name
    String branch = "branch_example"; // String | The url-encoded branch name
    String projKey = "projKey_example"; // String | Filter results to a specific project
    String flagKey = "flagKey_example"; // String | Filter results to a specific flag key
    try {
      BranchRep result = apiInstance.getBranch(repo, branch, projKey, flagKey);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#getBranch");
      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
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]

Return type

BranchRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

getBranches

BranchCollectionRep getBranches(repo)

List branches

Get a list of branches.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name
    try {
      BranchCollectionRep result = apiInstance.getBranches(repo);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#getBranches");
      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
repo String The repository name

Return type

BranchCollectionRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Branch collection response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

getExtinctions

ExtinctionCollectionRep getExtinctions(repoName, branchName, projKey, flagKey, from, to)

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.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repoName = "repoName_example"; // String | Filter results to a specific repository
    String branchName = "branchName_example"; // String | Filter results to a specific branch. By default, only the default branch will be queried for extinctions.
    String projKey = "projKey_example"; // String | Filter results to a specific project
    String flagKey = "flagKey_example"; // String | Filter results to a specific flag key
    Long from = 56L; // Long | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`.
    Long to = 56L; // Long | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`.
    try {
      ExtinctionCollectionRep result = apiInstance.getExtinctions(repoName, branchName, projKey, flagKey, from, to);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#getExtinctions");
      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
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 Long 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 Long Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`. [optional]

Return type

ExtinctionCollectionRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

getRepositories

RepositoryCollectionRep getRepositories(withBranches, withReferencesForDefaultBranch, projKey, flagKey)

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.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String withBranches = "withBranches_example"; // String | If set to any value, the endpoint returns repositories with associated branch data
    String 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
    String projKey = "projKey_example"; // String | A LaunchDarkly project key. If provided, this filters code reference results to the specified project.
    String 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
    try {
      RepositoryCollectionRep result = apiInstance.getRepositories(withBranches, withReferencesForDefaultBranch, projKey, flagKey);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#getRepositories");
      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
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]

Return type

RepositoryCollectionRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

getRepository

RepositoryRep getRepository(repo)

Get repository

Get a single repository by name.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name
    try {
      RepositoryRep result = apiInstance.getRepository(repo);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#getRepository");
      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
repo String The repository name

Return type

RepositoryRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

getRootStatistic

StatisticsRoot getRootStatistic()

Get links to code reference repositories for each project

Get links for all projects that have code references.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    try {
      StatisticsRoot result = apiInstance.getRootStatistic();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#getRootStatistic");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

StatisticsRoot

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

getStatistics

StatisticCollectionRep getStatistics(projectKey, flagKey)

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.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String flagKey = "flagKey_example"; // String | Filter results to a specific flag key
    try {
      StatisticCollectionRep result = apiInstance.getStatistics(projectKey, flagKey);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#getStatistics");
      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
flagKey String Filter results to a specific flag key [optional]

Return type

StatisticCollectionRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

patchRepository

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.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name
    List<PatchOperation> patchOperation = Arrays.asList(); // List<PatchOperation> | 
    try {
      RepositoryRep result = apiInstance.patchRepository(repo, patchOperation);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#patchRepository");
      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
repo String The repository name
patchOperation List<PatchOperation>

Return type

RepositoryRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

postExtinction

postExtinction(repo, branch, extinction)

Create extinction

Create a new extinction.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name
    String branch = "branch_example"; // String | The URL-encoded branch name
    List<Extinction> extinction = Arrays.asList(); // List<Extinction> | 
    try {
      apiInstance.postExtinction(repo, branch, extinction);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#postExtinction");
      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
repo String The repository name
branch String The URL-encoded branch name
extinction List<Extinction>

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

postRepository

RepositoryRep postRepository(repositoryPost)

Create repository

Create a repository with the specified name.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    RepositoryPost repositoryPost = new RepositoryPost(); // RepositoryPost | 
    try {
      RepositoryRep result = apiInstance.postRepository(repositoryPost);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#postRepository");
      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
repositoryPost RepositoryPost

Return type

RepositoryRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Repository response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
409 Status conflict -
429 Rate limited -

putBranch

putBranch(repo, branch, putBranch)

Upsert branch

Create a new branch if it doesn't exist, or update the branch if it already exists.

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

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

    CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient);
    String repo = "repo_example"; // String | The repository name
    String branch = "branch_example"; // String | The URL-encoded branch name
    PutBranch putBranch = new PutBranch(); // PutBranch | 
    try {
      apiInstance.putBranch(repo, branch, putBranch);
    } catch (ApiException e) {
      System.err.println("Exception when calling CodeReferencesApi#putBranch");
      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
repo String The repository name
branch String The URL-encoded branch name
putBranch PutBranch

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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