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 | |
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')
-rw-r--r-- | doc/api/project_statistics.md | 49 | ||||
-rw-r--r-- | doc/user/permissions.md | 1 | ||||
-rw-r--r-- | doc/user/project/index.md | 26 |
3 files changed, 73 insertions, 3 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" + } + ] + } +} +``` diff --git a/doc/user/permissions.md b/doc/user/permissions.md index dff77acd71b..ea3e9d0cce9 100644 --- a/doc/user/permissions.md +++ b/doc/user/permissions.md @@ -110,6 +110,7 @@ The following table depicts the various user permission levels in a project. | Force push to protected branches [^4] | | | | | | | Remove protected branches [^4] | | | | | | | View project Audit Events | | | | ✓ | ✓ | +| View project statistics | | | | ✓ | ✓ | ## Project features permissions diff --git a/doc/user/project/index.md b/doc/user/project/index.md index c62de41c539..0dc50d28cb0 100644 --- a/doc/user/project/index.md +++ b/doc/user/project/index.md @@ -8,7 +8,7 @@ Your projects can be [available](../../public_access/public_access.md) publicly, internally, or privately, at your choice. GitLab does not limit the number of private projects you create. -## Project's features +## Project features When you create a project in GitLab, you'll have access to a large number of [features](https://about.gitlab.com/features/): @@ -82,7 +82,7 @@ When you create a project in GitLab, you'll have access to a large number of the source, build output, and other metadata or artifacts associated with a released version of your code. -### Project's integrations +### Project integrations [Integrate your project](integrations/index.md) with Jira, Mattermost, Kubernetes, Slack, and a lot more. @@ -116,7 +116,7 @@ Read through the documentation on [project settings](settings/index.md). - [Export a project from GitLab](settings/import_export.md#exporting-a-project-and-its-data) - [Importing and exporting projects between GitLab instances](settings/import_export.md) -## Project's members +## Project members Learn how to [add members to your projects](members/index.md). @@ -170,3 +170,23 @@ password <personal_access_token> To quickly access a project from the GitLab UI using the project ID, visit the `/projects/:id` URL in your browser or other tool accessing the project. + +## Project APIs + +There are numerous [APIs](../../api/README.md) to use with your projects: + +- [Badges](../../api/project_badges.md) +- [Clusters](../../api/project_clusters.md) +- [Discussions](../../api/discussions.md) +- [General](../../api/projects.md) +- [Import/export](../../api/project_import_export.md) +- [Issue Board](../../api/boards.md) +- [Labels](../../api/labels.md) +- [Markdown](../../api/markdown.md) +- [Merge Requests](../../api/merge_requests.md) +- [Milestones](../../api/milestones.md) +- [Services](../../api/services.md) +- [Snippets](../../api/project_snippets.md) +- [Templates](../../api/project_templates.md) +- [Traffic](../../api/project_statistics.md) +- [Variables](../../api/project_level_variables.md) |