diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md index 7e00e7757c4e..a14f0fc24160 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.1.0-beta.1 (Unreleased) - -### Features Added +## 1.1.0 (2023-09-28) ### Breaking Changes - -### Bugs Fixed - -### Other Changes + - New optional parameter default action added in Access Control List and Route Policy resources. + - IP V4 address parameter type changed from IPAddress to String in internet gateway resource. ## 1.0.0 (2023-07-28) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/api/Azure.ResourceManager.ManagedNetworkFabric.netstandard2.0.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/api/Azure.ResourceManager.ManagedNetworkFabric.netstandard2.0.cs index 13bd0f74a0c1..39096fc7fd8b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/api/Azure.ResourceManager.ManagedNetworkFabric.netstandard2.0.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/api/Azure.ResourceManager.ManagedNetworkFabric.netstandard2.0.cs @@ -278,6 +278,7 @@ public NetworkFabricAccessControlListData(Azure.Core.AzureLocation location) : b public string Annotation { get { throw null; } set { } } public Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? ConfigurationState { get { throw null; } } public Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationType? ConfigurationType { get { throw null; } set { } } + public Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType? DefaultAction { get { throw null; } set { } } public System.Collections.Generic.IList DynamicMatchConfigurations { get { throw null; } } public System.DateTimeOffset? LastSyncedOn { get { throw null; } } public System.Collections.Generic.IList MatchConfigurations { get { throw null; } } @@ -523,7 +524,10 @@ public partial class NetworkFabricInternetGatewayData : Azure.ResourceManager.Mo public NetworkFabricInternetGatewayData(Azure.Core.AzureLocation location, Azure.ResourceManager.ManagedNetworkFabric.Models.InternetGatewayType typePropertiesType, Azure.Core.ResourceIdentifier networkFabricControllerId) : base (default(Azure.Core.AzureLocation)) { } public string Annotation { get { throw null; } set { } } public Azure.Core.ResourceIdentifier InternetGatewayRuleId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("IPv4Address is deprecated, use IPV4Address instead")] public System.Net.IPAddress IPv4Address { get { throw null; } } + public string IPV4Address { get { throw null; } } public Azure.Core.ResourceIdentifier NetworkFabricControllerId { get { throw null; } set { } } public int? Port { get { throw null; } } public Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? ProvisioningState { get { throw null; } } @@ -941,6 +945,7 @@ public NetworkFabricRoutePolicyData(Azure.Core.AzureLocation location, Azure.Cor public Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? AdministrativeState { get { throw null; } } public string Annotation { get { throw null; } set { } } public Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? ConfigurationState { get { throw null; } } + public Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType? DefaultAction { get { throw null; } set { } } public Azure.Core.ResourceIdentifier NetworkFabricId { get { throw null; } set { } } public Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? ProvisioningState { get { throw null; } } public System.Collections.Generic.IList Statements { get { throw null; } } @@ -1396,14 +1401,17 @@ public static partial class ArmManagedNetworkFabricModelFactory public static Azure.ResourceManager.ManagedNetworkFabric.NetworkDeviceData NetworkDeviceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, string hostName = null, string serialNumber = null, string version = null, string networkDeviceSku = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkDeviceRole? networkDeviceRole = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkDeviceRole?), Azure.Core.ResourceIdentifier networkRackId = null, System.Net.IPAddress managementIPv4Address = null, string managementIPv6Address = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkDeviceInterfaceData NetworkDeviceInterfaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string annotation = null, string physicalIdentifier = null, string connectedTo = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkDeviceInterfaceType? interfaceType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkDeviceInterfaceType?), System.Net.IPAddress ipv4Address = null, string ipv6Address = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkDeviceSkuData NetworkDeviceSkuData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string model = null, string manufacturer = null, System.Collections.Generic.IEnumerable supportedVersions = null, System.Collections.Generic.IEnumerable supportedRoleTypes = null, System.Collections.Generic.IEnumerable interfaces = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricAccessControlListData NetworkFabricAccessControlListData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationType? configurationType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationType?), System.Uri aclsUri = null, System.Collections.Generic.IEnumerable matchConfigurations = null, System.Collections.Generic.IEnumerable dynamicMatchConfigurations = null, System.DateTimeOffset? lastSyncedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricAccessControlListData NetworkFabricAccessControlListData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string annotation, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationType? configurationType, System.Uri aclsUri, System.Collections.Generic.IEnumerable matchConfigurations, System.Collections.Generic.IEnumerable dynamicMatchConfigurations, System.DateTimeOffset? lastSyncedOn, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState) { throw null; } + public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricAccessControlListData NetworkFabricAccessControlListData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationType? configurationType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationType?), System.Uri aclsUri = null, Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType? defaultAction = default(Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType?), System.Collections.Generic.IEnumerable matchConfigurations = null, System.Collections.Generic.IEnumerable dynamicMatchConfigurations = null, System.DateTimeOffset? lastSyncedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricControllerData NetworkFabricControllerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, System.Collections.Generic.IEnumerable infrastructureExpressRouteConnections = null, System.Collections.Generic.IEnumerable workloadExpressRouteConnections = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricControllerServices infrastructureServices = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricControllerServices workloadServices = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ManagedResourceGroupConfiguration managedResourceGroupConfiguration = null, System.Collections.Generic.IEnumerable networkFabricIds = null, bool? isWorkloadManagementNetwork = default(bool?), Azure.ResourceManager.ManagedNetworkFabric.Models.IsWorkloadManagementNetworkEnabled? isWorkloadManagementNetworkEnabled = default(Azure.ResourceManager.ManagedNetworkFabric.Models.IsWorkloadManagementNetworkEnabled?), System.Collections.Generic.IEnumerable tenantInternetGatewayIds = null, string ipv4AddressSpace = null, string ipv6AddressSpace = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricControllerSKU? nfcSku = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricControllerSKU?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricControllerServices NetworkFabricControllerServices(System.Collections.Generic.IEnumerable ipv4AddressSpaces = null, System.Collections.Generic.IEnumerable ipv6AddressSpaces = null) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricData NetworkFabricData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, string networkFabricSku = null, string fabricVersion = null, System.Collections.Generic.IEnumerable routerIds = null, Azure.Core.ResourceIdentifier networkFabricControllerId = null, int? rackCount = default(int?), int serverCountPerRack = 0, string ipv4Prefix = null, string ipv6Prefix = null, long fabricAsn = (long)0, Azure.ResourceManager.ManagedNetworkFabric.Models.TerminalServerConfiguration terminalServerConfiguration = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ManagementNetworkConfigurationProperties managementNetworkConfiguration = null, System.Collections.Generic.IEnumerable racks = null, System.Collections.Generic.IEnumerable l2IsolationDomains = null, System.Collections.Generic.IEnumerable l3IsolationDomains = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricErrorResult NetworkFabricErrorResult(Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricExternalNetworkData NetworkFabricExternalNetworkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string annotation = null, Azure.Core.ResourceIdentifier importRoutePolicyId = null, Azure.Core.ResourceIdentifier exportRoutePolicyId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ImportRoutePolicy importRoutePolicy = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ExportRoutePolicy exportRoutePolicy = null, Azure.Core.ResourceIdentifier networkToNetworkInterconnectId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.PeeringOption peeringOption = default(Azure.ResourceManager.ManagedNetworkFabric.Models.PeeringOption), Azure.ResourceManager.ManagedNetworkFabric.Models.L3OptionBProperties optionBProperties = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ExternalNetworkOptionAProperties optionAProperties = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricInternalNetworkData NetworkFabricInternalNetworkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string annotation = null, int? mtu = default(int?), System.Collections.Generic.IEnumerable connectedIPv4Subnets = null, System.Collections.Generic.IEnumerable connectedIPv6Subnets = null, Azure.Core.ResourceIdentifier importRoutePolicyId = null, Azure.Core.ResourceIdentifier exportRoutePolicyId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ImportRoutePolicy importRoutePolicy = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ExportRoutePolicy exportRoutePolicy = null, Azure.Core.ResourceIdentifier ingressAclId = null, Azure.Core.ResourceIdentifier egressAclId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.IsMonitoringEnabled? isMonitoringEnabled = default(Azure.ResourceManager.ManagedNetworkFabric.Models.IsMonitoringEnabled?), Azure.ResourceManager.ManagedNetworkFabric.Models.StaticRouteConfigurationExtension? extension = default(Azure.ResourceManager.ManagedNetworkFabric.Models.StaticRouteConfigurationExtension?), int vlanId = 0, Azure.ResourceManager.ManagedNetworkFabric.Models.InternalNetworkBgpConfiguration bgpConfiguration = null, Azure.ResourceManager.ManagedNetworkFabric.Models.InternalNetworkStaticRouteConfiguration staticRouteConfiguration = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } - public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.Core.ResourceIdentifier internetGatewayRuleId = null, System.Net.IPAddress ipv4Address = null, int? port = default(int?), Azure.ResourceManager.ManagedNetworkFabric.Models.InternetGatewayType typePropertiesType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.InternetGatewayType), Azure.Core.ResourceIdentifier networkFabricControllerId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string annotation, Azure.Core.ResourceIdentifier internetGatewayRuleId, System.Net.IPAddress ipv4Address, int? port, Azure.ResourceManager.ManagedNetworkFabric.Models.InternetGatewayType typePropertiesType, Azure.Core.ResourceIdentifier networkFabricControllerId, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState) { throw null; } + public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.Core.ResourceIdentifier internetGatewayRuleId = null, string ipV4Address = null, int? port = default(int?), Azure.ResourceManager.ManagedNetworkFabric.Models.InternetGatewayType typePropertiesType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.InternetGatewayType), Azure.Core.ResourceIdentifier networkFabricControllerId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricInternetGatewayRuleData NetworkFabricInternetGatewayRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.ResourceManager.ManagedNetworkFabric.Models.InternetGatewayRules ruleProperties = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), System.Collections.Generic.IEnumerable internetGatewayIds = null) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricIPCommunityData NetworkFabricIPCommunityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, System.Collections.Generic.IEnumerable ipCommunityRules = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricIPExtendedCommunityData NetworkFabricIPExtendedCommunityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, System.Collections.Generic.IEnumerable ipExtendedCommunityRules = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } @@ -1411,7 +1419,9 @@ public static partial class ArmManagedNetworkFabricModelFactory public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricL2IsolationDomainData NetworkFabricL2IsolationDomainData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.Core.ResourceIdentifier networkFabricId = null, int vlanId = 0, int? mtu = default(int?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricL3IsolationDomainData NetworkFabricL3IsolationDomainData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.ResourceManager.ManagedNetworkFabric.Models.RedistributeConnectedSubnet? redistributeConnectedSubnets = default(Azure.ResourceManager.ManagedNetworkFabric.Models.RedistributeConnectedSubnet?), Azure.ResourceManager.ManagedNetworkFabric.Models.RedistributeStaticRoute? redistributeStaticRoutes = default(Azure.ResourceManager.ManagedNetworkFabric.Models.RedistributeStaticRoute?), Azure.ResourceManager.ManagedNetworkFabric.Models.AggregateRouteConfiguration aggregateRouteConfiguration = null, Azure.ResourceManager.ManagedNetworkFabric.Models.ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy = null, Azure.Core.ResourceIdentifier networkFabricId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricNeighborGroupData NetworkFabricNeighborGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NeighborGroupDestination destination = null, System.Collections.Generic.IEnumerable networkTapIds = null, System.Collections.Generic.IEnumerable networkTapRuleIds = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, System.Collections.Generic.IEnumerable statements = null, Azure.Core.ResourceIdentifier networkFabricId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.AddressFamilyType? addressFamilyType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.AddressFamilyType?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string annotation, System.Collections.Generic.IEnumerable statements, Azure.Core.ResourceIdentifier networkFabricId, Azure.ResourceManager.ManagedNetworkFabric.Models.AddressFamilyType? addressFamilyType, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState) { throw null; } + public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType? defaultAction = default(Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType?), System.Collections.Generic.IEnumerable statements = null, Azure.Core.ResourceIdentifier networkFabricId = null, Azure.ResourceManager.ManagedNetworkFabric.Models.AddressFamilyType? addressFamilyType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.AddressFamilyType?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState? configurationState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?), Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState? administrativeState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricAdministrativeState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkFabricSkuData NetworkFabricSkuData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricSkuType? typePropertiesType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricSkuType?), int? maxComputeRacks = default(int?), int? maximumServerCount = default(int?), System.Collections.Generic.IEnumerable supportedVersions = null, string details = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkPacketBrokerData NetworkPacketBrokerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.Core.ResourceIdentifier networkFabricId = null, System.Collections.Generic.IEnumerable networkDeviceIds = null, System.Collections.Generic.IEnumerable sourceInterfaceIds = null, System.Collections.Generic.IEnumerable networkTapIds = null, System.Collections.Generic.IEnumerable neighborGroupIds = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } public static Azure.ResourceManager.ManagedNetworkFabric.NetworkRackData NetworkRackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string annotation = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkRackType? networkRackType = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkRackType?), Azure.Core.ResourceIdentifier networkFabricId = null, System.Collections.Generic.IEnumerable networkDevices = null, Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState? provisioningState = default(Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricProvisioningState?)) { throw null; } @@ -1995,6 +2005,7 @@ public NetworkFabricAccessControlListPatch() { } public System.Uri AclsUri { get { throw null; } set { } } public string Annotation { get { throw null; } set { } } public Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkFabricConfigurationType? ConfigurationType { get { throw null; } set { } } + public Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType? DefaultAction { get { throw null; } set { } } public System.Collections.Generic.IList DynamicMatchConfigurations { get { throw null; } } public System.Collections.Generic.IList MatchConfigurations { get { throw null; } } } @@ -2281,6 +2292,7 @@ public NetworkFabricPortCondition(Azure.ResourceManager.ManagedNetworkFabric.Mod public partial class NetworkFabricRoutePolicyPatch : Azure.ResourceManager.ManagedNetworkFabric.Models.NetworkRackPatch { public NetworkFabricRoutePolicyPatch() { } + public Azure.ResourceManager.ManagedNetworkFabric.Models.CommunityActionType? DefaultAction { get { throw null; } set { } } public System.Collections.Generic.IList Statements { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/assets.json b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/assets.json index 3a93462ae797..fe4e54be55b6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/assets.json +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric", - "Tag": "net/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric_258b2481b3" + "Tag": "net/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric_f981f8b3c9" } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs index 8e0c60b163d1..ade400154252 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs @@ -49,6 +49,7 @@ public async Task CreateOrUpdate_AccessControlListsCreateMaximumSetGen() Annotation = "annotation", ConfigurationType = NetworkFabricConfigurationType.File, AclsUri = new Uri("https://ACL-Storage-URL"), + DefaultAction = CommunityActionType.Permit, MatchConfigurations = { new AccessControlListMatchConfiguration() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs index 3398d33a14c3..a2b94adfe760 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs @@ -76,6 +76,7 @@ public async Task Update_AccessControlListsUpdateMaximumSetGen() { ConfigurationType = NetworkFabricConfigurationType.File, AclsUri = new Uri("https://microsoft.com/a"), + DefaultAction = CommunityActionType.Permit, MatchConfigurations = { new AccessControlListMatchConfiguration() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs index 0398a9c3e9b9..cc64b9cbcae4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs @@ -47,6 +47,7 @@ public async Task CreateOrUpdate_RoutePoliciesCreateMaximumSetGen() NetworkFabricRoutePolicyData data = new NetworkFabricRoutePolicyData(new AzureLocation("eastus"), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric")) { Annotation = "annotation", + DefaultAction = CommunityActionType.Deny, Statements = { new RoutePolicyStatementProperties(7,new StatementConditionProperties() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs index 71a2b513d903..a3ffb122d925 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/samples/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs @@ -74,6 +74,7 @@ public async Task Update_RoutePoliciesUpdateMaximumSetGen() // invoke the operation NetworkFabricRoutePolicyPatch patch = new NetworkFabricRoutePolicyPatch() { + DefaultAction = CommunityActionType.Deny, Statements = { new RoutePolicyStatementProperties(7,new StatementConditionProperties() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Azure.ResourceManager.ManagedNetworkFabric.csproj b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Azure.ResourceManager.ManagedNetworkFabric.csproj index 24e9bbc529bf..1e809ae5f7e6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Azure.ResourceManager.ManagedNetworkFabric.csproj +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Azure.ResourceManager.ManagedNetworkFabric.csproj @@ -1,6 +1,6 @@ - 1.1.0-beta.1 + 1.1.0 1.0.0 Azure.ResourceManager.ManagedNetworkFabric diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/ArmManagedNetworkFabricModelFactory.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/ArmManagedNetworkFabricModelFactory.cs new file mode 100644 index 000000000000..1d70f2a3c088 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/ArmManagedNetworkFabricModelFactory.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Net; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Model factory for models. + public static partial class ArmManagedNetworkFabricModelFactory + { + /// + /// This constructor is added for the backward compatibility. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, IEnumerable matchConfigurations, IEnumerable dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkFabricAccessControlListData(id, name, resourceType, systemData, tags, location, annotation, configurationType, aclsUri, null, matchConfigurations?.ToList(), dynamicMatchConfigurations?.ToList(), lastSyncedOn, configurationState, provisioningState, administrativeState); + } + + /// + /// This constructor is added for the backward compatibility + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IEnumerable statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkFabricRoutePolicyData(id, name, resourceType, systemData, tags, location, annotation, null, statements?.ToList(), networkFabricId, addressFamilyType, configurationState, provisioningState, administrativeState); + } + + /// + /// This constructor is added for the backward compatibility + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier internetGatewayRuleId, IPAddress ipv4Address, int? port, InternetGatewayType typePropertiesType, ResourceIdentifier networkFabricControllerId, NetworkFabricProvisioningState? provisioningState) + { + return NetworkFabricInternetGatewayData(id, name, resourceType, systemData, tags, location, annotation, internetGatewayRuleId, ipv4Address, port, typePropertiesType, networkFabricControllerId, provisioningState); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/NetworkFabricInternetGatewayData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/NetworkFabricInternetGatewayData.cs new file mode 100644 index 000000000000..9f465355743e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/NetworkFabricInternetGatewayData.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using System.Net; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + /// + /// A class representing the NetworkFabricInternetGateway data model. + /// The Internet Gateway resource definition. + /// + public partial class NetworkFabricInternetGatewayData : TrackedResourceData + { + + /// IPv4 Address of Internet Gateway. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("IPv4Address is deprecated, use IPV4Address instead")] + public IPAddress IPv4Address { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs index 40e54b433790..a0237269cfdb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs @@ -29,6 +29,7 @@ public static partial class ArmManagedNetworkFabricModelFactory /// Switch configuration description. /// Input method to configure Access Control List. /// Access Control List file URL. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. /// List of match configurations. /// List of dynamic match configurations. /// The last synced timestamp. @@ -36,13 +37,13 @@ public static partial class ArmManagedNetworkFabricModelFactory /// Provisioning state of the resource. /// Administrative state of the resource. /// A new instance for mocking. - public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, NetworkFabricConfigurationType? configurationType = null, Uri aclsUri = null, IEnumerable matchConfigurations = null, IEnumerable dynamicMatchConfigurations = null, DateTimeOffset? lastSyncedOn = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, NetworkFabricConfigurationType? configurationType = null, Uri aclsUri = null, CommunityActionType? defaultAction = null, IEnumerable matchConfigurations = null, IEnumerable dynamicMatchConfigurations = null, DateTimeOffset? lastSyncedOn = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { tags ??= new Dictionary(); matchConfigurations ??= new List(); dynamicMatchConfigurations ??= new List(); - return new NetworkFabricAccessControlListData(id, name, resourceType, systemData, tags, location, annotation, configurationType, aclsUri, matchConfigurations?.ToList(), dynamicMatchConfigurations?.ToList(), lastSyncedOn, configurationState, provisioningState, administrativeState); + return new NetworkFabricAccessControlListData(id, name, resourceType, systemData, tags, location, annotation, configurationType, aclsUri, defaultAction, matchConfigurations?.ToList(), dynamicMatchConfigurations?.ToList(), lastSyncedOn, configurationState, provisioningState, administrativeState); } /// Initializes a new instance of NetworkFabricErrorResult. @@ -81,17 +82,17 @@ public static ValidateConfigurationResult ValidateConfigurationResult(ResponseEr /// The location. /// Switch configuration description. /// ARM Resource ID of the Internet Gateway Rule. - /// IPv4 Address of Internet Gateway. + /// IPv4 Address of Internet Gateway. /// Port number of Internet Gateway. /// Gateway Type of the resource. /// ARM Resource ID of the Network Fabric Controller. /// Provisioning state of resource. /// A new instance for mocking. - public static NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, ResourceIdentifier internetGatewayRuleId = null, IPAddress ipv4Address = null, int? port = null, InternetGatewayType typePropertiesType = default, ResourceIdentifier networkFabricControllerId = null, NetworkFabricProvisioningState? provisioningState = null) + public static NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, ResourceIdentifier internetGatewayRuleId = null, string ipV4Address = null, int? port = null, InternetGatewayType typePropertiesType = default, ResourceIdentifier networkFabricControllerId = null, NetworkFabricProvisioningState? provisioningState = null) { tags ??= new Dictionary(); - return new NetworkFabricInternetGatewayData(id, name, resourceType, systemData, tags, location, annotation, internetGatewayRuleId, ipv4Address, port, typePropertiesType, networkFabricControllerId, provisioningState); + return new NetworkFabricInternetGatewayData(id, name, resourceType, systemData, tags, location, annotation, internetGatewayRuleId, ipV4Address, port, typePropertiesType, networkFabricControllerId, provisioningState); } /// Initializes a new instance of NetworkFabricInternetGatewayRuleData. @@ -786,6 +787,7 @@ public static NetworkTapData NetworkTapData(ResourceIdentifier id = null, string /// The tags. /// The location. /// Switch configuration description. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. /// Route Policy statements. /// Arm Resource ID of Network Fabric. /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. @@ -793,12 +795,12 @@ public static NetworkTapData NetworkTapData(ResourceIdentifier id = null, string /// Provisioning state of the resource. /// Administrative state of the resource. /// A new instance for mocking. - public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, IEnumerable statements = null, ResourceIdentifier networkFabricId = null, AddressFamilyType? addressFamilyType = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, CommunityActionType? defaultAction = null, IEnumerable statements = null, ResourceIdentifier networkFabricId = null, AddressFamilyType? addressFamilyType = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { tags ??= new Dictionary(); statements ??= new List(); - return new NetworkFabricRoutePolicyData(id, name, resourceType, systemData, tags, location, annotation, statements?.ToList(), networkFabricId, addressFamilyType, configurationState, provisioningState, administrativeState); + return new NetworkFabricRoutePolicyData(id, name, resourceType, systemData, tags, location, annotation, defaultAction, statements?.ToList(), networkFabricId, addressFamilyType, configurationState, provisioningState, administrativeState); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs index 743b9cc88793..6f99fdf33086 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs @@ -27,11 +27,11 @@ public AccessControlListMatchCondition() /// List of the protocols that need to be matched. /// Vlan match condition that needs to be matched. /// IP condition that needs to be matched. - /// List of ether type values that needs to be matched. - /// List of IP fragment packets that needs to be matched. - /// List of IP Lengths that needs to be matched. - /// List of TTL [Time To Live] values that needs to be matched. - /// List of DSCP Markings that needs to be matched. + /// List of ether type values that need to be matched. + /// List of IP fragment packets that need to be matched. + /// List of IP Lengths that need to be matched. + /// List of TTL [Time To Live] values that need to be matched. + /// List of DSCP Markings that need to be matched. /// Defines the port condition that needs to be matched. internal AccessControlListMatchCondition(IList protocolTypes, VlanMatchCondition vlanMatchCondition, IPMatchCondition ipCondition, IList etherTypes, IList fragments, IList ipLengths, IList ttlValues, IList dscpMarkings, AccessControlListPortCondition portCondition) : base(protocolTypes, vlanMatchCondition, ipCondition) { @@ -43,15 +43,15 @@ internal AccessControlListMatchCondition(IList protocolTypes, VlanMatchC PortCondition = portCondition; } - /// List of ether type values that needs to be matched. + /// List of ether type values that need to be matched. public IList EtherTypes { get; } - /// List of IP fragment packets that needs to be matched. + /// List of IP fragment packets that need to be matched. public IList Fragments { get; } - /// List of IP Lengths that needs to be matched. + /// List of IP Lengths that need to be matched. public IList IPLengths { get; } - /// List of TTL [Time To Live] values that needs to be matched. + /// List of TTL [Time To Live] values that need to be matched. public IList TtlValues { get; } - /// List of DSCP Markings that needs to be matched. + /// List of DSCP Markings that need to be matched. public IList DscpMarkings { get; } /// Defines the port condition that needs to be matched. public AccessControlListPortCondition PortCondition { get; set; } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs index d7bb3389aeb4..7d13e738185b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs @@ -24,14 +24,14 @@ public AccessControlListPortCondition(Layer4Protocol layer4Protocol) : base(laye /// Port type that needs to be matched. /// Layer4 protocol type that needs to be matched. /// List of the Ports that need to be matched. - /// List of the port Group Names that to be matched. - /// List of protocol flags that needs to be matched. + /// List of the port Group Names that need to be matched. + /// List of protocol flags that need to be matched. internal AccessControlListPortCondition(NetworkFabricPortType? portType, Layer4Protocol layer4Protocol, IList ports, IList portGroupNames, IList flags) : base(portType, layer4Protocol, ports, portGroupNames) { Flags = flags; } - /// List of protocol flags that needs to be matched. + /// List of protocol flags that need to be matched. public IList Flags { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfiguration.cs index 4d42f94fc5c6..dbae634b55e3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfiguration.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfiguration.cs @@ -24,7 +24,7 @@ public CommonDynamicMatchConfiguration() /// Initializes a new instance of CommonDynamicMatchConfiguration. /// List of IP Groups. /// List of vlan groups. - /// List of the port group. + /// List of the port groups. internal CommonDynamicMatchConfiguration(IList ipGroups, IList vlanGroups, IList portGroups) { IPGroups = ipGroups; @@ -36,7 +36,7 @@ internal CommonDynamicMatchConfiguration(IList IPGroups { get; } /// List of vlan groups. public IList VlanGroups { get; } - /// List of the port group. + /// List of the port groups. public IList PortGroups { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchCondition.cs index 8c201ce3d7b5..adb9014672bf 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchCondition.cs @@ -21,9 +21,9 @@ public IPMatchCondition() } /// Initializes a new instance of IPMatchCondition. - /// IP Address type. - /// IP Prefix Type. - /// The list of IP Prefixes. + /// IP Address type that needs to be matched. + /// IP Prefix Type that needs to be matched. + /// The list of IP Prefixes that need to be matched. /// The List of IP Group Names that need to be matched. internal IPMatchCondition(SourceDestinationType? sourceDestinationType, IPMatchConditionPrefixType? prefixType, IList ipPrefixValues, IList ipGroupNames) { @@ -33,11 +33,11 @@ internal IPMatchCondition(SourceDestinationType? sourceDestinationType, IPMatchC IPGroupNames = ipGroupNames; } - /// IP Address type. + /// IP Address type that needs to be matched. public SourceDestinationType? SourceDestinationType { get; set; } - /// IP Prefix Type. + /// IP Prefix Type that needs to be matched. public IPMatchConditionPrefixType? PrefixType { get; set; } - /// The list of IP Prefixes. + /// The list of IP Prefixes that need to be matched. public IList IPPrefixValues { get; } /// The List of IP Group Names that need to be matched. public IList IPGroupNames { get; } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs index d0373c2b166b..2d7008537179 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// IP Prefix Type. + /// IP Prefix Type that needs to be matched. public readonly partial struct IPMatchConditionPrefixType : IEquatable { private readonly string _value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListData.Serialization.cs index c01740219f2c..66b2dc7af684 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListData.Serialization.cs @@ -49,6 +49,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("aclsUrl"u8); writer.WriteStringValue(AclsUri.AbsoluteUri); } + if (Optional.IsDefined(DefaultAction)) + { + writer.WritePropertyName("defaultAction"u8); + writer.WriteStringValue(DefaultAction.Value.ToString()); + } if (Optional.IsCollectionDefined(MatchConfigurations)) { writer.WritePropertyName("matchConfigurations"u8); @@ -88,6 +93,7 @@ internal static NetworkFabricAccessControlListData DeserializeNetworkFabricAcces Optional annotation = default; Optional configurationType = default; Optional aclsUrl = default; + Optional defaultAction = default; Optional> matchConfigurations = default; Optional> dynamicMatchConfigurations = default; Optional lastSyncedTime = default; @@ -171,6 +177,15 @@ internal static NetworkFabricAccessControlListData DeserializeNetworkFabricAcces aclsUrl = new Uri(property0.Value.GetString()); continue; } + if (property0.NameEquals("defaultAction"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAction = new CommunityActionType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("matchConfigurations"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -239,7 +254,7 @@ internal static NetworkFabricAccessControlListData DeserializeNetworkFabricAcces continue; } } - return new NetworkFabricAccessControlListData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, annotation.Value, Optional.ToNullable(configurationType), aclsUrl.Value, Optional.ToList(matchConfigurations), Optional.ToList(dynamicMatchConfigurations), Optional.ToNullable(lastSyncedTime), Optional.ToNullable(configurationState), Optional.ToNullable(provisioningState), Optional.ToNullable(administrativeState)); + return new NetworkFabricAccessControlListData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, annotation.Value, Optional.ToNullable(configurationType), aclsUrl.Value, Optional.ToNullable(defaultAction), Optional.ToList(matchConfigurations), Optional.ToList(dynamicMatchConfigurations), Optional.ToNullable(lastSyncedTime), Optional.ToNullable(configurationState), Optional.ToNullable(provisioningState), Optional.ToNullable(administrativeState)); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs index 75c990045954..00d1e75338da 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs @@ -38,6 +38,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("aclsUrl"u8); writer.WriteStringValue(AclsUri.AbsoluteUri); } + if (Optional.IsDefined(DefaultAction)) + { + writer.WritePropertyName("defaultAction"u8); + writer.WriteStringValue(DefaultAction.Value.ToString()); + } if (Optional.IsCollectionDefined(MatchConfigurations)) { writer.WritePropertyName("matchConfigurations"u8); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs index fb239f671103..3785655914e7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs @@ -25,6 +25,8 @@ public NetworkFabricAccessControlListPatch() public NetworkFabricConfigurationType? ConfigurationType { get; set; } /// Access Control List file URL. public Uri AclsUri { get; set; } + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + public CommunityActionType? DefaultAction { get; set; } /// List of match configurations. public IList MatchConfigurations { get; } /// List of dynamic match configurations. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayData.Serialization.cs index 30ca496fe15a..9967b1804882 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayData.Serialization.cs @@ -6,7 +6,6 @@ #nullable disable using System.Collections.Generic; -using System.Net; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.ManagedNetworkFabric.Models; @@ -66,7 +65,7 @@ internal static NetworkFabricInternetGatewayData DeserializeNetworkFabricInterne Optional systemData = default; Optional annotation = default; Optional internetGatewayRuleId = default; - Optional ipv4Address = default; + Optional ipv4Address = default; Optional port = default; InternetGatewayType type0 = default; ResourceIdentifier networkFabricControllerId = default; @@ -141,11 +140,7 @@ internal static NetworkFabricInternetGatewayData DeserializeNetworkFabricInterne } if (property0.NameEquals("ipv4Address"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ipv4Address = IPAddress.Parse(property0.Value.GetString()); + ipv4Address = property0.Value.GetString(); continue; } if (property0.NameEquals("port"u8)) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs index 362ffd26f6e1..8e7e63827613 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs @@ -26,7 +26,7 @@ public NetworkFabricPortCondition(Layer4Protocol layer4Protocol) /// Port type that needs to be matched. /// Layer4 protocol type that needs to be matched. /// List of the Ports that need to be matched. - /// List of the port Group Names that to be matched. + /// List of the port Group Names that need to be matched. internal NetworkFabricPortCondition(NetworkFabricPortType? portType, Layer4Protocol layer4Protocol, IList ports, IList portGroupNames) { PortType = portType; @@ -41,7 +41,7 @@ internal NetworkFabricPortCondition(NetworkFabricPortType? portType, Layer4Proto public Layer4Protocol Layer4Protocol { get; set; } /// List of the Ports that need to be matched. public IList Ports { get; } - /// List of the port Group Names that to be matched. + /// List of the port Group Names that need to be matched. public IList PortGroupNames { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyData.Serialization.cs index 76dba87b8312..33d0035d025f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyData.Serialization.cs @@ -38,6 +38,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("annotation"u8); writer.WriteStringValue(Annotation); } + if (Optional.IsDefined(DefaultAction)) + { + writer.WritePropertyName("defaultAction"u8); + writer.WriteStringValue(DefaultAction.Value.ToString()); + } if (Optional.IsCollectionDefined(Statements)) { writer.WritePropertyName("statements"u8); @@ -72,6 +77,7 @@ internal static NetworkFabricRoutePolicyData DeserializeNetworkFabricRoutePolicy ResourceType type = default; Optional systemData = default; Optional annotation = default; + Optional defaultAction = default; Optional> statements = default; ResourceIdentifier networkFabricId = default; Optional addressFamilyType = default; @@ -137,6 +143,15 @@ internal static NetworkFabricRoutePolicyData DeserializeNetworkFabricRoutePolicy annotation = property0.Value.GetString(); continue; } + if (property0.NameEquals("defaultAction"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAction = new CommunityActionType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("statements"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -196,7 +211,7 @@ internal static NetworkFabricRoutePolicyData DeserializeNetworkFabricRoutePolicy continue; } } - return new NetworkFabricRoutePolicyData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, annotation.Value, Optional.ToList(statements), networkFabricId, Optional.ToNullable(addressFamilyType), Optional.ToNullable(configurationState), Optional.ToNullable(provisioningState), Optional.ToNullable(administrativeState)); + return new NetworkFabricRoutePolicyData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, annotation.Value, Optional.ToNullable(defaultAction), Optional.ToList(statements), networkFabricId, Optional.ToNullable(addressFamilyType), Optional.ToNullable(configurationState), Optional.ToNullable(provisioningState), Optional.ToNullable(administrativeState)); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs index a804d8963064..ef2e7acf009c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs @@ -28,6 +28,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (Optional.IsDefined(DefaultAction)) + { + writer.WritePropertyName("defaultAction"u8); + writer.WriteStringValue(DefaultAction.Value.ToString()); + } if (Optional.IsCollectionDefined(Statements)) { writer.WritePropertyName("statements"u8); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs index 8ef1a2bb5697..0df61a0772bb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs @@ -19,6 +19,8 @@ public NetworkFabricRoutePolicyPatch() Statements = new ChangeTrackingList(); } + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + public CommunityActionType? DefaultAction { get; set; } /// Route Policy statements. public IList Statements { get; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs index adae87c89dad..3383327467ed 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Encapsulation Type. + /// Encapsulation Type that needs to be matched. public readonly partial struct NetworkTapEncapsulationType : IEquatable { private readonly string _value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs index c890f5b3220d..d13f15216d1c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs @@ -21,7 +21,7 @@ public NetworkTapRuleMatchCondition() /// List of the protocols that need to be matched. /// Vlan match condition that needs to be matched. /// IP condition that needs to be matched. - /// Encapsulation Type. + /// Encapsulation Type that needs to be matched. /// Defines the port condition that needs to be matched. internal NetworkTapRuleMatchCondition(IList protocolTypes, VlanMatchCondition vlanMatchCondition, IPMatchCondition ipCondition, NetworkTapEncapsulationType? encapsulationType, NetworkFabricPortCondition portCondition) : base(protocolTypes, vlanMatchCondition, ipCondition) { @@ -29,7 +29,7 @@ internal NetworkTapRuleMatchCondition(IList protocolTypes, VlanMatchCond PortCondition = portCondition; } - /// Encapsulation Type. + /// Encapsulation Type that needs to be matched. public NetworkTapEncapsulationType? EncapsulationType { get; set; } /// Defines the port condition that needs to be matched. public NetworkFabricPortCondition PortCondition { get; set; } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupProperties.cs index f8eec36b3b26..23e4855f63af 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupProperties.cs @@ -21,7 +21,7 @@ public PortGroupProperties() /// Initializes a new instance of PortGroupProperties. /// The name of the port group. - /// List of the ports that needs to be matched. + /// List of the ports that need to be matched. internal PortGroupProperties(string name, IList ports) { Name = name; @@ -30,7 +30,7 @@ internal PortGroupProperties(string name, IList ports) /// The name of the port group. public string Name { get; set; } - /// List of the ports that needs to be matched. + /// List of the ports that need to be matched. public IList Ports { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs index aa27bd118539..553f9b7c6dd1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// IP Address type. + /// IP Address type that needs to be matched. public readonly partial struct SourceDestinationType : IEquatable { private readonly string _value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs index a915ea6ddabe..287b51a16fd3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// The vlan match conditions that needs to be matched. + /// The vlan match conditions that need to be matched. public partial class VlanMatchCondition { /// Initializes a new instance of VlanMatchCondition. @@ -22,9 +22,9 @@ public VlanMatchCondition() } /// Initializes a new instance of VlanMatchCondition. - /// List of vlans that needs to be matched. - /// List of inner vlans that needs to be matched. - /// List of vlan group names that to be matched. + /// List of vlans that need to be matched. + /// List of inner vlans that need to be matched. + /// List of vlan group names that need to be matched. internal VlanMatchCondition(IList vlans, IList innerVlans, IList vlanGroupNames) { Vlans = vlans; @@ -32,11 +32,11 @@ internal VlanMatchCondition(IList vlans, IList innerVlans, IList VlanGroupNames = vlanGroupNames; } - /// List of vlans that needs to be matched. + /// List of vlans that need to be matched. public IList Vlans { get; } - /// List of inner vlans that needs to be matched. + /// List of inner vlans that need to be matched. public IList InnerVlans { get; } - /// List of vlan group names that to be matched. + /// List of vlan group names that need to be matched. public IList VlanGroupNames { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs index b6f4ddc18a91..2126ef5e3394 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs @@ -37,17 +37,19 @@ public NetworkFabricAccessControlListData(AzureLocation location) : base(locatio /// Switch configuration description. /// Input method to configure Access Control List. /// Access Control List file URL. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. /// List of match configurations. /// List of dynamic match configurations. /// The last synced timestamp. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. - internal NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, IList matchConfigurations, IList dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, CommunityActionType? defaultAction, IList matchConfigurations, IList dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) : base(id, name, resourceType, systemData, tags, location) { Annotation = annotation; ConfigurationType = configurationType; AclsUri = aclsUri; + DefaultAction = defaultAction; MatchConfigurations = matchConfigurations; DynamicMatchConfigurations = dynamicMatchConfigurations; LastSyncedOn = lastSyncedOn; @@ -62,6 +64,8 @@ internal NetworkFabricAccessControlListData(ResourceIdentifier id, string name, public NetworkFabricConfigurationType? ConfigurationType { get; set; } /// Access Control List file URL. public Uri AclsUri { get; set; } + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + public CommunityActionType? DefaultAction { get; set; } /// List of match configurations. public IList MatchConfigurations { get; } /// List of dynamic match configurations. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs index f91d6b851cc1..13ebd1638008 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Net; using Azure.Core; using Azure.ResourceManager.ManagedNetworkFabric.Models; using Azure.ResourceManager.Models; @@ -42,16 +41,16 @@ public NetworkFabricInternetGatewayData(AzureLocation location, InternetGatewayT /// The location. /// Switch configuration description. /// ARM Resource ID of the Internet Gateway Rule. - /// IPv4 Address of Internet Gateway. + /// IPv4 Address of Internet Gateway. /// Port number of Internet Gateway. /// Gateway Type of the resource. /// ARM Resource ID of the Network Fabric Controller. /// Provisioning state of resource. - internal NetworkFabricInternetGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier internetGatewayRuleId, IPAddress ipv4Address, int? port, InternetGatewayType typePropertiesType, ResourceIdentifier networkFabricControllerId, NetworkFabricProvisioningState? provisioningState) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricInternetGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier internetGatewayRuleId, string ipV4Address, int? port, InternetGatewayType typePropertiesType, ResourceIdentifier networkFabricControllerId, NetworkFabricProvisioningState? provisioningState) : base(id, name, resourceType, systemData, tags, location) { Annotation = annotation; InternetGatewayRuleId = internetGatewayRuleId; - IPv4Address = ipv4Address; + IPV4Address = ipV4Address; Port = port; TypePropertiesType = typePropertiesType; NetworkFabricControllerId = networkFabricControllerId; @@ -63,7 +62,7 @@ internal NetworkFabricInternetGatewayData(ResourceIdentifier id, string name, Re /// ARM Resource ID of the Internet Gateway Rule. public ResourceIdentifier InternetGatewayRuleId { get; set; } /// IPv4 Address of Internet Gateway. - public IPAddress IPv4Address { get; } + public string IPV4Address { get; } /// Port number of Internet Gateway. public int? Port { get; } /// Gateway Type of the resource. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs index 97d61245d7c7..8c6fff08dbfc 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs @@ -39,15 +39,17 @@ public NetworkFabricRoutePolicyData(AzureLocation location, ResourceIdentifier n /// The tags. /// The location. /// Switch configuration description. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. /// Route Policy statements. /// Arm Resource ID of Network Fabric. /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. - internal NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IList statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, CommunityActionType? defaultAction, IList statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) : base(id, name, resourceType, systemData, tags, location) { Annotation = annotation; + DefaultAction = defaultAction; Statements = statements; NetworkFabricId = networkFabricId; AddressFamilyType = addressFamilyType; @@ -58,6 +60,8 @@ internal NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, Resour /// Switch configuration description. public string Annotation { get; set; } + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + public CommunityActionType? DefaultAction { get; set; } /// Route Policy statements. public IList Statements { get; } /// Arm Resource ID of Network Fabric. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md index 8ca7b6dad0dd..c190a67fc379 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: Azure.ResourceManager.ManagedNetworkFabric namespace: Azure.ResourceManager.ManagedNetworkFabric -require: https://github.com/Azure/azure-rest-api-specs/blob/0691ac4b0e05c8ca3bde2f8a33f036c12282fa25/specification/managednetworkfabric/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/managednetworkfabric/resource-manager/readme.md #tag: package-2023-06-15 output-folder: $(this-folder)/Generated clear-output-folder: true @@ -63,7 +63,7 @@ rename-mapping: ExternalNetwork.properties.networkToNetworkInterconnectId: -|arm-id InternalNetwork: NetworkFabricInternalNetwork InternetGateway: NetworkFabricInternetGateway - InternetGateway.properties.ipv4Address: -|ip-address + InternetGateway.properties.ipv4Address: IpV4Address InternetGatewayRule: NetworkFabricInternetGatewayRule InternetGatewayRule.properties.internetGatewayIds: -|arm-id IpCommunity: NetworkFabricIpCommunity diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/ManagedNetworkFabricManagementTestEnvironment.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/ManagedNetworkFabricManagementTestEnvironment.cs index d713610487d7..d6110c2639ed 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/ManagedNetworkFabricManagementTestEnvironment.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/ManagedNetworkFabricManagementTestEnvironment.cs @@ -130,10 +130,44 @@ public class ManagedNetworkFabricManagementTestEnvironment : TestEnvironment public string ExternalNetworkName => GetRecordedVariable("EXTERNAL_NETWORK_NAME"); /// - /// The name of the External Network to be used for playback tests. Recorded. + /// The name of the Internet Gateway to be used for playback tests. Recorded. /// public string InternetGatewayName => GetRecordedVariable("INTERNET_GATEWAY_NAME"); + /// + /// The name of the Internet Gateway Rule to be used for playback tests. Recorded. + /// + public string InternetGatewayRuleName => GetRecordedVariable("INTERNET_GATEWAY_RULE_NAME"); + + /// + /// The name of the Access Control List to be used for playback tests. Recorded. + /// + public string AccessControlListName => GetRecordedVariable("ACCESS_CONTROL_LIST_NAME"); + + /// + /// The name of the Network Packet Broker to be used for playback tests. Recorded. + /// + public string NetworkPacketBrokerName => GetRecordedVariable("NETWORK_PACKET_BROKER_NAME"); + + /// + /// The name of the Network Tap Rule to be used for playback tests. Recorded. + /// + public string NetworkTapRuleName => GetRecordedVariable("NETWORK_TAP_RULE_NAME"); + + /// + /// The name of the Network Tap to be used for playback tests. Recorded. + /// + public string NetworkTapName => GetRecordedVariable("NETWORK_TAP_NAME"); + + /// + /// The name of the Neighbor Group to be used for playback tests. Recorded. + /// + public string NeighborGroupName => GetRecordedVariable("NEIGHBOR_GROUP_NAME"); + + /// + /// The name of the Existing Network Fabric to be used for playback tests. Recorded. + /// + public string ExistingNetworkFabricName => GetRecordedVariable("EXISTING_NETWORK_FABRIC_NAME"); // Support using the Default Credential created by Azure CLI so // that we don't have to support creating a service principal, etc. to run these tests. public override TokenCredential Credential diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/AccessControlListTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/AccessControlListTests.cs new file mode 100644 index 000000000000..df13ec21da21 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/AccessControlListTests.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Tests.Scenario +{ + public class AccessControlListTests : ManagedNetworkFabricManagementTestBase + { + public AccessControlListTests(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) { } + public AccessControlListTests(bool isAsync) : base(isAsync) { } + + [Test] + [RecordedTest] + [AsyncOnly] + public async Task AccessControlList() + { + TestContext.Out.WriteLine($"Entered into the AccessControlList tests...."); + TestContext.Out.WriteLine($"Provided TestEnvironment.AccessControlListName name : {TestEnvironment.AccessControlListName}"); + ResourceIdentifier accessControlListResourceId = NetworkFabricAccessControlListResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName, TestEnvironment.AccessControlListName); + TestContext.Out.WriteLine($"accessControlListResourceId: {accessControlListResourceId}"); + TestContext.Out.WriteLine($"AccessControlList Test started....."); + NetworkFabricAccessControlListCollection collection = ResourceGroupResource.GetNetworkFabricAccessControlLists(); + + // Create + TestContext.Out.WriteLine($"PUT started....."); + NetworkFabricAccessControlListData data = new NetworkFabricAccessControlListData(new AzureLocation("eastUs")) + { + Annotation = "annotation", + ConfigurationType = NetworkFabricConfigurationType.File, + AclsUri = new Uri("https://ACL-Storage-URL"), + DefaultAction = CommunityActionType.Permit, + MatchConfigurations = + { + new AccessControlListMatchConfiguration() + { + MatchConfigurationName = "example-match", + SequenceNumber = 123, + IPAddressType = NetworkFabricIPAddressType.IPv4, + MatchConditions = + { + new AccessControlListMatchCondition() + { + EtherTypes = + { + "0x1" + }, + Fragments = + { + "0xff00-0xffff" + }, + IPLengths = + { + "4094-9214" + }, + TtlValues = + { + "23" + }, + DscpMarkings = + { + "32" + }, + PortCondition = new AccessControlListPortCondition(Layer4Protocol.Tcp) + { + Flags = + { + "established" + }, + PortType = NetworkFabricPortType.SourcePort, + Ports = + { + "1-20" + }, + PortGroupNames = + { + "example-portGroup" + }, + }, + ProtocolTypes = + { + "TCP" + }, + VlanMatchCondition = new VlanMatchCondition() + { + Vlans = + { + "20-30" + }, + InnerVlans = + { + "30" + }, + VlanGroupNames = + { + "example-vlanGroup" + }, + }, + IPCondition = new IPMatchCondition() + { + SourceDestinationType = SourceDestinationType.SourceIP, + PrefixType = IPMatchConditionPrefixType.Prefix, + IPPrefixValues = + { + "10.20.20.20/12" + }, + IPGroupNames = + { + "example-ipGroup" + }, + }, + } + }, + Actions = + { + new AccessControlListAction() + { + AclActionType = AclActionType.Count, + CounterName = "example-counter", + } + }, + } + }, + DynamicMatchConfigurations = + { + new CommonDynamicMatchConfiguration() + { + IPGroups = + { + new MatchConfigurationIPGroupProperties() + { + Name = "example-ipGroup", + IPAddressType = NetworkFabricIPAddressType.IPv4, + IPPrefixes = + { + "10.20.3.1/20" + }, + } + }, + VlanGroups = + { + new VlanGroupProperties() + { + Name = "example-vlanGroup", + Vlans = + { + "20-30" + }, + } + }, + PortGroups = + { + new PortGroupProperties() + { + Name = "example-portGroup", + Ports = + { + "100-200" + }, + } + }, + } + }, + Tags = + { + ["keyID"] = "KeyValue", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, TestEnvironment.AccessControlListName, data); + NetworkFabricAccessControlListResource createResult = lro.Value; + Assert.AreEqual(createResult.Data.Name, TestEnvironment.AccessControlListName); + + NetworkFabricAccessControlListResource accessControlList = Client.GetNetworkFabricAccessControlListResource(accessControlListResourceId); + + // Get + TestContext.Out.WriteLine($"GET started....."); + NetworkFabricAccessControlListResource getResult = await accessControlList.GetAsync(); + TestContext.Out.WriteLine($"{getResult}"); + Assert.AreEqual(getResult.Data.Name, TestEnvironment.AccessControlListName); + + // Patch not supported now. Will enable it once supported. + /* + NetworkFabricAccessControlListPatch patch = new NetworkFabricAccessControlListPatch() + { + ConfigurationType = NetworkFabricConfigurationType.File, + AclsUri = new Uri("https://microsoft.com/a"), + DefaultAction = CommunityActionType.Permit, + MatchConfigurations = + { + new AccessControlListMatchConfiguration() + { + MatchConfigurationName = "example-match", + SequenceNumber = 123, + IPAddressType = NetworkFabricIPAddressType.IPv4, + MatchConditions = + { + new AccessControlListMatchCondition() + { + EtherTypes = + { + "0x1" + }, + Fragments = + { + "0xff00-0xffff" + }, + IPLengths = + { + "4094-9214" + }, + TtlValues = + { + "23" + }, + DscpMarkings = + { + "32" + }, + PortCondition = new AccessControlListPortCondition(Layer4Protocol.Tcp) + { + Flags = + { + "established" + }, + PortType = NetworkFabricPortType.SourcePort, + Ports = + { + "1-20" + }, + PortGroupNames = + { + "example-portGroup" + }, + }, + ProtocolTypes = + { + "TCP" + }, + VlanMatchCondition = new VlanMatchCondition() + { + Vlans = + { + "20-30" + }, + InnerVlans = + { + "30" + }, + VlanGroupNames = + { + "example-vlanGroup" + }, + }, + IPCondition = new IPMatchCondition() + { + SourceDestinationType = SourceDestinationType.SourceIP, + PrefixType = IPMatchConditionPrefixType.Prefix, + IPPrefixValues = + { + "10.20.20.20/12" + }, + IPGroupNames = + { + "example-ipGroup" + }, + }, + } + }, + Actions = + { + new AccessControlListAction() + { + AclActionType = AclActionType.Count, + CounterName = "example-counter", + } + }, + } + }, + DynamicMatchConfigurations = + { + new CommonDynamicMatchConfiguration() + { + IPGroups = + { + new MatchConfigurationIPGroupProperties() + { + Name = "example-ipGroup", + IPAddressType = NetworkFabricIPAddressType.IPv4, + IPPrefixes = + { + "10.20.3.1/20" + }, + } + }, + VlanGroups = + { + new VlanGroupProperties() + { + Name = "example-vlanGroup", + Vlans = + { + "20-30" + }, + } + }, + PortGroups = + { + new PortGroupProperties() + { + Name = "example-portGroup", + Ports = + { + "100-200" + }, + } + }, + } + }, + Annotation = "annotation", + Tags = + { + ["keyID2"] = "KeyValue", + }, + }; + ArmOperation lroPatch = await accessControlList.UpdateAsync(WaitUntil.Completed, patch); + NetworkFabricAccessControlListResource result = lroPatch.Value; + NetworkFabricAccessControlListData resourcePatchData = result.Data; + Assert.IsTrue(resourcePatchData.Tags.Keys.Contains("keyID2")); + */ + + // List + TestContext.Out.WriteLine($"GET - List by Resource Group started....."); + var listByResourceGroup = new List(); + await foreach (NetworkFabricAccessControlListResource item in collection.GetAllAsync()) + { + listByResourceGroup.Add(item); + } + Assert.IsNotEmpty(listByResourceGroup); + + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + await foreach (NetworkFabricAccessControlListResource item in subscriptionResource.GetNetworkFabricAccessControlListsAsync()) + { + NetworkFabricAccessControlListData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + + // Delete + TestContext.Out.WriteLine($"DELETE started....."); + var deleteResponse = await accessControlList.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteResponse.HasCompleted); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/InternetGatewayRuleTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/InternetGatewayRuleTests.cs new file mode 100644 index 000000000000..0a2c15b5adf5 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/InternetGatewayRuleTests.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Tests.Scenario +{ + public class InternetGatewayRuleTests : ManagedNetworkFabricManagementTestBase + { + public InternetGatewayRuleTests(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) { } + public InternetGatewayRuleTests(bool isAsync) : base(isAsync) { } + + [Test] + [RecordedTest] + [AsyncOnly] + public async Task InternetGatewayRules_Operations() + { + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName); + ResourceGroupResource resourceGroupResource = Client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NetworkFabricInternetGatewayRuleResource + NetworkFabricInternetGatewayRuleCollection collection = resourceGroupResource.GetNetworkFabricInternetGatewayRules(); + + // invoke the create operation + NetworkFabricInternetGatewayRuleData data = + new NetworkFabricInternetGatewayRuleData(new AzureLocation(TestEnvironment.Location), new InternetGatewayRules(InternetGatewayRuleAction.Allow, new string[] { "10.10.10.10" })) + { + Annotation = "annotationValue", + Tags = + { + ["keyID"] = "keyValue", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, TestEnvironment.InternetGatewayRuleName, data); + NetworkFabricInternetGatewayRuleResource result = lro.Value; + NetworkFabricInternetGatewayRuleData resourceData = result.Data; + Assert.AreEqual(resourceData.Name, TestEnvironment.InternetGatewayRuleName); + TestContext.Out.WriteLine($"Create operation succeeded on id: {resourceData.Id}"); + + // invoke the get operation + result = await collection.GetAsync(TestEnvironment.InternetGatewayRuleName); + + resourceData = result.Data; + Assert.AreEqual(resourceData.Name, TestEnvironment.InternetGatewayRuleName); + TestContext.Out.WriteLine($"Get Operation succeeded on id: {resourceData.Id}"); + + /* + //invoke the update operation + ResourceIdentifier networkFabricInternetGatewayRuleResourceId = NetworkFabricInternetGatewayRuleResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName, TestEnvironment.InternetGatewayRuleName); + NetworkFabricInternetGatewayRuleResource networkFabricInternetGatewayRule = Client.GetNetworkFabricInternetGatewayRuleResource(networkFabricInternetGatewayRuleResourceId); + NetworkFabricInternetGatewayRulePatch patch = new NetworkFabricInternetGatewayRulePatch() + { + Tags = + { + ["key3311"] = "1234", + }, + }; + ArmOperation patchlro = await networkFabricInternetGatewayRule.UpdateAsync(WaitUntil.Completed, patch); + NetworkFabricInternetGatewayRuleResource patchResult = patchlro.Value; + NetworkFabricInternetGatewayRuleData patchResourceData = patchResult.Data; + Assert.True(patchResult.Data.Tags.ContainsKey("key3311")); + + TestContext.Out.WriteLine($"Patch operation succeeded on id: {patchResourceData.Id}"); + */ + + // invoke the list by group operation and iterate over the result + await foreach (NetworkFabricInternetGatewayRuleResource item in collection.GetAllAsync()) + { + resourceData = item.Data; + TestContext.Out.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + TestContext.Out.WriteLine($"List by resource group operation succeeded."); + + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the list by subscription operation and iterate over the result + await foreach (NetworkFabricInternetGatewayRuleResource item in subscriptionResource.GetNetworkFabricInternetGatewayRulesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkFabricInternetGatewayRuleData listResourceData = item.Data; + // for demo we just print out the id + TestContext.Out.WriteLine($"Succeeded on id: {listResourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by subscription operation succeeded."); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/InternetGatewayTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/InternetGatewayTests.cs index e554ed6b886d..a14b82584cba 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/InternetGatewayTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/InternetGatewayTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagedNetworkFabric.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -18,9 +19,30 @@ public InternetGatewayTests(bool isAsync) : base(isAsync) { } [Test] [RecordedTest] [AsyncOnly] - public async Task InternetGateways_List() + public async Task InternetGateways_Operations() { - TestContext.Out.WriteLine($"Entered into the InternetGateway tests...."); + TestContext.Out.WriteLine($"Entered into the Internet Gateway tests...."); + + ResourceIdentifier networkFabricInternetGatewayResourceId = NetworkFabricInternetGatewayResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.NFCResourceGroupName, TestEnvironment.InternetGatewayName); + NetworkFabricInternetGatewayResource networkFabricInternetGateway = Client.GetNetworkFabricInternetGatewayResource(networkFabricInternetGatewayResourceId); + + // invoke the get operation + NetworkFabricInternetGatewayResource result = await networkFabricInternetGateway.GetAsync(); + NetworkFabricInternetGatewayData resourceData = result.Data; + Assert.IsNotNull(resourceData); + Assert.AreEqual(resourceData.Name, TestEnvironment.InternetGatewayName); + TestContext.Out.WriteLine($"Get Operation Succeeded on id: {resourceData.Id}"); + + TestContext.Out.WriteLine($"Entered into the Internet Gateway update"); + NetworkFabricInternetGatewayPatch patch = new NetworkFabricInternetGatewayPatch() + { + InternetGatewayRuleId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetgatewayrule"), + }; + ArmOperation lro = await networkFabricInternetGateway.UpdateAsync(WaitUntil.Completed, patch); + NetworkFabricInternetGatewayResource result1 = lro.Value; + NetworkFabricInternetGatewayData resourceData1 = result1.Data; + TestContext.Out.WriteLine($"Update succeeded on id: {resourceData1.Id}"); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName); ResourceGroupResource resourceGroupResource = Client.GetResourceGroupResource(resourceGroupResourceId); @@ -30,10 +52,11 @@ public async Task InternetGateways_List() // invoke the operation and iterate over the result await foreach (NetworkFabricInternetGatewayResource item in collection.GetAllAsync()) { - NetworkFabricInternetGatewayData resourceData = item.Data; + NetworkFabricInternetGatewayData listResourceData = item.Data; + Console.Out.WriteLine($"Succeeded on id: {listResourceData.Id}"); } - Console.WriteLine($"Succeeded"); + TestContext.Out.WriteLine($"List by Subscription Succeeded."); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpCommunityTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpCommunityTests.cs index 6ccd66444344..52b3f068965c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpCommunityTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpCommunityTests.cs @@ -73,6 +73,19 @@ public async Task IpCommunitiesCRUD() } Assert.IsNotEmpty(listByResourceGroup); + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricIPCommunityResource item in subscriptionResource.GetNetworkFabricIPCommunitiesAsync()) + { + NetworkFabricIPCommunityData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Delete TestContext.Out.WriteLine($"DELETE started....."); ArmOperation deleteResponse = await ipCommunity.DeleteAsync(WaitUntil.Completed); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpExtendedCommunityTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpExtendedCommunityTests.cs index 84f2c8479d0e..0f65f028e28d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpExtendedCommunityTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpExtendedCommunityTests.cs @@ -64,6 +64,20 @@ public async Task IpExtendedCommunities() } Assert.IsNotEmpty(listByResourceGroup); + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricIPExtendedCommunityResource item in subscriptionResource.GetNetworkFabricIPExtendedCommunitiesAsync()) + { + NetworkFabricIPExtendedCommunityData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Delete TestContext.Out.WriteLine($"DELETE started....."); var deleteResponse = await ipExtendedCommunity.DeleteAsync(WaitUntil.Completed); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpPrefixTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpPrefixTests.cs index 1b2419ed1c4c..9d9c63266323 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpPrefixTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/IpPrefixTests.cs @@ -73,6 +73,20 @@ public async Task IpPrefixes() } Assert.IsNotEmpty(listByResourceGroup); + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricIPPrefixResource item in subscriptionResource.GetNetworkFabricIPPrefixesAsync()) + { + NetworkFabricIPPrefixData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Delete TestContext.Out.WriteLine($"DELETE started....."); var deleteResponse = await ipPrefix.DeleteAsync(WaitUntil.Completed); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L2IsolationDomainTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L2IsolationDomainTests.cs index 7bccf155bdf5..f7a5b9e4e29c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L2IsolationDomainTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L2IsolationDomainTests.cs @@ -68,6 +68,20 @@ public async Task L2IsolationDomains() } Assert.IsNotEmpty(listByResourceGroup); + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricL2IsolationDomainResource item in subscriptionResource.GetNetworkFabricL2IsolationDomainsAsync()) + { + NetworkFabricL2IsolationDomainData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Update Admin State TestContext.Out.WriteLine($"POST started....."); UpdateAdministrativeStateContent triggerEnable = new UpdateAdministrativeStateContent() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L3IsolationDomainTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L3IsolationDomainTests.cs index 09de97896bff..aaee41544e99 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L3IsolationDomainTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/L3IsolationDomainTests.cs @@ -75,6 +75,20 @@ public async Task L3IsolationDomains() } Assert.IsNotEmpty(listByResourceGroup); + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricL3IsolationDomainResource item in subscriptionResource.GetNetworkFabricL3IsolationDomainsAsync()) + { + NetworkFabricL3IsolationDomainData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Delete TestContext.Out.WriteLine($"DELETE started....."); ArmOperation deleteResponse = await l3IsolationDomain.DeleteAsync(WaitUntil.Completed); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NeighborGroupTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NeighborGroupTests.cs new file mode 100644 index 000000000000..972abaa1a24a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NeighborGroupTests.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Tests.Scenario +{ + public class NeighborGroupTests : ManagedNetworkFabricManagementTestBase + { + public NeighborGroupTests(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) { } + public NeighborGroupTests(bool isAsync) : base(isAsync) { } + + [Test] + [RecordedTest] + [AsyncOnly] + public async Task NeighborGroup() + { + TestContext.Out.WriteLine($"Entered into the NeighborGroup tests...."); + TestContext.Out.WriteLine($"Provided TestEnvironment.NeighborGroupName name : {TestEnvironment.NeighborGroupName}"); + ResourceIdentifier neighborGroupResourceId = NetworkFabricNeighborGroupResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName, TestEnvironment.NeighborGroupName); + TestContext.Out.WriteLine($"neighborGroupResourceId: {neighborGroupResourceId}"); + TestContext.Out.WriteLine($"NeighborGroup Test started....."); + NetworkFabricNeighborGroupCollection collection = ResourceGroupResource.GetNetworkFabricNeighborGroups(); + + // Create + TestContext.Out.WriteLine($"PUT started....."); + NetworkFabricNeighborGroupData data = new NetworkFabricNeighborGroupData(new AzureLocation("eastus")) + { + Annotation = "annotation", + Destination = new NeighborGroupDestination() + { + IPv4Addresses = + { + IPAddress.Parse("10.10.10.10"),IPAddress.Parse("20.10.10.10"),IPAddress.Parse("30.10.10.10"),IPAddress.Parse("40.10.10.10"),IPAddress.Parse("50.10.10.10"),IPAddress.Parse("60.10.10.10"),IPAddress.Parse("70.10.10.10"),IPAddress.Parse("80.10.10.10"),IPAddress.Parse("90.10.10.10") + }, + IPv6Addresses = + { + "2F::/100" + }, + }, + Tags = + { + ["key8107"] = "1234", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, TestEnvironment.NeighborGroupName, data); + NetworkFabricNeighborGroupResource result = lro.Value; + NetworkFabricNeighborGroupData resourceData = result.Data; + Assert.AreEqual(resourceData.Name, TestEnvironment.NeighborGroupName); + + // Update + NetworkFabricNeighborGroupPatch patch = new NetworkFabricNeighborGroupPatch() + { + Annotation = "Updating", + Destination = new NeighborGroupDestination() + { + IPv4Addresses = + { + IPAddress.Parse("10.10.10.10"),IPAddress.Parse("20.10.10.10"),IPAddress.Parse("30.10.10.10"),IPAddress.Parse("40.10.10.10"),IPAddress.Parse("50.10.10.10"),IPAddress.Parse("60.10.10.10"),IPAddress.Parse("70.10.10.10"),IPAddress.Parse("80.10.10.10"),IPAddress.Parse("90.10.10.10") + }, + IPv6Addresses = + { + "2F::/100", "3F::/100" + }, + }, + Tags = + { + ["key6025"] = "2345", + }, + }; + NetworkFabricNeighborGroupResource networkFabricNeighborGroup = Client.GetNetworkFabricNeighborGroupResource(resourceData.Id); + TestContext.Out.WriteLine($"PATCH - test started."); + ArmOperation lroPatch = await networkFabricNeighborGroup.UpdateAsync(WaitUntil.Completed, patch); + NetworkFabricNeighborGroupResource resultPatch = lroPatch.Value; + NetworkFabricNeighborGroupData resourcePatchData = resultPatch.Data; + Assert.AreEqual(resourcePatchData.Destination.IPv6Addresses.Count, 2); + TestContext.Out.WriteLine($"PATCH - test completed."); + + NetworkFabricNeighborGroupResource ntpResource = Client.GetNetworkFabricNeighborGroupResource(neighborGroupResourceId); + // Get + TestContext.Out.WriteLine($"GET started....."); + NetworkFabricNeighborGroupResource getResult = await ntpResource.GetAsync(); + TestContext.Out.WriteLine($"{getResult}"); + Assert.AreEqual(getResult.Data.Name, TestEnvironment.NeighborGroupName); + + // List + TestContext.Out.WriteLine($"GET - List by Resource Group started....."); + var listByResourceGroup = new List(); + await foreach (NetworkFabricNeighborGroupResource item in collection.GetAllAsync()) + { + listByResourceGroup.Add(item); + } + Assert.IsNotEmpty(listByResourceGroup); + + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + await foreach (NetworkFabricNeighborGroupResource item in subscriptionResource.GetNetworkFabricNeighborGroupsAsync()) + { + TestContext.WriteLine($"Succeeded on id: {item.Id}"); + } + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + + // Delete + TestContext.Out.WriteLine($"DELETE started....."); + var deleteResponse = await networkFabricNeighborGroup.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteResponse.HasCompleted); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkDeviceTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkDeviceTests.cs index a228e9f93a0b..0312eb43d828 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkDeviceTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkDeviceTests.cs @@ -48,6 +48,20 @@ public async Task NetworkDevices() } Assert.IsNotEmpty(listByResourceGroup); + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkDeviceResource item in subscriptionResource.GetNetworkDevicesAsync()) + { + NetworkDeviceData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Update Serial Number NetworkDevicePatch patch = new NetworkDevicePatch() { diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricControllerTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricControllerTests.cs index 74e38b840227..6d142444fc04 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricControllerTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricControllerTests.cs @@ -56,8 +56,8 @@ public async Task NetworkFabricControllers() }, ManagedResourceGroupConfiguration = new ManagedResourceGroupConfiguration() { - Name = "managedResourceGroupName", - Location = new AzureLocation("eastus"), + Name = TestEnvironment.NetworkFabricControllerName + "-mrg", + Location = new AzureLocation(TestEnvironment.Location), }, IsWorkloadManagementNetworkEnabled = IsWorkloadManagementNetworkEnabled.True, IPv4AddressSpace = "172.253.0.0/19", @@ -83,6 +83,20 @@ public async Task NetworkFabricControllers() listByResourceGroup.Add(item); } + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricControllerResource item in subscriptionResource.GetNetworkFabricControllersAsync()) + { + NetworkFabricControllerData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Delete TestContext.Out.WriteLine($"DELETE started....."); ArmOperation deleteResponse = await networkFabricController.DeleteAsync(WaitUntil.Completed); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricTests.cs index 11c1d7264e9d..d2860b534efc 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkFabricTests.cs @@ -163,16 +163,34 @@ public async Task NetworkFabrics() } Assert.IsNotEmpty(listByResourceGroup); + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricResource item in subscriptionResource.GetNetworkFabricsAsync()) + { + NetworkFabricData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + + ResourceIdentifier networkFabricResourceId2 = NetworkFabricResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName, TestEnvironment.ExistingNetworkFabricName); + TestContext.Out.WriteLine($"networkFabricId: {networkFabricResourceId2}"); + NetworkFabricResource networkFabric2 = Client.GetNetworkFabricResource(networkFabricResourceId2); + // provision TestContext.Out.WriteLine($"POST - Provision started....."); - ArmOperation triggerProvision = await networkFabric.ProvisionAsync(WaitUntil.Completed); + ArmOperation triggerProvision = await networkFabric2.ProvisionAsync(WaitUntil.Completed); DeviceUpdateCommonPostActionResult triggerProvisionResult = triggerProvision.Value; - Console.WriteLine(triggerProvisionResult); + TestContext.Out.WriteLine(triggerProvisionResult); // Deprovision TestContext.Out.WriteLine($"POST - Deprovision started....."); - ArmOperation deProvisionResponse = await networkFabric.DeprovisionAsync(WaitUntil.Completed); - Console.WriteLine(triggerProvisionResult); + ArmOperation deProvisionResponse = await networkFabric2.DeprovisionAsync(WaitUntil.Completed); + TestContext.Out.WriteLine(deProvisionResponse); // Delete TestContext.Out.WriteLine($"DELETE started....."); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkPacketBrokerTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkPacketBrokerTests.cs new file mode 100644 index 000000000000..181e0b62eef0 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkPacketBrokerTests.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Tests.Scenario +{ + public class NetworkPacketBrokerTests : ManagedNetworkFabricManagementTestBase + { + public NetworkPacketBrokerTests(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) { } + public NetworkPacketBrokerTests(bool isAsync) : base(isAsync) { } + + [Test] + [RecordedTest] + [AsyncOnly] + public async Task NetworkPacketBroker() + { + TestContext.Out.WriteLine($"Entered into the NetworkPacketBroker tests...."); + TestContext.Out.WriteLine($"Provided TestEnvironment.NetworkPacketBrokerName name : {TestEnvironment.NetworkPacketBrokerName}"); + + ResourceIdentifier networkPacketBrokerResourceId = NetworkPacketBrokerResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName, TestEnvironment.NetworkPacketBrokerName); + TestContext.Out.WriteLine($"networkPacketBrokerResourceId: {networkPacketBrokerResourceId}"); + TestContext.Out.WriteLine($"NetworkPacketBroker Test started....."); + + // Get individual resource details by name + NetworkPacketBrokerResource networkPacketBroker = Client.GetNetworkPacketBrokerResource(networkPacketBrokerResourceId); + NetworkPacketBrokerResource result = await networkPacketBroker.GetAsync(); + NetworkPacketBrokerData networkPacketBrokerData = result.Data; + TestContext.Out.WriteLine($"Succeeded on id: {networkPacketBrokerData.Id}"); + + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName); + ResourceGroupResource resourceGroupResource = Client.GetResourceGroupResource(resourceGroupResourceId); + NetworkPacketBrokerCollection collection = resourceGroupResource.GetNetworkPacketBrokers(); + // List by Resource + TestContext.Out.WriteLine($"GET - List by Resource Group started....."); + var listByResourceGroup = new List(); + await foreach (NetworkPacketBrokerResource item in collection.GetAllAsync()) + { + listByResourceGroup.Add(item); + } + Assert.IsNotEmpty(listByResourceGroup); + + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + await foreach (NetworkPacketBrokerResource resourceData in subscriptionResource.GetNetworkPacketBrokersAsync()) + { + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkRackTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkRackTests.cs index 513409eee7f5..b17da4223194 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkRackTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkRackTests.cs @@ -48,6 +48,20 @@ public async Task NetworkRacks() listByResourceGroup.Add(item); } Assert.IsNotEmpty(listByResourceGroup); + + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkRackResource item in subscriptionResource.GetNetworkRacksAsync()) + { + NetworkRackData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkTapRuleTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkTapRuleTests.cs new file mode 100644 index 000000000000..b662bca7c141 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkTapRuleTests.cs @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Tests.Scenario +{ + public class NetworkTapRuleTests : ManagedNetworkFabricManagementTestBase + { + public NetworkTapRuleTests(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) { } + public NetworkTapRuleTests(bool isAsync) : base(isAsync) { } + + [Test] + [RecordedTest] + [AsyncOnly] + public async Task NetworkTapRule() + { + TestContext.Out.WriteLine($"Entered into the NetworkTapRule tests...."); + TestContext.Out.WriteLine($"Provided TestEnvironment.NetworkTapRuleName name : {TestEnvironment.NetworkTapRuleName}"); + ResourceIdentifier networkTapRuleResourceId = NetworkTapRuleResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName, TestEnvironment.NetworkTapRuleName); + TestContext.Out.WriteLine($"networkTapRuleResourceId: {networkTapRuleResourceId}"); + TestContext.Out.WriteLine($"NetworkTapRule Test started....."); + NetworkTapRuleCollection collection = ResourceGroupResource.GetNetworkTapRules(); + + // Create + TestContext.Out.WriteLine($"PUT started....."); + NetworkTapRuleData data = new NetworkTapRuleData(new AzureLocation("eastus")) + { + Annotation = "annotation", + ConfigurationType = NetworkFabricConfigurationType.File, + TapRulesUri = new Uri("https://microsoft.com/a"), + MatchConfigurations = + { + new NetworkTapRuleMatchConfiguration() + { + MatchConfigurationName = "config1", + SequenceNumber = 10, + IPAddressType = NetworkFabricIPAddressType.IPv4, + MatchConditions = + { + new NetworkTapRuleMatchCondition() + { + EncapsulationType = NetworkTapEncapsulationType.None, + PortCondition = new NetworkFabricPortCondition(Layer4Protocol.Tcp) + { + PortType = NetworkFabricPortType.SourcePort, + Ports = + { + "100" + }, + PortGroupNames = + { + "example-portGroup1" + }, + }, + ProtocolTypes = + { + "TCP" + }, + VlanMatchCondition = new VlanMatchCondition() + { + Vlans = + { + "10" + }, + InnerVlans = + { + "11-20" + }, + VlanGroupNames = + { + "exmaple-vlanGroup" + }, + }, + IPCondition = new IPMatchCondition() + { + SourceDestinationType = SourceDestinationType.SourceIP, + PrefixType = IPMatchConditionPrefixType.Prefix, + IPPrefixValues = + { + "10.10.10.10/20" + }, + IPGroupNames = + { + "example-ipGroup" + }, + }, + } + }, + Actions = + { + new NetworkTapRuleAction() + { + TapRuleActionType = TapRuleActionType.Drop, + Truncate = "100", + IsTimestampEnabled = NetworkFabricBooleanValue.True, + DestinationId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + MatchConfigurationName = "match1", + } + }, + } + }, + DynamicMatchConfigurations = + { + new CommonDynamicMatchConfiguration() + { + IPGroups = + { + new MatchConfigurationIPGroupProperties() + { + Name = "example-ipGroup1", + IPAddressType = NetworkFabricIPAddressType.IPv4, + IPPrefixes = + { + "10.10.10.10/30" + }, + } + }, + VlanGroups = + { + new VlanGroupProperties() + { + Name = "exmaple-vlanGroup", + Vlans = + { + "10","100-200" + }, + } + }, + PortGroups = + { + new PortGroupProperties() + { + Name = "example-portGroup1", + Ports = + { + "100-200" + }, + }, + new PortGroupProperties() + { + Name = "example-portGroup2", + Ports = + { + "900","1000-2000" + }, + } + }, + } + }, + PollingIntervalInSeconds = PollingIntervalInSecond.Thirty, + Tags = + { + ["keyID"] = "keyValue", + }, + }; + TestContext.Out.WriteLine($" ########################################"); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, TestEnvironment.NetworkTapRuleName, data); + TestContext.Out.WriteLine($" ########################################"); + NetworkTapRuleResource createResult = lro.Value; + Assert.AreEqual(createResult.Data.Name, TestEnvironment.NetworkTapRuleName); + + // Update + // Patch not supported now. Will enable it once supported. + /* + NetworkTapRulePatch patch = new NetworkTapRulePatch() + { + Annotation = "annotation", + ConfigurationType = NetworkFabricConfigurationType.File, + TapRulesUri = new Uri("https://microsoft.com/amdsdx"), + MatchConfigurations = + { + new NetworkTapRuleMatchConfiguration() + { + MatchConfigurationName = "ModifiedConfigName", + SequenceNumber = 10, + IPAddressType = NetworkFabricIPAddressType.IPv4, + MatchConditions = + { + new NetworkTapRuleMatchCondition() + { + EncapsulationType = NetworkTapEncapsulationType.None, + PortCondition = new NetworkFabricPortCondition(Layer4Protocol.Tcp) + { + PortType = NetworkFabricPortType.SourcePort, + Ports = + { + "100" + }, + PortGroupNames = + { + "example-portGroup1" + }, + }, + ProtocolTypes = + { + "TCP" + }, + VlanMatchCondition = new VlanMatchCondition() + { + Vlans = + { + "10" + }, + InnerVlans = + { + "11-20" + }, + VlanGroupNames = + { + "exmaple-vlanGroup" + }, + }, + IPCondition = new IPMatchCondition() + { + SourceDestinationType = SourceDestinationType.SourceIP, + PrefixType = IPMatchConditionPrefixType.Prefix, + IPPrefixValues = + { + "10.10.10.10/20" + }, + IPGroupNames = + { + "example-ipGroup" + }, + }, + } + }, + Actions = + { + new NetworkTapRuleAction() + { + TapRuleActionType = TapRuleActionType.Goto, + Truncate = "100", + IsTimestampEnabled = NetworkFabricBooleanValue.True, + DestinationId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + MatchConfigurationName = "match1", + } + }, + } + }, + DynamicMatchConfigurations = + { + new CommonDynamicMatchConfiguration() + { + IPGroups = + { + new MatchConfigurationIPGroupProperties() + { + Name = "example-ipGroup1", + IPAddressType = NetworkFabricIPAddressType.IPv4, + IPPrefixes = + { + "10.10.10.10/30" + }, + } + }, + VlanGroups = + { + new VlanGroupProperties() + { + Name = "exmaple-vlanGroup", + Vlans = + { + "10","100-200" + }, + } + }, + PortGroups = + { + new PortGroupProperties() + { + Name = "example-portGroup1", + Ports = + { + "100-200" + }, + } + }, + } + }, + Tags = + { + ["keyID"] = "keyValue", + }, + }; + NetworkTapRuleResource networkTapRule = Client.GetNetworkTapRuleResource(createResult.Data.Id); + TestContext.Out.WriteLine($"PATCH - test started."); + ArmOperation lroPatch = await networkTapRule.UpdateAsync(WaitUntil.Completed, patch); + NetworkTapRuleResource result = lroPatch.Value; + NetworkTapRuleData resourceData = result.Data; + Assert.AreEqual(resourceData.MatchConfigurations[0].MatchConfigurationName, "ModifiedConfigName"); + TestContext.Out.WriteLine($"PATCH - test completed."); + */ + + NetworkTapRuleResource ntpResource = Client.GetNetworkTapRuleResource(networkTapRuleResourceId); + // Get + TestContext.Out.WriteLine($"GET started....."); + NetworkTapRuleResource getResult = await ntpResource.GetAsync(); + TestContext.Out.WriteLine($"{getResult}"); + Assert.AreEqual(getResult.Data.Name, TestEnvironment.NetworkTapRuleName); + + // List + TestContext.Out.WriteLine($"GET - List by Resource Group started....."); + var listByResourceGroup = new List(); + await foreach (NetworkTapRuleResource item in collection.GetAllAsync()) + { + listByResourceGroup.Add(item); + } + Assert.IsNotEmpty(listByResourceGroup); + + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + await foreach (NetworkTapRuleResource item in subscriptionResource.GetNetworkTapRulesAsync()) + { + NetworkTapRuleData rData = item.Data; + TestContext.WriteLine($"Succeeded on id: {rData.Id}"); + } + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + + // Delete + TestContext.Out.WriteLine($"DELETE started....."); + var deleteResponse = await ntpResource.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteResponse.HasCompleted); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkTapTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkTapTests.cs new file mode 100644 index 000000000000..c964d83c1bc5 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/NetworkTapTests.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Tests.Scenario +{ + public class NetworkTapTests : ManagedNetworkFabricManagementTestBase + { + public NetworkTapTests(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) { } + public NetworkTapTests(bool isAsync) : base(isAsync) { } + + [Test] + [RecordedTest] + [AsyncOnly] + public async Task NetworkTap() + { + TestContext.Out.WriteLine($"Entered into the NetworkTap tests...."); + TestContext.Out.WriteLine($"Provided TestEnvironment.NetworkTapName name : {TestEnvironment.NetworkTapName}"); + ResourceIdentifier networkTapRuleResourceId = NetworkTapResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, TestEnvironment.ResourceGroupName, TestEnvironment.NetworkTapName); + TestContext.Out.WriteLine($"networkTapRuleResourceId: {networkTapRuleResourceId}"); + TestContext.Out.WriteLine($"NetworkTap Test started....."); + NetworkTapCollection collection = ResourceGroupResource.GetNetworkTaps(); + + // Create + TestContext.Out.WriteLine($"PUT started....."); + NetworkTapData data = new NetworkTapData(new AzureLocation("eastus"), + new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkpacketbrokers/default"), new NetworkTapPropertiesDestinationsItem[] + { + new NetworkTapPropertiesDestinationsItem() + { + Name = "example-destinaionName", + DestinationType = NetworkTapDestinationType.IsolationDomain, + DestinationId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3isolationdomains/npbl3isd/internalnetworks/npbv4int"), + IsolationDomainProperties = new IsolationDomainProperties() + { + Encapsulation = IsolationDomainEncapsulationType.None, + NeighborGroupIds = + { + new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/ngh1") + }, + }, + DestinationTapRuleId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networktaprules/trafficrule1"), + } + } + ) + { + Annotation = "annotation", + PollingType = NetworkTapPollingType.Pull, + Tags = + { + ["key6024"] = "1234", + }, + }; + + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, TestEnvironment.NetworkTapName, data); + NetworkTapResource createResult = lro.Value; + Assert.AreEqual(createResult.Data.Name, TestEnvironment.NetworkTapName); + TestContext.Out.WriteLine($"Created.....{createResult.Data.Id}"); + + // Update + // Patch not supported now. Will enable it once supported. + /* + NetworkTapPatch patch = new NetworkTapPatch() + { + Annotation = "annotation1", + PollingType = NetworkTapPollingType.Pull, + Destinations = + { + new NetworkTapPatchableParametersDestinationsItem() + { + Name = "example-destinaionName", + DestinationType = NetworkTapDestinationType.IsolationDomain, + DestinationId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + IsolationDomainProperties = new IsolationDomainProperties() + { + Encapsulation = IsolationDomainEncapsulationType.None, + NeighborGroupIds = + { + new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup") + }, + }, + DestinationTapRuleId = new ResourceIdentifier("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + } + }, + Tags = + { + ["key6025"] = "1235", + }, + }; + NetworkTapResource networkTapRule = Client.GetNetworkTapResource(createResult.Data.Id); + TestContext.Out.WriteLine($"PATCH - test started."); + ArmOperation lroPatch = await networkTapRule.UpdateAsync(WaitUntil.Completed, patch); + NetworkTapResource result = lroPatch.Value; + NetworkTapData resourceData = result.Data; + Assert.IsTrue(resourceData.Tags.Keys.Contains("key6025")); + TestContext.Out.WriteLine($"PATCH - test completed."); + */ + + NetworkTapResource ntResource = Client.GetNetworkTapResource(networkTapRuleResourceId); + // Get + TestContext.Out.WriteLine($"GET started.....{networkTapRuleResourceId.ToString()}"); + NetworkTapResource getResult = await ntResource.GetAsync(); + TestContext.Out.WriteLine($"{getResult}"); + Assert.AreEqual(getResult.Data.Name, TestEnvironment.NetworkTapName); + + // Post + //TODO: uncomment this once post action issue fixed in southbound side. + /* + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent() + { + State = AdministrativeEnableState.Enable, + ResourceIds = + { + new ResourceIdentifier("") + }, + }; + TestContext.Out.WriteLine($"Enabling administrative state - AdministrativeEnableState.Enable"); + var enablePostResponse = await ntResource.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + getResult = await ntResource.GetAsync(); + TestContext.Out.WriteLine($"{getResult}"); + Assert.AreEqual(getResult.Data.AdministrativeState, AdministrativeEnableState.Enable); + + TestContext.Out.WriteLine($"Disabling administrative state - AdministrativeEnableState.Disable"); + content.State = AdministrativeEnableState.Disable; + var disablePostResponse = await ntResource.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + getResult = await ntResource.GetAsync(); + TestContext.Out.WriteLine($"{getResult}"); + Assert.AreEqual(getResult.Data.AdministrativeState, AdministrativeEnableState.Disable); + TestContext.Out.WriteLine($"AdministrativeEnableState test completed."); + */ + + // List + TestContext.Out.WriteLine($"GET - List by Resource Group started....."); + var listByResourceGroup = new List(); + await foreach (NetworkTapResource item in collection.GetAllAsync()) + { + listByResourceGroup.Add(item); + } + Assert.IsNotEmpty(listByResourceGroup); + + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + await foreach (NetworkTapResource item in subscriptionResource.GetNetworkTapsAsync()) + { + NetworkTapData rData = item.Data; + TestContext.WriteLine($"Succeeded on id: {rData.Id}"); + } + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + + // Delete + TestContext.Out.WriteLine($"DELETE started....."); + var deleteResponse = await ntResource.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteResponse.HasCompleted); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/RoutePolicyTests.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/RoutePolicyTests.cs index 4a7736faf997..b4c3bd89ca54 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/RoutePolicyTests.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Scenario/RoutePolicyTests.cs @@ -37,6 +37,7 @@ public async Task RoutePolicies() NetworkFabricRoutePolicyData data = new NetworkFabricRoutePolicyData(new AzureLocation(TestEnvironment.Location), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric")) { Annotation = "annotation", + DefaultAction = CommunityActionType.Permit, Statements = { new RoutePolicyStatementProperties( @@ -44,7 +45,7 @@ public async Task RoutePolicies() new StatementConditionProperties() { RoutePolicyConditionType = RoutePolicyConditionType.Or, - IPPrefixId = new ResourceIdentifier("/subscriptions/9531faa8-8c39-4165-b033-48697fe943db/resourceGroups/nfa-tool-ts-clisdktest-GA-nfcrg071323/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/nfa-tool-ts-GA-sdk-ipPrefix071423"), + IPPrefixId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/nfa-tool-ts-GA-sdk-ipprefix"), }, new StatementActionProperties(RoutePolicyActionType.Deny) { @@ -81,6 +82,20 @@ public async Task RoutePolicies() } Assert.IsNotEmpty(listByResourceGroup); + //List by subscription + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId); + SubscriptionResource subscriptionResource = Client.GetSubscriptionResource(subscriptionResourceId); + + TestContext.Out.WriteLine($"GET - List by Subscription started....."); + + await foreach (NetworkFabricRoutePolicyResource item in subscriptionResource.GetNetworkFabricRoutePoliciesAsync()) + { + NetworkFabricRoutePolicyData resourceData = item.Data; + TestContext.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + TestContext.Out.WriteLine($"List by Subscription operation succeeded."); + // Delete TestContext.Out.WriteLine($"DELETE started....."); var deleteResponse = await routePolicy.DeleteAsync(WaitUntil.Completed);