Skip to content

Latest commit

 

History

History
128 lines (99 loc) · 7.35 KB

InsightsPullRequestsBetaApi.md

File metadata and controls

128 lines (99 loc) · 7.35 KB

launchdarkly_api.InsightsPullRequestsBetaApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
get_pull_requests GET /api/v2/engineering-insights/pull-requests List pull requests

get_pull_requests

PullRequestCollectionRep get_pull_requests(project_key)

List pull requests

Get a list of pull requests ### Expanding the pull request collection response LaunchDarkly supports expanding the pull request collection response to include additional fields. To expand the response, append the expand query parameter and include the following: * deployments includes details on all of the deployments associated with each pull request * flagReferences includes details on all of the references to flags in each pull request * leadTime includes details about the lead time of the pull request for each stage For example, use ?expand=deployments to include the deployments field in the response. By default, this field is not included in the response.

Example

  • Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import insights_pull_requests_beta_api
from launchdarkly_api.model.validation_failed_error_rep import ValidationFailedErrorRep
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.pull_request_collection_rep import PullRequestCollectionRep
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 = insights_pull_requests_beta_api.InsightsPullRequestsBetaApi(api_client)
    project_key = "projectKey_example" # str | The project key
    environment_key = "environmentKey_example" # str | Required if you are using the <code>sort</code> parameter's <code>leadTime</code> option to sort pull requests. (optional)
    application_key = "applicationKey_example" # str | Filter the results to pull requests deployed to a comma separated list of applications (optional)
    status = "status_example" # str | Filter results to pull requests with the given status. Options: `open`, `merged`, `closed`, `deployed`. (optional)
    query = "query_example" # str | Filter list of pull requests by title or author (optional)
    limit = 1 # int | The number of pull requests to return. Default is 20. Maximum allowed is 100. (optional)
    expand = "expand_example" # str | Expand properties in response. Options: `deployments`, `flagReferences`, `leadTime`. (optional)
    sort = "sort_example" # str | Sort results. Requires the `environmentKey` to be set. Options: `leadTime` (asc) and `-leadTime` (desc). When query option is excluded, default sort is by created or merged date. (optional)
    _from = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Unix timestamp in milliseconds. Default value is 7 days ago. (optional)
    to = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Unix timestamp in milliseconds. Default value is now. (optional)
    after = "after_example" # str | Identifier used for pagination (optional)
    before = "before_example" # str | Identifier used for pagination (optional)

    # example passing only required values which don't have defaults set
    try:
        # List pull requests
        api_response = api_instance.get_pull_requests(project_key)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling InsightsPullRequestsBetaApi->get_pull_requests: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # List pull requests
        api_response = api_instance.get_pull_requests(project_key, environment_key=environment_key, application_key=application_key, status=status, query=query, limit=limit, expand=expand, sort=sort, _from=_from, to=to, after=after, before=before)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling InsightsPullRequestsBetaApi->get_pull_requests: %s\n" % e)

Parameters

Name Type Description Notes
project_key str The project key
environment_key str Required if you are using the <code>sort</code> parameter's <code>leadTime</code> option to sort pull requests. [optional]
application_key str Filter the results to pull requests deployed to a comma separated list of applications [optional]
status str Filter results to pull requests with the given status. Options: `open`, `merged`, `closed`, `deployed`. [optional]
query str Filter list of pull requests by title or author [optional]
limit int The number of pull requests to return. Default is 20. Maximum allowed is 100. [optional]
expand str Expand properties in response. Options: `deployments`, `flagReferences`, `leadTime`. [optional]
sort str Sort results. Requires the `environmentKey` to be set. Options: `leadTime` (asc) and `-leadTime` (desc). When query option is excluded, default sort is by created or merged date. [optional]
_from datetime Unix timestamp in milliseconds. Default value is 7 days ago. [optional]
to datetime Unix timestamp in milliseconds. Default value is now. [optional]
after str Identifier used for pagination [optional]
before str Identifier used for pagination [optional]

Return type

PullRequestCollectionRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Pull request 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]