Skip to content

Commit

Permalink
Add preconfigured NSG to 2023-09-04 api
Browse files Browse the repository at this point in the history
  • Loading branch information
nwnt committed Jul 26, 2023
1 parent 59c8f3a commit a2fd913
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .sha256sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
1d167031baf0209fe8c46df9654585c64e8cc9a0c89555d7479c4ed6dc150251 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json
622404e8311c62f27fba778e30e760bb1901e5bd221b23de72f449cafbdf0c45 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2023-04-01/redhatopenshift.json
4df3ebacaf35d77d09f5eab75fb9608241929b6ef8d00fb506455cd38e383640 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2023-07-01-preview/redhatopenshift.json
415605101b133e4277711cdac0dd5f95112fbffca2376c7728f35b6c9700f794 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2023-09-04/redhatopenshift.json
0b9ef64689f590c86068232bfa36bae2e4c569ecd8fd61707057ef05a8dfaee6 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2023-09-04/redhatopenshift.json
5 changes: 3 additions & 2 deletions pkg/api/openshiftclusterdocument_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ func ExampleOpenShiftClusterDocument() *OpenShiftClusterDocument {
ClientID: "clientId",
},
NetworkProfile: NetworkProfile{
PodCIDR: "10.128.0.0/14",
ServiceCIDR: "172.30.0.0/16",
PodCIDR: "10.128.0.0/14",
ServiceCIDR: "172.30.0.0/16",
PreconfiguredNSG: PreconfiguredNSGDisabled,
},
MasterProfile: MasterProfile{
VMSize: VMSizeStandardD8sV3,
Expand Down
12 changes: 12 additions & 0 deletions pkg/api/v20230904/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,20 @@ type NetworkProfile struct {

// The OutboundType used for egress traffic.
OutboundType OutboundType `json:"outboundType,omitempty"`

// Specifies whether subnets are pre-attached with an NSG
PreconfiguredNSG PreconfiguredNSG `json:"preconfiguredNSG,omitempty"`
}

// PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets
type PreconfiguredNSG string

// PreconfiguredNSG constants
const (
PreconfiguredNSGEnabled PreconfiguredNSG = "Enabled"
PreconfiguredNSGDisabled PreconfiguredNSG = "Disabled"
)

// EncryptionAtHost represents encryption at host state
type EncryptionAtHost string

Expand Down
7 changes: 4 additions & 3 deletions pkg/api/v20230904/openshiftcluster_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ func (c openShiftClusterConverter) ToExternal(oc *api.OpenShiftCluster) interfac
ClientSecret: string(oc.Properties.ServicePrincipalProfile.ClientSecret),
},
NetworkProfile: NetworkProfile{
PodCIDR: oc.Properties.NetworkProfile.PodCIDR,
ServiceCIDR: oc.Properties.NetworkProfile.ServiceCIDR,
OutboundType: OutboundType(oc.Properties.NetworkProfile.OutboundType),
PodCIDR: oc.Properties.NetworkProfile.PodCIDR,
ServiceCIDR: oc.Properties.NetworkProfile.ServiceCIDR,
OutboundType: OutboundType(oc.Properties.NetworkProfile.OutboundType),
PreconfiguredNSG: PreconfiguredNSG(oc.Properties.NetworkProfile.PreconfiguredNSG),
},
MasterProfile: MasterProfile{
VMSize: VMSize(oc.Properties.MasterProfile.VMSize),
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
EncryptionAtHost,
FipsValidatedModules,
OutboundType,
PreconfiguredNSG,
ProvisioningState,
Visibility,
)
Expand Down Expand Up @@ -136,6 +137,7 @@
'EncryptionAtHost',
'FipsValidatedModules',
'OutboundType',
'PreconfiguredNSG',
'ProvisioningState',
'Visibility',
]
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
LOADBALANCER = "Loadbalancer"
USER_DEFINED_ROUTING = "UserDefinedRouting"

class PreconfiguredNSG(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
"""PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets
"""

DISABLED = "Disabled"
ENABLED = "Enabled"

class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
"""ProvisioningState represents a provisioning state.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,17 @@ class NetworkProfile(msrest.serialization.Model):
:ivar outbound_type: The OutboundType used for egress traffic. Possible values include:
"Loadbalancer", "UserDefinedRouting".
:vartype outbound_type: str or ~azure.mgmt.redhatopenshift.v2023_09_04.models.OutboundType
:ivar preconfigured_nsg: Specifies whether subnets are pre-attached with an NSG. Possible
values include: "Disabled", "Enabled".
:vartype preconfigured_nsg: str or
~azure.mgmt.redhatopenshift.v2023_09_04.models.PreconfiguredNSG
"""

_attribute_map = {
'pod_cidr': {'key': 'podCidr', 'type': 'str'},
'service_cidr': {'key': 'serviceCidr', 'type': 'str'},
'outbound_type': {'key': 'outboundType', 'type': 'str'},
'preconfigured_nsg': {'key': 'preconfiguredNSG', 'type': 'str'},
}

def __init__(
Expand All @@ -521,11 +526,16 @@ def __init__(
:keyword outbound_type: The OutboundType used for egress traffic. Possible values include:
"Loadbalancer", "UserDefinedRouting".
:paramtype outbound_type: str or ~azure.mgmt.redhatopenshift.v2023_09_04.models.OutboundType
:keyword preconfigured_nsg: Specifies whether subnets are pre-attached with an NSG. Possible
values include: "Disabled", "Enabled".
:paramtype preconfigured_nsg: str or
~azure.mgmt.redhatopenshift.v2023_09_04.models.PreconfiguredNSG
"""
super(NetworkProfile, self).__init__(**kwargs)
self.pod_cidr = kwargs.get('pod_cidr', None)
self.service_cidr = kwargs.get('service_cidr', None)
self.outbound_type = kwargs.get('outbound_type', None)
self.preconfigured_nsg = kwargs.get('preconfigured_nsg', None)


class TrackedResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,17 @@ class NetworkProfile(msrest.serialization.Model):
:ivar outbound_type: The OutboundType used for egress traffic. Possible values include:
"Loadbalancer", "UserDefinedRouting".
:vartype outbound_type: str or ~azure.mgmt.redhatopenshift.v2023_09_04.models.OutboundType
:ivar preconfigured_nsg: Specifies whether subnets are pre-attached with an NSG. Possible
values include: "Disabled", "Enabled".
:vartype preconfigured_nsg: str or
~azure.mgmt.redhatopenshift.v2023_09_04.models.PreconfiguredNSG
"""

_attribute_map = {
'pod_cidr': {'key': 'podCidr', 'type': 'str'},
'service_cidr': {'key': 'serviceCidr', 'type': 'str'},
'outbound_type': {'key': 'outboundType', 'type': 'str'},
'preconfigured_nsg': {'key': 'preconfiguredNSG', 'type': 'str'},
}

def __init__(
Expand All @@ -558,6 +563,7 @@ def __init__(
pod_cidr: Optional[str] = None,
service_cidr: Optional[str] = None,
outbound_type: Optional[Union[str, "OutboundType"]] = None,
preconfigured_nsg: Optional[Union[str, "PreconfiguredNSG"]] = None,
**kwargs
):
"""
Expand All @@ -568,11 +574,16 @@ def __init__(
:keyword outbound_type: The OutboundType used for egress traffic. Possible values include:
"Loadbalancer", "UserDefinedRouting".
:paramtype outbound_type: str or ~azure.mgmt.redhatopenshift.v2023_09_04.models.OutboundType
:keyword preconfigured_nsg: Specifies whether subnets are pre-attached with an NSG. Possible
values include: "Disabled", "Enabled".
:paramtype preconfigured_nsg: str or
~azure.mgmt.redhatopenshift.v2023_09_04.models.PreconfiguredNSG
"""
super(NetworkProfile, self).__init__(**kwargs)
self.pod_cidr = pod_cidr
self.service_cidr = service_cidr
self.outbound_type = outbound_type
self.preconfigured_nsg = preconfigured_nsg


class TrackedResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down Expand Up @@ -84,7 +85,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down Expand Up @@ -146,7 +148,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down Expand Up @@ -83,7 +84,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down Expand Up @@ -145,7 +147,8 @@
},
"networkProfile": {
"podCidr": "10.128.0.0/14",
"serviceCidr": "172.30.0.0/16"
"serviceCidr": "172.30.0.0/16",
"preconfiguredNSG": "Disabled"
},
"masterProfile": {
"vmSize": "Standard_D8s_v3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,10 @@
"outboundType": {
"$ref": "#/definitions/OutboundType",
"description": "The OutboundType used for egress traffic."
},
"preconfiguredNSG": {
"$ref": "#/definitions/PreconfiguredNSG",
"description": "Specifies whether subnets are pre-attached with an NSG"
}
}
},
Expand Down Expand Up @@ -2224,6 +2228,18 @@
"modelAsString": true
}
},
"PreconfiguredNSG": {
"description": "PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets",
"enum": [
"Disabled",
"Enabled"
],
"type": "string",
"x-ms-enum": {
"name": "PreconfiguredNSG",
"modelAsString": true
}
},
"ProvisioningState": {
"description": "ProvisioningState represents a provisioning state.",
"enum": [
Expand Down

0 comments on commit a2fd913

Please sign in to comment.