Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
272e753
feat: 网关增加心跳上报配置 #3745
owenlxu Nov 13, 2025
92175d7
feat: 网关增加心跳上报配置 #3745
owenlxu Nov 13, 2025
644ea8e
feat: 网关增加心跳上报配置 #3745
owenlxu Nov 13, 2025
8a9e5b9
feat: 网关增加心跳上报配置 #3745
owenlxu Nov 13, 2025
a3e3726
feat: 网关增加心跳上报配置 #3745
owenlxu Nov 13, 2025
fe9e726
feat: 网关增加心跳上报配置 #3745
owenlxu Nov 14, 2025
49e8a2f
feat: 网关增加心跳上报配置 #3745
owenlxu Nov 14, 2025
269703e
Merge branch 'master' of https://github.com/TencentBlueKing/bk-repo i…
owenlxu Nov 17, 2025
78fd10c
feat: 上报网关工作状态到redis #3745
owenlxu Nov 21, 2025
7dccbef
Merge branch 'master' of https://github.com/TencentBlueKing/bk-repo i…
owenlxu Nov 21, 2025
0b07afc
feat: 上报网关工作状态到redis #3745
owenlxu Nov 21, 2025
99d5b69
feat: 上报网关工作状态到redis #3745
owenlxu Nov 24, 2025
e87f862
resolve conflict
owenlxu Nov 25, 2025
74082a2
Merge branch 'master' of https://github.com/TencentBlueKing/bk-repo i…
owenlxu Nov 25, 2025
1761585
Merge branch 'master' of https://github.com/TencentBlueKing/bk-repo i…
owenlxu Nov 27, 2025
6714daf
feat: 提供内部流量拓扑接口 #3745
owenlxu Nov 27, 2025
87b80a7
feat: 提供内部流量拓扑接口 #3745
owenlxu Nov 27, 2025
6b490ac
feat: 提供内部流量拓扑接口 #3745
owenlxu Nov 27, 2025
50471e1
feat: 网关增加心跳上报到redis #3745
owenlxu Nov 27, 2025
a5586e1
feat: 网关增加心跳上报到redis #3745
owenlxu Nov 27, 2025
3c89853
feat: 网关增加心跳上报到redis #3745
owenlxu Nov 27, 2025
4a2673a
feat: 网关增加心跳上报到redis #3745
owenlxu Nov 28, 2025
ae545f7
feat: 网关增加心跳上报到redis #3745
owenlxu Nov 28, 2025
90a79b9
Merge branch 'master' of https://github.com/TencentBlueKing/bk-repo i…
owenlxu Nov 28, 2025
1002279
feat: 网关增加心跳上报到redis #3745
owenlxu Nov 28, 2025
57bd497
feat: 网络拓扑op补充 #3796
lannoy0523 Dec 1, 2025
ee284d9
Merge pull request #42 from owenlxu/issue_3745
lannoy0523 Dec 1, 2025
cb20bb7
Merge branch 'TencentBlueKing:master' into issue_3796
lannoy0523 Jan 29, 2026
33d681e
Merge branch 'master' into issue_3796
lannoy0523 Feb 24, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ class StorageCredentialHelper(
}

fun convert(credentials: TStorageCredentials): StorageCredentials {
return credentials.credentials.readJsonString<StorageCredentials>().apply { this.key = credentials.id }
return credentials.credentials.readJsonString<StorageCredentials>().apply {
key = credentials.id
storageRegion = credentials.region.toString()
}
}

fun buildStorageCredential(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ data class FileSystemCredentials(
override var upload: UploadProperties = UploadProperties(),
override var encrypt: EncryptProperties = EncryptProperties(),
override var compress: CompressProperties = CompressProperties(),
override var storageRegion: String? = null,
) : StorageCredentials(key, cache, upload, encrypt, compress) {

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ data class HDFSCredentials(
override var upload: UploadProperties = UploadProperties(),
override var encrypt: EncryptProperties = EncryptProperties(),
override var compress: CompressProperties = CompressProperties(),
override var storageRegion: String? = null,
) : StorageCredentials(key, cache, upload, encrypt, compress) {
companion object {
const val type = "hdfs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ data class InnerCosCredentials(
override var upload: UploadProperties = UploadProperties(),
override var encrypt: EncryptProperties = EncryptProperties(),
override var compress: CompressProperties = CompressProperties(),
override var storageRegion: String? = null,
) : StorageCredentials(key, cache, upload, encrypt, compress) {

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ open class StorageCredentials(
open var upload: UploadProperties,
open var encrypt: EncryptProperties,
open var compress: CompressProperties,
open var storageRegion: String? = null,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2019 Tencent. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.opdata.pojo

import com.tencent.bkrepo.opdata.pojo.enums.ForwardType
import com.tencent.bkrepo.opdata.pojo.enums.LevelType
import io.swagger.v3.oas.annotations.media.Schema

/**
* 内部流转请求
*/
@Schema(title = "内部流转请求")
data class InternalFlowRequest(
@get:Schema(title = "级别类型", required = true)
val level: LevelType,

@get:Schema(title = "名称", required = true)
val name: String,

@get:Schema(title = "标签", required = true)
val tag: String,

@get:Schema(title = "区域", required = true)
val region: String,

@get:Schema(title = "下一个节点标签")
val next: String? = null,

@get:Schema(title = "流转方向")
val forward: ForwardType? = null,

@get:Schema(title = "流转提示")
val forwardTip: String? = null
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2019 Tencent. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.opdata.pojo


data class NameWithTag(
val name: String,
val tag: String?,
val region: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2022 Tencent. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.opdata.pojo.enums

enum class ForwardType {
Horizontal,
Vertical
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2022 Tencent. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.opdata.pojo.enums

enum class LevelType {
GATEWAY,
SERVICE,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2021 Tencent. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.opdata.pojo.gateway


/**
* Gateway心跳信息
*/
data class GatewayHeartbeatInfo(
val ip: String,
val tag: String,
val lastUpdate: String,
val online: Boolean = true
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2021 Tencent. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.opdata.pojo.gateway


/**
* Gateway心跳上报请求
*/
data class GatewayHeartbeatRequest(
val ip: String,
val tag: String
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2021 Tencent. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.opdata.controller

import com.tencent.bkrepo.common.api.pojo.Response
import com.tencent.bkrepo.common.security.permission.Principal
import com.tencent.bkrepo.common.security.permission.PrincipalType
import com.tencent.bkrepo.common.service.util.ResponseBuilder.success
import com.tencent.bkrepo.opdata.pojo.gateway.GatewayHeartbeatInfo
import com.tencent.bkrepo.opdata.pojo.gateway.GatewayHeartbeatRequest
import com.tencent.bkrepo.opdata.service.GatewayHeartbeatService
import org.apache.pulsar.shade.io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
* Gateway心跳管理接口
*/
@RestController
@RequestMapping("/api/heartbeat")
class GatewayHeartbeatController @Autowired constructor(
private val gatewayHeartbeatService: GatewayHeartbeatService
) {

/**
* 接收Gateway心跳上报
* 此接口不需要权限验证,允许Gateway直接调用
*/
@ApiOperation("接收Gateway心跳上报")
@PostMapping("/gateway")
fun reportHeartbeat(@RequestBody request: GatewayHeartbeatRequest): Response<Void> {
gatewayHeartbeatService.saveHeartbeat(request)
return success()
}

/**
* 获取所有Gateway的tag列表
*/
@ApiOperation("获取所有Gateway的tag列表")
@GetMapping("/gateway/tags")
@Principal(PrincipalType.ADMIN)
fun listAllTags(): Response<List<String>> {
return success(gatewayHeartbeatService.listAllTags())
}

/**
* 根据tag获取Gateway列表(只返回在线的Gateway)
*/
@ApiOperation("根据tag获取Gateway列表")
@GetMapping("/gateway/tag/{tag}")
@Principal(PrincipalType.ADMIN)
fun listGatewaysByTag(
@PathVariable tag: String
): Response<List<GatewayHeartbeatInfo>> {
return success(gatewayHeartbeatService.listGatewaysByTag(tag))
}
}
Loading
Loading