openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 78.4 kB
JSON
{"openapi":"3.0.1","servers":[{"url":"https://lgtm.com/api/v1.0"}],"x-hasEquivalentPaths":true,"info":{"description":"The REST API for LGTM provides data so that you can customize how you integrate LGTM analysis into your workflow. It includes the following resources:\n * `/` ([API root](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-API-root))—get version information or download the specification in OpenAPI format.\n * `/projects` ([Projects](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Projects))—list projects, get a summary of the current status for a project, or add new projects.\n * `/analyses` ([Analyses](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Analyses))—get a summary of results, download all the alerts, or trigger analysis for a specific commit.\n * `/codereviews` ([Code reviews](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Code-reviews))—trigger code review for a patch, and view the results.\n * `/operations` ([Operations](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Operations))—get information about long-running tasks, for example, analyses or code reviews that you've requested.\n * `/snapshots` ([Snapshots](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Snapshots))—download and upload databases representing a snapshot of a codebase.\n * `/queryjobs` ([Query jobs](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Query-jobs))—submit queries to evaluate against existing projects, and download their results.\n * `/system` ([System](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-System))—get information on the health or usage of the system.\n\nFor an overview and getting started topics, see [API for LGTM](https://lgtm.com/help/lgtm/api/api-for-lgtm).\n","title":"LGTM API specification","version":"v1.0","x-apisguru-categories":["developer_tools"],"x-origin":[{"format":"openapi","url":"https://lgtm.com/api/v1.0/openapi","version":"3.0"}],"x-providerName":"lgtm.com"},"tags":[{"description":"The `/` endpoints are used to get information about the API:\n * [Get the API version number](https://lgtm.com/help/lgtm/api/api-v1#opIdgetVersion) for the LGTM server.\n * [View the API specification](https://lgtm.com/help/lgtm/api/api-v1#opIdgetSpec) in [OpenAPI format](https://github.com/OAI/OpenAPI-Specification).\n","name":"API root"},{"description":"The `/projects` endpoints are used to interact with projects:\n * [List the projects](https://lgtm.com/help/lgtm/api/api-v1#opIdgetProjects) available to the current user.\n * Get the latest summary for a specific project [by identifier](https://lgtm.com/help/lgtm/api/api-v1#opIdgetProject), \n or by [URL identifier](https://lgtm.com/help/lgtm/api/api-v1#opIdgetProjectByUrlIdentifier).\n * LGTM administrators only, [add projects](https://lgtm.com/help/lgtm/api/api-v1#opIdaddProject) to LGTM.\n","name":"Projects"},{"description":"Most of the `/analyses` endpoints are used to retrieve the results of analyzing a commit:\n * [Get the *analysis* identifier and results summary for the latest or a specific commit](https://lgtm.com/help/lgtm/api/api-v1#opIdgetAnalysisForCommit).\n * [Get the *commit* identifier and results summary for a specific analysis](https://lgtm.com/help/lgtm/api/api-v1#opIdgetAnalysis).\n * [Download the full results for a specific analysis](https://lgtm.com/help/lgtm/api/api-v1#opIdgetAlerts).\n\n You can also use this end point to trigger the analysis of a commit that hasn't previously been analyzed.\n For more information, see [Run analysis of a specific commit](https://lgtm.com/help/lgtm/api/api-v1#opIdrequestAnalysis).\n","name":"Analyses"},{"description":"The `/codereviews` endpoint is used to trigger a patch code review and request the results:\n * [Trigger the review of a patch](https://lgtm.com/help/lgtm/api/api-v1#opIdrequestReview).\n * [Get the results of a completed code review](https://lgtm.com/help/lgtm/api/api-v1#opIdgetCodeReview).\n","name":"Code reviews"},{"description":"The `/operations` endpoint is used to track the progress of long-running tasks, for example, code review requests. For more information, see [Get operation status](https://lgtm.com/help/lgtm/api/api-v1#opIdgetOperation).\n","name":"Operations"},{"description":"The `/snapshots` endpoint is used to download databases, representing a snapshot of the code, to analyze in your IDE. LGTM administrators can also use it to upload externally-built databases to LGTM.\n","name":"Snapshots"},{"description":"The `/system` endpoint is used to retrieve information about the status of the system: \n * Get the [system health](https://lgtm.com/help/lgtm/api/api-v1#opIdgetHealth).\n * LGTM administrators only, get the [list of usage metrics](https://lgtm.com/help/lgtm/api/api-v1#opIdgetMetrics).\n * LGTM administrators only, get the [values of a given metric](https://lgtm.com/help/lgtm/api/api-v1#opIdgetMetric)\n","name":"System"},{"description":"The `/queryjobs` endpoint is used to run CodeQL queries on LGTM and check their progress.\n * [Create a new query job](https://lgtm.com/help/lgtm/api/api-v1#opIdcreateQueryJob).\n * Get an overview of the [progress of the query job](https://lgtm.com/help/lgtm/api/api-v1#opIdgetQueryJob).\n * Get a [summary of the results](https://lgtm.com/help/lgtm/api/api-v1#opIdgetQueryJobResultsOverview) for the query job.\n * Download the [results for a specific project](https://lgtm.com/help/lgtm/api/api-v1#opIdgetQueryJobResultsForProject).\n","name":"Query jobs"}],"paths":{"/":{"get":{"description":"Get the version information of this API.","operationId":"getVersion","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/version"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Version information","tags":["API root"],"x-auth-mode":"UNRESTRICTED"}},"/analyses/{analysis-id}":{"get":{"description":"Get a summary of the analysis results for a specific analysis identifier.\n\nTo find the analysis identifier for a commit, use the `/analyses/{project-id}/commits/{commit-id}` endpoint. For more information, see [Get analysis summary for a specific commit](https://lgtm.com/help/lgtm/api/api-v1#opIdgetAnalysisForCommit).\n\nThis endpoint reports the commit analyzed and a summary of the results for each language. Alternatively, you can use this identifier to download full details of all the alerts found by the analysis. For more information, see [Get detailed alert information](https://lgtm.com/help/lgtm/api/api-v1#opIdgetAlerts).\n","operationId":"getAnalysis","parameters":[{"description":"The analysis identifier.","explode":false,"in":"path","name":"analysis-id","required":true,"schema":{"maxLength":40,"minLength":40,"pattern":"[a-f0-9]+","type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"examples":{"analysisExample":{"$ref":"#/components/examples/analysisExample"}},"schema":{"$ref":"#/components/schemas/analysis"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Get analysis summary","tags":["Analyses"],"x-auth-mode":"BINARY"}},"/analyses/{analysis-id}/alerts":{"get":{"description":"Download all the alerts found by an analysis.\nUse the `Accept:` request header to specify the output media type as either CSV or [SARIF](https://lgtm.com/help/lgtm/sarif-results-file): \n\n- `application/sarif+json`: Alerts in SARIF format. If no version is specified the latest supported SARIF version is used.\n- `application/json`: Alerts in SARIF format (*deprecated*). \n If no version is specified, [SARIF 2.0.0](http://docs.oasis-open.org/sarif/sarif/v2.0/sarif-v2.0.html) \n is used for backwards compatibility.\n\n- `text/csv`: Alerts in CSV format. The `text/csv` media type has two optional parameters:\n - `charset`: determines the character encoding of the text, by default UTF-8.\n - `header`: determines whether a header row with column names is `present` or `absent`.\n The default value for this parameter is `present`.\n For example, an Accept header with value `text/csv; header=absent` \n would result in CSV output without a header row.\n \n\n\n\nTo find the analysis identifier for a commit, use the `/analyses/{project-id}/commits/{commit-id}` endpoint. For more information, see [Get analysis summary for a specific commit](https://lgtm.com/help/lgtm/api/api-v1#opIdgetAnalysisForCommit). \n","operationId":"getAlerts","parameters":[{"description":"The analysis identifier.","explode":false,"in":"path","name":"analysis-id","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"The desired version of the SARIF format. Currently supported versions are `1.0.0`, `2.0.0`, and `2.1.0`.","explode":true,"in":"query","name":"sarif-version","required":false,"schema":{"type":"string"},"style":"form"},{"description":"Set `true` to include results in files that are excluded from the output by default. This includes results in test code and generated files. For more information, see [File classification](https://lgtm.com/help/lgtm/file-classification).","explode":true,"in":"query","name":"excluded-files","required":false,"schema":{"default":false,"type":"boolean"},"style":"form"}],"responses":{"200":{"content":{"application/json":{"examples":{},"schema":{"deprecated":true,"type":"object"}},"application/sarif+json":{"examples":{},"schema":{"type":"object"}},"text/csv":{"examples":{},"schema":{"type":"string"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Get detailed alert information","tags":["Analyses"],"x-auth-mode":"BINARY"}},"/analyses/{project-id}":{"post":{"description":"Trigger the analysis of a specific commit to a project. If a previous attempt to analyze that commit failed, this triggers a fresh analysis. This is supported for all LGTM projects, regardless of repository type or host. The commit must be available in the main repository, but can be on a branch that isn't tracked by LGTM. For both LGTM.com and LGTM Enterprise, you must include an access token with the `analyses:write` scope.\n\nWhen you request the analysis of a commit, the API returns:\n- `operation-id`: used to track the status of the task using the `/operations` endpoint. For more information, see [Get operation status](https://lgtm.com/help/lgtm/api/api-v1#opIdgetOperation).\n- `status`: initially pending.\n- `task-result`: containing information about the progress and results of the analysis.\n","operationId":"requestAnalysis","parameters":[{"description":"The numeric project identifier.","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"},{"description":"The identifier of the commit to analyze.","explode":true,"in":"query","name":"commit","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The language codes of the languages to analyze.\nFor a list of available languages, see [Supported languages](https://lgtm.com/help/lgtm/analysis-faqs#which-languages-are-supported). To specify more than one language, this parameter can be repeated. If no language is specified, all the project's languages will be analyzed.\n","explode":true,"in":"query","name":"language","required":false,"schema":{"items":{"type":"string"},"maxItems":10,"type":"array"},"style":"form"}],"responses":{"202":{"content":{"application/json":{"examples":{"analysisRequestExample":{"$ref":"#/components/examples/analysisRequestExample"}},"schema":{"$ref":"#/components/schemas/operation"}}},"description":"Accepted. Analysis triggered. Tracking data returned."}},"security":[{"access-token":[]}],"summary":"Run analysis of a specific commit","tags":["Analyses"],"x-auth-mode":"BINARY"}},"/analyses/{project-id}/commits/{commit-id}":{"get":{"description":"Get a summary of the analysis results for a specific commit, or the latest commit, to a project. (For projects configured for sparse or upload analysis, only `latest` is supported.) \n\nThis endpoint reports a summary of results for each language, and also the analysis identifier. You can use the analysis identifier to download full details of all the alerts found by the analysis. For more information, see [Get detailed alert information](https://lgtm.com/help/lgtm/api/api-v1#opIdgetAlerts).\n","operationId":"getAnalysisForCommit","parameters":[{"description":"The numeric project identifier.","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"},{"description":"The identifier of a specific commit. Alternatively, use `latest` for the most recent analyzed commit.","explode":false,"in":"path","name":"commit-id","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"examples":{"analysisExample":{"$ref":"#/components/examples/analysisExample"}},"schema":{"$ref":"#/components/schemas/analysis"}}},"description":"Success. Data returned."}},"security":[{"access-token":[]}],"summary":"Get analysis summary for a specific commit","tags":["Analyses"],"x-auth-mode":"BINARY"}},"/codereviews/{project-id}":{"post":{"description":"Trigger the code review of a patch. This is available for projects with Git repositories.\n\nYour request must include:\n\n * Identifier for the base commit\n * Patch generated using `git diff --binary` (see [git diff](https://git-scm.com/docs/git-diff))\n * Header `Content-Type: application/octet-stream`\n * For both LGTM.com and LGTM Enterprise, an access token with the `codereviews:write` scope\n\nNote that if you make a request using Curl, you'll also need to add `--data-binary` to the request to ensure that the patch you supply in the body is sent with newlines unchanged.\nYou can track the progress of the review using the task result URL returned on creation of the task, or by calling the `/operations` endpoint with the operations identifier returned by the request. For more information, see [Get operation status](https://lgtm.com/help/lgtm/api/api-v1#opIdgetOperation). Alternatively, if you supply a callback URL you'll get a post-back automatically on completion of the review.\n\nWhen the review is complete, you can access the results using the task result URL.\n","operationId":"requestReview","parameters":[{"description":"The numeric project identifier.","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"},{"description":"The identifier for the base commit.","explode":true,"in":"query","name":"base","required":true,"schema":{"type":"string"},"style":"form"},{"description":"Your reference number for the code review.","example":"integer","explode":true,"in":"query","name":"external-id","required":true,"schema":{"format":"int32","type":"integer"},"style":"form"},{"description":"An informative back-link to an external system.","explode":true,"in":"query","name":"review-url","required":false,"schema":{"type":"string"},"style":"form"},{"description":"The callback URL for LGTM to post to on completion of the review.\nWhen the code review is complete, the API sends an HTTP POST request to the callback URL with the result of the code review in the request body. The code review results in the request body are identical to the results accessed through the [`/codereviews/{review-id}`](https://lgtm.com/help/lgtm/api/api-v1#opIdgetCodeReview) end-point.\nIf you specify a `callback-secret`, the request also includes an `x-lgtm-signature` header with a digital signature of the request's contents.\n","explode":true,"in":"query","name":"callback-url","required":false,"schema":{"type":"string"},"style":"form"},{"description":"The `callback-secret` is used to compute a signature which is included in the `x-lgtm-signature` header of the callback response.\nThe receiver of the callback can check the validity of the response by computing the signature using HMAC-SHA1 and verifying that it matches the `x-lgtm-signature` header value.\nThe HMAC algorithm requires byte sequences as inputs for both the secret and the message. The callback secret string must be converted to bytes using UTF-8 encoding. The response body should ideally be read as a plain byte sequence. Conversion to, for example a JSON object, and back to a byte sequence might change the formatting, and would invalidate the signature.\n","explode":true,"in":"query","name":"callback-secret","required":false,"schema":{"type":"string"},"style":"form"}],"requestBody":{"content":{"application/octet-stream":{"examples":{"patchFile":{"description":"The request body must contain a patch file generated using `git diff --binary`, see [git diff](https://git-scm.com/docs/git-diff), for example:\n```text\n diff --git a/describe.c b/describe.c\n index db827ffaba..510eaf4866 100644\n --- a/describe.c\n +++ b/describe.c\n @@ -132,7 +132,8 @@ void describe(char *arg)\n if (n) {\n printf(\"%s-g%s\\n\", n->path,\n find(cmit->key, abbrev));\n - clear(cmit, SEEN);\n + if (!last_one)\n + clear(cmit, SEEN);\n return;\n }\n }\n```\n","value":"The contents of a binary patch file"}},"schema":{"format":"binary","type":"string"}}},"description":"The patch containing the code changes for review.","required":true},"responses":{"202":{"content":{"application/json":{"examples":{"requestcode-reviewExample":{"$ref":"#/components/examples/requestcode-reviewExample"}},"schema":{"$ref":"#/components/schemas/operation"}}},"description":"Accepted. Code review triggered. Tracking data returned."}},"security":[{"access-token":[]}],"summary":"Run code review for a patch","tags":["Code reviews"],"x-auth-mode":"BINARY"}},"/codereviews/{review-id}":{"get":{"description":"Get the results of a code review using the review identifier for the task.\n\nWhen you request a code review, the response includes a task result URL of the form: `/codereviews/{review-id}`.\n\nThis endpoint reports the results of a complete code review, or the status of a review that's still in progress.\n","operationId":"getCodeReview","parameters":[{"description":"The identifier for the review (from the `task-result-url`).","explode":false,"in":"path","name":"review-id","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"examples":{"code-review":{"description":"A successful code review with 1 fixed alert.","summary":"A successful code review","value":{"id":"b45e291e7033460949ec986153c5416d22157d3e","languages":[{"alerts":[{"fixed":1,"new":0,"query":{"id":3717280014,"language":"javascript","name":"Duplicate switch case","pack":"com.lgtm/javascript-queries","properties":{"id":"js/duplicate-switch-case","name":"Duplicate switch case","severity":"warning","tags":["maintainability","correctness","external/cwe/cwe-561"]},"url":"https://lgtm.example.com/rules/3717280014/"}}],"fixed":1,"language":"javascript","new":0,"status":"success","status-message":"1 fixed alert"}],"results-url":"https://lgtm.example.com/projects/g/yarnpkg/yarn/rev/pr-b45e291e7033460949ec986153c5416d22157d3e","status":"success","status-message":"Analysis succeeded"}}},"schema":{"items":{"$ref":"#/components/schemas/code-review"},"type":"array"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Get results of code review","tags":["Code reviews"],"x-auth-mode":"BINARY"}},"/issues/{project-id}/{alert-key}":{"get":{"description":"Fetch the alert information for an issue in [SARIF](https://lgtm.com/help/lgtm/sarif-results-file) format.\n","operationId":"getIssue","parameters":[{"description":"The numeric project identifier.","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"},{"description":"The alert key is generated by LGTM when it posts an issue `create` webhook request \n to an external system using the [issue tracker Webhook API](https://lgtm.com/admin/help/issuetracker-webhook-api).\n This key is an opaque identifier that tracks the alert's location over time. For example, if a file containing the alert\n is modified, the SARIF data will reflect the updated location of the alert.\n Note that the key needs to be URL encoded as it may contain characters that are not web-safe. \n","example":"+ja0cf6+84AGgat15W1jooeMfUY=","explode":false,"in":"path","name":"alert-key","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/sarif+json":{"examples":{},"schema":{"type":"object"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Get detailed alert information for an issue","tags":["Issues"],"x-auth-mode":"BINARY"}},"/openapi":{"get":{"description":"Get the specification of this API in [OpenAPI](https://github.com/OAI/OpenAPI-Specification) format. This endpoint does not require an access token. This makes it easier for you to use the specification with third-party tools.","operationId":"getSpec","responses":{"200":{"content":{"application/json":{"examples":{},"schema":{"type":"object"}}},"description":"Success. Requested data returned."}},"summary":"API specification","tags":["API root"],"x-auth-mode":"UNRESTRICTED"}},"/operations/{operation-id}":{"get":{"description":"Track progress of a long-running operation using the operations identifier returned when you created the operation. For example, by triggering the analysis of a commit, or the code review of a patch. For both LGTM.com and LGTM Enterprise, you must include an access token with the `operations:read` scope.\n","operationId":"getOperation","parameters":[{"description":"The operation identifier returned on creating the task.","explode":false,"in":"path","name":"operation-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"examples":{"analysisOperationExample":{"$ref":"#/components/examples/analysisOperationExample"}},"schema":{"$ref":"#/components/schemas/operation"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Get operation status","tags":["Operations"],"x-auth-mode":"BINARY"}},"/projects":{"get":{"description":"List all the projects the current user has authorization to view. \n\nA maximum of 100 projects are returned in each response. When further results are available, the response includes the URL you need to request the next page of results.\n\nUse the optional parameter, `limit`, to change the number of results reported in each response (range of 1—100). If you supply an invalid value for this parameter, the default value of 100 is used.\n\nWhen more than one page of results is available, each response includes a `nextPageUrl` response parameter. You can use this URL to request the next page of results. The `nextPageUrl` includes an automatically generated `start` parameter, which specifies the projects to return in the next page of results.\n","operationId":"getProjects","parameters":[{"description":"The maximum number of projects to return in each response (1-100).","explode":true,"in":"query","name":"limit","required":false,"schema":{"default":100,"format":"int32","maximum":100,"minimum":1,"type":"integer"},"style":"form"},{"description":"An opaque identifier generated by the API.","explode":true,"in":"query","name":"start","required":false,"schema":{"type":"string"},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/project-list"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"List projects","tags":["Projects"],"x-auth-mode":"FILTERING"},"post":{"description":"LGTM administrators can add a new project to LGTM by providing a repository URL. By default, LGTM tries to build and analyze the project in the same way as for projects added through the user interface. If at least one language is successfully analyzed, and the repository doesn't already exist on LGTM, a new project is created. If the project already exists but your API call triggers a successful analysis of additional languages, LGTM adds those languages to the project.\n\nYou can configure how LGTM processes the project using query parameters to:\n * Specify the languages to analyze.\n * Create a new project in [sparse mode](https://help.semmle.com/lgtm-enterprise/user/help/analysis-faqs.html#what-is-sparse-analysis).\n * Create a new project in [upload mode](https://help.semmle.com/lgtm-enterprise/user/help/analysis-faqs.html#what-is-upload-analysis) to analyze externally-generated databases. Each database represents a snapshot of the codebase. \n Use this option when you want to upload databases that were generated by the CodeQL CLI (or the QL command-line tools).\n The version of the command line used to generate the database\n must be the same version as LGTM Enterprise. \n\nWith any of these options, you can also include an `lgtm.yml` in the body of the request to [customize extraction](https://lgtm.com/help/lgtm/customizing-code-extraction).\n","operationId":"addProject","parameters":[{"description":"The URL of the repository to analyze.\nLGTM tests this against the [repository providers](https://lgtm.com/admin/help/adding-repository-providers) defined for the system. If it doesn't match any of them, the request fails.","explode":true,"in":"query","name":"repository","required":true,"schema":{"format":"uri","type":"string"},"style":"form"},{"description":"Optional, a [language code](https://lgtm.com/help/lgtm/analysis-faqs#which-languages-are-supported) to specify which language to analyze.\nTo request the analysis of more than one language, specify a query parameter for each language. By default, LGTM tries to analyze all supported languages.\n","explode":true,"in":"query","name":"language","required":false,"schema":{"items":{"type":"string"},"type":"array"},"style":"form"},{"description":"The analysis mode of the new project.\nWhen set to `full` all commits of the project are analyzed; when set to `sparse` the latest commit of the project is analyzed periodically; when set to `upload`, no automatic analysis is performed, instead externally-generated databases should be uploaded.\nFor new projects the default value is `full`. The `mode` parameter cannot be used to change the analysis mode of existing projects. Therefore, for existing projects, it should either be left blank or set to match the analysis mode of the project.\n","explode":true,"in":"query","name":"mode","required":false,"schema":{"enum":["full","sparse","upload"],"type":"string"},"style":"form"},{"description":"Required when `mode=upload`, specify the identifier of the commit used to generate the database.","explode":true,"in":"query","name":"commit","required":false,"schema":{"type":"string"},"style":"form"},{"description":"Optional when `mode=upload`, specify the date and time of the commit used to generate the database; defaults to the current time.","explode":true,"in":"query","name":"date","required":false,"schema":{"format":"date-time","type":"string"},"style":"form"},{"description":"Optional, any [labels](https://lgtm.com/admin/help/defining-worker-labels) required by workers to analyze this project. \nTo specify more than one label, repeat the query parameter.\n","explode":true,"in":"query","name":"worker-label","required":false,"schema":{"items":{"type":"string"},"type":"array"},"style":"form"}],"requestBody":{"content":{"application/x-yaml":{"examples":{"lgtm_yml":{"description":"An optional [lgtm.yml project configuration](https://lgtm.com/help/lgtm/lgtm.yml-configuration-file) file to customize the LGTM code analysis and results display for the project.\n","value":{"extraction":{"java":{"index":{"build_command":"./build.sh"}}}}}},"schema":{"type":"string"}}},"description":"An optional [lgtm.yml project configuration](https://lgtm.com/help/lgtm/lgtm.yml-configuration-file) file to customize the LGTM code analysis and results display for the project.","required":false},"responses":{"202":{"content":{"application/json":{"examples":{"externalOperationExample":{"$ref":"#/components/examples/externalOperationExample"}},"schema":{"$ref":"#/components/schemas/operation"}}},"description":"Accepted. Analysis attempts triggered or upload URLs returned."}},"security":[{"access-token":[]}],"summary":"Add a project to LGTM","tags":["Projects"],"x-auth-mode":"BINARY"}},"/projects/{project-id}":{"delete":{"description":"Delete a project with a particular numeric project identifier.\nIn addition to access to the project, administrative access to LGTM or the LGTM Enterprise instance is required to delete projects.\n","operationId":"deleteProject","parameters":[{"description":"The numeric project identifier","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","minimum":1,"type":"integer"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/project-details"}}},"description":"Success. Details of the deleted project returned."}},"security":[{"access-token":[]}],"summary":"Delete project by numeric identifier","tags":["Projects"],"x-auth-mode":"BINARY"},"get":{"description":"Get the latest summary for a specific project using the numeric project identifier.\n\nTo find the LGTM identifier for a project, list all projects using the `/projects` endpoint and look up the project by name. Alternatively, use the `/projects/{provider}/{org}/{name}` endpoint. If you have administration access, the project identifier is also displayed in the administration page for the project.\n","operationId":"getProject","parameters":[{"description":"The numeric project identifier","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","minimum":1,"type":"integer"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/project-details"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Get project by numeric identifier","tags":["Projects"],"x-auth-mode":"BINARY"}},"/projects/{project-id}/settings/analysis-configuration":{"get":{"description":"Get the latest configuration for a specific project using the numeric project identifier.","operationId":"getProjectConfig","parameters":[{"description":"The numeric project identifier","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"},{"description":"The type of project configuration to retrieve.\nIf this parameter isn't specified, the request retrieves the effective configuration. That is, the configuration that is actually applied to the project, which may be from:\n* the repository\n* the administrator-set, project configuration\n* the global configuration.\n\nIf you do specify this value, it must be one of:\n\n * `repository` to retrieve the configuration specified by a YAML file in the repository. A 404 status is returned if there is no repository configuration. \n\n * `administrator` to retrieve the administrator-set, project configuration. A 404 status is returned if there is no administrator configuration.\n","explode":true,"in":"query","name":"source","required":false,"schema":{"enum":["repository","administrator"],"type":"string"},"style":"form"}],"responses":{"200":{"content":{"application/x-yaml":{"schema":{"type":"object"}}},"description":"Success. Requested data returned."},"400":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Only YAML is supported."}},"security":[{"access-token":[]}],"summary":"Get configuration for a project identified by numeric identifier","tags":["Projects"],"x-auth-mode":"BINARY"},"put":{"description":"Set the administrator configuration for a specific project using the numeric project identifier.","operationId":"setProjectConfig","parameters":[{"description":"The numeric project identifier","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"}],"requestBody":{"content":{"application/x-yaml":{"examples":{"snapshotPart":{"$ref":"#/components/examples/projectConfiguration"}},"schema":{"type":"string"}}},"description":"The project configuration to set. Note that this only sets the administrator project configuration. It can be overridden by the repository configuration.\nIn addition to access to the project, administrative access to LGTM or the LGTM Enterprise instance is required to set administrator project configurations.\n","required":true},"responses":{"200":{"content":{"application/x-yaml":{"schema":{"type":"object"}}},"description":"Success. The new effective project configuration is returned."}},"security":[{"access-token":[]}],"summary":"Set the administrator configuration for a project identified by numeric identifier","tags":["Projects"],"x-auth-mode":"BINARY"}},"/projects/{provider}/{org}/{name}":{"get":{"description":"Get the latest summary for a specific project using the project's URL identifier `{provider}/{org}/{name}`.\n\nTo find the URL identifier for a project, view the project overview page in LGTM. The URL identifier follows after `/projects`. For example, for a project with the URL `https://lgtm.example.com/projects/g/apache/commons-io` the URL identifier is `g/apache/commons-io`. In the example, `g` represents the `provider` (repository host), `apache` is the `organization` and `commons-io` is the `name` of the repository.\n","operationId":"getProjectByUrlIdentifier","parameters":[{"description":"The first part of the URL identifier of a project, which represents the repository host.","explode":false,"in":"path","name":"provider","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"The second part of the URL identifier of a project, the organization.","explode":false,"in":"path","name":"org","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"The third part of the URL identifier of a project, the repository name.","explode":false,"in":"path","name":"name","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/project-details"}}},"description":"Success. Requested data returned."},"307":{"description":"Redirect. The project has been renamed. Request redirected to numeric identifier for the project.\n"}},"security":[{"access-token":[]}],"summary":"Get project by URL identifier","tags":["Projects"],"x-auth-mode":"BINARY"}},"/queryjobs":{"post":{"description":"Submit a query to run on one or more projects on LGTM. The query is included in the body of the request.\n","operationId":"createQueryJob","parameters":[{"description":"The [language](https://lgtm.com/help/lgtm/analysis-faqs#which-languages-are-supported) you want to analyze.\n","explode":true,"in":"query","name":"language","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The identifier of the project to analyze. Either `project-id` or `projects-list` must be specified.","explode":true,"in":"query","name":"project-id","required":false,"schema":{"items":{"format":"int64","type":"integer"},"maxItems":200,"minItems":0,"type":"array"},"style":"form"},{"description":"Name of the list containing the projects to analyze. Either `project-id` or `projects-list` must be specified.","explode":true,"in":"query","name":"projects-list","required":false,"schema":{"type":"string"},"style":"form"}],"requestBody":{"content":{"text/plain":{"examples":{"HelloWorld":{"description":"A CodeQL query","value":"select \"hello\", \"world\""}},"schema":{"description":"The CodeQL query text","type":"string"}}},"description":"The query to run.","required":true},"responses":{"202":{"content":{"application/json":{"examples":{"runqueryExample":{"$ref":"#/components/examples/queryjobsRequestExample"}},"schema":{"$ref":"#/components/schemas/operation"}}},"description":"Accepted. Query submitted. Tracking data returned."}},"security":[{"access-token":[]}],"summary":"Run a CodeQL query on one or more projects","tags":["Query jobs"],"x-auth-mode":"BINARY"}},"/queryjobs/{queryjob-id}":{"get":{"description":"Get the status of a query job using the query job identifier for the task.\n\nWhen you create a query job, the response includes a task result URL of the form: `/queryjobs/{queryjob-id}`.\n","operationId":"getQueryJob","parameters":[{"description":"The identifier of the query job, from the `task-result` given in the response to the initial `POST /queryjobs` request.","explode":false,"in":"path","name":"queryjob-id","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"examples":{"getqueryjobExample":{"$ref":"#/components/examples/queryjobsResponseExample"}},"schema":{"$ref":"#/components/schemas/queryjob"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Get the status of a query job","tags":["Query jobs"],"x-auth-mode":"BINARY"}},"/queryjobs/{queryjob-id}/results":{"get":{"description":"This endpoint provides a summary of the results generated by completed query runs for each project specified in the the POST /queryjobs endpoint. For completed query jobs, the summary includes:\n\n * The number of results for successful query runs.\n * Error information for failed query runs.\n\nNo information is included in the response for any project for which the query run is still in progress.\n","operationId":"getQueryJobResultsOverview","parameters":[{"description":"The identifier of the query job, from the `task-result` given in the response to the initial `POST /queryjobs` request.","explode":false,"in":"path","name":"queryjob-id","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"An opaque identifier generated by the API used for pagination. \nThis identifier will be included as part of the response for this endpoint whenever more than one page of results is available. \n","explode":true,"in":"query","name":"start","required":false,"schema":{"type":"string"},"style":"form"},{"description":"The number of results to return. Useful for pagination.","explode":true,"in":"query","name":"limit","required":false,"schema":{"default":100,"format":"int32","type":"integer"},"style":"form"},{"description":"Only return a subset of results. Legal values are `w-results`, `wo-results`, `error`.","explode":true,"in":"query","name":"filter","required":false,"schema":{"type":"string"},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/queryjob-results-overview"}}},"description":"Success. Requested data returned."}},"security":[{"access-token":[]}],"summary":"Provide a summary of results for the projects in the query job","tags":["Query jobs"],"x-auth-mode":"FILTERING"}},"/queryjobs/{queryjob-id}/results/{project-id}":{"get":{"description":"Fetch the results for a specific project. The endpoint succeeds only if the query was successful, and returns a `404` error otherwise. By default, the endpoint provides only results that are within the source tree. To obtain all results, specify the `nofilter` parameter.\n","operationId":"getQueryJobResultsForProject","parameters":[{"description":"The identifier of the query job, from the `task-result` given in the response to the initial `POST /queryjobs` request.","explode":false,"in":"path","name":"queryjob-id","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"The identifier for the project.","explode":false,"in":"path","name":"project-id","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"Start point for the page of results.","explode":true,"in":"query","name":"start","required":false,"schema":{"format":"int32","type":"integer"},"style":"form"},{"description":"The maximum number of results to display (less than 100).","explode":true,"in":"query","name":"limit","required":false,"schema":{"default":100,"format":"int32","type":"integer"},"style":"form"},{"description":"Include results that are not part of the source tree. These results are filtered out by default.","explode":true,"in":"query","name":"nofilter","required":false,"schema":{"default":false,"type":"boolean"},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/queryjob-project-results"}}},"description":"Success. The result contains three items: column headers, data, and pagination information."}},"security":[{"access-token":[]}],"summary":"Fetch the results of a query job for a specific project","tags":["Query jobs"],"x-auth-mode":"BINARY"}},"/snapshots/uploads/{session-id}":{"delete":{"description":"Aborts the specified upload session and deletes any uploaded parts. After the session is aborted it cannot be restarted.\nIf any part uploads are in progress when the session is aborted, their data may not be deleted. To ensure that uploaded parts are deleted correctly, you should only abort an upload session after all part uploads have completed.\n","operationId":"abortUpload","parameters":[{"description":"The id of the upload session.","explode":false,"in":"path","name":"session-id","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"202":{"content":{"application/json":{"examples":{"abortUploadoperation":{"description":"A summary of the aborted upload session. Aborted sessions have an analysis status of `failure` in the API response and in LGTM.","summary":"An aborted upload session.","value":{"commit-id":"04d7a2300feec9bbcc48185e370e3b5d3ae4da9d","id":"ec741d71eeb55250ddca33800f0ee06e77ccfd7f","languages":[{"language":"java","status":"failure"}],"log-url":"https://lgtm.example.com/projects/g/apache/commons-io/logs/analysis/ec741d71eeb55250ddca33800f0ee06e77ccfd7f","project":{"id":1548859144386,"name":"apache/commons-io","url":"https://lgtm.example.com/projects/g/apache/commons-io","url-identifier":"g/apache/commons-io"},"results-url":"https://lgtm.example.com/projects/g/apache/commons-io/analysis/ec741d71eeb55250ddca33800f0ee06e77ccfd7f/files"}}},"schema":{"$ref":"#/components/schemas/operation"}}},"description":"Aborted."}},"security":[{"access-token":[]}],"summary":"Abort database upload process","tags":["Snapshots"],"x-auth-mode":"BINARY"},"post":{"description":"Completes the database upload by closing the upload session, upgrading the database if appropriate, and scheduling analysis of that snapshot of the codebase.\n\nYou can view the analysis progress and access the results using the `task-result-url`.\n","operationId":"completeUpload","parameters":[{"description":"The id of the upload session.","explode":false,"in":"path","name":"session-id","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"202":{"content":{"application/json":{"examples":{"analysisRequestExample":{"$ref":"#/components/examples/analysisRequestExample"}},"schema":{"$ref":"#/components/schemas/operation"}}},"description":"Accepted. Analysis triggered. Tracking data returned."}},"security":[{"access-token":[]}],"summary":"Complete snapshot upload session","tags":["Snapshots"],"x-auth-mode":"BINARY"},"put":{"description":"Upload a database representing a snapshot of a codebase. The database is sent in one or more parts. Each part is sent in the request body. \nUse the [`POST /snapshots/{project-id}/{language}`](https://lgtm.com/help/lgtm/api/api-v1#opIdinitSnapshotUpload) endpoint to start an upload session before uploading a database part. Database parts must have been generated and prepared for upload using the CodeQL CLI or the QL command-line tools. For further information on exporting externally-built databases, see [Preparing snapshots to upload to LGTM](https://help.semmle.com/wiki/display/SD/Preparing+snapshots+to+upload+to+LGTM).\n\nSplit large databases into multiple parts. Upload the parts by making a separate request for each part. Don't upload the next part until you've successfully uploaded the previous part.\n\nIf the upload fails you should retry it with the same data.\n","operationId":"uploadPart","parameters":[{"description":"The id of the upload session.","explode":false,"in":"path","name":"session-id","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/octet-stream":{"examples":{"snapshotPart":{"$ref":"#/components/examples/snapshotPart"}},"schema":{"format":"binary","type":"string"}},"application/zip":{"examples":{"snapshotPart":{"$ref":"#/components/examples/snapshotPart"}},"schema":{"format":"binary","type":"string"}}},"description":"The database or database part to upload.","required":true},"responses":{"204":{"description":"Success."}},"security":[{"access-token":[]}],"summary":"Upload snapshot","tags":["Snapshots"],"x-auth-mode":"BINARY"}},"/snapshots/{project-id}/{language}":{"get":{"description":"Download a CodeQL database from LGTM, representing a snapshot of the codebase, to run queries in your IDE.\n\nThis endpoint works for projects that have been successfully analyzed for the language specified in the request. A successful request redirects you to a URL for downloading a database that represents the code snapshot, as specified in the `Location:` header in the response. Therefore, your HTTP client should be configured to follow redirects. For example, if you are using `curl`, you can add the`-L` flag to the command.\n\nThe database is downloaded as a zip file that can be imported into an IDE equipped with a CodeQL extension. The extension must be up to date to analyze databases downloaded from LGTM. For more information on running queries locally in your IDE, see [Runnning queries in your IDE](https://lgtm.com/help/lgtm/running-queries-ide). \n","operationId":"getSnapshot","parameters":[{"description":"The numeric project identifier.","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"},{"description":"The language of the database to download.","explode":false,"in":"path","name":"language","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"303":{"description":"Redirects to a URL for downloading the CodeQL database as indicated by the `Location:` header.","headers":{"Location":{"explode":false,"schema":{"format":"uri","type":"string"},"style":"simple"}}}},"security":[{"access-token":[]}],"summary":"Download a snapshot","tags":["Snapshots"],"x-auth-mode":"BINARY"},"post":{"description":"Start a session to upload an externally-built database (which represents a snapshot of a codebase) to a project on LGTM. \n\nThis endpoint works for projects that are already on LGTM, and the selected language of the database must already be configured. The project must be configured with 'upload' analysis mode. You can upload a \"bundled\" CodeQL database or a database exported by the QL command-line tools (`odasa`).\n\nIf your database was generated using a version of the command line that is older than LGTM, LGTM will try to upgrade and analyze it when the upload is complete. You can include cached predicates in the upload, but they are ignored as the cache is repopulated after the database has been upgraded and analyzed. However, if you want to include results with your database, make sure the database is compatible before you start the upload session. Incompatible databases with results won't be upgraded and therefore cannot be uploaded. For further information on externally-built databases, see [Preparing snapshots to upload to LGTM using the QL command-line tools](https://help.semmle.com/wiki/display/SD/Preparing+snapshots+to+upload+to+LGTM).\n\n \nWhen the upload session has been successfully started, upload the database to the upload URL returned in the response. The database can be uploaded to the upload URL in parts using the [`PUT /snapshots/uploads/{session-id}`](https://lgtm.com/help/lgtm/api/api-v1#opIduploadPart) endpoint. After uploading all the parts you must call the [`POST /snapshots/uploads/{session-id}`](https://lgtm.com/help/lgtm/api/api-v1#opIdcompleteUpload) endpoint to complete the upload session.\n","operationId":"initSnapshotUpload","parameters":[{"description":"The numeric project identifier.","explode":false,"in":"path","name":"project-id","required":true,"schema":{"format":"int64","type":"integer"},"style":"simple"},{"description":"The language of the database to upload.","explode":false,"in":"path","name":"language","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"The identifier of the analyzed commit.","explode":true,"in":"query","name":"commit","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The date and time of the analyzed commit (default the current time).","explode":true,"in":"query","name":"date","required":false,"schema":{"format":"date-time","type":"string"},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/upload-session"}}},"description":"Success."}},"security":[{"access-token":[]}],"summary":"Start snapshot upload session","tags":["Snapshots"],"x-auth-mode":"BINARY"}},"/system/health":{"get":{"description":"Return an indication of whether the application is working as expected (up) or needs attention (down). \n\\> The `description` and `details` fields are reported only if the request includes an access token for a user account that has administration rights for this LGTM server.\n","operationId":"getHealth","responses":{"200":{"content":{"application/json":{