diff options
author | Tetiana Chupryna <tchupryna@gitlab.com> | 2019-07-16 13:06:09 +0000 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2019-07-16 13:06:09 +0000 |
commit | 96454b0fb632e3129876456f3f190ada8caf144e (patch) | |
tree | 18fe4f4bbbf3da8b733b02408b23bf1bd26d4ea9 /doc/api/dependencies.md | |
parent | 46fb73a372621918fae77c0d338d9a42a13071fd (diff) | |
download | gitlab-ce-96454b0fb632e3129876456f3f190ada8caf144e.tar.gz |
Docs Dependencies API
Diffstat (limited to 'doc/api/dependencies.md')
-rw-r--r-- | doc/api/dependencies.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/api/dependencies.md b/doc/api/dependencies.md new file mode 100644 index 00000000000..ed5ebdade19 --- /dev/null +++ b/doc/api/dependencies.md @@ -0,0 +1,50 @@ +# Dependencies API **(ULTIMATE)** + +CAUTION: **Caution:** +This API is in an alpha stage and considered unstable. +The response payload may be subject to change or breakage +across GitLab releases. + +Every call to this endpoint requires authentication. To perform this call, user should be authorized to read +[Project Security Dashboard](../user/application_security/security_dashboard/index.md#project-security-dashboard). + +## List project dependencies + +Get a list of project dependencies. This API partially mirroring +[Dependency List](../user/application_security/dependency_scanning/index.md#dependency-list) feature. +This list can be generated only for [languages and package managers](../user/application_security/dependency_scanning/index.md#supported-languages-and-package-managers) +supported by Gemnasium. + +``` +GET /projects/:id/dependencies +GET /projects/:id/vulnerabilities?package_manger=maven +GET /projects/:id/vulnerabilities?package_manger=yarn,bundler +``` + +| Attribute | Type | Required | Description | +| ------------- | -------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `package_manager` | string array | no | Returns dependencies belonging to specified package manager. Valid values: `bundler`, `composer`, `maven`, `npm`, `pip` or `yarn`. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/dependencies +``` + +Example response: + +```json +[ + { + "name": "rails", + "version": "5.0.1", + "package_manager": "bundler", + "dependency_file_path": "Gemfile.lock" + }, + { + "name": "hanami", + "version": "1.3.1", + "package_manager": "bundler", + "dependency_file_path": "Gemfile.lock" + } +] +``` |