Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Amirault <ravlen@gmail.com>2019-06-12 06:33:22 +0300
committerMarcel Amirault <ravlen@gmail.com>2019-06-12 09:25:07 +0300
commit7b8ba5014597d9e527b285cf88d559b3da120745 (patch)
tree2b342b2d10081701cd3846c6e656b0a42c3b3a4f
parent4bbc8d076a63cd02e1a5673646cc93ab0e310b59 (diff)
Merge projects api doc from ee to ce
-rw-r--r--doc/api/projects.md211
1 files changed, 185 insertions, 26 deletions
diff --git a/doc/api/projects.md b/doc/api/projects.md
index 75669d85803..189e7eadf32 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -14,7 +14,7 @@ Values for the project visibility level are:
The project can be cloned by any logged in user.
- `public`:
- The project can be cloned without any authentication.
+ The project can be accessed without any authentication.
## Project merge method
@@ -41,23 +41,23 @@ GET /projects
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
-| `archived` | boolean | no | Limit by archived status |
-| `visibility` | string | no | Limit by visibility `public`, `internal`, or `private` |
-| `order_by` | string | no | Return projects ordered by `id`, `name`, `path`, `created_at`, `updated_at`, or `last_activity_at` fields. Default is `created_at` |
-| `sort` | string | no | Return projects sorted in `asc` or `desc` order. Default is `desc` |
-| `search` | string | no | Return list of projects matching the search criteria |
-| `simple` | boolean | no | Return only limited fields for each project. This is a no-op without authentication as then _only_ simple fields are returned. |
-| `owned` | boolean | no | Limit by projects explicitly owned by the current user |
-| `membership` | boolean | no | Limit by projects that the current user is a member of |
-| `starred` | boolean | no | Limit by projects starred by the current user |
-| `statistics` | boolean | no | Include project statistics |
-| `with_custom_attributes` | boolean | no | Include [custom attributes](custom_attributes.md) in response (admins only) |
-| `with_issues_enabled` | boolean | no | Limit by enabled issues feature |
+| `archived` | boolean | no | Limit by archived status |
+| `visibility` | string | no | Limit by visibility `public`, `internal`, or `private` |
+| `order_by` | string | no | Return projects ordered by `id`, `name`, `path`, `created_at`, `updated_at`, or `last_activity_at` fields. Default is `created_at` |
+| `sort` | string | no | Return projects sorted in `asc` or `desc` order. Default is `desc` |
+| `search` | string | no | Return list of projects matching the search criteria |
+| `simple` | boolean | no | Return only limited fields for each project. This is a no-op without authentication as then _only_ simple fields are returned. |
+| `owned` | boolean | no | Limit by projects explicitly owned by the current user |
+| `membership` | boolean | no | Limit by projects that the current user is a member of |
+| `starred` | boolean | no | Limit by projects starred by the current user |
+| `statistics` | boolean | no | Include project statistics |
+| `with_custom_attributes` | boolean | no | Include [custom attributes](custom_attributes.md) in response (admins only) |
+| `with_issues_enabled` | boolean | no | Limit by enabled issues feature |
| `with_merge_requests_enabled` | boolean | no | Limit by enabled merge requests feature |
-| `with_programming_language` | string | no | Limit by projects which use the given programming language |
-| `wiki_checksum_failed` | boolean | no | Limit projects where the wiki checksum calculation has failed _([Introduced][ee-6137] in [GitLab Premium][eep] 11.2)_ |
-| `repository_checksum_failed` | boolean | no | Limit projects where the repository checksum calculation has failed _([Introduced][ee-6137] in [GitLab Premium][eep] 11.2)_ |
-| `min_access_level` | integer | no | Limit by current user minimal [access level](members.md) |
+| `with_programming_language` | string | no | Limit by projects which use the given programming language |
+| `wiki_checksum_failed` | boolean | no | **[PREMIUM]** Limit projects where the wiki checksum calculation has failed *([Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6137) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.2)* |
+| `repository_checksum_failed` | boolean | no | **[PREMIUM]** Limit projects where the repository checksum calculation has failed *([Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6137) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.2)* |
+| `min_access_level` | integer | no | Limit by current user minimal [access level](members.md) |
When `simple=true` or the user is unauthenticated this returns something like:
@@ -155,7 +155,8 @@ When the user is authenticated and `simple` is not set this returns something li
"repository_size": 1038090,
"wiki_size" : 0,
"lfs_objects_size": 0,
- "job_artifacts_size": 0
+ "job_artifacts_size": 0,
+ "packages_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
@@ -237,7 +238,8 @@ When the user is authenticated and `simple` is not set this returns something li
"repository_size": 2066080,
"wiki_size" : 0,
"lfs_objects_size": 0,
- "job_artifacts_size": 0
+ "job_artifacts_size": 0,
+ "packages_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
@@ -252,6 +254,13 @@ When the user is authenticated and `simple` is not set this returns something li
]
```
+Users on GitLab [Starter, Bronze, or higher](https://about.gitlab.com/pricing/) will also see
+the `approvals_before_merge` parameter:
+
+```json
+ "approvals_before_merge": 0,
+```
+
You can filter by [custom attributes](custom_attributes.md) with:
```
@@ -346,7 +355,8 @@ GET /users/:user_id/projects
"repository_size": 1038090,
"wiki_size" : 0,
"lfs_objects_size": 0,
- "job_artifacts_size": 0
+ "job_artifacts_size": 0,
+ "packages_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
@@ -428,7 +438,8 @@ GET /users/:user_id/projects
"repository_size": 2066080,
"wiki_size" : 0,
"lfs_objects_size": 0,
- "job_artifacts_size": 0
+ "job_artifacts_size": 0,
+ "packages_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
@@ -543,6 +554,7 @@ GET /projects/:id
"group_access_level": 10
}
],
+ "repository_storage": "default",
"only_allow_merge_if_pipeline_succeeds": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"printing_merge_requests_link_enabled": true,
@@ -554,7 +566,8 @@ GET /projects/:id
"repository_size": 1038090,
"wiki_size" : 0,
"lfs_objects_size": 0,
- "job_artifacts_size": 0
+ "job_artifacts_size": 0,
+ "packages_size": 0
},
"_links": {
"self": "http://example.com/api/v4/projects",
@@ -568,6 +581,13 @@ GET /projects/:id
}
```
+Users on GitLab [Starter, Bronze, or higher](https://about.gitlab.com/pricing/) will also see
+the `approvals_before_merge` parameter:
+
+```json
+ "approvals_before_merge": 0,
+```
+
**Note**: The `web_url` and `avatar_url` attributes on `namespace` were [introduced][ce-27427] in GitLab 11.11.
If the project is a fork, and you provide a valid token to authenticate, the
@@ -669,6 +689,7 @@ POST /projects
| `name` | string | yes if path is not provided | The name of the new project. Equals path if not provided. |
| `path` | string | yes if name is not provided | Repository name for new project. Generated based on name if not provided (generated lowercased with dashes). |
| `namespace_id` | integer | no | Namespace for the new project (defaults to the current user's namespace) |
+| `default_branch` | string | no | `master` by default |
| `description` | string | no | Short project description |
| `issues_enabled` | boolean | no | Enable issues for this project |
| `merge_requests_enabled` | boolean | no | Enable merge requests for this project |
@@ -690,8 +711,16 @@ POST /projects
| `avatar` | mixed | no | Image file for avatar of the project |
| `printing_merge_request_link_enabled` | boolean | no | Show link to create/view merge request when pushing from the command line |
| `ci_config_path` | string | no | The path to CI config file |
+| `repository_storage` | string | no | Which storage shard the repository is on. Available only to admins |
+| `approvals_before_merge` | integer | no | **[STARTER]** How many approvers should approve merge requests by default |
+| `mirror` | boolean | no | **[STARTER]** Enables pull mirroring in a project |
+| `mirror_trigger_builds` | boolean | no | **[STARTER]** Pull mirroring triggers builds |
| `initialize_with_readme` | boolean | no | `false` by default |
+>**Note**: If your HTTP repository is not publicly accessible,
+add authentication information to the URL: `https://username:password@gitlab.company.com/group/project.git`
+where `password` is a public access key with the `api` scope enabled.
+
## Create project for user
Creates a new project owned by the specified user. Available only for admins.
@@ -705,7 +734,6 @@ POST /projects/user/:user_id
| `user_id` | integer | yes | The user ID of the project owner |
| `name` | string | yes | The name of the new project |
| `path` | string | no | Custom repository name for new project. By default generated based on name |
-| `default_branch` | string | no | `master` by default |
| `namespace_id` | integer | no | Namespace for the new project (defaults to the current user's namespace) |
| `description` | string | no | Short project description |
| `issues_enabled` | boolean | no | Enable issues for this project |
@@ -728,6 +756,15 @@ POST /projects/user/:user_id
| `avatar` | mixed | no | Image file for avatar of the project |
| `printing_merge_request_link_enabled` | boolean | no | Show link to create/view merge request when pushing from the command line |
| `ci_config_path` | string | no | The path to CI config file |
+| `repository_storage` | string | no | Which storage shard the repository is on. Available only to admins |
+| `approvals_before_merge` | integer | no | **[STARTER]** How many approvers should approve merge requests by default |
+| `external_authorization_classification_label` | string | no | **[CORE ONLY]** The classification label for the project |
+| `mirror` | boolean | no | **[STARTER]** Enables pull mirroring in a project |
+| `mirror_trigger_builds` | boolean | no | **[STARTER]** Pull mirroring triggers builds |
+
+>**Note**: If your HTTP repository is not publicly accessible,
+add authentication information to the URL: `https://username:password@gitlab.company.com/group/project.git`
+where `password` is a public access key with the `api` scope enabled.
## Edit project
@@ -763,6 +800,19 @@ PUT /projects/:id
| `tag_list` | array | no | The list of tags for a project; put array of tags, that should be finally assigned to a project |
| `avatar` | mixed | no | Image file for avatar of the project |
| `ci_config_path` | string | no | The path to CI config file |
+| `repository_storage` | string | no | Which storage shard the repository is on. Available only to admins |
+| `approvals_before_merge` | integer | no | **[STARTER]** How many approvers should approve merge request by default |
+| `external_authorization_classification_label` | string | no | **[CORE ONLY]** The classification label for the project |
+| `mirror` | boolean | no | **[STARTER]** Enables pull mirroring in a project |
+| `mirror_user_id` | integer | no | **[STARTER]** User responsible for all the activity surrounding a pull mirror event |
+| `mirror_trigger_builds` | boolean | no | **[STARTER]** Pull mirroring triggers builds |
+| `only_mirror_protected_branches` | boolean | no | **[STARTER]** Only mirror protected branches |
+| `mirror_overwrites_diverged_branches` | boolean | no | **[STARTER]** Pull mirror overwrites diverged branches |
+| `packages_enabled` | boolean | no | **[PREMIUM ONLY]** Enable or disable packages repository feature |
+
+>**Note**: If your HTTP repository is not publicly accessible,
+add authentication information to the URL: `https://username:password@gitlab.company.com/group/project.git`
+where `password` is a public access key with the `api` scope enabled.
## Fork project
@@ -1540,9 +1590,104 @@ POST /projects/:id/housekeeping
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
+| `id` | integer/string | yes | The ID of the project or NAMESPACE/PROJECT_NAME |
+
+## Push Rules **[STARTER]**
+
+### Get project push rules
+
+Get the push rules of a project.
+
+```
+GET /projects/:id/push_rule
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer/string | yes | The ID of the project or NAMESPACE/PROJECT_NAME |
+
+```json
+{
+ "id": 1,
+ "project_id": 3,
+ "commit_message_regex": "Fixes \d+\..*",
+ "branch_name_regex": "",
+ "deny_delete_tag": false,
+ "created_at": "2012-10-12T17:04:47Z",
+ "member_check": false,
+ "prevent_secrets": false,
+ "author_email_regex": "",
+ "file_name_regex": "",
+ "max_file_size": 5,
+ "commit_committer_check": false
+}
+```
+
+The following attributes are restricted to certain plans, and will not appear if
+you do not have access to those features:
+
+* `commit_committer_check` only available on **[PREMIUM]**
+
+### Add project push rule
+
+Adds a push rule to a specified project.
+
+```
+POST /projects/:id/push_rule
+```
+
+| Attribute | Type | Required | Description |
+| -------------------------------------- | -------------- | -------- | ----------- |
+| `id` | integer/string | yes | The ID of the project or NAMESPACE/PROJECT_NAME |
+| `deny_delete_tag` **[STARTER]** | boolean | no | Deny deleting a tag |
+| `member_check` **[STARTER]** | boolean | no | Restrict commits by author (email) to existing GitLab users |
+| `prevent_secrets` **[STARTER]** | boolean | no | GitLab will reject any files that are likely to contain secrets |
+| `commit_message_regex` **[STARTER]** | string | no | All commit messages must match this, e.g. `Fixed \d+\..*` |
+| `branch_name_regex` **[STARTER]** | string | no | All branch names must match this, e.g. `(feature|hotfix)\/*` |
+| `author_email_regex` **[STARTER]** | string | no | All commit author emails must match this, e.g. `@my-company.com$` |
+| `file_name_regex` **[STARTER]** | string | no | All commited filenames must **not** match this, e.g. `(jar|exe)$` |
+| `max_file_size` **[STARTER]** | integer | no | Maximum file size (MB) |
+| `commit_committer_check` **[PREMIUM]** | boolean | no | Users can only push commits to this repository that were committed with one of their own verified emails. |
+
+### Edit project push rule
+
+Edits a push rule for a specified project.
+
+```
+PUT /projects/:id/push_rule
+```
+
+| Attribute | Type | Required | Description |
+| -------------------------------------- | -------------- | -------- | ----------- |
+| `id` | integer/string | yes | The ID of the project or NAMESPACE/PROJECT_NAME |
+| `deny_delete_tag` **[STARTER]** | boolean | no | Deny deleting a tag |
+| `member_check` **[STARTER]** | boolean | no | Restrict commits by author (email) to existing GitLab users |
+| `prevent_secrets` **[STARTER]** | boolean | no | GitLab will reject any files that are likely to contain secrets |
+| `commit_message_regex` **[STARTER]** | string | no | All commit messages must match this, e.g. `Fixed \d+\..*` |
+| `branch_name_regex` **[STARTER]** | string | no | All branch names must match this, e.g. `(feature|hotfix)\/*` |
+| `author_email_regex` **[STARTER]** | string | no | All commit author emails must match this, e.g. `@my-company.com$` |
+| `file_name_regex` **[STARTER]** | string | no | All commited filenames must **not** match this, e.g. `(jar|exe)$` |
+| `max_file_size` **[STARTER]** | integer | no | Maximum file size (MB) |
+| `commit_committer_check` **[PREMIUM]** | boolean | no | Users can only push commits to this repository that were committed with one of their own verified emails. |
+
+### Delete project push rule
+
+> Introduced in GitLab 9.0.
+
+Removes a push rule from a project. This is an idempotent method and can be called multiple times.
+Either the push rule is available or not.
+
+```
+DELETE /projects/:id/push_rule
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
-### Transfer a project to a new namespace
+## Transfer a project to a new namespace
+
+> Introduced in GitLab 11.1.
```
PUT /projects/:id/transfer
@@ -1564,6 +1709,22 @@ Read more in the [Project import/export](project_import_export.md) documentation
Read more in the [Project members](members.md) documentation.
+## Start the pull mirroring process for a Project **[STARTER]**
+
+> Introduced in [GitLab Starter](https://about.gitlab.com/pricing) 10.3.
+
+```
+POST /projects/:id/mirror/pull
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
+
+```bash
+curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/mirror/pull
+```
+
## Project badges
Read more in the [Project Badges](project_badges.md) documentation.
@@ -1594,6 +1755,4 @@ GET /projects/:id/snapshot
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
| `wiki` | boolean | no | Whether to download the wiki, rather than project, repository |
-[eep]: https://about.gitlab.com/pricing/ "Available only in GitLab Premium"
-[ee-6137]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6137
[ce-27427]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27427