Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
550ac52b
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
550ac52b
编写于
6月 13, 2019
作者:
P
Patrick Bajao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add documentation for feature and API
上级
13ab6a38
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
114 addition
and
0 deletion
+114
-0
doc/api/project_aliases.md
doc/api/project_aliases.md
+101
-0
doc/user/project/index.md
doc/user/project/index.md
+13
-0
未找到文件。
doc/api/project_aliases.md
0 → 100644
浏览文件 @
550ac52b
# 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: <your_access_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: <your_access_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: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab-ee"
```
doc/user/project/index.md
浏览文件 @
550ac52b
...
...
@@ -193,6 +193,18 @@ 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 aliases
Projects' repositories are usually cloned with a namespace and project name. It is
also possible to clone them via a project alias. This feature is only available on Git over SSH.
A project alias can be created via API only by administrators. Follow the
[
Project Aliases API documentation
](
../../api/project_aliases.md
)
for more details.
Once an alias has been created for a project (e.g. gitlab-ce for gitlab-org/gitlab-ce),
the repository can be cloned using the alias (e.g
`git clone git@gitlab.com:gitlab-ce.git`
instead of
`git clone git@gitlab.com:gitlab-org/gitlab-ce.git`
).
## Project APIs
There are numerous
[
APIs
](
../../api/README.md
)
to use with your projects:
...
...
@@ -212,3 +224,4 @@ There are numerous [APIs](../../api/README.md) to use with your projects:
-
[
Templates
](
../../api/project_templates.md
)
-
[
Traffic
](
../../api/project_statistics.md
)
-
[
Variables
](
../../api/project_level_variables.md
)
-
[
Aliases
](
../../api/project_aliases.md
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录