Skip to content

Commit

Permalink
Add v20230701preview API changes for NSG Enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
nwnt committed Jul 5, 2023
1 parent d82d4f5 commit dd94bb2
Show file tree
Hide file tree
Showing 16 changed files with 97 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .sha256sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
239c63228da1db172f298cd81d0c3cc0d52ecca907915efe61be98c42b6d8f1d swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/redhatopenshift.json
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
daab3ae0f3e21da0c63fd3f5a895d090cba06374c7e6912444cd82e834a773d6 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2023-07-01-preview/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/v20230701preview/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,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/v20230701preview/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 @@ -47,6 +47,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 @@ -502,12 +502,17 @@ class NetworkProfile(msrest.serialization.Model):
"Loadbalancer", "UserDefinedRouting".
:vartype outbound_type: str or
~azure.mgmt.redhatopenshift.v2023_07_01_preview.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_07_01_preview.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 @@ -523,11 +528,16 @@ def __init__(
"Loadbalancer", "UserDefinedRouting".
:paramtype outbound_type: str or
~azure.mgmt.redhatopenshift.v2023_07_01_preview.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_07_01_preview.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 @@ -545,12 +545,17 @@ class NetworkProfile(msrest.serialization.Model):
"Loadbalancer", "UserDefinedRouting".
:vartype outbound_type: str or
~azure.mgmt.redhatopenshift.v2023_07_01_preview.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_07_01_preview.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 @@ -559,6 +564,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 @@ -570,11 +576,16 @@ def __init__(
"Loadbalancer", "UserDefinedRouting".
:paramtype outbound_type: str or
~azure.mgmt.redhatopenshift.v2023_07_01_preview.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_07_01_preview.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 @@ -2219,6 +2223,14 @@
],
"type": "string"
},
"PreconfiguredNSG": {
"description": "PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets",
"enum": [
"Disabled",
"Enabled"
],
"type": "string"
},
"ProvisioningState": {
"description": "ProvisioningState represents a provisioning state.",
"enum": [
Expand Down

0 comments on commit dd94bb2

Please sign in to comment.