Skip to content

Latest commit

 

History

History
1132 lines (791 loc) · 39.3 KB

File metadata and controls

1132 lines (791 loc) · 39.3 KB

launchdarkly_api.CodeReferencesApi

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

delete_branches(repo, request_body)

Delete branches

Asynchronously delete a number of branches.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_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"] # List[str] | 

    try:
        # Delete branches
        api_instance.delete_branches(repo, request_body)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->delete_branches: %s\n" % e)

Parameters

Name Type Description Notes
repo str The repository name to delete branches for.
request_body List[str]

Return type

void (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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_repository

delete_repository(repo)

Delete repository

Delete a repository with the specified name.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo = 'repo_example' # str | The repository name

    try:
        # Delete repository
        api_instance.delete_repository(repo)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->delete_repository: %s\n" % e)

Parameters

Name Type Description Notes
repo str The repository name

Return type

void (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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_branch

BranchRep get_branch(repo, branch, proj_key=proj_key, flag_key=flag_key)

Get branch

Get a specific branch in a repository.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.branch_rep import BranchRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo = 'repo_example' # str | The repository name
    branch = 'branch_example' # str | The url-encoded branch name
    proj_key = 'proj_key_example' # str | Filter results to a specific project (optional)
    flag_key = 'flag_key_example' # str | Filter results to a specific flag key (optional)

    try:
        # Get branch
        api_response = api_instance.get_branch(repo, branch, proj_key=proj_key, flag_key=flag_key)
        print("The response of CodeReferencesApi->get_branch:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->get_branch: %s\n" % e)

Parameters

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]

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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_branches

BranchCollectionRep get_branches(repo)

List branches

Get a list of branches.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.branch_collection_rep import BranchCollectionRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo = 'repo_example' # str | The repository name

    try:
        # List branches
        api_response = api_instance.get_branches(repo)
        print("The response of CodeReferencesApi->get_branches:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->get_branches: %s\n" % e)

Parameters

Name Type Description Notes
repo str 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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_extinctions

ExtinctionCollectionRep get_extinctions(repo_name=repo_name, branch_name=branch_name, proj_key=proj_key, flag_key=flag_key, var_from=var_from, to=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

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.extinction_collection_rep import ExtinctionCollectionRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo_name = 'repo_name_example' # str | Filter results to a specific repository (optional)
    branch_name = 'branch_name_example' # str | Filter results to a specific branch. By default, only the default branch will be queried for extinctions. (optional)
    proj_key = 'proj_key_example' # str | Filter results to a specific project (optional)
    flag_key = 'flag_key_example' # str | Filter results to a specific flag key (optional)
    var_from = 56 # 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 = 56 # 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)

    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, var_from=var_from, to=to)
        print("The response of CodeReferencesApi->get_extinctions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->get_extinctions: %s\n" % e)

Parameters

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]
var_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]

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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_repositories

RepositoryCollectionRep get_repositories(with_branches=with_branches, with_references_for_default_branch=with_references_for_default_branch, proj_key=proj_key, flag_key=flag_key)

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

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.repository_collection_rep import RepositoryCollectionRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    with_branches = 'with_branches_example' # str | If set to any value, the endpoint returns repositories with associated branch data (optional)
    with_references_for_default_branch = 'with_references_for_default_branch_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 = 'proj_key_example' # str | A LaunchDarkly project key. If provided, this filters code reference results to the specified project. (optional)
    flag_key = 'flag_key_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)

    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)
        print("The response of CodeReferencesApi->get_repositories:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->get_repositories: %s\n" % e)

Parameters

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]

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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_repository

RepositoryRep get_repository(repo)

Get repository

Get a single repository by name.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.repository_rep import RepositoryRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo = 'repo_example' # str | The repository name

    try:
        # Get repository
        api_response = api_instance.get_repository(repo)
        print("The response of CodeReferencesApi->get_repository:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->get_repository: %s\n" % e)

Parameters

Name Type Description Notes
repo str 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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_root_statistic

StatisticsRoot get_root_statistic()

Get links to code reference repositories for each project

Get links for all projects that have code references.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.statistics_root import StatisticsRoot
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)

    try:
        # Get links to code reference repositories for each project
        api_response = api_instance.get_root_statistic()
        print("The response of CodeReferencesApi->get_root_statistic:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->get_root_statistic: %s\n" % e)

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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_statistics

StatisticCollectionRep get_statistics(project_key, flag_key=flag_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.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.statistic_collection_rep import StatisticCollectionRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    project_key = 'project_key_example' # str | The project key
    flag_key = 'flag_key_example' # str | Filter results to a specific flag key (optional)

    try:
        # Get code references statistics for flags
        api_response = api_instance.get_statistics(project_key, flag_key=flag_key)
        print("The response of CodeReferencesApi->get_statistics:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->get_statistics: %s\n" % e)

Parameters

Name Type Description Notes
project_key str The project key
flag_key str 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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_repository

RepositoryRep patch_repository(repo, patch_operation)

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

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.patch_operation import PatchOperation
from launchdarkly_api.models.repository_rep import RepositoryRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo = 'repo_example' # str | The repository name
    patch_operation = [{"op":"replace","path":"/defaultBranch","value":"main"}] # List[PatchOperation] | 

    try:
        # Update repository
        api_response = api_instance.patch_repository(repo, patch_operation)
        print("The response of CodeReferencesApi->patch_repository:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->patch_repository: %s\n" % e)

Parameters

Name Type Description Notes
repo str The repository name
patch_operation 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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

post_extinction

post_extinction(repo, branch, extinction)

Create extinction

Create a new extinction.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.extinction import Extinction
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo = 'repo_example' # str | The repository name
    branch = 'branch_example' # str | The URL-encoded branch name
    extinction = [launchdarkly_api.Extinction()] # List[Extinction] | 

    try:
        # Create extinction
        api_instance.post_extinction(repo, branch, extinction)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->post_extinction: %s\n" % e)

Parameters

Name Type Description Notes
repo str The repository name
branch str The URL-encoded branch name
extinction List[Extinction]

Return type

void (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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

post_repository

RepositoryRep post_repository(repository_post)

Create repository

Create a repository with the specified name.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.repository_post import RepositoryPost
from launchdarkly_api.models.repository_rep import RepositoryRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repository_post = launchdarkly_api.RepositoryPost() # RepositoryPost | 

    try:
        # Create repository
        api_response = api_instance.post_repository(repository_post)
        print("The response of CodeReferencesApi->post_repository:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->post_repository: %s\n" % e)

Parameters

Name Type Description Notes
repository_post 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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

put_branch

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.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.put_branch import PutBranch
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.CodeReferencesApi(api_client)
    repo = 'repo_example' # str | The repository name
    branch = 'branch_example' # str | The URL-encoded branch name
    put_branch = launchdarkly_api.PutBranch() # PutBranch | 

    try:
        # Upsert branch
        api_instance.put_branch(repo, branch, put_branch)
    except Exception as e:
        print("Exception when calling CodeReferencesApi->put_branch: %s\n" % e)

Parameters

Name Type Description Notes
repo str The repository name
branch str The URL-encoded branch name
put_branch PutBranch

Return type

void (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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]