Skip to content

Commit 212c64d

Browse files
authored
feat: add proxy port support across all host models (#4283)
Signed-off-by: chlins <chlins.zhang@gmail.com>
1 parent fb93f29 commit 212c64d

33 files changed

+584
-411
lines changed

api/manager/docs.go

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4430,6 +4430,9 @@ const docTemplate = `{
44304430
"port": {
44314431
"type": "integer"
44324432
},
4433+
"proxy_port": {
4434+
"type": "integer"
4435+
},
44334436
"scheduler_cluster": {
44344437
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_models.SchedulerCluster"
44354438
},
@@ -4494,6 +4497,9 @@ const docTemplate = `{
44944497
"d7y_io_dragonfly_v2_manager_models.Scheduler": {
44954498
"type": "object",
44964499
"properties": {
4500+
"config": {
4501+
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_models.JSONMap"
4502+
},
44974503
"created_at": {
44984504
"type": "string"
44994505
},
@@ -4518,6 +4524,9 @@ const docTemplate = `{
45184524
"is_del": {
45194525
"type": "integer"
45204526
},
4527+
"last_keep_alive_at": {
4528+
"type": "string"
4529+
},
45214530
"location": {
45224531
"type": "string"
45234532
},
@@ -4980,6 +4989,7 @@ const docTemplate = `{
49804989
"host_name",
49814990
"ip",
49824991
"port",
4992+
"proxy_port",
49834993
"scheduler_cluster_id",
49844994
"type"
49854995
],
@@ -5029,6 +5039,9 @@ const docTemplate = `{
50295039
"port": {
50305040
"type": "integer"
50315041
},
5042+
"proxy_port": {
5043+
"type": "integer"
5044+
},
50325045
"scheduler_cluster_id": {
50335046
"type": "integer"
50345047
},
@@ -5136,6 +5149,9 @@ const docTemplate = `{
51365149
"scheduler_cluster_id"
51375150
],
51385151
"properties": {
5152+
"config": {
5153+
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_types.SchedulerConfig"
5154+
},
51395155
"features": {
51405156
"type": "array",
51415157
"items": {
@@ -5547,14 +5563,6 @@ const docTemplate = `{
55475563
"description": "Network contains network information.",
55485564
"type": "object",
55495565
"properties": {
5550-
"download_rate": {
5551-
"description": "DownloadRate is download rate.",
5552-
"type": "integer"
5553-
},
5554-
"download_rate_limit": {
5555-
"description": "DownloadRateLimit is download rate limit.",
5556-
"type": "integer"
5557-
},
55585566
"idc": {
55595567
"description": "IDC is network idc.",
55605568
"type": "string"
@@ -5563,16 +5571,24 @@ const docTemplate = `{
55635571
"description": "Location is network location.",
55645572
"type": "string"
55655573
},
5566-
"tcp_connection_count": {
5567-
"description": "TCPConnectionCount is tcp connection count.",
5574+
"max_rx_bandwidth": {
5575+
"description": "MaxRxBandwidth is download rate limit.",
5576+
"type": "integer"
5577+
},
5578+
"max_tx_bandwidth": {
5579+
"description": "MaxTxBandwidth is upload rate limit.",
5580+
"type": "integer"
5581+
},
5582+
"rx_bandwidth": {
5583+
"description": "RxBandwidth is download rate.",
55685584
"type": "integer"
55695585
},
5570-
"upload_rate": {
5571-
"description": "UploadRate is upload rate.",
5586+
"tcp_connection_count": {
5587+
"description": "TCPConnectionCount is tcp connection count.",
55725588
"type": "integer"
55735589
},
5574-
"upload_rate_limit": {
5575-
"description": "UploadRateLimit is upload rate limit.",
5590+
"tx_bandwidth": {
5591+
"description": "TxBandwidth is upload rate.",
55765592
"type": "integer"
55775593
},
55785594
"upload_tcp_connection_count": {
@@ -5822,6 +5838,17 @@ const docTemplate = `{
58225838
}
58235839
}
58245840
},
5841+
"d7y_io_dragonfly_v2_manager_types.SchedulerConfig": {
5842+
"type": "object",
5843+
"required": [
5844+
"manager_keep_alive_interval"
5845+
],
5846+
"properties": {
5847+
"manager_keep_alive_interval": {
5848+
"$ref": "#/definitions/time.Duration"
5849+
}
5850+
}
5851+
},
58255852
"d7y_io_dragonfly_v2_manager_types.SeedPeerClusterConfig": {
58265853
"type": "object",
58275854
"properties": {
@@ -6084,6 +6111,9 @@ const docTemplate = `{
60846111
"d7y_io_dragonfly_v2_manager_types.UpdateSchedulerRequest": {
60856112
"type": "object",
60866113
"properties": {
6114+
"config": {
6115+
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_types.SchedulerConfig"
6116+
},
60876117
"features": {
60886118
"type": "array",
60896119
"items": {

api/manager/swagger.json

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4424,6 +4424,9 @@
44244424
"port": {
44254425
"type": "integer"
44264426
},
4427+
"proxy_port": {
4428+
"type": "integer"
4429+
},
44274430
"scheduler_cluster": {
44284431
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_models.SchedulerCluster"
44294432
},
@@ -4488,6 +4491,9 @@
44884491
"d7y_io_dragonfly_v2_manager_models.Scheduler": {
44894492
"type": "object",
44904493
"properties": {
4494+
"config": {
4495+
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_models.JSONMap"
4496+
},
44914497
"created_at": {
44924498
"type": "string"
44934499
},
@@ -4512,6 +4518,9 @@
45124518
"is_del": {
45134519
"type": "integer"
45144520
},
4521+
"last_keep_alive_at": {
4522+
"type": "string"
4523+
},
45154524
"location": {
45164525
"type": "string"
45174526
},
@@ -4974,6 +4983,7 @@
49744983
"host_name",
49754984
"ip",
49764985
"port",
4986+
"proxy_port",
49774987
"scheduler_cluster_id",
49784988
"type"
49794989
],
@@ -5023,6 +5033,9 @@
50235033
"port": {
50245034
"type": "integer"
50255035
},
5036+
"proxy_port": {
5037+
"type": "integer"
5038+
},
50265039
"scheduler_cluster_id": {
50275040
"type": "integer"
50285041
},
@@ -5130,6 +5143,9 @@
51305143
"scheduler_cluster_id"
51315144
],
51325145
"properties": {
5146+
"config": {
5147+
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_types.SchedulerConfig"
5148+
},
51335149
"features": {
51345150
"type": "array",
51355151
"items": {
@@ -5541,14 +5557,6 @@
55415557
"description": "Network contains network information.",
55425558
"type": "object",
55435559
"properties": {
5544-
"download_rate": {
5545-
"description": "DownloadRate is download rate.",
5546-
"type": "integer"
5547-
},
5548-
"download_rate_limit": {
5549-
"description": "DownloadRateLimit is download rate limit.",
5550-
"type": "integer"
5551-
},
55525560
"idc": {
55535561
"description": "IDC is network idc.",
55545562
"type": "string"
@@ -5557,16 +5565,24 @@
55575565
"description": "Location is network location.",
55585566
"type": "string"
55595567
},
5560-
"tcp_connection_count": {
5561-
"description": "TCPConnectionCount is tcp connection count.",
5568+
"max_rx_bandwidth": {
5569+
"description": "MaxRxBandwidth is download rate limit.",
5570+
"type": "integer"
5571+
},
5572+
"max_tx_bandwidth": {
5573+
"description": "MaxTxBandwidth is upload rate limit.",
5574+
"type": "integer"
5575+
},
5576+
"rx_bandwidth": {
5577+
"description": "RxBandwidth is download rate.",
55625578
"type": "integer"
55635579
},
5564-
"upload_rate": {
5565-
"description": "UploadRate is upload rate.",
5580+
"tcp_connection_count": {
5581+
"description": "TCPConnectionCount is tcp connection count.",
55665582
"type": "integer"
55675583
},
5568-
"upload_rate_limit": {
5569-
"description": "UploadRateLimit is upload rate limit.",
5584+
"tx_bandwidth": {
5585+
"description": "TxBandwidth is upload rate.",
55705586
"type": "integer"
55715587
},
55725588
"upload_tcp_connection_count": {
@@ -5816,6 +5832,17 @@
58165832
}
58175833
}
58185834
},
5835+
"d7y_io_dragonfly_v2_manager_types.SchedulerConfig": {
5836+
"type": "object",
5837+
"required": [
5838+
"manager_keep_alive_interval"
5839+
],
5840+
"properties": {
5841+
"manager_keep_alive_interval": {
5842+
"$ref": "#/definitions/time.Duration"
5843+
}
5844+
}
5845+
},
58195846
"d7y_io_dragonfly_v2_manager_types.SeedPeerClusterConfig": {
58205847
"type": "object",
58215848
"properties": {
@@ -6078,6 +6105,9 @@
60786105
"d7y_io_dragonfly_v2_manager_types.UpdateSchedulerRequest": {
60796106
"type": "object",
60806107
"properties": {
6108+
"config": {
6109+
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_types.SchedulerConfig"
6110+
},
60816111
"features": {
60826112
"type": "array",
60836113
"items": {

api/manager/swagger.yaml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ definitions:
194194
type: string
195195
port:
196196
type: integer
197+
proxy_port:
198+
type: integer
197199
scheduler_cluster:
198200
$ref: '#/definitions/d7y_io_dragonfly_v2_manager_models.SchedulerCluster'
199201
scheduler_cluster_id:
@@ -236,6 +238,8 @@ definitions:
236238
type: object
237239
d7y_io_dragonfly_v2_manager_models.Scheduler:
238240
properties:
241+
config:
242+
$ref: '#/definitions/d7y_io_dragonfly_v2_manager_models.JSONMap'
239243
created_at:
240244
type: string
241245
features:
@@ -252,6 +256,8 @@ definitions:
252256
type: string
253257
is_del:
254258
type: integer
259+
last_keep_alive_at:
260+
type: string
255261
location:
256262
type: string
257263
port:
@@ -590,6 +596,8 @@ definitions:
590596
type: string
591597
port:
592598
type: integer
599+
proxy_port:
600+
type: integer
593601
scheduler_cluster_id:
594602
type: integer
595603
state:
@@ -609,6 +617,7 @@ definitions:
609617
- host_name
610618
- ip
611619
- port
620+
- proxy_port
612621
- scheduler_cluster_id
613622
- type
614623
type: object
@@ -666,6 +675,8 @@ definitions:
666675
type: object
667676
d7y_io_dragonfly_v2_manager_types.CreateSchedulerRequest:
668677
properties:
678+
config:
679+
$ref: '#/definitions/d7y_io_dragonfly_v2_manager_types.SchedulerConfig'
669680
features:
670681
items:
671682
type: string
@@ -960,26 +971,26 @@ definitions:
960971
network:
961972
description: Network contains network information.
962973
properties:
963-
download_rate:
964-
description: DownloadRate is download rate.
965-
type: integer
966-
download_rate_limit:
967-
description: DownloadRateLimit is download rate limit.
968-
type: integer
969974
idc:
970975
description: IDC is network idc.
971976
type: string
972977
location:
973978
description: Location is network location.
974979
type: string
980+
max_rx_bandwidth:
981+
description: MaxRxBandwidth is download rate limit.
982+
type: integer
983+
max_tx_bandwidth:
984+
description: MaxTxBandwidth is upload rate limit.
985+
type: integer
986+
rx_bandwidth:
987+
description: RxBandwidth is download rate.
988+
type: integer
975989
tcp_connection_count:
976990
description: TCPConnectionCount is tcp connection count.
977991
type: integer
978-
upload_rate:
979-
description: UploadRate is upload rate.
980-
type: integer
981-
upload_rate_limit:
982-
description: UploadRateLimit is upload rate limit.
992+
tx_bandwidth:
993+
description: TxBandwidth is upload rate.
983994
type: integer
984995
upload_tcp_connection_count:
985996
description: UploadTCPConnectionCount is upload tcp connection count.
@@ -1152,6 +1163,13 @@ definitions:
11521163
location:
11531164
type: string
11541165
type: object
1166+
d7y_io_dragonfly_v2_manager_types.SchedulerConfig:
1167+
properties:
1168+
manager_keep_alive_interval:
1169+
$ref: '#/definitions/time.Duration'
1170+
required:
1171+
- manager_keep_alive_interval
1172+
type: object
11551173
d7y_io_dragonfly_v2_manager_types.SeedPeerClusterConfig:
11561174
properties:
11571175
load_limit:
@@ -1328,6 +1346,8 @@ definitions:
13281346
type: object
13291347
d7y_io_dragonfly_v2_manager_types.UpdateSchedulerRequest:
13301348
properties:
1349+
config:
1350+
$ref: '#/definitions/d7y_io_dragonfly_v2_manager_types.SchedulerConfig'
13311351
features:
13321352
items:
13331353
type: string

0 commit comments

Comments
 (0)