diff options
author | Nick Thomas <nick@gitlab.com> | 2019-02-27 12:07:05 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-02-27 12:07:05 +0000 |
commit | a5174cf0fcfd0ae77d25ac5208b7aa371d7d7b73 (patch) | |
tree | 6610d4dbd0b47f666586e7f5e0e87a285a3426c5 /doc/api | |
parent | 61c1509cc992959ac5021d10825d5dbf9dd2c091 (diff) | |
parent | 5ae9a44aa17c8929627cc450f936cd960c143e25 (diff) | |
download | gitlab-ce-a5174cf0fcfd0ae77d25ac5208b7aa371d7d7b73.tar.gz |
Merge branch '42086-project-fetch-statistics-api-http-only' into 'master'57125-heatmap-chart-type
Resolve "Project fetch statistics API (HTTP only)"
Closes #42086
See merge request gitlab-org/gitlab-ce!23596
Diffstat (limited to 'doc/api')
-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" + } + ] + } +} +``` |