Skip to content

Commit 39a8f8e

Browse files
Enhance for network design and configuration
2 parents 116ee55 + 171e262 commit 39a8f8e

File tree

6 files changed

+239
-148
lines changed

6 files changed

+239
-148
lines changed

src/api/rest/docs/docs.go

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10424,20 +10424,6 @@ const docTemplate = `{
1042410424
}
1042510425
}
1042610426
},
10427-
"model.CspRegion": {
10428-
"type": "object",
10429-
"properties": {
10430-
"connectionName": {
10431-
"type": "string"
10432-
},
10433-
"neededVNets": {
10434-
"type": "array",
10435-
"items": {
10436-
"$ref": "#/definitions/model.NeededVNet"
10437-
}
10438-
}
10439-
}
10440-
},
1044110427
"model.CustomImageStatus": {
1044210428
"type": "string",
1044310429
"enum": [
@@ -10915,6 +10901,20 @@ const docTemplate = `{
1091510901
}
1091610902
}
1091710903
},
10904+
"model.McNetConfigurationDetails": {
10905+
"type": "object",
10906+
"properties": {
10907+
"csp": {
10908+
"type": "string"
10909+
},
10910+
"regions": {
10911+
"type": "array",
10912+
"items": {
10913+
"$ref": "#/definitions/model.RegionDetails"
10914+
}
10915+
}
10916+
}
10917+
},
1091810918
"model.McNlbInfo": {
1091910919
"type": "object",
1092010920
"properties": {
@@ -11190,20 +11190,6 @@ const docTemplate = `{
1119011190
}
1119111191
}
1119211192
},
11193-
"model.NeededVNet": {
11194-
"type": "object",
11195-
"properties": {
11196-
"subnetCount": {
11197-
"type": "integer"
11198-
},
11199-
"subnetSize": {
11200-
"type": "integer"
11201-
},
11202-
"zoneSelectionMethod": {
11203-
"type": "string"
11204-
}
11205-
}
11206-
},
1120711193
"model.NsInfo": {
1120811194
"type": "object",
1120911195
"properties": {
@@ -11396,6 +11382,20 @@ const docTemplate = `{
1139611382
}
1139711383
}
1139811384
},
11385+
"model.RegionDetails": {
11386+
"type": "object",
11387+
"properties": {
11388+
"name": {
11389+
"type": "string"
11390+
},
11391+
"vNets": {
11392+
"type": "array",
11393+
"items": {
11394+
"$ref": "#/definitions/model.VNetDetails"
11395+
}
11396+
}
11397+
}
11398+
},
1139911399
"model.RegionInfo": {
1140011400
"type": "object",
1140111401
"properties": {
@@ -14431,6 +14431,20 @@ const docTemplate = `{
1443114431
}
1443214432
}
1443314433
},
14434+
"model.VNetDetails": {
14435+
"type": "object",
14436+
"properties": {
14437+
"hostsPerSubnet": {
14438+
"type": "string"
14439+
},
14440+
"subnetCount": {
14441+
"type": "string"
14442+
},
14443+
"useFirstNZones": {
14444+
"type": "string"
14445+
}
14446+
}
14447+
},
1443414448
"model.inspectOverview": {
1443514449
"type": "object",
1443614450
"properties": {
@@ -14547,17 +14561,17 @@ const docTemplate = `{
1454714561
"netutil.RestPostUtilToDesignVNetRequest": {
1454814562
"type": "object",
1454914563
"properties": {
14550-
"cspRegions": {
14564+
"desiredPrivateNetwork": {
14565+
"type": "string"
14566+
},
14567+
"mcNetConfigurations": {
1455114568
"type": "array",
1455214569
"items": {
14553-
"$ref": "#/definitions/model.CspRegion"
14570+
"$ref": "#/definitions/model.McNetConfigurationDetails"
1455414571
}
1455514572
},
1455614573
"supernettingEnabled": {
1455714574
"type": "string"
14558-
},
14559-
"targetPrivateNetwork": {
14560-
"type": "string"
1456114575
}
1456214576
}
1456314577
},

src/api/rest/docs/swagger.json

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10417,20 +10417,6 @@
1041710417
}
1041810418
}
1041910419
},
10420-
"model.CspRegion": {
10421-
"type": "object",
10422-
"properties": {
10423-
"connectionName": {
10424-
"type": "string"
10425-
},
10426-
"neededVNets": {
10427-
"type": "array",
10428-
"items": {
10429-
"$ref": "#/definitions/model.NeededVNet"
10430-
}
10431-
}
10432-
}
10433-
},
1043410420
"model.CustomImageStatus": {
1043510421
"type": "string",
1043610422
"enum": [
@@ -10908,6 +10894,20 @@
1090810894
}
1090910895
}
1091010896
},
10897+
"model.McNetConfigurationDetails": {
10898+
"type": "object",
10899+
"properties": {
10900+
"csp": {
10901+
"type": "string"
10902+
},
10903+
"regions": {
10904+
"type": "array",
10905+
"items": {
10906+
"$ref": "#/definitions/model.RegionDetails"
10907+
}
10908+
}
10909+
}
10910+
},
1091110911
"model.McNlbInfo": {
1091210912
"type": "object",
1091310913
"properties": {
@@ -11183,20 +11183,6 @@
1118311183
}
1118411184
}
1118511185
},
11186-
"model.NeededVNet": {
11187-
"type": "object",
11188-
"properties": {
11189-
"subnetCount": {
11190-
"type": "integer"
11191-
},
11192-
"subnetSize": {
11193-
"type": "integer"
11194-
},
11195-
"zoneSelectionMethod": {
11196-
"type": "string"
11197-
}
11198-
}
11199-
},
1120011186
"model.NsInfo": {
1120111187
"type": "object",
1120211188
"properties": {
@@ -11389,6 +11375,20 @@
1138911375
}
1139011376
}
1139111377
},
11378+
"model.RegionDetails": {
11379+
"type": "object",
11380+
"properties": {
11381+
"name": {
11382+
"type": "string"
11383+
},
11384+
"vNets": {
11385+
"type": "array",
11386+
"items": {
11387+
"$ref": "#/definitions/model.VNetDetails"
11388+
}
11389+
}
11390+
}
11391+
},
1139211392
"model.RegionInfo": {
1139311393
"type": "object",
1139411394
"properties": {
@@ -14424,6 +14424,20 @@
1442414424
}
1442514425
}
1442614426
},
14427+
"model.VNetDetails": {
14428+
"type": "object",
14429+
"properties": {
14430+
"hostsPerSubnet": {
14431+
"type": "string"
14432+
},
14433+
"subnetCount": {
14434+
"type": "string"
14435+
},
14436+
"useFirstNZones": {
14437+
"type": "string"
14438+
}
14439+
}
14440+
},
1442714441
"model.inspectOverview": {
1442814442
"type": "object",
1442914443
"properties": {
@@ -14540,17 +14554,17 @@
1454014554
"netutil.RestPostUtilToDesignVNetRequest": {
1454114555
"type": "object",
1454214556
"properties": {
14543-
"cspRegions": {
14557+
"desiredPrivateNetwork": {
14558+
"type": "string"
14559+
},
14560+
"mcNetConfigurations": {
1454414561
"type": "array",
1454514562
"items": {
14546-
"$ref": "#/definitions/model.CspRegion"
14563+
"$ref": "#/definitions/model.McNetConfigurationDetails"
1454714564
}
1454814565
},
1454914566
"supernettingEnabled": {
1455014567
"type": "string"
14551-
},
14552-
"targetPrivateNetwork": {
14553-
"type": "string"
1455414568
}
1455514569
}
1455614570
},

src/api/rest/docs/swagger.yaml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7866,15 +7866,6 @@ components:
78667866
description: "CredentialReq contains the necessary information to register a\
78677867
\ credential. This includes the AES key encrypted with the RSA public key,\
78687868
\ which is then used to decrypt the AES key on the server side."
7869-
model.CspRegion:
7870-
type: object
7871-
properties:
7872-
connectionName:
7873-
type: string
7874-
neededVNets:
7875-
type: array
7876-
items:
7877-
$ref: '#/components/schemas/model.NeededVNet'
78787869
model.CustomImageStatus:
78797870
type: string
78807871
enum:
@@ -8193,6 +8184,15 @@ components:
81938184
type: number
81948185
longitude:
81958186
type: number
8187+
model.McNetConfigurationDetails:
8188+
type: object
8189+
properties:
8190+
csp:
8191+
type: string
8192+
regions:
8193+
type: array
8194+
items:
8195+
$ref: '#/components/schemas/model.RegionDetails'
81968196
model.McNlbInfo:
81978197
type: object
81988198
properties:
@@ -8381,15 +8381,6 @@ components:
83818381
type: string
83828382
description: TCP|UDP
83838383
example: TCP
8384-
model.NeededVNet:
8385-
type: object
8386-
properties:
8387-
subnetCount:
8388-
type: integer
8389-
subnetSize:
8390-
type: integer
8391-
zoneSelectionMethod:
8392-
type: string
83938384
model.NsInfo:
83948385
type: object
83958386
properties:
@@ -8526,6 +8517,15 @@ components:
85268517
type: array
85278518
items:
85288519
type: string
8520+
model.RegionDetails:
8521+
type: object
8522+
properties:
8523+
name:
8524+
type: string
8525+
vNets:
8526+
type: array
8527+
items:
8528+
$ref: '#/components/schemas/model.VNetDetails'
85298529
model.RegionInfo:
85308530
type: object
85318531
properties:
@@ -10754,6 +10754,15 @@ components:
1075410754
resource-group-id:
1075510755
type: string
1075610756
example: ""
10757+
model.VNetDetails:
10758+
type: object
10759+
properties:
10760+
hostsPerSubnet:
10761+
type: string
10762+
subnetCount:
10763+
type: string
10764+
useFirstNZones:
10765+
type: string
1075710766
model.inspectOverview:
1075810767
type: object
1075910768
properties:
@@ -10831,14 +10840,14 @@ components:
1083110840
netutil.RestPostUtilToDesignVNetRequest:
1083210841
type: object
1083310842
properties:
10834-
cspRegions:
10843+
desiredPrivateNetwork:
10844+
type: string
10845+
mcNetConfigurations:
1083510846
type: array
1083610847
items:
10837-
$ref: '#/components/schemas/model.CspRegion'
10848+
$ref: '#/components/schemas/model.McNetConfigurationDetails'
1083810849
supernettingEnabled:
1083910850
type: string
10840-
targetPrivateNetwork:
10841-
type: string
1084210851
netutil.RestPostUtilToValidateNetworkRequest:
1084310852
type: object
1084410853
properties:

src/core/model/vnet.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,25 @@ type BastionNode struct {
7777

7878
// VNetDesignRequest is a struct to handle the utility function, DesignVNet()
7979
type VNetDesignRequest struct {
80-
TargetPrivateNetwork string `json:"targetPrivateNetwork"`
81-
SupernettingEnabled string `json:"supernettingEnabled"`
82-
CspRegions []CspRegion `json:"cspRegions"`
80+
DesiredPrivateNetwork string `json:"desiredPrivateNetwork"`
81+
SupernettingEnabled string `json:"supernettingEnabled"`
82+
McNetConfigurations []McNetConfigurationDetails `json:"mcNetConfigurations"`
8383
}
8484

85-
type CspRegion struct {
86-
ConnectionName string `json:"connectionName"`
87-
NeededVNets []NeededVNet `json:"neededVNets"`
85+
type McNetConfigurationDetails struct {
86+
Csp string `json:"csp"`
87+
Regions []RegionDetails `json:"regions"`
8888
}
8989

90-
type NeededVNet struct {
91-
SubnetCount int `json:"subnetCount"`
92-
SubnetSize int `json:"subnetSize"`
93-
ZoneSelectionMethod string `json:"zoneSelectionMethod"`
90+
type RegionDetails struct {
91+
Name string `json:"name"`
92+
VNets []VNetDetails `json:"vNets"`
93+
}
94+
95+
type VNetDetails struct {
96+
SubnetCount string `json:"subnetCount"`
97+
HostsPerSubnet string `json:"hostsPerSubnet"`
98+
UseFirstNZones string `json:"useFirstNZones"`
9499
}
95100

96101
type VNetDesignResponse struct {

0 commit comments

Comments
 (0)