All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
delete_branches | POST /api/v2/code-refs/repositories/{repo}/branch-delete-tasks | Delete branches |
delete_repository | DELETE /api/v2/code-refs/repositories/{repo} | Delete repository |
get_branch | GET /api/v2/code-refs/repositories/{repo}/branches/{branch} | Get branch |
get_branches | GET /api/v2/code-refs/repositories/{repo}/branches | List branches |
get_extinctions | GET /api/v2/code-refs/extinctions | List extinctions |
get_repositories | GET /api/v2/code-refs/repositories | List repositories |
get_repository | GET /api/v2/code-refs/repositories/{repo} | Get repository |
get_root_statistic | GET /api/v2/code-refs/statistics | Get links to code reference repositories for each project |
get_statistics | GET /api/v2/code-refs/statistics/{projectKey} | Get code references statistics for flags |
patch_repository | PATCH /api/v2/code-refs/repositories/{repo} | Update repository |
post_extinction | POST /api/v2/code-refs/repositories/{repo}/branches/{branch}/extinction-events | Create extinction |
post_repository | POST /api/v2/code-refs/repositories | Create repository |
put_branch | PUT /api/v2/code-refs/repositories/{repo}/branches/{branch} | Upsert branch |
delete_branches(repo, request_body)
Delete branches
Asynchronously delete a number of branches.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name to delete branches for.
request_body = ["branch-to-be-deleted","another-branch-to-be-deleted"] # [str] |
# example passing only required values which don't have defaults set
try:
# Delete branches
api_instance.delete_branches(repo, request_body)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->delete_branches: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name to delete branches for. | |
request_body | [str] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Action succeeded | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_repository(repo)
Delete repository
Delete a repository with the specified name.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name
# example passing only required values which don't have defaults set
try:
# Delete repository
api_instance.delete_repository(repo)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->delete_repository: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | Action succeeded | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BranchRep get_branch(repo, branch)
Get branch
Get a specific branch in a repository.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.branch_rep import BranchRep
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name
branch = "branch_example" # str | The url-encoded branch name
proj_key = "projKey_example" # str | Filter results to a specific project (optional)
flag_key = "flagKey_example" # str | Filter results to a specific flag key (optional)
# example passing only required values which don't have defaults set
try:
# Get branch
api_response = api_instance.get_branch(repo, branch)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_branch: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get branch
api_response = api_instance.get_branch(repo, branch, proj_key=proj_key, flag_key=flag_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_branch: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name | |
branch | str | The url-encoded branch name | |
proj_key | str | Filter results to a specific project | [optional] |
flag_key | str | Filter results to a specific flag key | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Branch response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BranchCollectionRep get_branches(repo)
List branches
Get a list of branches.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.branch_collection_rep import BranchCollectionRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name
# example passing only required values which don't have defaults set
try:
# List branches
api_response = api_instance.get_branches(repo)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_branches: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name |
- Content-Type: Not defined
- Accept: application/json
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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExtinctionCollectionRep get_extinctions()
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.extinction_collection_rep import ExtinctionCollectionRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo_name = "repoName_example" # str | Filter results to a specific repository (optional)
branch_name = "branchName_example" # str | Filter results to a specific branch. By default, only the default branch will be queried for extinctions. (optional)
proj_key = "projKey_example" # str | Filter results to a specific project (optional)
flag_key = "flagKey_example" # str | Filter results to a specific flag key (optional)
_from = 1 # int | 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 = 1 # int | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`. (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# List extinctions
api_response = api_instance.get_extinctions(repo_name=repo_name, branch_name=branch_name, proj_key=proj_key, flag_key=flag_key, _from=_from, to=to)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_extinctions: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo_name | str | Filter results to a specific repository | [optional] |
branch_name | str | Filter results to a specific branch. By default, only the default branch will be queried for extinctions. | [optional] |
proj_key | str | Filter results to a specific project | [optional] |
flag_key | str | Filter results to a specific flag key | [optional] |
_from | int | 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 | int | 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
Status code | Description | Response headers |
---|---|---|
200 | Extinction collection response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RepositoryCollectionRep get_repositories()
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.repository_collection_rep import RepositoryCollectionRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
with_branches = "withBranches_example" # str | If set to any value, the endpoint returns repositories with associated branch data (optional)
with_references_for_default_branch = "withReferencesForDefaultBranch_example" # str | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch (optional)
proj_key = "projKey_example" # str | A LaunchDarkly project key. If provided, this filters code reference results to the specified project. (optional)
flag_key = "flagKey_example" # str | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# List repositories
api_response = api_instance.get_repositories(with_branches=with_branches, with_references_for_default_branch=with_references_for_default_branch, proj_key=proj_key, flag_key=flag_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_repositories: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
with_branches | str | If set to any value, the endpoint returns repositories with associated branch data | [optional] |
with_references_for_default_branch | str | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch | [optional] |
proj_key | str | A LaunchDarkly project key. If provided, this filters code reference results to the specified project. | [optional] |
flag_key | str | 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
Status code | Description | Response headers |
---|---|---|
200 | Repository collection response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RepositoryRep get_repository(repo)
Get repository
Get a single repository by name.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.repository_rep import RepositoryRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name
# example passing only required values which don't have defaults set
try:
# Get repository
api_response = api_instance.get_repository(repo)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_repository: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Repository response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StatisticsRoot get_root_statistic()
Get links to code reference repositories for each project
Get links for all projects that have code references.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.statistics_root import StatisticsRoot
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# Get links to code reference repositories for each project
api_response = api_instance.get_root_statistic()
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_root_statistic: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Statistic root response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StatisticCollectionRep get_statistics(project_key)
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.statistic_collection_rep import StatisticCollectionRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
project_key = "projectKey_example" # str | The project key
flag_key = "flagKey_example" # str | Filter results to a specific flag key (optional)
# example passing only required values which don't have defaults set
try:
# Get code references statistics for flags
api_response = api_instance.get_statistics(project_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_statistics: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get code references statistics for flags
api_response = api_instance.get_statistics(project_key, flag_key=flag_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->get_statistics: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
flag_key | str | Filter results to a specific flag key | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Statistic collection response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RepositoryRep patch_repository(repo, json_patch)
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.json_patch import JSONPatch
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.repository_rep import RepositoryRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name
json_patch = JSONPatch([
PatchOperation(
op="replace",
path="/exampleField",
value=None,
),
]) # JSONPatch |
# example passing only required values which don't have defaults set
try:
# Update repository
api_response = api_instance.patch_repository(repo, json_patch)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->patch_repository: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name | |
json_patch | JSONPatch |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Repository response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
post_extinction(repo, branch, extinction_list_post)
Create extinction
Create a new extinction.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.extinction_list_post import ExtinctionListPost
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name
branch = "branch_example" # str | The URL-encoded branch name
extinction_list_post = ExtinctionListPost([
Extinction(
revision="a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
message="Remove flag for launched feature",
time=1,
flag_key="enable-feature",
proj_key="default",
),
]) # ExtinctionListPost |
# example passing only required values which don't have defaults set
try:
# Create extinction
api_instance.post_extinction(repo, branch, extinction_list_post)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->post_extinction: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name | |
branch | str | The URL-encoded branch name | |
extinction_list_post | ExtinctionListPost |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Action succeeded | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RepositoryRep post_repository(repository_post)
Create repository
Create a repository with the specified name.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.repository_post import RepositoryPost
from launchdarkly_api.model.repository_rep import RepositoryRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repository_post = RepositoryPost(
name="LaunchDarkly-Docs",
source_link="https://github.com/launchdarkly/LaunchDarkly-Docs",
commit_url_template="https://github.com/launchdarkly/LaunchDarkly-Docs/commit/${sha}",
hunk_url_template="https://github.com/launchdarkly/LaunchDarkly-Docs/blob/${sha}/${filePath}#L${lineNumber}",
type="github",
default_branch="main",
) # RepositoryPost |
# example passing only required values which don't have defaults set
try:
# Create repository
api_response = api_instance.post_repository(repository_post)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->post_repository: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repository_post | RepositoryPost |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Repository response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
409 | Status conflict | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
put_branch(repo, branch, put_branch)
Upsert branch
Create a new branch if it doesn't exist, or update the branch if it already exists.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import code_references_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.put_branch import PutBranch
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_references_api.CodeReferencesApi(api_client)
repo = "repo_example" # str | The repository name
branch = "branch_example" # str | The URL-encoded branch name
put_branch = PutBranch(
name="main",
head="a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
update_sequence_id=25,
sync_time=1,
references=[
ReferenceRep(
path="/main/index.js",
hint="javascript",
hunks=[
HunkRep(
starting_line_number=45,
lines="var enableFeature = 'enable-feature';",
proj_key="default",
flag_key="enable-feature",
aliases=["enableFeature","EnableFeature"],
),
],
),
],
commit_time=1,
) # PutBranch |
# example passing only required values which don't have defaults set
try:
# Upsert branch
api_instance.put_branch(repo, branch, put_branch)
except launchdarkly_api.ApiException as e:
print("Exception when calling CodeReferencesApi->put_branch: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
repo | str | The repository name | |
branch | str | The URL-encoded branch name | |
put_branch | PutBranch |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]