From 550ac52b143b7d4b77203b81c1b92997c4c63e34 Mon Sep 17 00:00:00 2001 From: Patrick Bajao Date: Thu, 13 Jun 2019 20:04:36 -0800 Subject: Add documentation for feature and API --- doc/api/project_aliases.md | 101 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 doc/api/project_aliases.md (limited to 'doc/api') diff --git a/doc/api/project_aliases.md b/doc/api/project_aliases.md new file mode 100644 index 00000000000..4456388c74f --- /dev/null +++ b/doc/api/project_aliases.md @@ -0,0 +1,101 @@ +# Project Aliases API + +All methods require administrator authorization. + +## List all project aliases + +Get a list of all project aliases + +``` +GET /project_aliases +``` + +``` +curl --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/project_aliases" +``` + +Example response: + +```json +[ + { + "id": 1, + "project_id": 1, + "name": "gitlab-ce" + }, + { + "id": 2, + "project_id": 2, + "name": "gitlab-ee" + } +] +``` + +## Get project alias' details + +Get details of a project alias + +``` +GET /project_aliases/:name +``` + +| Attribute | Type | Required | Description | +|-----------|--------|----------|-----------------------| +| `name` | string | yes | The name of the alias | + +``` +curl --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/project_aliases/gitlab-ee" +``` + +Example response: + +```json +{ + "id": 1, + "project_id": 1, + "name": "gitlab-ee" +} +``` + +## Create an alias for a project + +Add a new alias for a project. Reponds with a 201 when successful, 400 when there are validation errors (e.g. alias already exists). + +``` +POST /project_aliases +``` + +| Attribute | Type | Required | Description | +|--------------|--------|----------|-----------------------------------------------| +| `project_id` | string | yes | The The ID or URL-encoded path of the project | +| `name` | string | yes | The name of the alias. Must be unique. | + +``` +curl --request POST "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=gitlab-org%2Fgitlab-ee" --form "name=gitlab-ee" +``` + +Example response: + +```json +{ + "id": 1, + "project_id": 1, + "name": "gitlab-ee" +} +``` + +## Delete a project aliase + +Removes a project aliases. Respond with a 204 when project alias exists, 404 when it doesn't. + +``` +DELETE /project_aliases/:name +``` + +| Attribute | Type | Required | Description | +|-----------|--------|----------|-----------------------| +| `name` | string | yes | The name of the alias | + +``` +curl --request DELETE --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/project_aliases/gitlab-ee" +``` -- cgit v1.2.1 From 6aa0b173e240f7f27c2cc6d1d4c87b7688940283 Mon Sep 17 00:00:00 2001 From: Patrick Bajao Date: Mon, 17 Jun 2019 11:56:59 +0800 Subject: Update related documentation Update the newly added documentation to be more precise and fix the typos. Add information about Project aliases into permissions doc. --- doc/api/project_aliases.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'doc/api') diff --git a/doc/api/project_aliases.md b/doc/api/project_aliases.md index 4456388c74f..20e4e844654 100644 --- a/doc/api/project_aliases.md +++ b/doc/api/project_aliases.md @@ -1,10 +1,12 @@ -# Project Aliases API +# Project Aliases API **[PREMIUM ONLY]** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/3264) in GitLab 12.1. All methods require administrator authorization. ## List all project aliases -Get a list of all project aliases +Get a list of all project aliases: ``` GET /project_aliases @@ -33,7 +35,7 @@ Example response: ## Get project alias' details -Get details of a project alias +Get details of a project alias: ``` GET /project_aliases/:name @@ -57,9 +59,10 @@ Example response: } ``` -## Create an alias for a project +## Create a project alias -Add a new alias for a project. Reponds with a 201 when successful, 400 when there are validation errors (e.g. alias already exists). +Add a new alias for a project. Responds with a 201 when successful, +400 when there are validation errors (e.g. alias already exists): ``` POST /project_aliases @@ -67,7 +70,7 @@ POST /project_aliases | Attribute | Type | Required | Description | |--------------|--------|----------|-----------------------------------------------| -| `project_id` | string | yes | The The ID or URL-encoded path of the project | +| `project_id` | string | yes | The ID or URL-encoded path of the project. | | `name` | string | yes | The name of the alias. Must be unique. | ``` @@ -84,9 +87,10 @@ Example response: } ``` -## Delete a project aliase +## Delete a project alias -Removes a project aliases. Respond with a 204 when project alias exists, 404 when it doesn't. +Removes a project aliases. Responds with a 204 when project alias +exists, 404 when it doesn't: ``` DELETE /project_aliases/:name -- cgit v1.2.1 From 0dc667149be84b18554342559d2612a8f3c23bb5 Mon Sep 17 00:00:00 2001 From: Patrick Bajao Date: Tue, 18 Jun 2019 19:52:36 +0800 Subject: Specify feature was added in GitLab Premium --- doc/api/project_aliases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/api') diff --git a/doc/api/project_aliases.md b/doc/api/project_aliases.md index 20e4e844654..65845579409 100644 --- a/doc/api/project_aliases.md +++ b/doc/api/project_aliases.md @@ -1,6 +1,6 @@ # Project Aliases API **[PREMIUM ONLY]** -> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/3264) in GitLab 12.1. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/3264) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.1. All methods require administrator authorization. -- cgit v1.2.1