Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 1809 #2

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This is a basic workflow to help you get started with Actions

name: Proxy CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
paths:
- 'src/proxy/**'
pull_request:
branches: [ master, release-* ]
paths:
- 'src/proxy/**'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-proxy-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-proxy-gradle-
- name: Gradle Build
working-directory: src/proxy/
run: |
chmod +x gradlew
./gradlew clean build
4 changes: 3 additions & 1 deletion docs/apidoc/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@
- [分发接口](/apidoc/replication/remote-replication.md)
- [同步执行日志接口](/apidoc/replication/record.md)
- **审计日志**
- [审计日志接口](/apidoc/log/log.md)
- [审计日志接口](/apidoc/log/log.md)
- **Proxy**
- [Proxy接口](/apidoc/proxy/proxy.md)
187 changes: 187 additions & 0 deletions docs/apidoc/proxy/proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
## bkrepo proxy相关接口

### 创建proxy

- API: POST /auth/api/proxy/create
- API 名称: create_proxy
- 功能说明:
- 中文:创建proxy
- English:create proxy

- input body:

```
{
"projectId": "demo",
"clusterName": "center",
"displayName": "xxx",
"domain": "http://xxx",
"syncTimeRange": "0-24",
"syncRateLimit": -1,
"cacheExpireDays": 7
}
```

- input 字段说明

| 字段 | 类型 | 是否必须 | 默认值 | 说明 | Description |
| ---- | ------ | -------- | ------ | -------- | ------------- |
| projectId | string | 是 | 无 | 项目Id | the project id |
| clusterName | string | 是 | 无 | 集群名称 | the cluster name |
| displayName | string | 是 | 无 | proxy展示名 | the display name |
| domain | string | 是 | 无 | proxy访问域名 | the domain |
| syncTimeRange | string | 是 | 0-24 | proxy同步时间范围 | the sync time range |
| syncRateLimit | int | 否 | -1 | proxy同步速率限制,单位字节,-1表示不限制 | the sync rate limit |
| cacheExpireDays | int | 否 | 7 | proxy缓存过期天数 | the cache expire days |


- output:

```
{
"code": 0,
"message": null,
"data": {
"name": "557c8d7574",
"displayName": "xxx",
"projectId": "xxx",
"clusterName": "center",
"domain": "http://xxx",
"ip": "Unknown",
"status": "CREATE",
"syncRateLimit": -1,
"syncTimeRange": "0-24",
"cacheExpireDays": 7
},
"traceId": "4d617888730986188f0ed7564269728d"
}


```

- output 字段说明

| 字段 | 类型 | 说明 | Description |
| ------- | -------------- | --------------------------------------- | ------------------------- |
| code | bool | 错误编码。 0表示success,>0表示失败错误 | 0:success, other: failure |
| message | result message | 错误消息 | the failure message |
| data | object | result data | the data for response |
| traceId | string | 请求跟踪id | the trace id |


### 删除proxy

- API: DELETE /auth/api/proxy/delete/{projectId}/{name}
- API 名称: delete_proxy
- 功能说明:
- 中文:删除proxy
- English:delete proxy

- input body:

``` json

```

- input 字段说明

| 字段 | 类型 | 是否必须 | 默认值 | 说明 | Description |
| ---- | ------ | -------- | ------ | ------ | ----------- |
| projectId | string | 是 | 无 | 项目ID | the project id |
| name | string | 是 | 无 | proxy名 | the proxy name |

- output:

```
{
"code":0,
"data":null,
"message":"",
"traceId":""
}

```

- output 字段说明

| 字段 | 类型 | 说明 | Description |
| ------- | -------------- | --------------------------------------- | ------------------------- |
| code | bool | 错误编码。 0表示success,>0表示失败错误 | 0:success, other: failure |
| message | result message | 错误消息 | the failure message |
| data | object | result data | the data for response |
| traceId | string | 请求跟踪id | the trace id |

### 分页查询Proxy列表

- API: GET /auth/api/proxy/page/{projectId}?name=xxx&displayName=xxx&pageNumber=1&pageSize=20
- API 名称: list_proxy
- 功能说明:
- 中文:分页查询Proxy列表
- English:list proxy


- input 字段说明
| 字段 | 类型 | 是否必须 | 默认值 | 说明 | Description |
| ---- | ------ | -------- | ------ | ------ | ----------- |
| projectId | string | 是 | 无 | 项目ID | the project id |
| name | string | 否 | 无 | proxy名 | the proxy name |
| displayName | string | 否 | 无 | proxy展示名 | the proxy display name |
| pageNumber | int | 是 | 无 | 页数 | the page number |
| pageSize | int | 是 | 无 | 页大小 | the page size |


- output:

```
{
"code": 0,
"message": null,
"data": {
"pageNumber": 1,
"pageSize": 20,
"totalRecords": 1,
"totalPages": 1,
"records": [
{
"name": "0y54vD",
"displayName": "test",
"projectId": "demo",
"clusterName": "test",
"domain": "http://127.0.0.1",
"ip": "127.0.0.1",
"status": "OFFLINE",
"syncRateLimit": 1024,
"syncTimeRange": "0-24",
"cacheExpireDays": 7
}
],
"count": 1,
"page": 1
},
"traceId": "6bfc5132a349072726d688764a8b1d67"
}

```

- output 字段说明

| 字段 | 类型 | 说明 | Description |
| ------- | -------------- | --------------------------------------- | ------------------------- |
| code | bool | 错误编码。 0表示success,>0表示失败错误 | 0:success, other: failure |
| message | result message | 错误消息 | the failure message |
| data | object array | result data | the data for response |
| traceId | string | 请求跟踪id | the trace id |

### 下载proxy
- API: GET /generic/api/proxy/download/{projectId}/{name}
- API 名称: download proxy
- 功能说明:
- 中文:下载proxy
- English:download proxy


- input 字段说明
| 字段 | 类型 | 是否必须 | 默认值 | 说明 | Description |
| ---- | ------ | -------- | ------ | ------ | ----------- |
| projectId | string | 是 | 无 | 项目ID | the project id |
| name | string | 否 | 无 | proxy名 | the proxy name |
101 changes: 101 additions & 0 deletions docs/apidoc/proxy/router.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
## bkrepo router-controller相关接口

### 增加路由策略

- API: POST /router-controller/api/router/admin/policy
- API 名称: add_policy
- 功能说明:
- 中文:增加路由策略
- English:add policy

- input body:

```
{
"users": ["user1", "user2"],
"projectIds": ["project1", "project2"],
"destRouterNodeId": "proxy1"
}
```

- input 字段说明

| 字段 | 类型 | 是否必须 | 默认值 | 说明 | Description |
| ---- | ------ | -------- | ------ | -------- | ------------- |
| users | list | 是 | 无 | 需要路由的用户 | the users |
| projectIds | list | 是 | 无 | 需要路由的项目 | the project id list |
| destRouterNodeId | string | 是 | 无 | proxy名 | the proxy name |


- output:

```
{
"code": 0,
"message": null,
"data": {
"id": "xxxx",
"createdBy": "admin",
"createdDate": "",
"users": ["user1", "user2"],
"projectIds": ["project1", "project2"],
"destRouterNodeId": "proxy1"
},
"traceId": "4d617888730986188f0ed7564269728d"
}


```

- output 字段说明

| 字段 | 类型 | 说明 | Description |
| ------- | -------------- | --------------------------------------- | ------------------------- |
| code | bool | 错误编码。 0表示success,>0表示失败错误 | 0:success, other: failure |
| message | result message | 错误消息 | the failure message |
| data | object | result data | the data for response |
| traceId | string | 请求跟踪id | the trace id |


### 删除路由策略

- API: DELETE /router-controller/api/router/admin/policy
- API 名称: delete_policy
- 功能说明:
- 中文:删除路由策略
- English:delete policy

- input body:

``` json
{
"policyId": "xxx"
}
```

- input 字段说明

| 字段 | 类型 | 是否必须 | 默认值 | 说明 | Description |
| ---- | ------ | -------- | ------ | ------ | ----------- |
| policyId | string | 是 | 无 | 路由策略ID | the policy id |

- output:

```
{
"code":0,
"data":null,
"message":"",
"traceId":""
}

```

- output 字段说明

| 字段 | 类型 | 说明 | Description |
| ------- | -------------- | --------------------------------------- | ------------------------- |
| code | bool | 错误编码。 0表示success,>0表示失败错误 | 0:success, other: failure |
| message | result message | 错误消息 | the failure message |
| data | object | result data | the data for response |
| traceId | string | 请求跟踪id | the trace id |
2 changes: 2 additions & 0 deletions docs/install/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
- [后端部署](/install/binary/backend)
- 容器化部署
- [Helm Charts部署](/install/helm.md)
- proxy部署
- [说明](/install/proxy.md)
- [repo.env配置项](/install/env.md)
- [源码编译](/install/compile.md)
Loading
Loading