mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-25 12:12:12 +02:00
[management] Add support to allocate same port for public and internal (#3347)
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
parent
630edf2480
commit
4ebf1410c6
@ -1693,10 +1693,12 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/IngressPortAllocationRequestPortRange'
|
||||
direct_port:
|
||||
description: Direct port allocation
|
||||
$ref: '#/components/schemas/IngressPortAllocationRequestDirectPort'
|
||||
required:
|
||||
- name
|
||||
- enabled
|
||||
- port_ranges
|
||||
IngressPortAllocationRequestPortRange:
|
||||
type: object
|
||||
properties:
|
||||
@ -1711,12 +1713,27 @@ components:
|
||||
protocol:
|
||||
description: The protocol accepted by the port range
|
||||
type: string
|
||||
enum: [ "tcp", "udp" ]
|
||||
enum: [ "tcp", "udp", "tcp/udp" ]
|
||||
example: tcp
|
||||
required:
|
||||
- start
|
||||
- end
|
||||
- protocol
|
||||
IngressPortAllocationRequestDirectPort:
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
description: The number of ports to be forwarded
|
||||
type: integer
|
||||
example: 5
|
||||
protocol:
|
||||
description: The protocol accepted by the port
|
||||
type: string
|
||||
enum: [ "tcp", "udp", "tcp/udp" ]
|
||||
example: udp
|
||||
required:
|
||||
- count
|
||||
- protocol
|
||||
IngressPortAllocation:
|
||||
type: object
|
||||
properties:
|
||||
@ -1779,7 +1796,7 @@ components:
|
||||
protocol:
|
||||
description: Protocol accepted by the ports
|
||||
type: string
|
||||
enum: [ "tcp", "udp" ]
|
||||
enum: [ "tcp", "udp", "tcp/udp" ]
|
||||
example: tcp
|
||||
required:
|
||||
- translated_start
|
||||
|
@ -86,12 +86,21 @@ const (
|
||||
// Defines values for IngressPortAllocationPortMappingProtocol.
|
||||
const (
|
||||
IngressPortAllocationPortMappingProtocolTcp IngressPortAllocationPortMappingProtocol = "tcp"
|
||||
IngressPortAllocationPortMappingProtocolTcpudp IngressPortAllocationPortMappingProtocol = "tcp/udp"
|
||||
IngressPortAllocationPortMappingProtocolUdp IngressPortAllocationPortMappingProtocol = "udp"
|
||||
)
|
||||
|
||||
// Defines values for IngressPortAllocationRequestDirectPortProtocol.
|
||||
const (
|
||||
IngressPortAllocationRequestDirectPortProtocolTcp IngressPortAllocationRequestDirectPortProtocol = "tcp"
|
||||
IngressPortAllocationRequestDirectPortProtocolTcpudp IngressPortAllocationRequestDirectPortProtocol = "tcp/udp"
|
||||
IngressPortAllocationRequestDirectPortProtocolUdp IngressPortAllocationRequestDirectPortProtocol = "udp"
|
||||
)
|
||||
|
||||
// Defines values for IngressPortAllocationRequestPortRangeProtocol.
|
||||
const (
|
||||
IngressPortAllocationRequestPortRangeProtocolTcp IngressPortAllocationRequestPortRangeProtocol = "tcp"
|
||||
IngressPortAllocationRequestPortRangeProtocolTcpudp IngressPortAllocationRequestPortRangeProtocol = "tcp/udp"
|
||||
IngressPortAllocationRequestPortRangeProtocolUdp IngressPortAllocationRequestPortRangeProtocol = "udp"
|
||||
)
|
||||
|
||||
@ -533,6 +542,8 @@ type IngressPortAllocationPortMappingProtocol string
|
||||
|
||||
// IngressPortAllocationRequest defines model for IngressPortAllocationRequest.
|
||||
type IngressPortAllocationRequest struct {
|
||||
DirectPort *IngressPortAllocationRequestDirectPort `json:"direct_port,omitempty"`
|
||||
|
||||
// Enabled Indicates if an ingress port allocation is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
@ -540,9 +551,21 @@ type IngressPortAllocationRequest struct {
|
||||
Name string `json:"name"`
|
||||
|
||||
// PortRanges List of port ranges that are forwarded by the ingress peer
|
||||
PortRanges []IngressPortAllocationRequestPortRange `json:"port_ranges"`
|
||||
PortRanges *[]IngressPortAllocationRequestPortRange `json:"port_ranges,omitempty"`
|
||||
}
|
||||
|
||||
// IngressPortAllocationRequestDirectPort defines model for IngressPortAllocationRequestDirectPort.
|
||||
type IngressPortAllocationRequestDirectPort struct {
|
||||
// Count The number of ports to be forwarded
|
||||
Count int `json:"count"`
|
||||
|
||||
// Protocol The protocol accepted by the port
|
||||
Protocol IngressPortAllocationRequestDirectPortProtocol `json:"protocol"`
|
||||
}
|
||||
|
||||
// IngressPortAllocationRequestDirectPortProtocol The protocol accepted by the port
|
||||
type IngressPortAllocationRequestDirectPortProtocol string
|
||||
|
||||
// IngressPortAllocationRequestPortRange defines model for IngressPortAllocationRequestPortRange.
|
||||
type IngressPortAllocationRequestPortRange struct {
|
||||
// End The ending port of the range of forwarded ports
|
||||
|
Loading…
x
Reference in New Issue
Block a user