From 62b978c050534faeecbe8967cd40074453a0e054 Mon Sep 17 00:00:00 2001 From: Bethuel Mmbaga Date: Tue, 25 Feb 2025 10:11:50 +0000 Subject: [PATCH] [management] Add support for tcp/udp allocations (#3381) Signed-off-by: bcmmbaga --- management/server/http/api/openapi.yml | 19 ++++++++++++++++--- management/server/http/api/types.gen.go | 12 ++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/management/server/http/api/openapi.yml b/management/server/http/api/openapi.yml index 1a3d58eaa..ab4f7c0ba 100644 --- a/management/server/http/api/openapi.yml +++ b/management/server/http/api/openapi.yml @@ -1649,9 +1649,7 @@ components: type: string example: 192.34.0.123 available_ports: - description: Number of available ports left on the ingress peer - type: integer - example: 45765 + $ref: '#/components/schemas/AvailablePorts' enabled: description: Indicates if an ingress peer is enabled type: boolean @@ -1677,6 +1675,21 @@ components: - connected - fallback - region + + AvailablePorts: + type: object + properties: + tcp: + description: Number of available TCP ports left on the ingress peer + type: integer + example: 45765 + udp: + description: Number of available UDP ports left on the ingress peer + type: integer + example: 50000 + required: + - tcp + - udp IngressPortAllocationRequest: type: object properties: diff --git a/management/server/http/api/types.gen.go b/management/server/http/api/types.gen.go index 7b783a962..fc5d3d707 100644 --- a/management/server/http/api/types.gen.go +++ b/management/server/http/api/types.gen.go @@ -274,6 +274,15 @@ type AccountSettings struct { RoutingPeerDnsResolutionEnabled *bool `json:"routing_peer_dns_resolution_enabled,omitempty"` } +// AvailablePorts defines model for AvailablePorts. +type AvailablePorts struct { + // Tcp Number of available TCP ports left on the ingress peer + Tcp int `json:"tcp"` + + // Udp Number of available UDP ports left on the ingress peer + Udp int `json:"udp"` +} + // Checks List of objects that perform the actual checks type Checks struct { // GeoLocationCheck Posture check for geo location @@ -449,8 +458,7 @@ type GroupRequest struct { // IngressPeer defines model for IngressPeer. type IngressPeer struct { - // AvailablePorts Number of available ports left on the ingress peer - AvailablePorts int `json:"available_ports"` + AvailablePorts AvailablePorts `json:"available_ports"` // Connected Indicates if an ingress peer is connected to the management server Connected bool `json:"connected"`