diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-12-13 20:26:56 +0100 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2019-02-27 11:52:35 +0100 |
commit | 5ae9a44aa17c8929627cc450f936cd960c143e25 (patch) | |
tree | 6a14d388f5687979a683d443868b4297ebc6838c /doc/api/project_statistics.md | |
parent | 6fa88ed77e1693cda845efe49bf2c9a77aed2e4f (diff) | |
download | gitlab-ce-5ae9a44aa17c8929627cc450f936cd960c143e25.tar.gz |
Add project http fetch statistics API
The API get projects/:id/traffic/fetches allows user with write
access to the repository to get the number of clones for the
last 30 days.
Diffstat (limited to 'doc/api/project_statistics.md')
-rw-r--r-- | doc/api/project_statistics.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/api/project_statistics.md b/doc/api/project_statistics.md new file mode 100644 index 00000000000..34d73abfcbf --- /dev/null +++ b/doc/api/project_statistics.md @@ -0,0 +1,49 @@ +# Project statistics API + +Every API call to [project](../user/project/index.md) statistics must be authenticated. + +## Get the statistics of the last 30 days + +Retrieving the statistics requires write access to the repository. +Currently only HTTP fetches statistics are returned. +Fetches statistics includes both clones and pulls count and are HTTP only, SSH fetches are not included. + +``` +GET /projects/:id/statistics +``` + +| Attribute | Type | Required | Description | +| ---------- | ------ | -------- | ----------- | +| `id ` | integer / string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | + +Example response: + +```json +{ + "fetches": { + "total": 50, + "days": [ + { + "count": 10, + "date": "2018-01-10" + }, + { + "count": 10, + "date": "2018-01-09" + }, + { + "count": 10, + "date": "2018-01-08" + }, + { + "count": 10, + "date": "2018-01-07" + }, + { + "count": 10, + "date": "2018-01-06" + } + ] + } +} +``` |