Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance for network design and configuration #1866

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
80 changes: 47 additions & 33 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10424,20 +10424,6 @@ const docTemplate = `{
}
}
},
"model.CspRegion": {
"type": "object",
"properties": {
"connectionName": {
"type": "string"
},
"neededVNets": {
"type": "array",
"items": {
"$ref": "#/definitions/model.NeededVNet"
}
}
}
},
"model.CustomImageStatus": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -10915,6 +10901,20 @@ const docTemplate = `{
}
}
},
"model.McNetConfigurationDetails": {
"type": "object",
"properties": {
"csp": {
"type": "string"
},
"regions": {
"type": "array",
"items": {
"$ref": "#/definitions/model.RegionDetails"
}
}
}
},
"model.McNlbInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -11190,20 +11190,6 @@ const docTemplate = `{
}
}
},
"model.NeededVNet": {
"type": "object",
"properties": {
"subnetCount": {
"type": "integer"
},
"subnetSize": {
"type": "integer"
},
"zoneSelectionMethod": {
"type": "string"
}
}
},
"model.NsInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -11396,6 +11382,20 @@ const docTemplate = `{
}
}
},
"model.RegionDetails": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"vNets": {
"type": "array",
"items": {
"$ref": "#/definitions/model.VNetDetails"
}
}
}
},
"model.RegionInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -14431,6 +14431,20 @@ const docTemplate = `{
}
}
},
"model.VNetDetails": {
"type": "object",
"properties": {
"hostsPerSubnet": {
"type": "string"
},
"subnetCount": {
"type": "string"
},
"useFirstNZones": {
"type": "string"
}
}
},
"model.inspectOverview": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -14547,17 +14561,17 @@ const docTemplate = `{
"netutil.RestPostUtilToDesignVNetRequest": {
"type": "object",
"properties": {
"cspRegions": {
"desiredPrivateNetwork": {
"type": "string"
},
"mcNetConfigurations": {
"type": "array",
"items": {
"$ref": "#/definitions/model.CspRegion"
"$ref": "#/definitions/model.McNetConfigurationDetails"
}
},
"supernettingEnabled": {
"type": "string"
},
"targetPrivateNetwork": {
"type": "string"
}
}
},
Expand Down
80 changes: 47 additions & 33 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10417,20 +10417,6 @@
}
}
},
"model.CspRegion": {
"type": "object",
"properties": {
"connectionName": {
"type": "string"
},
"neededVNets": {
"type": "array",
"items": {
"$ref": "#/definitions/model.NeededVNet"
}
}
}
},
"model.CustomImageStatus": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -10908,6 +10894,20 @@
}
}
},
"model.McNetConfigurationDetails": {
"type": "object",
"properties": {
"csp": {
"type": "string"
},
"regions": {
"type": "array",
"items": {
"$ref": "#/definitions/model.RegionDetails"
}
}
}
},
"model.McNlbInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -11183,20 +11183,6 @@
}
}
},
"model.NeededVNet": {
"type": "object",
"properties": {
"subnetCount": {
"type": "integer"
},
"subnetSize": {
"type": "integer"
},
"zoneSelectionMethod": {
"type": "string"
}
}
},
"model.NsInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -11389,6 +11375,20 @@
}
}
},
"model.RegionDetails": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"vNets": {
"type": "array",
"items": {
"$ref": "#/definitions/model.VNetDetails"
}
}
}
},
"model.RegionInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -14424,6 +14424,20 @@
}
}
},
"model.VNetDetails": {
"type": "object",
"properties": {
"hostsPerSubnet": {
"type": "string"
},
"subnetCount": {
"type": "string"
},
"useFirstNZones": {
"type": "string"
}
}
},
"model.inspectOverview": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -14540,17 +14554,17 @@
"netutil.RestPostUtilToDesignVNetRequest": {
"type": "object",
"properties": {
"cspRegions": {
"desiredPrivateNetwork": {
"type": "string"
},
"mcNetConfigurations": {
"type": "array",
"items": {
"$ref": "#/definitions/model.CspRegion"
"$ref": "#/definitions/model.McNetConfigurationDetails"
}
},
"supernettingEnabled": {
"type": "string"
},
"targetPrivateNetwork": {
"type": "string"
}
}
},
Expand Down
53 changes: 31 additions & 22 deletions src/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7866,15 +7866,6 @@ components:
description: "CredentialReq contains the necessary information to register a\
\ credential. This includes the AES key encrypted with the RSA public key,\
\ which is then used to decrypt the AES key on the server side."
model.CspRegion:
type: object
properties:
connectionName:
type: string
neededVNets:
type: array
items:
$ref: '#/components/schemas/model.NeededVNet'
model.CustomImageStatus:
type: string
enum:
Expand Down Expand Up @@ -8193,6 +8184,15 @@ components:
type: number
longitude:
type: number
model.McNetConfigurationDetails:
type: object
properties:
csp:
type: string
regions:
type: array
items:
$ref: '#/components/schemas/model.RegionDetails'
model.McNlbInfo:
type: object
properties:
Expand Down Expand Up @@ -8381,15 +8381,6 @@ components:
type: string
description: TCP|UDP
example: TCP
model.NeededVNet:
type: object
properties:
subnetCount:
type: integer
subnetSize:
type: integer
zoneSelectionMethod:
type: string
model.NsInfo:
type: object
properties:
Expand Down Expand Up @@ -8526,6 +8517,15 @@ components:
type: array
items:
type: string
model.RegionDetails:
type: object
properties:
name:
type: string
vNets:
type: array
items:
$ref: '#/components/schemas/model.VNetDetails'
model.RegionInfo:
type: object
properties:
Expand Down Expand Up @@ -10754,6 +10754,15 @@ components:
resource-group-id:
type: string
example: ""
model.VNetDetails:
type: object
properties:
hostsPerSubnet:
type: string
subnetCount:
type: string
useFirstNZones:
type: string
model.inspectOverview:
type: object
properties:
Expand Down Expand Up @@ -10831,14 +10840,14 @@ components:
netutil.RestPostUtilToDesignVNetRequest:
type: object
properties:
cspRegions:
desiredPrivateNetwork:
type: string
mcNetConfigurations:
type: array
items:
$ref: '#/components/schemas/model.CspRegion'
$ref: '#/components/schemas/model.McNetConfigurationDetails'
supernettingEnabled:
type: string
targetPrivateNetwork:
type: string
netutil.RestPostUtilToValidateNetworkRequest:
type: object
properties:
Expand Down
25 changes: 15 additions & 10 deletions src/core/model/vnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,25 @@ type BastionNode struct {

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

type CspRegion struct {
ConnectionName string `json:"connectionName"`
NeededVNets []NeededVNet `json:"neededVNets"`
type McNetConfigurationDetails struct {
Csp string `json:"csp"`
Regions []RegionDetails `json:"regions"`
}

type NeededVNet struct {
SubnetCount int `json:"subnetCount"`
SubnetSize int `json:"subnetSize"`
ZoneSelectionMethod string `json:"zoneSelectionMethod"`
type RegionDetails struct {
Name string `json:"name"`
VNets []VNetDetails `json:"vNets"`
}

type VNetDetails struct {
SubnetCount string `json:"subnetCount"`
HostsPerSubnet string `json:"hostsPerSubnet"`
UseFirstNZones string `json:"useFirstNZones"`
}

type VNetDesignResponse struct {
Expand Down
Loading