diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 380acbed43419..ce5aabe84659a 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -335,6 +335,7 @@ com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-be
com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2
+com.azure.resourcemanager:azure-resourcemanager-network-generated;1.0.0-beta.1;1.0.0-beta.1
com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
diff --git a/pom.xml b/pom.xml
index efafdfe5c9411..44a102a054553 100644
--- a/pom.xml
+++ b/pom.xml
@@ -802,6 +802,7 @@
sdk/mysql
sdk/mysqlflexibleserver
sdk/netapp
+ sdk/network
sdk/notificationhubs
sdk/oep
sdk/operationsmanagement
diff --git a/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md b/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md
new file mode 100644
index 0000000000000..beb164a065ccd
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 1.0.0-beta.1 (2022-02-01)
+
+- Azure Resource Manager Network client library for Java. This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
diff --git a/sdk/network/azure-resourcemanager-network-generated/README.md b/sdk/network/azure-resourcemanager-network-generated/README.md
new file mode 100644
index 0000000000000..6f0e7aa628ccc
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/README.md
@@ -0,0 +1,102 @@
+# Azure Resource Manager Network client library for Java
+
+Azure Resource Manager Network client library for Java.
+
+This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+
+## We'd love to hear your feedback
+
+We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
+
+If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
+
+Thank you in advance for your collaboration. We really appreciate your time!
+
+## Documentation
+
+Various documentation is available to help you get started
+
+- [API reference documentation][docs]
+
+## Getting started
+
+### Prerequisites
+
+- [Java Development Kit (JDK)][jdk] with version 8 or above
+- [Azure Subscription][azure_subscription]
+
+### Adding the package to your product
+
+[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-network-generated;current})
+```xml
+
+ com.azure.resourcemanager
+ azure-resourcemanager-network-generated
+ 1.0.0-beta.1
+
+```
+[//]: # ({x-version-update-end})
+
+### Include the recommended packages
+
+Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
+
+[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
+
+### Authentication
+
+By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
+
+- `AZURE_CLIENT_ID` for Azure client ID.
+- `AZURE_TENANT_ID` for Azure tenant ID.
+- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+
+In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
+
+With above configuration, `azure` client can be authenticated by following code:
+
+```java
+AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+TokenCredential credential = new DefaultAzureCredentialBuilder()
+ .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
+ .build();
+NetworkManager manager = NetworkManager
+ .authenticate(credential, profile);
+```
+
+The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+
+See [Authentication][authenticate] for more options.
+
+## Key concepts
+
+See [API design][design] for general introduction on design and key concepts on Azure Management Libraries.
+
+## Examples
+
+[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md)
+
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
+
+1. Fork it
+1. Create your feature branch (`git checkout -b my-new-feature`)
+1. Commit your changes (`git commit -am 'Add some feature'`)
+1. Push to the branch (`git push origin my-new-feature`)
+1. Create new Pull Request
+
+
+[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
+[docs]: https://azure.github.io/azure-sdk-for-java/
+[jdk]: https://docs.microsoft.com/java/azure/jdk/
+[azure_subscription]: https://azure.microsoft.com/free/
+[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
+[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
+[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
+[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
diff --git a/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md
new file mode 100644
index 0000000000000..1c973fdbbab25
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md
@@ -0,0 +1,18531 @@
+# Code snippets and samples
+
+
+## ApplicationGatewayPrivateEndpointConnections
+
+- [Delete](#applicationgatewayprivateendpointconnections_delete)
+- [Get](#applicationgatewayprivateendpointconnections_get)
+- [List](#applicationgatewayprivateendpointconnections_list)
+- [Update](#applicationgatewayprivateendpointconnections_update)
+
+## ApplicationGatewayPrivateLinkResources
+
+- [List](#applicationgatewayprivatelinkresources_list)
+
+## ApplicationGateways
+
+- [BackendHealth](#applicationgateways_backendhealth)
+- [BackendHealthOnDemand](#applicationgateways_backendhealthondemand)
+- [CreateOrUpdate](#applicationgateways_createorupdate)
+- [Delete](#applicationgateways_delete)
+- [GetByResourceGroup](#applicationgateways_getbyresourcegroup)
+- [GetSslPredefinedPolicy](#applicationgateways_getsslpredefinedpolicy)
+- [List](#applicationgateways_list)
+- [ListAvailableRequestHeaders](#applicationgateways_listavailablerequestheaders)
+- [ListAvailableResponseHeaders](#applicationgateways_listavailableresponseheaders)
+- [ListAvailableServerVariables](#applicationgateways_listavailableservervariables)
+- [ListAvailableSslOptions](#applicationgateways_listavailablessloptions)
+- [ListAvailableSslPredefinedPolicies](#applicationgateways_listavailablesslpredefinedpolicies)
+- [ListAvailableWafRuleSets](#applicationgateways_listavailablewafrulesets)
+- [ListByResourceGroup](#applicationgateways_listbyresourcegroup)
+- [Start](#applicationgateways_start)
+- [Stop](#applicationgateways_stop)
+- [UpdateTags](#applicationgateways_updatetags)
+
+## ApplicationSecurityGroups
+
+- [CreateOrUpdate](#applicationsecuritygroups_createorupdate)
+- [Delete](#applicationsecuritygroups_delete)
+- [GetByResourceGroup](#applicationsecuritygroups_getbyresourcegroup)
+- [List](#applicationsecuritygroups_list)
+- [ListByResourceGroup](#applicationsecuritygroups_listbyresourcegroup)
+- [UpdateTags](#applicationsecuritygroups_updatetags)
+
+## AvailableDelegations
+
+- [List](#availabledelegations_list)
+
+## AvailableEndpointServices
+
+- [List](#availableendpointservices_list)
+
+## AvailablePrivateEndpointTypes
+
+- [List](#availableprivateendpointtypes_list)
+- [ListByResourceGroup](#availableprivateendpointtypes_listbyresourcegroup)
+
+## AvailableResourceGroupDelegations
+
+- [List](#availableresourcegroupdelegations_list)
+
+## AvailableServiceAliases
+
+- [List](#availableservicealiases_list)
+- [ListByResourceGroup](#availableservicealiases_listbyresourcegroup)
+
+## AzureFirewallFqdnTags
+
+- [List](#azurefirewallfqdntags_list)
+
+## AzureFirewalls
+
+- [CreateOrUpdate](#azurefirewalls_createorupdate)
+- [Delete](#azurefirewalls_delete)
+- [GetByResourceGroup](#azurefirewalls_getbyresourcegroup)
+- [List](#azurefirewalls_list)
+- [ListByResourceGroup](#azurefirewalls_listbyresourcegroup)
+- [UpdateTags](#azurefirewalls_updatetags)
+
+## BastionHosts
+
+- [CreateOrUpdate](#bastionhosts_createorupdate)
+- [Delete](#bastionhosts_delete)
+- [GetByResourceGroup](#bastionhosts_getbyresourcegroup)
+- [List](#bastionhosts_list)
+- [ListByResourceGroup](#bastionhosts_listbyresourcegroup)
+- [UpdateTags](#bastionhosts_updatetags)
+
+## BgpServiceCommunities
+
+- [List](#bgpservicecommunities_list)
+
+## ConnectionMonitors
+
+- [CreateOrUpdate](#connectionmonitors_createorupdate)
+- [Delete](#connectionmonitors_delete)
+- [Get](#connectionmonitors_get)
+- [List](#connectionmonitors_list)
+- [Query](#connectionmonitors_query)
+- [Start](#connectionmonitors_start)
+- [Stop](#connectionmonitors_stop)
+- [UpdateTags](#connectionmonitors_updatetags)
+
+## CustomIpPrefixes
+
+- [CreateOrUpdate](#customipprefixes_createorupdate)
+- [Delete](#customipprefixes_delete)
+- [GetByResourceGroup](#customipprefixes_getbyresourcegroup)
+- [List](#customipprefixes_list)
+- [ListByResourceGroup](#customipprefixes_listbyresourcegroup)
+- [UpdateTags](#customipprefixes_updatetags)
+
+## DdosCustomPolicies
+
+- [CreateOrUpdate](#ddoscustompolicies_createorupdate)
+- [Delete](#ddoscustompolicies_delete)
+- [GetByResourceGroup](#ddoscustompolicies_getbyresourcegroup)
+- [UpdateTags](#ddoscustompolicies_updatetags)
+
+## DdosProtectionPlans
+
+- [CreateOrUpdate](#ddosprotectionplans_createorupdate)
+- [Delete](#ddosprotectionplans_delete)
+- [GetByResourceGroup](#ddosprotectionplans_getbyresourcegroup)
+- [List](#ddosprotectionplans_list)
+- [ListByResourceGroup](#ddosprotectionplans_listbyresourcegroup)
+- [UpdateTags](#ddosprotectionplans_updatetags)
+
+## DefaultSecurityRules
+
+- [Get](#defaultsecurityrules_get)
+- [List](#defaultsecurityrules_list)
+
+## DscpConfiguration
+
+- [CreateOrUpdate](#dscpconfiguration_createorupdate)
+- [Delete](#dscpconfiguration_delete)
+- [GetByResourceGroup](#dscpconfiguration_getbyresourcegroup)
+- [List](#dscpconfiguration_list)
+- [ListByResourceGroup](#dscpconfiguration_listbyresourcegroup)
+
+## ExpressRouteCircuitAuthorizations
+
+- [CreateOrUpdate](#expressroutecircuitauthorizations_createorupdate)
+- [Delete](#expressroutecircuitauthorizations_delete)
+- [Get](#expressroutecircuitauthorizations_get)
+- [List](#expressroutecircuitauthorizations_list)
+
+## ExpressRouteCircuitConnections
+
+- [CreateOrUpdate](#expressroutecircuitconnections_createorupdate)
+- [Delete](#expressroutecircuitconnections_delete)
+- [Get](#expressroutecircuitconnections_get)
+- [List](#expressroutecircuitconnections_list)
+
+## ExpressRouteCircuitPeerings
+
+- [CreateOrUpdate](#expressroutecircuitpeerings_createorupdate)
+- [Delete](#expressroutecircuitpeerings_delete)
+- [Get](#expressroutecircuitpeerings_get)
+- [List](#expressroutecircuitpeerings_list)
+
+## ExpressRouteCircuits
+
+- [CreateOrUpdate](#expressroutecircuits_createorupdate)
+- [Delete](#expressroutecircuits_delete)
+- [GetByResourceGroup](#expressroutecircuits_getbyresourcegroup)
+- [GetPeeringStats](#expressroutecircuits_getpeeringstats)
+- [GetStats](#expressroutecircuits_getstats)
+- [List](#expressroutecircuits_list)
+- [ListArpTable](#expressroutecircuits_listarptable)
+- [ListByResourceGroup](#expressroutecircuits_listbyresourcegroup)
+- [ListRoutesTable](#expressroutecircuits_listroutestable)
+- [ListRoutesTableSummary](#expressroutecircuits_listroutestablesummary)
+- [UpdateTags](#expressroutecircuits_updatetags)
+
+## ExpressRouteConnections
+
+- [CreateOrUpdate](#expressrouteconnections_createorupdate)
+- [Delete](#expressrouteconnections_delete)
+- [Get](#expressrouteconnections_get)
+- [List](#expressrouteconnections_list)
+
+## ExpressRouteCrossConnectionPeerings
+
+- [CreateOrUpdate](#expressroutecrossconnectionpeerings_createorupdate)
+- [Delete](#expressroutecrossconnectionpeerings_delete)
+- [Get](#expressroutecrossconnectionpeerings_get)
+- [List](#expressroutecrossconnectionpeerings_list)
+
+## ExpressRouteCrossConnections
+
+- [CreateOrUpdate](#expressroutecrossconnections_createorupdate)
+- [GetByResourceGroup](#expressroutecrossconnections_getbyresourcegroup)
+- [List](#expressroutecrossconnections_list)
+- [ListArpTable](#expressroutecrossconnections_listarptable)
+- [ListByResourceGroup](#expressroutecrossconnections_listbyresourcegroup)
+- [ListRoutesTable](#expressroutecrossconnections_listroutestable)
+- [ListRoutesTableSummary](#expressroutecrossconnections_listroutestablesummary)
+- [UpdateTags](#expressroutecrossconnections_updatetags)
+
+## ExpressRouteGateways
+
+- [CreateOrUpdate](#expressroutegateways_createorupdate)
+- [Delete](#expressroutegateways_delete)
+- [GetByResourceGroup](#expressroutegateways_getbyresourcegroup)
+- [ListByResourceGroup](#expressroutegateways_listbyresourcegroup)
+- [ListBySubscription](#expressroutegateways_listbysubscription)
+- [UpdateTags](#expressroutegateways_updatetags)
+
+## ExpressRouteLinks
+
+- [Get](#expressroutelinks_get)
+- [List](#expressroutelinks_list)
+
+## ExpressRoutePortAuthorizations
+
+- [CreateOrUpdate](#expressrouteportauthorizations_createorupdate)
+- [Delete](#expressrouteportauthorizations_delete)
+- [Get](#expressrouteportauthorizations_get)
+- [List](#expressrouteportauthorizations_list)
+
+## ExpressRoutePorts
+
+- [CreateOrUpdate](#expressrouteports_createorupdate)
+- [Delete](#expressrouteports_delete)
+- [GenerateLoa](#expressrouteports_generateloa)
+- [GetByResourceGroup](#expressrouteports_getbyresourcegroup)
+- [List](#expressrouteports_list)
+- [ListByResourceGroup](#expressrouteports_listbyresourcegroup)
+- [UpdateTags](#expressrouteports_updatetags)
+
+## ExpressRoutePortsLocations
+
+- [Get](#expressrouteportslocations_get)
+- [List](#expressrouteportslocations_list)
+
+## ExpressRouteServiceProviders
+
+- [List](#expressrouteserviceproviders_list)
+
+## FirewallPolicies
+
+- [CreateOrUpdate](#firewallpolicies_createorupdate)
+- [Delete](#firewallpolicies_delete)
+- [GetByResourceGroup](#firewallpolicies_getbyresourcegroup)
+- [List](#firewallpolicies_list)
+- [ListByResourceGroup](#firewallpolicies_listbyresourcegroup)
+
+## FirewallPolicyIdpsSignatures
+
+- [List](#firewallpolicyidpssignatures_list)
+
+## FirewallPolicyIdpsSignaturesFilterValues
+
+- [List](#firewallpolicyidpssignaturesfiltervalues_list)
+
+## FirewallPolicyIdpsSignaturesOverrides
+
+- [Get](#firewallpolicyidpssignaturesoverrides_get)
+- [List](#firewallpolicyidpssignaturesoverrides_list)
+- [Patch](#firewallpolicyidpssignaturesoverrides_patch)
+- [Put](#firewallpolicyidpssignaturesoverrides_put)
+
+## FirewallPolicyRuleCollectionGroups
+
+- [CreateOrUpdate](#firewallpolicyrulecollectiongroups_createorupdate)
+- [Delete](#firewallpolicyrulecollectiongroups_delete)
+- [Get](#firewallpolicyrulecollectiongroups_get)
+- [List](#firewallpolicyrulecollectiongroups_list)
+
+## FlowLogs
+
+- [CreateOrUpdate](#flowlogs_createorupdate)
+- [Delete](#flowlogs_delete)
+- [Get](#flowlogs_get)
+- [List](#flowlogs_list)
+- [UpdateTags](#flowlogs_updatetags)
+
+## HubRouteTables
+
+- [CreateOrUpdate](#hubroutetables_createorupdate)
+- [Delete](#hubroutetables_delete)
+- [Get](#hubroutetables_get)
+- [List](#hubroutetables_list)
+
+## HubVirtualNetworkConnections
+
+- [CreateOrUpdate](#hubvirtualnetworkconnections_createorupdate)
+- [Delete](#hubvirtualnetworkconnections_delete)
+- [Get](#hubvirtualnetworkconnections_get)
+- [List](#hubvirtualnetworkconnections_list)
+
+## InboundNatRules
+
+- [CreateOrUpdate](#inboundnatrules_createorupdate)
+- [Delete](#inboundnatrules_delete)
+- [Get](#inboundnatrules_get)
+- [List](#inboundnatrules_list)
+
+## InboundSecurityRuleOperation
+
+- [CreateOrUpdate](#inboundsecurityruleoperation_createorupdate)
+
+## IpAllocations
+
+- [CreateOrUpdate](#ipallocations_createorupdate)
+- [Delete](#ipallocations_delete)
+- [GetByResourceGroup](#ipallocations_getbyresourcegroup)
+- [List](#ipallocations_list)
+- [ListByResourceGroup](#ipallocations_listbyresourcegroup)
+- [UpdateTags](#ipallocations_updatetags)
+
+## IpGroups
+
+- [CreateOrUpdate](#ipgroups_createorupdate)
+- [Delete](#ipgroups_delete)
+- [GetByResourceGroup](#ipgroups_getbyresourcegroup)
+- [List](#ipgroups_list)
+- [ListByResourceGroup](#ipgroups_listbyresourcegroup)
+- [UpdateGroups](#ipgroups_updategroups)
+
+## LoadBalancerBackendAddressPools
+
+- [CreateOrUpdate](#loadbalancerbackendaddresspools_createorupdate)
+- [Delete](#loadbalancerbackendaddresspools_delete)
+- [Get](#loadbalancerbackendaddresspools_get)
+- [List](#loadbalancerbackendaddresspools_list)
+
+## LoadBalancerFrontendIpConfigurations
+
+- [Get](#loadbalancerfrontendipconfigurations_get)
+- [List](#loadbalancerfrontendipconfigurations_list)
+
+## LoadBalancerLoadBalancingRules
+
+- [Get](#loadbalancerloadbalancingrules_get)
+- [List](#loadbalancerloadbalancingrules_list)
+
+## LoadBalancerNetworkInterfaces
+
+- [List](#loadbalancernetworkinterfaces_list)
+
+## LoadBalancerOutboundRules
+
+- [Get](#loadbalanceroutboundrules_get)
+- [List](#loadbalanceroutboundrules_list)
+
+## LoadBalancerProbes
+
+- [Get](#loadbalancerprobes_get)
+- [List](#loadbalancerprobes_list)
+
+## LoadBalancers
+
+- [CreateOrUpdate](#loadbalancers_createorupdate)
+- [Delete](#loadbalancers_delete)
+- [GetByResourceGroup](#loadbalancers_getbyresourcegroup)
+- [List](#loadbalancers_list)
+- [ListByResourceGroup](#loadbalancers_listbyresourcegroup)
+- [ListInboundNatRulePortMappings](#loadbalancers_listinboundnatruleportmappings)
+- [SwapPublicIpAddresses](#loadbalancers_swappublicipaddresses)
+- [UpdateTags](#loadbalancers_updatetags)
+
+## LocalNetworkGateways
+
+- [CreateOrUpdate](#localnetworkgateways_createorupdate)
+- [Delete](#localnetworkgateways_delete)
+- [GetByResourceGroup](#localnetworkgateways_getbyresourcegroup)
+- [ListByResourceGroup](#localnetworkgateways_listbyresourcegroup)
+- [UpdateTags](#localnetworkgateways_updatetags)
+
+## NatGateways
+
+- [CreateOrUpdate](#natgateways_createorupdate)
+- [Delete](#natgateways_delete)
+- [GetByResourceGroup](#natgateways_getbyresourcegroup)
+- [List](#natgateways_list)
+- [ListByResourceGroup](#natgateways_listbyresourcegroup)
+- [UpdateTags](#natgateways_updatetags)
+
+## NatRules
+
+- [CreateOrUpdate](#natrules_createorupdate)
+- [Delete](#natrules_delete)
+- [Get](#natrules_get)
+- [ListByVpnGateway](#natrules_listbyvpngateway)
+
+## NetworkInterfaceIpConfigurations
+
+- [Get](#networkinterfaceipconfigurations_get)
+- [List](#networkinterfaceipconfigurations_list)
+
+## NetworkInterfaceLoadBalancers
+
+- [List](#networkinterfaceloadbalancers_list)
+
+## NetworkInterfaceTapConfigurations
+
+- [CreateOrUpdate](#networkinterfacetapconfigurations_createorupdate)
+- [Delete](#networkinterfacetapconfigurations_delete)
+- [Get](#networkinterfacetapconfigurations_get)
+- [List](#networkinterfacetapconfigurations_list)
+
+## NetworkInterfaces
+
+- [CreateOrUpdate](#networkinterfaces_createorupdate)
+- [Delete](#networkinterfaces_delete)
+- [GetByResourceGroup](#networkinterfaces_getbyresourcegroup)
+- [GetCloudServiceNetworkInterface](#networkinterfaces_getcloudservicenetworkinterface)
+- [GetEffectiveRouteTable](#networkinterfaces_geteffectiveroutetable)
+- [GetVirtualMachineScaleSetIpConfiguration](#networkinterfaces_getvirtualmachinescalesetipconfiguration)
+- [GetVirtualMachineScaleSetNetworkInterface](#networkinterfaces_getvirtualmachinescalesetnetworkinterface)
+- [List](#networkinterfaces_list)
+- [ListByResourceGroup](#networkinterfaces_listbyresourcegroup)
+- [ListCloudServiceNetworkInterfaces](#networkinterfaces_listcloudservicenetworkinterfaces)
+- [ListCloudServiceRoleInstanceNetworkInterfaces](#networkinterfaces_listcloudserviceroleinstancenetworkinterfaces)
+- [ListEffectiveNetworkSecurityGroups](#networkinterfaces_listeffectivenetworksecuritygroups)
+- [ListVirtualMachineScaleSetIpConfigurations](#networkinterfaces_listvirtualmachinescalesetipconfigurations)
+- [ListVirtualMachineScaleSetNetworkInterfaces](#networkinterfaces_listvirtualmachinescalesetnetworkinterfaces)
+- [ListVirtualMachineScaleSetVMNetworkInterfaces](#networkinterfaces_listvirtualmachinescalesetvmnetworkinterfaces)
+- [UpdateTags](#networkinterfaces_updatetags)
+
+## NetworkProfiles
+
+- [CreateOrUpdate](#networkprofiles_createorupdate)
+- [Delete](#networkprofiles_delete)
+- [GetByResourceGroup](#networkprofiles_getbyresourcegroup)
+- [List](#networkprofiles_list)
+- [ListByResourceGroup](#networkprofiles_listbyresourcegroup)
+- [UpdateTags](#networkprofiles_updatetags)
+
+## NetworkSecurityGroups
+
+- [CreateOrUpdate](#networksecuritygroups_createorupdate)
+- [Delete](#networksecuritygroups_delete)
+- [GetByResourceGroup](#networksecuritygroups_getbyresourcegroup)
+- [List](#networksecuritygroups_list)
+- [ListByResourceGroup](#networksecuritygroups_listbyresourcegroup)
+- [UpdateTags](#networksecuritygroups_updatetags)
+
+## NetworkVirtualAppliances
+
+- [CreateOrUpdate](#networkvirtualappliances_createorupdate)
+- [Delete](#networkvirtualappliances_delete)
+- [GetByResourceGroup](#networkvirtualappliances_getbyresourcegroup)
+- [List](#networkvirtualappliances_list)
+- [ListByResourceGroup](#networkvirtualappliances_listbyresourcegroup)
+- [UpdateTags](#networkvirtualappliances_updatetags)
+
+## NetworkWatchers
+
+- [CheckConnectivity](#networkwatchers_checkconnectivity)
+- [CreateOrUpdate](#networkwatchers_createorupdate)
+- [Delete](#networkwatchers_delete)
+- [GetAzureReachabilityReport](#networkwatchers_getazurereachabilityreport)
+- [GetByResourceGroup](#networkwatchers_getbyresourcegroup)
+- [GetFlowLogStatus](#networkwatchers_getflowlogstatus)
+- [GetNetworkConfigurationDiagnostic](#networkwatchers_getnetworkconfigurationdiagnostic)
+- [GetNextHop](#networkwatchers_getnexthop)
+- [GetTopology](#networkwatchers_gettopology)
+- [GetTroubleshooting](#networkwatchers_gettroubleshooting)
+- [GetTroubleshootingResult](#networkwatchers_gettroubleshootingresult)
+- [GetVMSecurityRules](#networkwatchers_getvmsecurityrules)
+- [List](#networkwatchers_list)
+- [ListAvailableProviders](#networkwatchers_listavailableproviders)
+- [ListByResourceGroup](#networkwatchers_listbyresourcegroup)
+- [SetFlowLogConfiguration](#networkwatchers_setflowlogconfiguration)
+- [UpdateTags](#networkwatchers_updatetags)
+- [VerifyIpFlow](#networkwatchers_verifyipflow)
+
+## Operations
+
+- [List](#operations_list)
+
+## P2SVpnGateways
+
+- [CreateOrUpdate](#p2svpngateways_createorupdate)
+- [Delete](#p2svpngateways_delete)
+- [DisconnectP2SVpnConnections](#p2svpngateways_disconnectp2svpnconnections)
+- [GenerateVpnProfile](#p2svpngateways_generatevpnprofile)
+- [GetByResourceGroup](#p2svpngateways_getbyresourcegroup)
+- [GetP2SVpnConnectionHealth](#p2svpngateways_getp2svpnconnectionhealth)
+- [GetP2SVpnConnectionHealthDetailed](#p2svpngateways_getp2svpnconnectionhealthdetailed)
+- [List](#p2svpngateways_list)
+- [ListByResourceGroup](#p2svpngateways_listbyresourcegroup)
+- [Reset](#p2svpngateways_reset)
+- [UpdateTags](#p2svpngateways_updatetags)
+
+## PacketCaptures
+
+- [Create](#packetcaptures_create)
+- [Delete](#packetcaptures_delete)
+- [Get](#packetcaptures_get)
+- [GetStatus](#packetcaptures_getstatus)
+- [List](#packetcaptures_list)
+- [Stop](#packetcaptures_stop)
+
+## PeerExpressRouteCircuitConnections
+
+- [Get](#peerexpressroutecircuitconnections_get)
+- [List](#peerexpressroutecircuitconnections_list)
+
+## PrivateDnsZoneGroups
+
+- [CreateOrUpdate](#privatednszonegroups_createorupdate)
+- [Delete](#privatednszonegroups_delete)
+- [Get](#privatednszonegroups_get)
+- [List](#privatednszonegroups_list)
+
+## PrivateEndpoints
+
+- [CreateOrUpdate](#privateendpoints_createorupdate)
+- [Delete](#privateendpoints_delete)
+- [GetByResourceGroup](#privateendpoints_getbyresourcegroup)
+- [List](#privateendpoints_list)
+- [ListByResourceGroup](#privateendpoints_listbyresourcegroup)
+
+## PrivateLinkServices
+
+- [CheckPrivateLinkServiceVisibility](#privatelinkservices_checkprivatelinkservicevisibility)
+- [CheckPrivateLinkServiceVisibilityByResourceGroup](#privatelinkservices_checkprivatelinkservicevisibilitybyresourcegroup)
+- [CreateOrUpdate](#privatelinkservices_createorupdate)
+- [Delete](#privatelinkservices_delete)
+- [DeletePrivateEndpointConnection](#privatelinkservices_deleteprivateendpointconnection)
+- [GetByResourceGroup](#privatelinkservices_getbyresourcegroup)
+- [GetPrivateEndpointConnection](#privatelinkservices_getprivateendpointconnection)
+- [List](#privatelinkservices_list)
+- [ListAutoApprovedPrivateLinkServices](#privatelinkservices_listautoapprovedprivatelinkservices)
+- [ListAutoApprovedPrivateLinkServicesByResourceGroup](#privatelinkservices_listautoapprovedprivatelinkservicesbyresourcegroup)
+- [ListByResourceGroup](#privatelinkservices_listbyresourcegroup)
+- [ListPrivateEndpointConnections](#privatelinkservices_listprivateendpointconnections)
+- [UpdatePrivateEndpointConnection](#privatelinkservices_updateprivateendpointconnection)
+
+## PublicIpAddresses
+
+- [CreateOrUpdate](#publicipaddresses_createorupdate)
+- [Delete](#publicipaddresses_delete)
+- [GetByResourceGroup](#publicipaddresses_getbyresourcegroup)
+- [GetCloudServicePublicIpAddress](#publicipaddresses_getcloudservicepublicipaddress)
+- [GetVirtualMachineScaleSetPublicIpAddress](#publicipaddresses_getvirtualmachinescalesetpublicipaddress)
+- [List](#publicipaddresses_list)
+- [ListByResourceGroup](#publicipaddresses_listbyresourcegroup)
+- [ListCloudServicePublicIpAddresses](#publicipaddresses_listcloudservicepublicipaddresses)
+- [ListCloudServiceRoleInstancePublicIpAddresses](#publicipaddresses_listcloudserviceroleinstancepublicipaddresses)
+- [ListVirtualMachineScaleSetPublicIpAddresses](#publicipaddresses_listvirtualmachinescalesetpublicipaddresses)
+- [ListVirtualMachineScaleSetVMPublicIpAddresses](#publicipaddresses_listvirtualmachinescalesetvmpublicipaddresses)
+- [UpdateTags](#publicipaddresses_updatetags)
+
+## PublicIpPrefixes
+
+- [CreateOrUpdate](#publicipprefixes_createorupdate)
+- [Delete](#publicipprefixes_delete)
+- [GetByResourceGroup](#publicipprefixes_getbyresourcegroup)
+- [List](#publicipprefixes_list)
+- [ListByResourceGroup](#publicipprefixes_listbyresourcegroup)
+- [UpdateTags](#publicipprefixes_updatetags)
+
+## ResourceNavigationLinks
+
+- [List](#resourcenavigationlinks_list)
+
+## ResourceProvider
+
+- [CheckDnsNameAvailability](#resourceprovider_checkdnsnameavailability)
+- [DeleteBastionShareableLink](#resourceprovider_deletebastionshareablelink)
+- [DisconnectActiveSessions](#resourceprovider_disconnectactivesessions)
+- [Generatevirtualwanvpnserverconfigurationvpnprofile](#resourceprovider_generatevirtualwanvpnserverconfigurationvpnprofile)
+- [GetActiveSessions](#resourceprovider_getactivesessions)
+- [GetBastionShareableLink](#resourceprovider_getbastionshareablelink)
+- [PutBastionShareableLink](#resourceprovider_putbastionshareablelink)
+- [SupportedSecurityProviders](#resourceprovider_supportedsecurityproviders)
+
+## RouteFilterRules
+
+- [CreateOrUpdate](#routefilterrules_createorupdate)
+- [Delete](#routefilterrules_delete)
+- [Get](#routefilterrules_get)
+- [ListByRouteFilter](#routefilterrules_listbyroutefilter)
+
+## RouteFilters
+
+- [CreateOrUpdate](#routefilters_createorupdate)
+- [Delete](#routefilters_delete)
+- [GetByResourceGroup](#routefilters_getbyresourcegroup)
+- [List](#routefilters_list)
+- [ListByResourceGroup](#routefilters_listbyresourcegroup)
+- [UpdateTags](#routefilters_updatetags)
+
+## RouteTables
+
+- [CreateOrUpdate](#routetables_createorupdate)
+- [Delete](#routetables_delete)
+- [GetByResourceGroup](#routetables_getbyresourcegroup)
+- [List](#routetables_list)
+- [ListByResourceGroup](#routetables_listbyresourcegroup)
+- [UpdateTags](#routetables_updatetags)
+
+## Routes
+
+- [CreateOrUpdate](#routes_createorupdate)
+- [Delete](#routes_delete)
+- [Get](#routes_get)
+- [List](#routes_list)
+
+## RoutingIntent
+
+- [CreateOrUpdate](#routingintent_createorupdate)
+- [Delete](#routingintent_delete)
+- [Get](#routingintent_get)
+- [List](#routingintent_list)
+
+## SecurityPartnerProviders
+
+- [CreateOrUpdate](#securitypartnerproviders_createorupdate)
+- [Delete](#securitypartnerproviders_delete)
+- [GetByResourceGroup](#securitypartnerproviders_getbyresourcegroup)
+- [List](#securitypartnerproviders_list)
+- [ListByResourceGroup](#securitypartnerproviders_listbyresourcegroup)
+- [UpdateTags](#securitypartnerproviders_updatetags)
+
+## SecurityRules
+
+- [CreateOrUpdate](#securityrules_createorupdate)
+- [Delete](#securityrules_delete)
+- [Get](#securityrules_get)
+- [List](#securityrules_list)
+
+## ServiceAssociationLinks
+
+- [List](#serviceassociationlinks_list)
+
+## ServiceEndpointPolicies
+
+- [CreateOrUpdate](#serviceendpointpolicies_createorupdate)
+- [Delete](#serviceendpointpolicies_delete)
+- [GetByResourceGroup](#serviceendpointpolicies_getbyresourcegroup)
+- [List](#serviceendpointpolicies_list)
+- [ListByResourceGroup](#serviceendpointpolicies_listbyresourcegroup)
+- [UpdateTags](#serviceendpointpolicies_updatetags)
+
+## ServiceEndpointPolicyDefinitions
+
+- [CreateOrUpdate](#serviceendpointpolicydefinitions_createorupdate)
+- [Delete](#serviceendpointpolicydefinitions_delete)
+- [Get](#serviceendpointpolicydefinitions_get)
+- [ListByResourceGroup](#serviceendpointpolicydefinitions_listbyresourcegroup)
+
+## ServiceTagInformation
+
+- [List](#servicetaginformation_list)
+
+## ServiceTags
+
+- [List](#servicetags_list)
+
+## Subnets
+
+- [CreateOrUpdate](#subnets_createorupdate)
+- [Delete](#subnets_delete)
+- [Get](#subnets_get)
+- [List](#subnets_list)
+- [PrepareNetworkPolicies](#subnets_preparenetworkpolicies)
+- [UnprepareNetworkPolicies](#subnets_unpreparenetworkpolicies)
+
+## Usages
+
+- [List](#usages_list)
+
+## VirtualApplianceSites
+
+- [CreateOrUpdate](#virtualappliancesites_createorupdate)
+- [Delete](#virtualappliancesites_delete)
+- [Get](#virtualappliancesites_get)
+- [List](#virtualappliancesites_list)
+
+## VirtualApplianceSkus
+
+- [Get](#virtualapplianceskus_get)
+- [List](#virtualapplianceskus_list)
+
+## VirtualHubBgpConnections
+
+- [CreateOrUpdate](#virtualhubbgpconnections_createorupdate)
+- [Delete](#virtualhubbgpconnections_delete)
+- [Get](#virtualhubbgpconnections_get)
+- [List](#virtualhubbgpconnections_list)
+- [ListAdvertisedRoutes](#virtualhubbgpconnections_listadvertisedroutes)
+- [ListLearnedRoutes](#virtualhubbgpconnections_listlearnedroutes)
+
+## VirtualHubIpConfiguration
+
+- [CreateOrUpdate](#virtualhubipconfiguration_createorupdate)
+- [Delete](#virtualhubipconfiguration_delete)
+- [Get](#virtualhubipconfiguration_get)
+- [List](#virtualhubipconfiguration_list)
+
+## VirtualHubRouteTableV2S
+
+- [CreateOrUpdate](#virtualhubroutetablev2s_createorupdate)
+- [Delete](#virtualhubroutetablev2s_delete)
+- [Get](#virtualhubroutetablev2s_get)
+- [List](#virtualhubroutetablev2s_list)
+
+## VirtualHubs
+
+- [CreateOrUpdate](#virtualhubs_createorupdate)
+- [Delete](#virtualhubs_delete)
+- [GetByResourceGroup](#virtualhubs_getbyresourcegroup)
+- [GetEffectiveVirtualHubRoutes](#virtualhubs_geteffectivevirtualhubroutes)
+- [List](#virtualhubs_list)
+- [ListByResourceGroup](#virtualhubs_listbyresourcegroup)
+- [UpdateTags](#virtualhubs_updatetags)
+
+## VirtualNetworkGatewayConnections
+
+- [CreateOrUpdate](#virtualnetworkgatewayconnections_createorupdate)
+- [Delete](#virtualnetworkgatewayconnections_delete)
+- [GetByResourceGroup](#virtualnetworkgatewayconnections_getbyresourcegroup)
+- [GetIkeSas](#virtualnetworkgatewayconnections_getikesas)
+- [GetSharedKey](#virtualnetworkgatewayconnections_getsharedkey)
+- [ListByResourceGroup](#virtualnetworkgatewayconnections_listbyresourcegroup)
+- [ResetConnection](#virtualnetworkgatewayconnections_resetconnection)
+- [ResetSharedKey](#virtualnetworkgatewayconnections_resetsharedkey)
+- [SetSharedKey](#virtualnetworkgatewayconnections_setsharedkey)
+- [StartPacketCapture](#virtualnetworkgatewayconnections_startpacketcapture)
+- [StopPacketCapture](#virtualnetworkgatewayconnections_stoppacketcapture)
+- [UpdateTags](#virtualnetworkgatewayconnections_updatetags)
+
+## VirtualNetworkGatewayNatRules
+
+- [CreateOrUpdate](#virtualnetworkgatewaynatrules_createorupdate)
+- [Delete](#virtualnetworkgatewaynatrules_delete)
+- [Get](#virtualnetworkgatewaynatrules_get)
+- [ListByVirtualNetworkGateway](#virtualnetworkgatewaynatrules_listbyvirtualnetworkgateway)
+
+## VirtualNetworkGateways
+
+- [CreateOrUpdate](#virtualnetworkgateways_createorupdate)
+- [Delete](#virtualnetworkgateways_delete)
+- [DisconnectVirtualNetworkGatewayVpnConnections](#virtualnetworkgateways_disconnectvirtualnetworkgatewayvpnconnections)
+- [GenerateVpnProfile](#virtualnetworkgateways_generatevpnprofile)
+- [Generatevpnclientpackage](#virtualnetworkgateways_generatevpnclientpackage)
+- [GetAdvertisedRoutes](#virtualnetworkgateways_getadvertisedroutes)
+- [GetBgpPeerStatus](#virtualnetworkgateways_getbgppeerstatus)
+- [GetByResourceGroup](#virtualnetworkgateways_getbyresourcegroup)
+- [GetLearnedRoutes](#virtualnetworkgateways_getlearnedroutes)
+- [GetVpnProfilePackageUrl](#virtualnetworkgateways_getvpnprofilepackageurl)
+- [GetVpnclientConnectionHealth](#virtualnetworkgateways_getvpnclientconnectionhealth)
+- [GetVpnclientIpsecParameters](#virtualnetworkgateways_getvpnclientipsecparameters)
+- [ListByResourceGroup](#virtualnetworkgateways_listbyresourcegroup)
+- [ListConnections](#virtualnetworkgateways_listconnections)
+- [Reset](#virtualnetworkgateways_reset)
+- [ResetVpnClientSharedKey](#virtualnetworkgateways_resetvpnclientsharedkey)
+- [SetVpnclientIpsecParameters](#virtualnetworkgateways_setvpnclientipsecparameters)
+- [StartPacketCapture](#virtualnetworkgateways_startpacketcapture)
+- [StopPacketCapture](#virtualnetworkgateways_stoppacketcapture)
+- [SupportedVpnDevices](#virtualnetworkgateways_supportedvpndevices)
+- [UpdateTags](#virtualnetworkgateways_updatetags)
+- [VpnDeviceConfigurationScript](#virtualnetworkgateways_vpndeviceconfigurationscript)
+
+## VirtualNetworkPeerings
+
+- [CreateOrUpdate](#virtualnetworkpeerings_createorupdate)
+- [Delete](#virtualnetworkpeerings_delete)
+- [Get](#virtualnetworkpeerings_get)
+- [List](#virtualnetworkpeerings_list)
+
+## VirtualNetworkTaps
+
+- [CreateOrUpdate](#virtualnetworktaps_createorupdate)
+- [Delete](#virtualnetworktaps_delete)
+- [GetByResourceGroup](#virtualnetworktaps_getbyresourcegroup)
+- [List](#virtualnetworktaps_list)
+- [ListByResourceGroup](#virtualnetworktaps_listbyresourcegroup)
+- [UpdateTags](#virtualnetworktaps_updatetags)
+
+## VirtualNetworks
+
+- [CheckIpAddressAvailability](#virtualnetworks_checkipaddressavailability)
+- [CreateOrUpdate](#virtualnetworks_createorupdate)
+- [Delete](#virtualnetworks_delete)
+- [GetByResourceGroup](#virtualnetworks_getbyresourcegroup)
+- [List](#virtualnetworks_list)
+- [ListByResourceGroup](#virtualnetworks_listbyresourcegroup)
+- [ListUsage](#virtualnetworks_listusage)
+- [UpdateTags](#virtualnetworks_updatetags)
+
+## VirtualRouterPeerings
+
+- [CreateOrUpdate](#virtualrouterpeerings_createorupdate)
+- [Delete](#virtualrouterpeerings_delete)
+- [Get](#virtualrouterpeerings_get)
+- [List](#virtualrouterpeerings_list)
+
+## VirtualRouters
+
+- [CreateOrUpdate](#virtualrouters_createorupdate)
+- [Delete](#virtualrouters_delete)
+- [GetByResourceGroup](#virtualrouters_getbyresourcegroup)
+- [List](#virtualrouters_list)
+- [ListByResourceGroup](#virtualrouters_listbyresourcegroup)
+
+## VirtualWans
+
+- [CreateOrUpdate](#virtualwans_createorupdate)
+- [Delete](#virtualwans_delete)
+- [GetByResourceGroup](#virtualwans_getbyresourcegroup)
+- [List](#virtualwans_list)
+- [ListByResourceGroup](#virtualwans_listbyresourcegroup)
+- [UpdateTags](#virtualwans_updatetags)
+
+## VpnConnections
+
+- [CreateOrUpdate](#vpnconnections_createorupdate)
+- [Delete](#vpnconnections_delete)
+- [Get](#vpnconnections_get)
+- [ListByVpnGateway](#vpnconnections_listbyvpngateway)
+- [StartPacketCapture](#vpnconnections_startpacketcapture)
+- [StopPacketCapture](#vpnconnections_stoppacketcapture)
+
+## VpnGateways
+
+- [CreateOrUpdate](#vpngateways_createorupdate)
+- [Delete](#vpngateways_delete)
+- [GetByResourceGroup](#vpngateways_getbyresourcegroup)
+- [List](#vpngateways_list)
+- [ListByResourceGroup](#vpngateways_listbyresourcegroup)
+- [Reset](#vpngateways_reset)
+- [StartPacketCapture](#vpngateways_startpacketcapture)
+- [StopPacketCapture](#vpngateways_stoppacketcapture)
+- [UpdateTags](#vpngateways_updatetags)
+
+## VpnLinkConnections
+
+- [GetIkeSas](#vpnlinkconnections_getikesas)
+- [ListByVpnConnection](#vpnlinkconnections_listbyvpnconnection)
+- [ResetConnection](#vpnlinkconnections_resetconnection)
+
+## VpnServerConfigurations
+
+- [CreateOrUpdate](#vpnserverconfigurations_createorupdate)
+- [Delete](#vpnserverconfigurations_delete)
+- [GetByResourceGroup](#vpnserverconfigurations_getbyresourcegroup)
+- [List](#vpnserverconfigurations_list)
+- [ListByResourceGroup](#vpnserverconfigurations_listbyresourcegroup)
+- [UpdateTags](#vpnserverconfigurations_updatetags)
+
+## VpnServerConfigurationsAssociatedWithVirtualWan
+
+- [List](#vpnserverconfigurationsassociatedwithvirtualwan_list)
+
+## VpnSiteLinkConnections
+
+- [Get](#vpnsitelinkconnections_get)
+
+## VpnSiteLinks
+
+- [Get](#vpnsitelinks_get)
+- [ListByVpnSite](#vpnsitelinks_listbyvpnsite)
+
+## VpnSites
+
+- [CreateOrUpdate](#vpnsites_createorupdate)
+- [Delete](#vpnsites_delete)
+- [GetByResourceGroup](#vpnsites_getbyresourcegroup)
+- [List](#vpnsites_list)
+- [ListByResourceGroup](#vpnsites_listbyresourcegroup)
+- [UpdateTags](#vpnsites_updatetags)
+
+## VpnSitesConfiguration
+
+- [Download](#vpnsitesconfiguration_download)
+
+## WebApplicationFirewallPolicies
+
+- [CreateOrUpdate](#webapplicationfirewallpolicies_createorupdate)
+- [Delete](#webapplicationfirewallpolicies_delete)
+- [GetByResourceGroup](#webapplicationfirewallpolicies_getbyresourcegroup)
+- [List](#webapplicationfirewallpolicies_list)
+- [ListByResourceGroup](#webapplicationfirewallpolicies_listbyresourcegroup)
+
+## WebCategories
+
+- [Get](#webcategories_get)
+- [List](#webcategories_list)
+### ApplicationGatewayPrivateEndpointConnections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections Delete. */
+public final class ApplicationGatewayPrivateEndpointConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayPrivateEndpointConnectionDelete.json
+ */
+ /**
+ * Sample code: Delete Application Gateway Private Endpoint Connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteApplicationGatewayPrivateEndpointConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGatewayPrivateEndpointConnections().delete("rg1", "appgw", "connection1", Context.NONE);
+ }
+}
+```
+
+### ApplicationGatewayPrivateEndpointConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections Get. */
+public final class ApplicationGatewayPrivateEndpointConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayPrivateEndpointConnectionGet.json
+ */
+ /**
+ * Sample code: Get Application Gateway Private Endpoint Connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getApplicationGatewayPrivateEndpointConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .applicationGatewayPrivateEndpointConnections()
+ .getWithResponse("rg1", "appgw", "connection1", Context.NONE);
+ }
+}
+```
+
+### ApplicationGatewayPrivateEndpointConnections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections List. */
+public final class ApplicationGatewayPrivateEndpointConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayPrivateEndpointConnectionList.json
+ */
+ /**
+ * Sample code: Lists all private endpoint connections on application gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listsAllPrivateEndpointConnectionsOnApplicationGateway(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGatewayPrivateEndpointConnections().list("rg1", "appgw", Context.NONE);
+ }
+}
+```
+
+### ApplicationGatewayPrivateEndpointConnections_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner;
+import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections Update. */
+public final class ApplicationGatewayPrivateEndpointConnectionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayPrivateEndpointConnectionUpdate.json
+ */
+ /**
+ * Sample code: Update Application Gateway Private Endpoint Connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateApplicationGatewayPrivateEndpointConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .applicationGatewayPrivateEndpointConnections()
+ .update(
+ "rg1",
+ "appgw",
+ "connection1",
+ new ApplicationGatewayPrivateEndpointConnectionInner()
+ .withName("connection1")
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionState()
+ .withStatus("Approved")
+ .withDescription("approved it for some reason.")),
+ Context.NONE);
+ }
+}
+```
+
+### ApplicationGatewayPrivateLinkResources_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateLinkResources List. */
+public final class ApplicationGatewayPrivateLinkResourcesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayPrivateLinkResourceList.json
+ */
+ /**
+ * Sample code: Lists all private link resources on application gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listsAllPrivateLinkResourcesOnApplicationGateway(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGatewayPrivateLinkResources().list("rg1", "appgw", Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_BackendHealth
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways BackendHealth. */
+public final class ApplicationGatewaysBackendHealthSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayBackendHealthGet.json
+ */
+ /**
+ * Sample code: Get Backend Health.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getBackendHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().backendHealth("appgw", "appgw", null, Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_BackendHealthOnDemand
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol;
+
+/** Samples for ApplicationGateways BackendHealthOnDemand. */
+public final class ApplicationGatewaysBackendHealthOnDemandSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayBackendHealthTest.json
+ */
+ /**
+ * Sample code: Test Backend Health.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void testBackendHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .applicationGateways()
+ .backendHealthOnDemand(
+ "rg1",
+ "appgw",
+ new ApplicationGatewayOnDemandProbe()
+ .withProtocol(ApplicationGatewayProtocol.HTTP)
+ .withPath("/")
+ .withTimeout(30)
+ .withPickHostnameFromBackendHttpSettings(true)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"))
+ .withBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings")),
+ null,
+ Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddress;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayClientAuthConfiguration;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCookieBasedAffinity;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayGlobalConfiguration;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHeaderConfiguration;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionAlgorithm;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionPolicy;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionTarget;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPathRule;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRule;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRule;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleActionSet;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleCondition;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleSet;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySku;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySkuName;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCertificate;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicy;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyType;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProfile;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTier;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedClientCertificate;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedRootCertificate;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlConfiguration;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlPathMap;
+import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities;
+import com.azure.resourcemanager.network.generated.models.ResourceIdentityType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ApplicationGateways CreateOrUpdate. */
+public final class ApplicationGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayCreate.json
+ */
+ /**
+ * Sample code: Create Application Gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .applicationGateways()
+ .define("appgw")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withIdentity(
+ new ManagedServiceIdentity()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
+ new ManagedServiceIdentityUserAssignedIdentities())))
+ .withSku(
+ new ApplicationGatewaySku()
+ .withName(ApplicationGatewaySkuName.STANDARD_V2)
+ .withTier(ApplicationGatewayTier.STANDARD_V2)
+ .withCapacity(3))
+ .withGatewayIpConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayIpConfiguration()
+ .withName("appgwipc")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/appgwsubnet"))))
+ .withTrustedRootCertificates(
+ Arrays
+ .asList(
+ new ApplicationGatewayTrustedRootCertificate().withName("rootcert").withData("****"),
+ new ApplicationGatewayTrustedRootCertificate()
+ .withName("rootcert1")
+ .withKeyVaultSecretId("https://kv/secret")))
+ .withTrustedClientCertificates(
+ Arrays.asList(new ApplicationGatewayTrustedClientCertificate().withName("clientcert").withData("****")))
+ .withSslCertificates(
+ Arrays
+ .asList(
+ new ApplicationGatewaySslCertificate()
+ .withName("sslcert")
+ .withData("****")
+ .withPassword("****"),
+ new ApplicationGatewaySslCertificate()
+ .withName("sslcert2")
+ .withKeyVaultSecretId("https://kv/secret")))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayFrontendIpConfiguration()
+ .withName("appgwfip")
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"))))
+ .withFrontendPorts(
+ Arrays
+ .asList(
+ new ApplicationGatewayFrontendPort().withName("appgwfp").withPort(443),
+ new ApplicationGatewayFrontendPort().withName("appgwfp80").withPort(80)))
+ .withBackendAddressPools(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendAddressPool()
+ .withName("appgwpool")
+ .withBackendAddresses(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.1"),
+ new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.2"))),
+ new ApplicationGatewayBackendAddressPool()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1")
+ .withName("appgwpool1")
+ .withBackendAddresses(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendAddress(),
+ new ApplicationGatewayBackendAddress()))))
+ .withBackendHttpSettingsCollection(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendHttpSettings()
+ .withName("appgwbhs")
+ .withPort(80)
+ .withProtocol(ApplicationGatewayProtocol.HTTP)
+ .withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity.DISABLED)
+ .withRequestTimeout(30)))
+ .withHttpListeners(
+ Arrays
+ .asList(
+ new ApplicationGatewayHttpListener()
+ .withName("appgwhl")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"))
+ .withFrontendPort(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"))
+ .withProtocol(ApplicationGatewayProtocol.HTTPS)
+ .withSslCertificate(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"))
+ .withSslProfile(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"))
+ .withRequireServerNameIndication(false),
+ new ApplicationGatewayHttpListener()
+ .withName("appgwhttplistener")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"))
+ .withFrontendPort(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"))
+ .withProtocol(ApplicationGatewayProtocol.HTTP)))
+ .withSslProfiles(
+ Arrays
+ .asList(
+ new ApplicationGatewaySslProfile()
+ .withName("sslProfile1")
+ .withTrustedClientCertificates(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert")))
+ .withSslPolicy(
+ new ApplicationGatewaySslPolicy()
+ .withPolicyType(ApplicationGatewaySslPolicyType.CUSTOM)
+ .withCipherSuites(
+ Arrays
+ .asList(
+ ApplicationGatewaySslCipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256))
+ .withMinProtocolVersion(ApplicationGatewaySslProtocol.TLSV1_1))
+ .withClientAuthConfiguration(
+ new ApplicationGatewayClientAuthConfiguration().withVerifyClientCertIssuerDN(true))))
+ .withUrlPathMaps(
+ Arrays
+ .asList(
+ new ApplicationGatewayUrlPathMap()
+ .withName("pathMap1")
+ .withDefaultBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"))
+ .withDefaultBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"))
+ .withDefaultRewriteRuleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"))
+ .withDefaultLoadDistributionPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"))
+ .withPathRules(
+ Arrays
+ .asList(
+ new ApplicationGatewayPathRule()
+ .withName("apiPaths")
+ .withPaths(Arrays.asList("/api", "/v1/api"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"))
+ .withBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"))
+ .withRewriteRuleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"))
+ .withLoadDistributionPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"))))))
+ .withRequestRoutingRules(
+ Arrays
+ .asList(
+ new ApplicationGatewayRequestRoutingRule()
+ .withName("appgwrule")
+ .withRuleType(ApplicationGatewayRequestRoutingRuleType.BASIC)
+ .withPriority(10)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"))
+ .withBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"))
+ .withHttpListener(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"))
+ .withRewriteRuleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"))
+ .withLoadDistributionPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")),
+ new ApplicationGatewayRequestRoutingRule()
+ .withName("appgwPathBasedRule")
+ .withRuleType(ApplicationGatewayRequestRoutingRuleType.PATH_BASED_ROUTING)
+ .withPriority(20)
+ .withHttpListener(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"))
+ .withUrlPathMap(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"))))
+ .withRewriteRuleSets(
+ Arrays
+ .asList(
+ new ApplicationGatewayRewriteRuleSet()
+ .withName("rewriteRuleSet1")
+ .withRewriteRules(
+ Arrays
+ .asList(
+ new ApplicationGatewayRewriteRule()
+ .withName("Set X-Forwarded-For")
+ .withRuleSequence(102)
+ .withConditions(
+ Arrays
+ .asList(
+ new ApplicationGatewayRewriteRuleCondition()
+ .withVariable("http_req_Authorization")
+ .withPattern("^Bearer")
+ .withIgnoreCase(true)
+ .withNegate(false)))
+ .withActionSet(
+ new ApplicationGatewayRewriteRuleActionSet()
+ .withRequestHeaderConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayHeaderConfiguration()
+ .withHeaderName("X-Forwarded-For")
+ .withHeaderValue(
+ "{var_add_x_forwarded_for_proxy}")))
+ .withResponseHeaderConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayHeaderConfiguration()
+ .withHeaderName("Strict-Transport-Security")
+ .withHeaderValue("max-age=31536000")))
+ .withUrlConfiguration(
+ new ApplicationGatewayUrlConfiguration()
+ .withModifiedPath("/abc")))))))
+ .withLoadDistributionPolicies(
+ Arrays
+ .asList(
+ new ApplicationGatewayLoadDistributionPolicy()
+ .withName("ldp1")
+ .withLoadDistributionTargets(
+ Arrays
+ .asList(
+ new ApplicationGatewayLoadDistributionTarget()
+ .withName("ld11")
+ .withWeightPerServer(40)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")),
+ new ApplicationGatewayLoadDistributionTarget()
+ .withName("ld11")
+ .withWeightPerServer(60)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"))))
+ .withLoadDistributionAlgorithm(ApplicationGatewayLoadDistributionAlgorithm.ROUND_ROBIN)))
+ .withGlobalConfiguration(
+ new ApplicationGatewayGlobalConfiguration()
+ .withEnableRequestBuffering(true)
+ .withEnableResponseBuffering(true))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ApplicationGateways_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways Delete. */
+public final class ApplicationGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayDelete.json
+ */
+ /**
+ * Sample code: Delete ApplicationGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().delete("rg1", "appgw", Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways GetByResourceGroup. */
+public final class ApplicationGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayGet.json
+ */
+ /**
+ * Sample code: Get ApplicationGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().getByResourceGroupWithResponse("rg1", "appgw", Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_GetSslPredefinedPolicy
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways GetSslPredefinedPolicy. */
+public final class ApplicationGatewaysGetSslPredefinedPolicySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json
+ */
+ /**
+ * Sample code: Get Available Ssl Predefined Policy by name.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableSslPredefinedPolicyByName(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().getSslPredefinedPolicyWithResponse("AppGwSslPolicy20150501", Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways List. */
+public final class ApplicationGatewaysListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayListAll.json
+ */
+ /**
+ * Sample code: Lists all application gateways in a subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listsAllApplicationGatewaysInASubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().list(Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_ListAvailableRequestHeaders
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableRequestHeaders. */
+public final class ApplicationGatewaysListAvailableRequestHeadersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayAvailableRequestHeadersGet.json
+ */
+ /**
+ * Sample code: Get Available Request Headers.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableRequestHeaders(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().listAvailableRequestHeadersWithResponse(Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_ListAvailableResponseHeaders
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableResponseHeaders. */
+public final class ApplicationGatewaysListAvailableResponseHeadersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayAvailableResponseHeadersGet.json
+ */
+ /**
+ * Sample code: Get Available Response Headers.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableResponseHeaders(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().listAvailableResponseHeadersWithResponse(Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_ListAvailableServerVariables
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableServerVariables. */
+public final class ApplicationGatewaysListAvailableServerVariablesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayAvailableServerVariablesGet.json
+ */
+ /**
+ * Sample code: Get Available Server Variables.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableServerVariables(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().listAvailableServerVariablesWithResponse(Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_ListAvailableSslOptions
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableSslOptions. */
+public final class ApplicationGatewaysListAvailableSslOptionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayAvailableSslOptionsGet.json
+ */
+ /**
+ * Sample code: Get Available Ssl Options.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableSslOptions(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().listAvailableSslOptionsWithResponse(Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_ListAvailableSslPredefinedPolicies
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableSslPredefinedPolicies. */
+public final class ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json
+ */
+ /**
+ * Sample code: Get Available Ssl Predefined Policies.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableSslPredefinedPolicies(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().listAvailableSslPredefinedPolicies(Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_ListAvailableWafRuleSets
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableWafRuleSets. */
+public final class ApplicationGatewaysListAvailableWafRuleSetsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayAvailableWafRuleSetsGet.json
+ */
+ /**
+ * Sample code: Get Available Waf Rule Sets.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableWafRuleSets(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().listAvailableWafRuleSetsWithResponse(Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListByResourceGroup. */
+public final class ApplicationGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayList.json
+ */
+ /**
+ * Sample code: Lists all application gateways in a resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listsAllApplicationGatewaysInAResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_Start
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways Start. */
+public final class ApplicationGatewaysStartSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayStart.json
+ */
+ /**
+ * Sample code: Start Application Gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().start("rg1", "appgw", Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_Stop
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways Stop. */
+public final class ApplicationGatewaysStopSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayStop.json
+ */
+ /**
+ * Sample code: Stop Application Gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void stopApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationGateways().stop("rg1", "appgw", Context.NONE);
+ }
+}
+```
+
+### ApplicationGateways_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ApplicationGateway;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ApplicationGateways UpdateTags. */
+public final class ApplicationGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: Update Application Gateway tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateApplicationGatewayTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ApplicationGateway resource =
+ manager.applicationGateways().getByResourceGroupWithResponse("rg1", "AppGw", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ApplicationSecurityGroups_CreateOrUpdate
+
+```java
+/** Samples for ApplicationSecurityGroups CreateOrUpdate. */
+public final class ApplicationSecurityGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationSecurityGroupCreate.json
+ */
+ /**
+ * Sample code: Create application security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createApplicationSecurityGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .applicationSecurityGroups()
+ .define("test-asg")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .create();
+ }
+}
+```
+
+### ApplicationSecurityGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups Delete. */
+public final class ApplicationSecurityGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationSecurityGroupDelete.json
+ */
+ /**
+ * Sample code: Delete application security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteApplicationSecurityGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationSecurityGroups().delete("rg1", "test-asg", Context.NONE);
+ }
+}
+```
+
+### ApplicationSecurityGroups_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups GetByResourceGroup. */
+public final class ApplicationSecurityGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationSecurityGroupGet.json
+ */
+ /**
+ * Sample code: Get application security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getApplicationSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationSecurityGroups().getByResourceGroupWithResponse("rg1", "test-asg", Context.NONE);
+ }
+}
+```
+
+### ApplicationSecurityGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups List. */
+public final class ApplicationSecurityGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationSecurityGroupListAll.json
+ */
+ /**
+ * Sample code: List all application security groups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllApplicationSecurityGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationSecurityGroups().list(Context.NONE);
+ }
+}
+```
+
+### ApplicationSecurityGroups_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups ListByResourceGroup. */
+public final class ApplicationSecurityGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationSecurityGroupList.json
+ */
+ /**
+ * Sample code: List load balancers in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listLoadBalancersInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.applicationSecurityGroups().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### ApplicationSecurityGroups_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ApplicationSecurityGroups UpdateTags. */
+public final class ApplicationSecurityGroupsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ApplicationSecurityGroupUpdateTags.json
+ */
+ /**
+ * Sample code: Update application security group tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateApplicationSecurityGroupTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ApplicationSecurityGroup resource =
+ manager
+ .applicationSecurityGroups()
+ .getByResourceGroupWithResponse("rg1", "test-asg", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### AvailableDelegations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailableDelegations List. */
+public final class AvailableDelegationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AvailableDelegationsSubscriptionGet.json
+ */
+ /**
+ * Sample code: Get available delegations.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableDelegations(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.availableDelegations().list("westcentralus", Context.NONE);
+ }
+}
+```
+
+### AvailableEndpointServices_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailableEndpointServices List. */
+public final class AvailableEndpointServicesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/EndpointServicesList.json
+ */
+ /**
+ * Sample code: EndpointServicesList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void endpointServicesList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.availableEndpointServices().list("westus", Context.NONE);
+ }
+}
+```
+
+### AvailablePrivateEndpointTypes_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailablePrivateEndpointTypes List. */
+public final class AvailablePrivateEndpointTypesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AvailablePrivateEndpointTypesGet.json
+ */
+ /**
+ * Sample code: Get available PrivateEndpoint types.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailablePrivateEndpointTypes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.availablePrivateEndpointTypes().list("regionName", Context.NONE);
+ }
+}
+```
+
+### AvailablePrivateEndpointTypes_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailablePrivateEndpointTypes ListByResourceGroup. */
+public final class AvailablePrivateEndpointTypesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AvailablePrivateEndpointTypesResourceGroupGet.json
+ */
+ /**
+ * Sample code: Get available PrivateEndpoint types in the resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailablePrivateEndpointTypesInTheResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.availablePrivateEndpointTypes().listByResourceGroup("regionName", "rg1", Context.NONE);
+ }
+}
+```
+
+### AvailableResourceGroupDelegations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailableResourceGroupDelegations List. */
+public final class AvailableResourceGroupDelegationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AvailableDelegationsResourceGroupGet.json
+ */
+ /**
+ * Sample code: Get available delegations in the resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableDelegationsInTheResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.availableResourceGroupDelegations().list("westcentralus", "rg1", Context.NONE);
+ }
+}
+```
+
+### AvailableServiceAliases_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailableServiceAliases List. */
+public final class AvailableServiceAliasesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AvailableServiceAliasesList.json
+ */
+ /**
+ * Sample code: Get available service aliases.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableServiceAliases(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.availableServiceAliases().list("westcentralus", Context.NONE);
+ }
+}
+```
+
+### AvailableServiceAliases_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailableServiceAliases ListByResourceGroup. */
+public final class AvailableServiceAliasesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AvailableServiceAliasesListByResourceGroup.json
+ */
+ /**
+ * Sample code: Get available service aliases in the resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableServiceAliasesInTheResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.availableServiceAliases().listByResourceGroup("rg1", "westcentralus", Context.NONE);
+ }
+}
+```
+
+### AzureFirewallFqdnTags_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewallFqdnTags List. */
+public final class AzureFirewallFqdnTagsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallFqdnTagsListBySubscription.json
+ */
+ /**
+ * Sample code: List all Azure Firewall FQDN Tags for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllAzureFirewallFQDNTagsForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewallFqdnTags().list(Context.NONE);
+ }
+}
+```
+
+### AzureFirewalls_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRule;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleProtocol;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleProtocolType;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRCAction;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRCActionType;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRule;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRule;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleProtocol;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallRCAction;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallRCActionType;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallSku;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallSkuName;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallSkuTier;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode;
+import com.azure.resourcemanager.network.generated.models.HubIpAddresses;
+import com.azure.resourcemanager.network.generated.models.HubPublicIpAddresses;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for AzureFirewalls CreateOrUpdate. */
+public final class AzureFirewallsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallPutWithIpGroups.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createAzureFirewallWithIpGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .azureFirewalls()
+ .define("azurefirewall")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription("Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallPutWithZones.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With Zones.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createAzureFirewallWithZones(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .azureFirewalls()
+ .define("azurefirewall")
+ .withRegion("West US 2")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList("1", "2", "3"))
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription("Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallPut.json
+ */
+ /**
+ * Sample code: Create Azure Firewall.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .azureFirewalls()
+ .define("azurefirewall")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription("Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallPutWithAdditionalProperties.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With Additional Properties.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createAzureFirewallWithAdditionalProperties(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .azureFirewalls()
+ .define("azurefirewall")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription("Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD))
+ .withAdditionalProperties(mapOf("key1", "value1", "key2", "value2"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallPutInHub.json
+ */
+ /**
+ * Sample code: Create Azure Firewall in virtual Hub.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createAzureFirewallInVirtualHub(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .azureFirewalls()
+ .define("azurefirewall")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withVirtualHub(
+ new SubResource()
+ .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"))
+ .withFirewallPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"))
+ .withHubIpAddresses(
+ new HubIpAddresses()
+ .withPublicIPs(new HubPublicIpAddresses().withAddresses(Arrays.asList()).withCount(1)))
+ .withSku(
+ new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_HUB).withTier(AzureFirewallSkuTier.STANDARD))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallPutWithMgmtSubnet.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With management subnet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createAzureFirewallWithManagementSubnet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .azureFirewalls()
+ .define("azurefirewall")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription("Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withManagementIpConfiguration(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallMgmtIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName")))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### AzureFirewalls_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls Delete. */
+public final class AzureFirewallsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallDelete.json
+ */
+ /**
+ * Sample code: Delete Azure Firewall.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().delete("rg1", "azurefirewall", Context.NONE);
+ }
+}
+```
+
+### AzureFirewalls_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls GetByResourceGroup. */
+public final class AzureFirewallsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallGetWithAdditionalProperties.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With Additional Properties.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAzureFirewallWithAdditionalProperties(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallGetWithIpGroups.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAzureFirewallWithIpGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallGetWithZones.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With Zones.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAzureFirewallWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallGetWithMgmtSubnet.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With management subnet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAzureFirewallWithManagementSubnet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallGet.json
+ */
+ /**
+ * Sample code: Get Azure Firewall.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+}
+```
+
+### AzureFirewalls_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls List. */
+public final class AzureFirewallsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallListBySubscription.json
+ */
+ /**
+ * Sample code: List all Azure Firewalls for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllAzureFirewallsForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().list(Context.NONE);
+ }
+}
+```
+
+### AzureFirewalls_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls ListByResourceGroup. */
+public final class AzureFirewallsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Azure Firewalls for a given resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllAzureFirewallsForAGivenResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.azureFirewalls().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### AzureFirewalls_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.AzureFirewall;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for AzureFirewalls UpdateTags. */
+public final class AzureFirewallsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureFirewallUpdateTags.json
+ */
+ /**
+ * Sample code: Update Azure Firewall Tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateAzureFirewallTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ AzureFirewall resource =
+ manager.azureFirewalls().getByResourceGroupWithResponse("azfwtest", "fw1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### BastionHosts_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration;
+import java.util.Arrays;
+
+/** Samples for BastionHosts CreateOrUpdate. */
+public final class BastionHostsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionHostPut.json
+ */
+ /**
+ * Sample code: Create Bastion Host.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .bastionHosts()
+ .define("bastionhosttenant")
+ .withRegion((String) null)
+ .withExistingResourceGroup("rg1")
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new BastionHostIpConfiguration()
+ .withName("bastionHostIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .create();
+ }
+}
+```
+
+### BastionHosts_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts Delete. */
+public final class BastionHostsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionHostDelete.json
+ */
+ /**
+ * Sample code: Delete Bastion Host.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.bastionHosts().delete("rg1", "bastionhosttenant", Context.NONE);
+ }
+}
+```
+
+### BastionHosts_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts GetByResourceGroup. */
+public final class BastionHostsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionHostGet.json
+ */
+ /**
+ * Sample code: Get Bastion Host.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.bastionHosts().getByResourceGroupWithResponse("rg1", "bastionhosttenant'", Context.NONE);
+ }
+}
+```
+
+### BastionHosts_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts List. */
+public final class BastionHostsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionHostListBySubscription.json
+ */
+ /**
+ * Sample code: List all Bastion Hosts for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllBastionHostsForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.bastionHosts().list(Context.NONE);
+ }
+}
+```
+
+### BastionHosts_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts ListByResourceGroup. */
+public final class BastionHostsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionHostListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Bastion Hosts for a given resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllBastionHostsForAGivenResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.bastionHosts().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### BastionHosts_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.BastionHost;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for BastionHosts UpdateTags. */
+public final class BastionHostsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionHostPatch.json
+ */
+ /**
+ * Sample code: Patch Bastion Host.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void patchBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ BastionHost resource =
+ manager.bastionHosts().getByResourceGroupWithResponse("rg1", "bastionhosttenant", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### BgpServiceCommunities_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for BgpServiceCommunities List. */
+public final class BgpServiceCommunitiesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceCommunityList.json
+ */
+ /**
+ * Sample code: ServiceCommunityList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void serviceCommunityList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.bgpServiceCommunities().list(Context.NONE);
+ }
+}
+```
+
+### ConnectionMonitors_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilter;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterItem;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterItemType;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterType;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTcpConfiguration;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfigurationProtocol;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup;
+import java.util.Arrays;
+
+/** Samples for ConnectionMonitors CreateOrUpdate. */
+public final class ConnectionMonitorsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorCreate.json
+ */
+ /**
+ * Sample code: Create connection monitor V1.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createConnectionMonitorV1(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .connectionMonitors()
+ .define("cm1")
+ .withExistingNetworkWatcher("rg1", "nw1")
+ .withRegion("eastus")
+ .withEndpoints(
+ Arrays
+ .asList(
+ new ConnectionMonitorEndpoint()
+ .withName("source")
+ .withResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"),
+ new ConnectionMonitorEndpoint().withName("destination").withAddress("bing.com")))
+ .withTestConfigurations(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestConfiguration()
+ .withName("tcp")
+ .withTestFrequencySec(60)
+ .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP)
+ .withTcpConfiguration(new ConnectionMonitorTcpConfiguration().withPort(80))))
+ .withTestGroups(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestGroup()
+ .withName("tg")
+ .withTestConfigurations(Arrays.asList("tcp"))
+ .withSources(Arrays.asList("source"))
+ .withDestinations(Arrays.asList("destination"))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorV2Create.json
+ */
+ /**
+ * Sample code: Create connection monitor V2.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createConnectionMonitorV2(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .connectionMonitors()
+ .define("cm1")
+ .withExistingNetworkWatcher("rg1", "nw1")
+ .withEndpoints(
+ Arrays
+ .asList(
+ new ConnectionMonitorEndpoint()
+ .withName("vm1")
+ .withResourceId(
+ "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"),
+ new ConnectionMonitorEndpoint()
+ .withName("CanaryWorkspaceVamshi")
+ .withResourceId(
+ "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace")
+ .withFilter(
+ new ConnectionMonitorEndpointFilter()
+ .withType(ConnectionMonitorEndpointFilterType.INCLUDE)
+ .withItems(
+ Arrays
+ .asList(
+ new ConnectionMonitorEndpointFilterItem()
+ .withType(ConnectionMonitorEndpointFilterItemType.AGENT_ADDRESS)
+ .withAddress("npmuser")))),
+ new ConnectionMonitorEndpoint().withName("bing").withAddress("bing.com"),
+ new ConnectionMonitorEndpoint().withName("google").withAddress("google.com")))
+ .withTestConfigurations(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestConfiguration()
+ .withName("testConfig1")
+ .withTestFrequencySec(60)
+ .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP)
+ .withTcpConfiguration(
+ new ConnectionMonitorTcpConfiguration().withPort(80).withDisableTraceRoute(false))))
+ .withTestGroups(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestGroup()
+ .withName("test1")
+ .withDisable(false)
+ .withTestConfigurations(Arrays.asList("testConfig1"))
+ .withSources(Arrays.asList("vm1", "CanaryWorkspaceVamshi"))
+ .withDestinations(Arrays.asList("bing", "google"))))
+ .withOutputs(Arrays.asList())
+ .create();
+ }
+}
+```
+
+### ConnectionMonitors_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Delete. */
+public final class ConnectionMonitorsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorDelete.json
+ */
+ /**
+ * Sample code: Delete connection monitor.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.connectionMonitors().delete("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
+```
+
+### ConnectionMonitors_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Get. */
+public final class ConnectionMonitorsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorGet.json
+ */
+ /**
+ * Sample code: Get connection monitor.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.connectionMonitors().getWithResponse("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
+```
+
+### ConnectionMonitors_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors List. */
+public final class ConnectionMonitorsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorList.json
+ */
+ /**
+ * Sample code: List connection monitors.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listConnectionMonitors(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.connectionMonitors().list("rg1", "nw1", Context.NONE);
+ }
+}
+```
+
+### ConnectionMonitors_Query
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Query. */
+public final class ConnectionMonitorsQuerySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorQuery.json
+ */
+ /**
+ * Sample code: Query connection monitor.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void queryConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.connectionMonitors().query("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
+```
+
+### ConnectionMonitors_Start
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Start. */
+public final class ConnectionMonitorsStartSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorStart.json
+ */
+ /**
+ * Sample code: Start connection monitor.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.connectionMonitors().start("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
+```
+
+### ConnectionMonitors_Stop
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Stop. */
+public final class ConnectionMonitorsStopSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorStop.json
+ */
+ /**
+ * Sample code: Stop connection monitor.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void stopConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.connectionMonitors().stop("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
+```
+
+### ConnectionMonitors_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitorResult;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ConnectionMonitors UpdateTags. */
+public final class ConnectionMonitorsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectionMonitorUpdateTags.json
+ */
+ /**
+ * Sample code: Update connection monitor tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateConnectionMonitorTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ConnectionMonitorResult resource =
+ manager.connectionMonitors().getWithResponse("rg1", "nw1", "cm1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### CustomIpPrefixes_CreateOrUpdate
+
+```java
+/** Samples for CustomIpPrefixes CreateOrUpdate. */
+public final class CustomIpPrefixesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CustomIpPrefixCreateCustomizedValues.json
+ */
+ /**
+ * Sample code: Create custom IP prefix allocation method.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createCustomIPPrefixAllocationMethod(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .customIpPrefixes()
+ .define("test-customipprefix")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withCidr("0.0.0.0/24")
+ .create();
+ }
+}
+```
+
+### CustomIpPrefixes_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes Delete. */
+public final class CustomIpPrefixesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CustomIpPrefixDelete.json
+ */
+ /**
+ * Sample code: Delete custom IP prefix.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteCustomIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.customIpPrefixes().delete("rg1", "test-customipprefix", Context.NONE);
+ }
+}
+```
+
+### CustomIpPrefixes_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes GetByResourceGroup. */
+public final class CustomIpPrefixesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CustomIpPrefixGet.json
+ */
+ /**
+ * Sample code: Get custom IP prefix.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getCustomIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.customIpPrefixes().getByResourceGroupWithResponse("rg1", "test-customipprefix", null, Context.NONE);
+ }
+}
+```
+
+### CustomIpPrefixes_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes List. */
+public final class CustomIpPrefixesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CustomIpPrefixListAll.json
+ */
+ /**
+ * Sample code: List all custom IP prefixes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllCustomIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.customIpPrefixes().list(Context.NONE);
+ }
+}
+```
+
+### CustomIpPrefixes_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes ListByResourceGroup. */
+public final class CustomIpPrefixesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CustomIpPrefixList.json
+ */
+ /**
+ * Sample code: List resource group Custom IP prefixes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listResourceGroupCustomIPPrefixes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.customIpPrefixes().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### CustomIpPrefixes_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.CustomIpPrefix;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CustomIpPrefixes UpdateTags. */
+public final class CustomIpPrefixesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CustomIpPrefixUpdateTags.json
+ */
+ /**
+ * Sample code: Update public IP address tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updatePublicIPAddressTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ CustomIpPrefix resource =
+ manager
+ .customIpPrefixes()
+ .getByResourceGroupWithResponse("rg1", "test-customipprefix", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DdosCustomPolicies_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.DdosCustomPolicyProtocol;
+import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat;
+import java.util.Arrays;
+
+/** Samples for DdosCustomPolicies CreateOrUpdate. */
+public final class DdosCustomPoliciesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosCustomPolicyCreate.json
+ */
+ /**
+ * Sample code: Create DDoS custom policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .ddosCustomPolicies()
+ .define("test-ddos-custom-policy")
+ .withRegion("centraluseuap")
+ .withExistingResourceGroup("rg1")
+ .withProtocolCustomSettings(
+ Arrays.asList(new ProtocolCustomSettingsFormat().withProtocol(DdosCustomPolicyProtocol.TCP)))
+ .create();
+ }
+}
+```
+
+### DdosCustomPolicies_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DdosCustomPolicies Delete. */
+public final class DdosCustomPoliciesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosCustomPolicyDelete.json
+ */
+ /**
+ * Sample code: Delete DDoS custom policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ddosCustomPolicies().delete("rg1", "test-ddos-custom-policy", Context.NONE);
+ }
+}
+```
+
+### DdosCustomPolicies_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DdosCustomPolicies GetByResourceGroup. */
+public final class DdosCustomPoliciesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosCustomPolicyGet.json
+ */
+ /**
+ * Sample code: Get DDoS custom policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ddosCustomPolicies().getByResourceGroupWithResponse("rg1", "test-ddos-custom-policy", Context.NONE);
+ }
+}
+```
+
+### DdosCustomPolicies_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.DdosCustomPolicy;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DdosCustomPolicies UpdateTags. */
+public final class DdosCustomPoliciesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosCustomPolicyUpdateTags.json
+ */
+ /**
+ * Sample code: DDoS Custom policy Update tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void dDoSCustomPolicyUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ DdosCustomPolicy resource =
+ manager
+ .ddosCustomPolicies()
+ .getByResourceGroupWithResponse("rg1", "test-ddos-custom-policy", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DdosProtectionPlans_CreateOrUpdate
+
+```java
+/** Samples for DdosProtectionPlans CreateOrUpdate. */
+public final class DdosProtectionPlansCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosProtectionPlanCreate.json
+ */
+ /**
+ * Sample code: Create DDoS protection plan.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .ddosProtectionPlans()
+ .define("test-plan")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .create();
+ }
+}
+```
+
+### DdosProtectionPlans_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans Delete. */
+public final class DdosProtectionPlansDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosProtectionPlanDelete.json
+ */
+ /**
+ * Sample code: Delete DDoS protection plan.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ddosProtectionPlans().delete("rg1", "test-plan", Context.NONE);
+ }
+}
+```
+
+### DdosProtectionPlans_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans GetByResourceGroup. */
+public final class DdosProtectionPlansGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosProtectionPlanGet.json
+ */
+ /**
+ * Sample code: Get DDoS protection plan.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ddosProtectionPlans().getByResourceGroupWithResponse("rg1", "test-plan", Context.NONE);
+ }
+}
+```
+
+### DdosProtectionPlans_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans List. */
+public final class DdosProtectionPlansListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosProtectionPlanListAll.json
+ */
+ /**
+ * Sample code: List all DDoS protection plans.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllDDoSProtectionPlans(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ddosProtectionPlans().list(Context.NONE);
+ }
+}
+```
+
+### DdosProtectionPlans_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans ListByResourceGroup. */
+public final class DdosProtectionPlansListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosProtectionPlanList.json
+ */
+ /**
+ * Sample code: List DDoS protection plans in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listDDoSProtectionPlansInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ddosProtectionPlans().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### DdosProtectionPlans_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.DdosProtectionPlan;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DdosProtectionPlans UpdateTags. */
+public final class DdosProtectionPlansUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DdosProtectionPlanUpdateTags.json
+ */
+ /**
+ * Sample code: DDoS protection plan Update tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void dDoSProtectionPlanUpdateTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ DdosProtectionPlan resource =
+ manager.ddosProtectionPlans().getByResourceGroupWithResponse("rg1", "test-plan", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DefaultSecurityRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DefaultSecurityRules Get. */
+public final class DefaultSecurityRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DefaultSecurityRuleGet.json
+ */
+ /**
+ * Sample code: DefaultSecurityRuleGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void defaultSecurityRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.defaultSecurityRules().getWithResponse("testrg", "nsg1", "AllowVnetInBound", Context.NONE);
+ }
+}
+```
+
+### DefaultSecurityRules_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DefaultSecurityRules List. */
+public final class DefaultSecurityRulesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DefaultSecurityRuleList.json
+ */
+ /**
+ * Sample code: DefaultSecurityRuleList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void defaultSecurityRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.defaultSecurityRules().list("testrg", "nsg1", Context.NONE);
+ }
+}
+```
+
+### DscpConfiguration_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.ProtocolType;
+import com.azure.resourcemanager.network.generated.models.QosDefinition;
+import com.azure.resourcemanager.network.generated.models.QosIpRange;
+import com.azure.resourcemanager.network.generated.models.QosPortRange;
+import java.util.Arrays;
+
+/** Samples for DscpConfiguration CreateOrUpdate. */
+public final class DscpConfigurationCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DscpConfigurationCreate.json
+ */
+ /**
+ * Sample code: Create DSCP Configuration.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createDSCPConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .dscpConfigurations()
+ .define("mydscpconfig")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withQosDefinitionCollection(
+ Arrays
+ .asList(
+ new QosDefinition()
+ .withMarkings(Arrays.asList(1))
+ .withSourceIpRanges(
+ Arrays.asList(new QosIpRange().withStartIp("127.0.0.1").withEndIp("127.0.0.2")))
+ .withDestinationIpRanges(
+ Arrays.asList(new QosIpRange().withStartIp("127.0.10.1").withEndIp("127.0.10.2")))
+ .withSourcePortRanges(
+ Arrays
+ .asList(
+ new QosPortRange().withStart(10).withEnd(11),
+ new QosPortRange().withStart(20).withEnd(21)))
+ .withDestinationPortRanges(Arrays.asList(new QosPortRange().withStart(15).withEnd(15)))
+ .withProtocol(ProtocolType.TCP),
+ new QosDefinition()
+ .withMarkings(Arrays.asList(2))
+ .withSourceIpRanges(
+ Arrays.asList(new QosIpRange().withStartIp("12.0.0.1").withEndIp("12.0.0.2")))
+ .withDestinationIpRanges(
+ Arrays.asList(new QosIpRange().withStartIp("12.0.10.1").withEndIp("12.0.10.2")))
+ .withSourcePortRanges(Arrays.asList(new QosPortRange().withStart(11).withEnd(12)))
+ .withDestinationPortRanges(Arrays.asList(new QosPortRange().withStart(51).withEnd(52)))
+ .withProtocol(ProtocolType.UDP)))
+ .create();
+ }
+}
+```
+
+### DscpConfiguration_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration Delete. */
+public final class DscpConfigurationDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DscpConfigurationDelete.json
+ */
+ /**
+ * Sample code: Delete DSCP Configuration.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteDSCPConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.dscpConfigurations().delete("rg1", "mydscpConfig", Context.NONE);
+ }
+}
+```
+
+### DscpConfiguration_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration GetByResourceGroup. */
+public final class DscpConfigurationGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DscpConfigurationGet.json
+ */
+ /**
+ * Sample code: Get Dscp Configuration.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getDscpConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.dscpConfigurations().getByResourceGroupWithResponse("rg1", "mydscpConfig", Context.NONE);
+ }
+}
+```
+
+### DscpConfiguration_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration List. */
+public final class DscpConfigurationListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DscpConfigurationListAll.json
+ */
+ /**
+ * Sample code: List all network interfaces.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.dscpConfigurations().list(Context.NONE);
+ }
+}
+```
+
+### DscpConfiguration_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration ListByResourceGroup. */
+public final class DscpConfigurationListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/DscpConfigurationList.json
+ */
+ /**
+ * Sample code: Get Dscp Configuration.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getDscpConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.dscpConfigurations().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitAuthorizations_CreateOrUpdate
+
+```java
+/** Samples for ExpressRouteCircuitAuthorizations CreateOrUpdate. */
+public final class ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitAuthorizationCreate.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createExpressRouteCircuitAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuitAuthorizations()
+ .define("authorizatinName")
+ .withExistingExpressRouteCircuit("rg1", "circuitName")
+ .create();
+ }
+}
+```
+
+### ExpressRouteCircuitAuthorizations_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitAuthorizations Delete. */
+public final class ExpressRouteCircuitAuthorizationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitAuthorizationDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteExpressRouteCircuitAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuitAuthorizations().delete("rg1", "circuitName", "authorizationName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitAuthorizations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitAuthorizations Get. */
+public final class ExpressRouteCircuitAuthorizationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitAuthorizationGet.json
+ */
+ /**
+ * Sample code: Get ExpressRouteCircuit Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCircuitAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuitAuthorizations()
+ .getWithResponse("rg1", "circuitName", "authorizationName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitAuthorizations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitAuthorizations List. */
+public final class ExpressRouteCircuitAuthorizationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitAuthorizationList.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuit Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listExpressRouteCircuitAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuitAuthorizations().list("rg1", "circuitName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitConnections_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig;
+
+/** Samples for ExpressRouteCircuitConnections CreateOrUpdate. */
+public final class ExpressRouteCircuitConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitConnectionCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteCircuitConnectionCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteCircuitConnectionCreate(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuitConnections()
+ .define("circuitConnectionUSAUS")
+ .withExistingPeering("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering")
+ .withExpressRouteCircuitPeering(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"))
+ .withPeerExpressRouteCircuitPeering(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"))
+ .withAddressPrefix("10.0.0.0/29")
+ .withAuthorizationKey("946a1918-b7a2-4917-b43c-8c4cdaee006a")
+ .withIpv6CircuitConnectionConfig(new Ipv6CircuitConnectionConfig().withAddressPrefix("aa:bb::/125"))
+ .create();
+ }
+}
+```
+
+### ExpressRouteCircuitConnections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitConnections Delete. */
+public final class ExpressRouteCircuitConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitConnectionDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuitConnections()
+ .delete("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitConnections Get. */
+public final class ExpressRouteCircuitConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitConnectionGet.json
+ */
+ /**
+ * Sample code: ExpressRouteCircuitConnectionGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteCircuitConnectionGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuitConnections()
+ .getWithResponse(
+ "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitConnections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitConnections List. */
+public final class ExpressRouteCircuitConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitConnectionList.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuit Connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listExpressRouteCircuitConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuitConnections()
+ .list("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitPeerings_CreateOrUpdate
+
+```java
+/** Samples for ExpressRouteCircuitPeerings CreateOrUpdate. */
+public final class ExpressRouteCircuitPeeringsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitPeeringCreate.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit Peerings.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createExpressRouteCircuitPeerings(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuitPeerings()
+ .define("AzurePrivatePeering")
+ .withExistingExpressRouteCircuit("rg1", "circuitName")
+ .withPeerAsn(200L)
+ .withPrimaryPeerAddressPrefix("192.168.16.252/30")
+ .withSecondaryPeerAddressPrefix("192.168.18.252/30")
+ .withVlanId(200)
+ .create();
+ }
+}
+```
+
+### ExpressRouteCircuitPeerings_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitPeerings Delete. */
+public final class ExpressRouteCircuitPeeringsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitPeeringDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit Peerings.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteExpressRouteCircuitPeerings(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuitPeerings().delete("rg1", "circuitName", "peeringName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitPeerings_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitPeerings Get. */
+public final class ExpressRouteCircuitPeeringsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitPeeringGet.json
+ */
+ /**
+ * Sample code: Get ExpressRouteCircuit Peering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCircuitPeering(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuitPeerings().getWithResponse("rg1", "circuitName", "MicrosoftPeering", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuitPeerings_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitPeerings List. */
+public final class ExpressRouteCircuitPeeringsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitPeeringList.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuit Peerings.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listExpressRouteCircuitPeerings(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuitPeerings().list("rg1", "circuitName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSku;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSkuFamily;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSkuTier;
+import java.util.Arrays;
+
+/** Samples for ExpressRouteCircuits CreateOrUpdate. */
+public final class ExpressRouteCircuitsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitCreate.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuits()
+ .define("circuitName")
+ .withRegion("Brazil South")
+ .withExistingResourceGroup("rg1")
+ .withSku(
+ new ExpressRouteCircuitSku()
+ .withName("Standard_MeteredData")
+ .withTier(ExpressRouteCircuitSkuTier.STANDARD)
+ .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA))
+ .withAllowClassicOperations(false)
+ .withAuthorizations(Arrays.asList())
+ .withPeerings(Arrays.asList())
+ .withServiceProviderProperties(
+ new ExpressRouteCircuitServiceProviderProperties()
+ .withServiceProviderName("Equinix")
+ .withPeeringLocation("Silicon Valley")
+ .withBandwidthInMbps(200))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit on ExpressRoutePort.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createExpressRouteCircuitOnExpressRoutePort(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuits()
+ .define("expressRouteCircuit1")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withSku(
+ new ExpressRouteCircuitSku()
+ .withName("Premium_MeteredData")
+ .withTier(ExpressRouteCircuitSkuTier.PREMIUM)
+ .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA))
+ .withExpressRoutePort(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"))
+ .withBandwidthInGbps(10.0f)
+ .withAuthorizationKey("b0be57f5-1fba-463b-adec-ffe767354cdd")
+ .create();
+ }
+}
+```
+
+### ExpressRouteCircuits_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits Delete. */
+public final class ExpressRouteCircuitsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().delete("rg1", "circuitName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits GetByResourceGroup. */
+public final class ExpressRouteCircuitsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitGet.json
+ */
+ /**
+ * Sample code: Get ExpressRouteCircuit.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().getByResourceGroupWithResponse("rg1", "circuitName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_GetPeeringStats
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits GetPeeringStats. */
+public final class ExpressRouteCircuitsGetPeeringStatsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitPeeringStats.json
+ */
+ /**
+ * Sample code: Get ExpressRoute Circuit Peering Traffic Stats.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCircuitPeeringTrafficStats(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().getPeeringStatsWithResponse("rg1", "circuitName", "peeringName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_GetStats
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits GetStats. */
+public final class ExpressRouteCircuitsGetStatsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitStats.json
+ */
+ /**
+ * Sample code: Get ExpressRoute Circuit Traffic Stats.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCircuitTrafficStats(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().getStatsWithResponse("rg1", "circuitName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits List. */
+public final class ExpressRouteCircuitsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitListBySubscription.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuits in a subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listExpressRouteCircuitsInASubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().list(Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_ListArpTable
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListArpTable. */
+public final class ExpressRouteCircuitsListArpTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitARPTableList.json
+ */
+ /**
+ * Sample code: List ARP Table.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listARPTable(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().listArpTable("rg1", "circuitName", "peeringName", "devicePath", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListByResourceGroup. */
+public final class ExpressRouteCircuitsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitListByResourceGroup.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuits in a resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listExpressRouteCircuitsInAResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_ListRoutesTable
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListRoutesTable. */
+public final class ExpressRouteCircuitsListRoutesTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitRouteTableList.json
+ */
+ /**
+ * Sample code: List Route Tables.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCircuits().listRoutesTable("rg1", "circuitName", "peeringName", "devicePath", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_ListRoutesTableSummary
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListRoutesTableSummary. */
+public final class ExpressRouteCircuitsListRoutesTableSummarySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitRouteTableSummaryList.json
+ */
+ /**
+ * Sample code: List Route Table Summary.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listRouteTableSummary(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCircuits()
+ .listRoutesTableSummary("rg1", "circuitName", "peeringName", "devicePath", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCircuits_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuit;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRouteCircuits UpdateTags. */
+public final class ExpressRouteCircuitsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCircuitUpdateTags.json
+ */
+ /**
+ * Sample code: Update Express Route Circuit Tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateExpressRouteCircuitTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ExpressRouteCircuit resource =
+ manager.expressRouteCircuits().getByResourceGroupWithResponse("ertest", "er1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ExpressRouteConnections_CreateOrUpdate
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId;
+
+/** Samples for ExpressRouteConnections CreateOrUpdate. */
+public final class ExpressRouteConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteConnectionCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteConnectionCreate(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteConnections()
+ .createOrUpdate(
+ "resourceGroupName",
+ "gateway-2",
+ "connectionName",
+ new ExpressRouteConnectionInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName")
+ .withName("connectionName")
+ .withExpressRouteCircuitPeering(
+ new ExpressRouteCircuitPeeringId()
+ .withId(
+ "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"))
+ .withAuthorizationKey("authorizationKey")
+ .withRoutingWeight(2),
+ Context.NONE);
+ }
+}
+```
+
+### ExpressRouteConnections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteConnections Delete. */
+public final class ExpressRouteConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteConnectionDelete.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteConnectionDelete(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteConnections()
+ .delete("resourceGroupName", "expressRouteGatewayName", "connectionName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteConnections Get. */
+public final class ExpressRouteConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteConnectionGet.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteConnections()
+ .getWithResponse("resourceGroupName", "expressRouteGatewayName", "connectionName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteConnections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteConnections List. */
+public final class ExpressRouteConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteConnectionList.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteConnections()
+ .listWithResponse("resourceGroupName", "expressRouteGatewayName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnectionPeerings_CreateOrUpdate
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner;
+import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig;
+
+/** Samples for ExpressRouteCrossConnectionPeerings CreateOrUpdate. */
+public final class ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionBgpPeeringCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionBgpPeeringCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteCrossConnectionBgpPeeringCreate(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnectionPeerings()
+ .createOrUpdate(
+ "CrossConnection-SiliconValley",
+ "",
+ "AzurePrivatePeering",
+ new ExpressRouteCrossConnectionPeeringInner()
+ .withPeerAsn(200L)
+ .withPrimaryPeerAddressPrefix("192.168.16.252/30")
+ .withSecondaryPeerAddressPrefix("192.168.18.252/30")
+ .withVlanId(200)
+ .withIpv6PeeringConfig(
+ new Ipv6ExpressRouteCircuitPeeringConfig()
+ .withPrimaryPeerAddressPrefix("3FFE:FFFF:0:CD30::/126")
+ .withSecondaryPeerAddressPrefix("3FFE:FFFF:0:CD30::4/126")),
+ Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnectionPeerings_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnectionPeerings Delete. */
+public final class ExpressRouteCrossConnectionPeeringsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionBgpPeeringDelete.json
+ */
+ /**
+ * Sample code: DeleteExpressRouteCrossConnectionBgpPeering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteExpressRouteCrossConnectionBgpPeering(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnectionPeerings()
+ .delete("CrossConnection-SiliconValley", "", "AzurePrivatePeering", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnectionPeerings_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnectionPeerings Get. */
+public final class ExpressRouteCrossConnectionPeeringsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionBgpPeeringGet.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionBgpPeering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCrossConnectionBgpPeering(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnectionPeerings()
+ .getWithResponse(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnectionPeerings_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnectionPeerings List. */
+public final class ExpressRouteCrossConnectionPeeringsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionBgpPeeringList.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionBgpPeeringList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteCrossConnectionBgpPeeringList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnectionPeerings()
+ .list("CrossConnection-SiliconValley", "", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnections_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState;
+
+/** Samples for ExpressRouteCrossConnections CreateOrUpdate. */
+public final class ExpressRouteCrossConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionUpdate.json
+ */
+ /**
+ * Sample code: UpdateExpressRouteCrossConnection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateExpressRouteCrossConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnections()
+ .define("")
+ .withRegion((String) null)
+ .withExistingResourceGroup("CrossConnection-SiliconValley")
+ .withServiceProviderProvisioningState(ServiceProviderProvisioningState.NOT_PROVISIONED)
+ .create();
+ }
+}
+```
+
+### ExpressRouteCrossConnections_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections GetByResourceGroup. */
+public final class ExpressRouteCrossConnectionsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionGet.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCrossConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnections()
+ .getByResourceGroupWithResponse("CrossConnection-SiliconValley", "", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections List. */
+public final class ExpressRouteCrossConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionList.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteCrossConnectionList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCrossConnections().list(Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnections_ListArpTable
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListArpTable. */
+public final class ExpressRouteCrossConnectionsListArpTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionsArpTable.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionsArpTable.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCrossConnectionsArpTable(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnections()
+ .listArpTable(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnections_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListByResourceGroup. */
+public final class ExpressRouteCrossConnectionsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionListByResourceGroup.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteCrossConnectionListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteCrossConnections().listByResourceGroup("CrossConnection-SiliconValley", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnections_ListRoutesTable
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListRoutesTable. */
+public final class ExpressRouteCrossConnectionsListRoutesTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionsRouteTable.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionsRouteTable.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCrossConnectionsRouteTable(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnections()
+ .listRoutesTable(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnections_ListRoutesTableSummary
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListRoutesTableSummary. */
+public final class ExpressRouteCrossConnectionsListRoutesTableSummarySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionsRouteTableSummary.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionsRouteTableSummary.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRouteCrossConnectionsRouteTableSummary(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteCrossConnections()
+ .listRoutesTableSummary(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteCrossConnections_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnection;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRouteCrossConnections UpdateTags. */
+public final class ExpressRouteCrossConnectionsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteCrossConnectionUpdateTags.json
+ */
+ /**
+ * Sample code: UpdateExpressRouteCrossConnectionTags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateExpressRouteCrossConnectionTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ExpressRouteCrossConnection resource =
+ manager
+ .expressRouteCrossConnections()
+ .getByResourceGroupWithResponse("CrossConnection-SiliconValley", "", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ExpressRouteGateways_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds;
+import com.azure.resourcemanager.network.generated.models.VirtualHubId;
+
+/** Samples for ExpressRouteGateways CreateOrUpdate. */
+public final class ExpressRouteGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteGatewayCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteGatewayCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteGateways()
+ .define("gateway-2")
+ .withRegion("westus")
+ .withExistingResourceGroup("resourceGroupName")
+ .withAutoScaleConfiguration(
+ new ExpressRouteGatewayPropertiesAutoScaleConfiguration()
+ .withBounds(new ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds().withMin(3)))
+ .withVirtualHub(
+ new VirtualHubId()
+ .withId(
+ "/subscriptions/subid/resourceGroups/resourceGroupId/providers/Microsoft.Network/virtualHubs/virtualHubName"))
+ .create();
+ }
+}
+```
+
+### ExpressRouteGateways_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways Delete. */
+public final class ExpressRouteGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteGatewayDelete.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteGateways().delete("resourceGroupName", "expressRouteGatewayName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteGateways_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways GetByResourceGroup. */
+public final class ExpressRouteGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteGatewayGet.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRouteGateways()
+ .getByResourceGroupWithResponse("resourceGroupName", "expressRouteGatewayName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteGateways_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways ListByResourceGroup. */
+public final class ExpressRouteGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteGatewayListByResourceGroup.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteGatewayListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteGateways().listByResourceGroupWithResponse("resourceGroupName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteGateways_ListBySubscription
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways ListBySubscription. */
+public final class ExpressRouteGatewaysListBySubscriptionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteGatewayListBySubscription.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayListBySubscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteGatewayListBySubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteGateways().listBySubscriptionWithResponse(Context.NONE);
+ }
+}
+```
+
+### ExpressRouteGateways_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRouteGateways UpdateTags. */
+public final class ExpressRouteGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayUpdate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ExpressRouteGateway resource =
+ manager
+ .expressRouteGateways()
+ .getByResourceGroupWithResponse("resourceGroupName", "expressRouteGatewayName", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ExpressRouteLinks_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteLinks Get. */
+public final class ExpressRouteLinksGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteLinkGet.json
+ */
+ /**
+ * Sample code: ExpressRouteLinkGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteLinkGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteLinks().getWithResponse("rg1", "portName", "linkName", Context.NONE);
+ }
+}
+```
+
+### ExpressRouteLinks_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteLinks List. */
+public final class ExpressRouteLinksListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteLinkList.json
+ */
+ /**
+ * Sample code: ExpressRouteLinkGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRouteLinkGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteLinks().list("rg1", "portName", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePortAuthorizations_CreateOrUpdate
+
+```java
+/** Samples for ExpressRoutePortAuthorizations CreateOrUpdate. */
+public final class ExpressRoutePortAuthorizationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortAuthorizationCreate.json
+ */
+ /**
+ * Sample code: Create ExpressRoutePort Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createExpressRoutePortAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRoutePortAuthorizations()
+ .define("authorizatinName")
+ .withExistingExpressRoutePort("rg1", "expressRoutePortName")
+ .create();
+ }
+}
+```
+
+### ExpressRoutePortAuthorizations_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePortAuthorizations Delete. */
+public final class ExpressRoutePortAuthorizationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortAuthorizationDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRoutePort Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteExpressRoutePortAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRoutePortAuthorizations()
+ .delete("rg1", "expressRoutePortName", "authorizationName", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePortAuthorizations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePortAuthorizations Get. */
+public final class ExpressRoutePortAuthorizationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortAuthorizationGet.json
+ */
+ /**
+ * Sample code: Get ExpressRoutePort Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getExpressRoutePortAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRoutePortAuthorizations()
+ .getWithResponse("rg1", "expressRoutePortName", "authorizationName", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePortAuthorizations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePortAuthorizations List. */
+public final class ExpressRoutePortAuthorizationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortAuthorizationList.json
+ */
+ /**
+ * Sample code: List ExpressRoutePort Authorization.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listExpressRoutePortAuthorization(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRoutePortAuthorizations().list("rg1", "expressRoutePortName", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePorts_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState;
+import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation;
+import java.util.Arrays;
+
+/** Samples for ExpressRoutePorts CreateOrUpdate. */
+public final class ExpressRoutePortsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortUpdateLink.json
+ */
+ /**
+ * Sample code: ExpressRoutePortUpdateLink.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortUpdateLink(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRoutePorts()
+ .define("portName")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withPeeringLocation("peeringLocationName")
+ .withBandwidthInGbps(100)
+ .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ)
+ .withLinks(
+ Arrays
+ .asList(
+ new ExpressRouteLinkInner()
+ .withName("link1")
+ .withAdminState(ExpressRouteLinkAdminState.ENABLED)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortCreate.json
+ */
+ /**
+ * Sample code: ExpressRoutePortCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRoutePorts()
+ .define("portName")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withPeeringLocation("peeringLocationName")
+ .withBandwidthInGbps(100)
+ .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ)
+ .create();
+ }
+}
+```
+
+### ExpressRoutePorts_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts Delete. */
+public final class ExpressRoutePortsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortDelete.json
+ */
+ /**
+ * Sample code: ExpressRoutePortDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRoutePorts().delete("rg1", "portName", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePorts_GenerateLoa
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest;
+
+/** Samples for ExpressRoutePorts GenerateLoa. */
+public final class ExpressRoutePortsGenerateLoaSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/GenerateExpressRoutePortsLOA.json
+ */
+ /**
+ * Sample code: GenerateExpressRoutePortLOA.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void generateExpressRoutePortLOA(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .expressRoutePorts()
+ .generateLoaWithResponse(
+ "rg1",
+ "portName",
+ new GenerateExpressRoutePortsLoaRequest().withCustomerName("customerName"),
+ Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePorts_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts GetByResourceGroup. */
+public final class ExpressRoutePortsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortGet.json
+ */
+ /**
+ * Sample code: ExpressRoutePortGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRoutePorts().getByResourceGroupWithResponse("rg1", "portName", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePorts_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts List. */
+public final class ExpressRoutePortsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortList.json
+ */
+ /**
+ * Sample code: ExpressRoutePortList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRoutePorts().list(Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePorts_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts ListByResourceGroup. */
+public final class ExpressRoutePortsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortListByResourceGroup.json
+ */
+ /**
+ * Sample code: ExpressRoutePortListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRoutePorts().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePorts_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ExpressRoutePort;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRoutePorts UpdateTags. */
+public final class ExpressRoutePortsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortUpdateTags.json
+ */
+ /**
+ * Sample code: ExpressRoutePortUpdateTags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ExpressRoutePort resource =
+ manager.expressRoutePorts().getByResourceGroupWithResponse("rg1", "portName", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ExpressRoutePortsLocations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePortsLocations Get. */
+public final class ExpressRoutePortsLocationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortsLocationGet.json
+ */
+ /**
+ * Sample code: ExpressRoutePortsLocationGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortsLocationGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRoutePortsLocations().getWithResponse("locationName", Context.NONE);
+ }
+}
+```
+
+### ExpressRoutePortsLocations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePortsLocations List. */
+public final class ExpressRoutePortsLocationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRoutePortsLocationList.json
+ */
+ /**
+ * Sample code: ExpressRoutePortsLocationList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void expressRoutePortsLocationList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRoutePortsLocations().list(Context.NONE);
+ }
+}
+```
+
+### ExpressRouteServiceProviders_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteServiceProviders List. */
+public final class ExpressRouteServiceProvidersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ExpressRouteProviderList.json
+ */
+ /**
+ * Sample code: List ExpressRoute providers.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listExpressRouteProviders(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.expressRouteServiceProviders().list(Context.NONE);
+ }
+}
+```
+
+### FirewallPolicies_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode;
+import com.azure.resourcemanager.network.generated.models.DnsSettings;
+import com.azure.resourcemanager.network.generated.models.ExplicitProxySettings;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyCertificateAuthority;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionConfiguration;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProtocol;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionSignatureSpecification;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionStateType;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsResources;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsWorkspace;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicySku;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicySkuTier;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicySql;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyTransportSecurity;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FirewallPolicies CreateOrUpdate. */
+public final class FirewallPoliciesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicies()
+ .define("firewallPolicy")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withThreatIntelWhitelist(
+ new FirewallPolicyThreatIntelWhitelist()
+ .withIpAddresses(Arrays.asList("20.3.4.5"))
+ .withFqdns(Arrays.asList("*.microsoft.com")))
+ .withInsights(
+ new FirewallPolicyInsights()
+ .withIsEnabled(true)
+ .withRetentionDays(100)
+ .withLogAnalyticsResources(
+ new FirewallPolicyLogAnalyticsResources()
+ .withWorkspaces(
+ Arrays
+ .asList(
+ new FirewallPolicyLogAnalyticsWorkspace()
+ .withRegion("westus")
+ .withWorkspaceId(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1")),
+ new FirewallPolicyLogAnalyticsWorkspace()
+ .withRegion("eastus")
+ .withWorkspaceId(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"))))
+ .withDefaultWorkspaceId(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"))))
+ .withSnat(new FirewallPolicySnat().withPrivateRanges(Arrays.asList("IANAPrivateRanges")))
+ .withSql(new FirewallPolicySql().withAllowSqlRedirect(true))
+ .withDnsSettings(
+ new DnsSettings()
+ .withServers(Arrays.asList("30.3.4.5"))
+ .withEnableProxy(true)
+ .withRequireProxyForNetworkRules(false))
+ .withExplicitProxySettings(
+ new ExplicitProxySettings()
+ .withEnableExplicitProxy(true)
+ .withHttpPort(8087)
+ .withHttpsPort(8087)
+ .withPacFilePort(8087)
+ .withPacFile(
+ "https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"))
+ .withIntrusionDetection(
+ new FirewallPolicyIntrusionDetection()
+ .withMode(FirewallPolicyIntrusionDetectionStateType.ALERT)
+ .withConfiguration(
+ new FirewallPolicyIntrusionDetectionConfiguration()
+ .withSignatureOverrides(
+ Arrays
+ .asList(
+ new FirewallPolicyIntrusionDetectionSignatureSpecification()
+ .withId("2525004")
+ .withMode(FirewallPolicyIntrusionDetectionStateType.DENY)))
+ .withBypassTrafficSettings(
+ Arrays
+ .asList(
+ new FirewallPolicyIntrusionDetectionBypassTrafficSpecifications()
+ .withName("bypassRule1")
+ .withDescription("Rule 1")
+ .withProtocol(FirewallPolicyIntrusionDetectionProtocol.TCP)
+ .withSourceAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationAddresses(Arrays.asList("5.6.7.8"))
+ .withDestinationPorts(Arrays.asList("*"))))))
+ .withTransportSecurity(
+ new FirewallPolicyTransportSecurity()
+ .withCertificateAuthority(
+ new FirewallPolicyCertificateAuthority()
+ .withKeyVaultSecretId("https://kv/secret")
+ .withName("clientcert")))
+ .withSku(new FirewallPolicySku().withTier(FirewallPolicySkuTier.PREMIUM))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### FirewallPolicies_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies Delete. */
+public final class FirewallPoliciesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyDelete.json
+ */
+ /**
+ * Sample code: Delete Firewall Policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicies().delete("rg1", "firewallPolicy", Context.NONE);
+ }
+}
+```
+
+### FirewallPolicies_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies GetByResourceGroup. */
+public final class FirewallPoliciesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicies().getByResourceGroupWithResponse("rg1", "firewallPolicy", null, Context.NONE);
+ }
+}
+```
+
+### FirewallPolicies_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies List. */
+public final class FirewallPoliciesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyListBySubscription.json
+ */
+ /**
+ * Sample code: List all Firewall Policies for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllFirewallPoliciesForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicies().list(Context.NONE);
+ }
+}
+```
+
+### FirewallPolicies_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies ListByResourceGroup. */
+public final class FirewallPoliciesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Firewall Policies for a given resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllFirewallPoliciesForAGivenResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicies().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### FirewallPolicyIdpsSignatures_List
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.FilterItems;
+import com.azure.resourcemanager.network.generated.models.IdpsQueryObject;
+import com.azure.resourcemanager.network.generated.models.OrderBy;
+import com.azure.resourcemanager.network.generated.models.OrderByOrder;
+import java.util.Arrays;
+
+/** Samples for FirewallPolicyIdpsSignatures List. */
+public final class FirewallPolicyIdpsSignaturesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyQuerySignatureOverrides.json
+ */
+ /**
+ * Sample code: query signature overrides.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void querySignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyIdpsSignatures()
+ .listWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new IdpsQueryObject()
+ .withFilters(Arrays.asList(new FilterItems().withField("Mode").withValues(Arrays.asList("Deny"))))
+ .withSearch("")
+ .withOrderBy(new OrderBy().withField("severity").withOrder(OrderByOrder.ASCENDING))
+ .withResultsPerPage(20)
+ .withSkip(0),
+ Context.NONE);
+ }
+}
+```
+
+### FirewallPolicyIdpsSignaturesFilterValues_List
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesQuery;
+
+/** Samples for FirewallPolicyIdpsSignaturesFilterValues List. */
+public final class FirewallPolicyIdpsSignaturesFilterValuesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyQuerySignatureOverridesFilterValues.json
+ */
+ /**
+ * Sample code: query signature overrides.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void querySignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyIdpsSignaturesFilterValues()
+ .listWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new SignatureOverridesFilterValuesQuery().withFilterName("severity"),
+ Context.NONE);
+ }
+}
+```
+
+### FirewallPolicyIdpsSignaturesOverrides_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides Get. */
+public final class FirewallPolicyIdpsSignaturesOverridesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicySignatureOverridesGet.json
+ */
+ /**
+ * Sample code: get signature overrides.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicyIdpsSignaturesOverrides().getWithResponse("rg1", "firewallPolicy", Context.NONE);
+ }
+}
+```
+
+### FirewallPolicyIdpsSignaturesOverrides_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides List. */
+public final class FirewallPolicyIdpsSignaturesOverridesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicySignatureOverridesList.json
+ */
+ /**
+ * Sample code: get signature overrides.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicyIdpsSignaturesOverrides().listWithResponse("rg1", "firewallPolicy", Context.NONE);
+ }
+}
+```
+
+### FirewallPolicyIdpsSignaturesOverrides_Patch
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner;
+import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides Patch. */
+public final class FirewallPolicyIdpsSignaturesOverridesPatchSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicySignatureOverridesPatch.json
+ */
+ /**
+ * Sample code: patch signature overrides.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void patchSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyIdpsSignaturesOverrides()
+ .patchWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new SignaturesOverridesInner()
+ .withName("default")
+ .withId(
+ "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default")
+ .withType("Microsoft.Network/firewallPolicies/signatureOverrides")
+ .withProperties(
+ new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### FirewallPolicyIdpsSignaturesOverrides_Put
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner;
+import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides Put. */
+public final class FirewallPolicyIdpsSignaturesOverridesPutSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicySignatureOverridesPut.json
+ */
+ /**
+ * Sample code: put signature overrides.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void putSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyIdpsSignaturesOverrides()
+ .putWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new SignaturesOverridesInner()
+ .withName("default")
+ .withId(
+ "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default")
+ .withType("Microsoft.Network/firewallPolicies/signatureOverrides")
+ .withProperties(
+ new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### FirewallPolicyRuleCollectionGroups_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.ApplicationRule;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollection;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionAction;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionActionType;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollection;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollectionAction;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollectionActionType;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleApplicationProtocol;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleApplicationProtocolType;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleNetworkProtocol;
+import com.azure.resourcemanager.network.generated.models.NatRule;
+import com.azure.resourcemanager.network.generated.models.NetworkRule;
+import java.util.Arrays;
+
+/** Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate. */
+public final class FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyRuleCollectionGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createFirewallPolicyRuleCollectionGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .define("ruleCollectionGroup1")
+ .withExistingFirewallPolicy("rg1", "firewallPolicy")
+ .withPriority(100)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyFilterRuleCollection()
+ .withName("Example-Filter-Rule-Collection")
+ .withPriority(100)
+ .withAction(
+ new FirewallPolicyFilterRuleCollectionAction()
+ .withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new NetworkRule()
+ .withName("network-rule1")
+ .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.1.25.0/24"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("*"))))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyRuleCollectionGroup With IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createFirewallPolicyRuleCollectionGroupWithIpGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .define("ruleCollectionGroup1")
+ .withExistingFirewallPolicy("rg1", "firewallPolicy")
+ .withPriority(110)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyFilterRuleCollection()
+ .withName("Example-Filter-Rule-Collection")
+ .withAction(
+ new FirewallPolicyFilterRuleCollectionAction()
+ .withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new NetworkRule()
+ .withName("network-1")
+ .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP))
+ .withDestinationPorts(Arrays.asList("*"))
+ .withSourceIpGroups(
+ Arrays
+ .asList(
+ "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1"))
+ .withDestinationIpGroups(
+ Arrays
+ .asList(
+ "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2"))))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyRuleCollectionGroup With Web Categories.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createFirewallPolicyRuleCollectionGroupWithWebCategories(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .define("ruleCollectionGroup1")
+ .withExistingFirewallPolicy("rg1", "firewallPolicy")
+ .withPriority(110)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyFilterRuleCollection()
+ .withName("Example-Filter-Rule-Collection")
+ .withAction(
+ new FirewallPolicyFilterRuleCollectionAction()
+ .withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new ApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new FirewallPolicyRuleApplicationProtocol()
+ .withProtocolType(
+ FirewallPolicyRuleApplicationProtocolType.HTTPS)
+ .withPort(443)))
+ .withWebCategories(Arrays.asList("Hacking"))))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyNatRuleCollectionGroupPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyNatRuleCollectionGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createFirewallPolicyNatRuleCollectionGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .define("ruleCollectionGroup1")
+ .withExistingFirewallPolicy("rg1", "firewallPolicy")
+ .withPriority(100)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyNatRuleCollection()
+ .withName("Example-Nat-Rule-Collection")
+ .withPriority(100)
+ .withAction(
+ new FirewallPolicyNatRuleCollectionAction()
+ .withType(FirewallPolicyNatRuleCollectionActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new NatRule()
+ .withName("nat-rule1")
+ .withIpProtocols(
+ Arrays
+ .asList(
+ FirewallPolicyRuleNetworkProtocol.TCP,
+ FirewallPolicyRuleNetworkProtocol.UDP))
+ .withSourceAddresses(Arrays.asList("2.2.2.2"))
+ .withDestinationAddresses(Arrays.asList("152.23.32.23"))
+ .withDestinationPorts(Arrays.asList("8080"))
+ .withTranslatedPort("8080")
+ .withSourceIpGroups(Arrays.asList())
+ .withTranslatedFqdn("internalhttp.server.net")))))
+ .create();
+ }
+}
+```
+
+### FirewallPolicyRuleCollectionGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyRuleCollectionGroups Delete. */
+public final class FirewallPolicyRuleCollectionGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupDelete.json
+ */
+ /**
+ * Sample code: Delete FirewallPolicyRuleCollectionGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteFirewallPolicyRuleCollectionGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .delete("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+}
+```
+
+### FirewallPolicyRuleCollectionGroups_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyRuleCollectionGroups Get. */
+public final class FirewallPolicyRuleCollectionGroupsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyNatRuleCollectionGroupGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyNatRuleCollectionGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getFirewallPolicyNatRuleCollectionGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyRuleCollectionGroup With Web Categories.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getFirewallPolicyRuleCollectionGroupWithWebCategories(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyRuleCollectionGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getFirewallPolicyRuleCollectionGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyRuleCollectionGroup With IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getFirewallPolicyRuleCollectionGroupWithIpGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .firewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleGroup1", Context.NONE);
+ }
+}
+```
+
+### FirewallPolicyRuleCollectionGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyRuleCollectionGroups List. */
+public final class FirewallPolicyRuleCollectionGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupList.json
+ */
+ /**
+ * Sample code: List all FirewallPolicyRuleCollectionGroups for a given FirewallPolicy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllFirewallPolicyRuleCollectionGroupsForAGivenFirewallPolicy(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsList.json
+ */
+ /**
+ * Sample code: List all FirewallPolicyRuleCollectionGroups with IpGroups for a given FirewallPolicy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllFirewallPolicyRuleCollectionGroupsWithIpGroupsForAGivenFirewallPolicy(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesList.json
+ */
+ /**
+ * Sample code: List all FirewallPolicyRuleCollectionGroup With Web Categories.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllFirewallPolicyRuleCollectionGroupWithWebCategories(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", Context.NONE);
+ }
+}
+```
+
+### FlowLogs_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters;
+import com.azure.resourcemanager.network.generated.models.FlowLogFormatType;
+
+/** Samples for FlowLogs CreateOrUpdate. */
+public final class FlowLogsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherFlowLogCreate.json
+ */
+ /**
+ * Sample code: Create or update flow log.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createOrUpdateFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .flowLogs()
+ .define("fl")
+ .withRegion("centraluseuap")
+ .withExistingNetworkWatcher("rg1", "nw1")
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg")
+ .withStorageId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe")
+ .withEnabled(true)
+ .withFormat(new FlowLogFormatParameters().withType(FlowLogFormatType.JSON).withVersion(1))
+ .create();
+ }
+}
+```
+
+### FlowLogs_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FlowLogs Delete. */
+public final class FlowLogsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherFlowLogDelete.json
+ */
+ /**
+ * Sample code: Delete flow log.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.flowLogs().delete("rg1", "nw1", "fl", Context.NONE);
+ }
+}
+```
+
+### FlowLogs_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FlowLogs Get. */
+public final class FlowLogsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherFlowLogGet.json
+ */
+ /**
+ * Sample code: Get flow log.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.flowLogs().getWithResponse("rg1", "nw1", "flowLog1", Context.NONE);
+ }
+}
+```
+
+### FlowLogs_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FlowLogs List. */
+public final class FlowLogsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherFlowLogList.json
+ */
+ /**
+ * Sample code: List connection monitors.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listConnectionMonitors(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.flowLogs().list("rg1", "nw1", Context.NONE);
+ }
+}
+```
+
+### FlowLogs_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.FlowLog;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FlowLogs UpdateTags. */
+public final class FlowLogsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherFlowLogUpdateTags.json
+ */
+ /**
+ * Sample code: Update flow log tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateFlowLogTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ FlowLog resource = manager.flowLogs().getWithResponse("rg1", "nw", "fl", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### HubRouteTables_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.HubRoute;
+import java.util.Arrays;
+
+/** Samples for HubRouteTables CreateOrUpdate. */
+public final class HubRouteTablesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubRouteTablePut.json
+ */
+ /**
+ * Sample code: RouteTablePut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeTablePut(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .hubRouteTables()
+ .define("hubRouteTable1")
+ .withExistingVirtualHub("rg1", "virtualHub1")
+ .withRoutes(
+ Arrays
+ .asList(
+ new HubRoute()
+ .withName("route1")
+ .withDestinationType("CIDR")
+ .withDestinations(Arrays.asList("10.0.0.0/8", "20.0.0.0/8", "30.0.0.0/8"))
+ .withNextHopType("ResourceId")
+ .withNextHop(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1")))
+ .withLabels(Arrays.asList("label1", "label2"))
+ .create();
+ }
+}
+```
+
+### HubRouteTables_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for HubRouteTables Delete. */
+public final class HubRouteTablesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubRouteTableDelete.json
+ */
+ /**
+ * Sample code: RouteTableDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeTableDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.hubRouteTables().delete("rg1", "virtualHub1", "hubRouteTable1", Context.NONE);
+ }
+}
+```
+
+### HubRouteTables_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for HubRouteTables Get. */
+public final class HubRouteTablesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubRouteTableGet.json
+ */
+ /**
+ * Sample code: RouteTableGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeTableGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.hubRouteTables().getWithResponse("rg1", "virtualHub1", "hubRouteTable1", Context.NONE);
+ }
+}
+```
+
+### HubRouteTables_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for HubRouteTables List. */
+public final class HubRouteTablesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubRouteTableList.json
+ */
+ /**
+ * Sample code: RouteTableList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeTableList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.hubRouteTables().list("rg1", "virtualHub1", Context.NONE);
+ }
+}
+```
+
+### HubVirtualNetworkConnections_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner;
+import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable;
+import com.azure.resourcemanager.network.generated.models.RoutingConfiguration;
+import com.azure.resourcemanager.network.generated.models.StaticRoute;
+import com.azure.resourcemanager.network.generated.models.VnetRoute;
+import java.util.Arrays;
+
+/** Samples for HubVirtualNetworkConnections CreateOrUpdate. */
+public final class HubVirtualNetworkConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubVirtualNetworkConnectionPut.json
+ */
+ /**
+ * Sample code: HubVirtualNetworkConnectionPut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void hubVirtualNetworkConnectionPut(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .hubVirtualNetworkConnections()
+ .createOrUpdate(
+ "rg1",
+ "virtualHub1",
+ "connection1",
+ new HubVirtualNetworkConnectionInner()
+ .withRemoteVirtualNetwork(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1"))
+ .withEnableInternetSecurity(false)
+ .withRoutingConfiguration(
+ new RoutingConfiguration()
+ .withAssociatedRouteTable(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"))
+ .withPropagatedRouteTables(
+ new PropagatedRouteTable()
+ .withLabels(Arrays.asList("label1", "label2"))
+ .withIds(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"))))
+ .withVnetRoutes(
+ new VnetRoute()
+ .withStaticRoutes(
+ Arrays
+ .asList(
+ new StaticRoute()
+ .withName("route1")
+ .withAddressPrefixes(Arrays.asList("10.1.0.0/16", "10.2.0.0/16"))
+ .withNextHopIpAddress("10.0.0.68"),
+ new StaticRoute()
+ .withName("route2")
+ .withAddressPrefixes(Arrays.asList("10.3.0.0/16", "10.4.0.0/16"))
+ .withNextHopIpAddress("10.0.0.65"))))),
+ Context.NONE);
+ }
+}
+```
+
+### HubVirtualNetworkConnections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for HubVirtualNetworkConnections Delete. */
+public final class HubVirtualNetworkConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubVirtualNetworkConnectionDelete.json
+ */
+ /**
+ * Sample code: HubVirtualNetworkConnectionDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void hubVirtualNetworkConnectionDelete(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.hubVirtualNetworkConnections().delete("rg1", "virtualHub1", "connection1", Context.NONE);
+ }
+}
+```
+
+### HubVirtualNetworkConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for HubVirtualNetworkConnections Get. */
+public final class HubVirtualNetworkConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubVirtualNetworkConnectionGet.json
+ */
+ /**
+ * Sample code: HubVirtualNetworkConnectionGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void hubVirtualNetworkConnectionGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.hubVirtualNetworkConnections().getWithResponse("rg1", "virtualHub1", "connection1", Context.NONE);
+ }
+}
+```
+
+### HubVirtualNetworkConnections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for HubVirtualNetworkConnections List. */
+public final class HubVirtualNetworkConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/HubVirtualNetworkConnectionList.json
+ */
+ /**
+ * Sample code: HubVirtualNetworkConnectionList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void hubVirtualNetworkConnectionList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.hubVirtualNetworkConnections().list("rg1", "virtualHub1", Context.NONE);
+ }
+}
+```
+
+### InboundNatRules_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.TransportProtocol;
+
+/** Samples for InboundNatRules CreateOrUpdate. */
+public final class InboundNatRulesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/InboundNatRuleCreate.json
+ */
+ /**
+ * Sample code: InboundNatRuleCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void inboundNatRuleCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .inboundNatRules()
+ .define("natRule1.1")
+ .withExistingLoadBalancer("testrg", "lb1")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"))
+ .withProtocol(TransportProtocol.TCP)
+ .withFrontendPort(3390)
+ .withBackendPort(3389)
+ .withIdleTimeoutInMinutes(4)
+ .withEnableFloatingIp(false)
+ .withEnableTcpReset(false)
+ .create();
+ }
+}
+```
+
+### InboundNatRules_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for InboundNatRules Delete. */
+public final class InboundNatRulesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/InboundNatRuleDelete.json
+ */
+ /**
+ * Sample code: InboundNatRuleDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void inboundNatRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.inboundNatRules().delete("testrg", "lb1", "natRule1.1", Context.NONE);
+ }
+}
+```
+
+### InboundNatRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for InboundNatRules Get. */
+public final class InboundNatRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/InboundNatRuleGet.json
+ */
+ /**
+ * Sample code: InboundNatRuleGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void inboundNatRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.inboundNatRules().getWithResponse("testrg", "lb1", "natRule1.1", null, Context.NONE);
+ }
+}
+```
+
+### InboundNatRules_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for InboundNatRules List. */
+public final class InboundNatRulesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/InboundNatRuleList.json
+ */
+ /**
+ * Sample code: InboundNatRuleList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void inboundNatRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.inboundNatRules().list("testrg", "lb1", Context.NONE);
+ }
+}
+```
+
+### InboundSecurityRuleOperation_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.InboundSecurityRules;
+import com.azure.resourcemanager.network.generated.models.InboundSecurityRulesProtocol;
+import java.util.Arrays;
+
+/** Samples for InboundSecurityRuleOperation CreateOrUpdate. */
+public final class InboundSecurityRuleOperationCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/InboundSecurityRulePut.json
+ */
+ /**
+ * Sample code: Create Network Virtual Appliance Inbound Security Rules.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkVirtualApplianceInboundSecurityRules(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .inboundSecurityRuleOperations()
+ .define("rule1")
+ .withExistingNetworkVirtualAppliance("rg1", "nva")
+ .withRules(
+ Arrays
+ .asList(
+ new InboundSecurityRules()
+ .withProtocol(InboundSecurityRulesProtocol.TCP)
+ .withSourceAddressPrefix("50.20.121.5/32")
+ .withDestinationPortRange(22)))
+ .create();
+ }
+}
+```
+
+### IpAllocations_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.IpAllocationType;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for IpAllocations CreateOrUpdate. */
+public final class IpAllocationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpAllocationCreate.json
+ */
+ /**
+ * Sample code: Create IpAllocation.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .ipAllocations()
+ .define("test-ipallocation")
+ .withRegion("centraluseuap")
+ .withExistingResourceGroup("rg1")
+ .withTypePropertiesType(IpAllocationType.HYPERNET)
+ .withPrefix("3.2.5.0/24")
+ .withAllocationTags(
+ mapOf(
+ "VNetID",
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### IpAllocations_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpAllocations Delete. */
+public final class IpAllocationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpAllocationDelete.json
+ */
+ /**
+ * Sample code: Delete IpAllocation.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipAllocations().delete("rg1", "test-ipallocation", Context.NONE);
+ }
+}
+```
+
+### IpAllocations_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpAllocations GetByResourceGroup. */
+public final class IpAllocationsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpAllocationGet.json
+ */
+ /**
+ * Sample code: Get IpAllocation.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipAllocations().getByResourceGroupWithResponse("rg1", "test-ipallocation", null, Context.NONE);
+ }
+}
+```
+
+### IpAllocations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpAllocations List. */
+public final class IpAllocationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpAllocationList.json
+ */
+ /**
+ * Sample code: List all IpAllocations.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllIpAllocations(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipAllocations().list(Context.NONE);
+ }
+}
+```
+
+### IpAllocations_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpAllocations ListByResourceGroup. */
+public final class IpAllocationsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpAllocationListByResourceGroup.json
+ */
+ /**
+ * Sample code: List IpAllocations in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listIpAllocationsInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipAllocations().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### IpAllocations_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.IpAllocation;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for IpAllocations UpdateTags. */
+public final class IpAllocationsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpAllocationUpdateTags.json
+ */
+ /**
+ * Sample code: Update virtual network tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateVirtualNetworkTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ IpAllocation resource =
+ manager
+ .ipAllocations()
+ .getByResourceGroupWithResponse("rg1", "test-ipallocation", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### IpGroups_CreateOrUpdate
+
+```java
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for IpGroups CreateOrUpdate. */
+public final class IpGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpGroupsCreate.json
+ */
+ /**
+ * Sample code: CreateOrUpdate_IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createOrUpdateIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .ipGroups()
+ .define("ipGroups1")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withTags(mapOf("key1", "value1"))
+ .withIpAddresses(Arrays.asList("13.64.39.16/32", "40.74.146.80/31", "40.74.147.32/28"))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### IpGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpGroups Delete. */
+public final class IpGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpGroupsDelete.json
+ */
+ /**
+ * Sample code: Delete_IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipGroups().delete("myResourceGroup", "ipGroups1", Context.NONE);
+ }
+}
+```
+
+### IpGroups_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpGroups GetByResourceGroup. */
+public final class IpGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpGroupsGet.json
+ */
+ /**
+ * Sample code: Get_IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipGroups().getByResourceGroupWithResponse("myResourceGroup", "ipGroups1", null, Context.NONE);
+ }
+}
+```
+
+### IpGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpGroups List. */
+public final class IpGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpGroupsListBySubscription.json
+ */
+ /**
+ * Sample code: List_IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipGroups().list(Context.NONE);
+ }
+}
+```
+
+### IpGroups_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for IpGroups ListByResourceGroup. */
+public final class IpGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpGroupsListByResourceGroup.json
+ */
+ /**
+ * Sample code: ListByResourceGroup_IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listByResourceGroupIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.ipGroups().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### IpGroups_UpdateGroups
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.IpGroup;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for IpGroups UpdateGroups. */
+public final class IpGroupsUpdateGroupsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/IpGroupsUpdateTags.json
+ */
+ /**
+ * Sample code: Update_IpGroups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ IpGroup resource =
+ manager
+ .ipGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "ipGroups1", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### LoadBalancerBackendAddressPools_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.BackendAddressPool;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress;
+import java.util.Arrays;
+
+/** Samples for LoadBalancerBackendAddressPools CreateOrUpdate. */
+public final class LoadBalancerBackendAddressPoolsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LBBackendAddressPoolWithBackendAddressesPut.json
+ */
+ /**
+ * Sample code: Update load balancer backend pool with backend addresses containing virtual network and IP address.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateLoadBalancerBackendPoolWithBackendAddressesContainingVirtualNetworkAndIPAddress(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ BackendAddressPool resource =
+ manager
+ .loadBalancerBackendAddressPools()
+ .getWithResponse("testrg", "lb", "backend", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withLoadBalancerBackendAddresses(
+ Arrays
+ .asList(
+ new LoadBalancerBackendAddress()
+ .withName("address1")
+ .withVirtualNetwork(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"))
+ .withIpAddress("10.0.0.4"),
+ new LoadBalancerBackendAddress()
+ .withName("address2")
+ .withVirtualNetwork(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"))
+ .withIpAddress("10.0.0.5")))
+ .apply();
+ }
+}
+```
+
+### LoadBalancerBackendAddressPools_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerBackendAddressPools Delete. */
+public final class LoadBalancerBackendAddressPoolsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerBackendAddressPoolDelete.json
+ */
+ /**
+ * Sample code: BackendAddressPoolDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void backendAddressPoolDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerBackendAddressPools().delete("testrg", "lb", "backend", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerBackendAddressPools_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerBackendAddressPools Get. */
+public final class LoadBalancerBackendAddressPoolsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerBackendAddressPoolGet.json
+ */
+ /**
+ * Sample code: LoadBalancerBackendAddressPoolGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerBackendAddressPoolGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerBackendAddressPools().getWithResponse("testrg", "lb", "backend", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LBBackendAddressPoolWithBackendAddressesGet.json
+ */
+ /**
+ * Sample code: LoadBalancer with BackendAddressPool with BackendAddresses.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerWithBackendAddressPoolWithBackendAddresses(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerBackendAddressPools().getWithResponse("testrg", "lb", "backend", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerBackendAddressPools_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerBackendAddressPools List. */
+public final class LoadBalancerBackendAddressPoolsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LBBackendAddressPoolListWithBackendAddressesPoolType.json
+ */
+ /**
+ * Sample code: Load balancer with BackendAddressPool containing BackendAddresses.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerWithBackendAddressPoolContainingBackendAddresses(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerBackendAddressPools().list("testrg", "lb", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerBackendAddressPoolList.json
+ */
+ /**
+ * Sample code: LoadBalancerBackendAddressPoolList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerBackendAddressPoolList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerBackendAddressPools().list("testrg", "lb", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerFrontendIpConfigurations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerFrontendIpConfigurations Get. */
+public final class LoadBalancerFrontendIpConfigurationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerFrontendIPConfigurationGet.json
+ */
+ /**
+ * Sample code: LoadBalancerFrontendIPConfigurationGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerFrontendIPConfigurationGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerFrontendIpConfigurations().getWithResponse("testrg", "lb", "frontend", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerFrontendIpConfigurations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerFrontendIpConfigurations List. */
+public final class LoadBalancerFrontendIpConfigurationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerFrontendIPConfigurationList.json
+ */
+ /**
+ * Sample code: LoadBalancerFrontendIPConfigurationList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerFrontendIPConfigurationList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerFrontendIpConfigurations().list("testrg", "lb", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerLoadBalancingRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerLoadBalancingRules Get. */
+public final class LoadBalancerLoadBalancingRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerLoadBalancingRuleGet.json
+ */
+ /**
+ * Sample code: LoadBalancerLoadBalancingRuleGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerLoadBalancingRuleGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerLoadBalancingRules().getWithResponse("testrg", "lb1", "rule1", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerLoadBalancingRules_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerLoadBalancingRules List. */
+public final class LoadBalancerLoadBalancingRulesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerLoadBalancingRuleList.json
+ */
+ /**
+ * Sample code: LoadBalancerLoadBalancingRuleList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerLoadBalancingRuleList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerLoadBalancingRules().list("testrg", "lb1", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerNetworkInterfaces_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerNetworkInterfaces List. */
+public final class LoadBalancerNetworkInterfacesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerNetworkInterfaceListVmss.json
+ */
+ /**
+ * Sample code: LoadBalancerNetworkInterfaceListVmss.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerNetworkInterfaceListVmss(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerNetworkInterfaces().list("testrg", "lb", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerNetworkInterfaceListSimple.json
+ */
+ /**
+ * Sample code: LoadBalancerNetworkInterfaceListSimple.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerNetworkInterfaceListSimple(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerNetworkInterfaces().list("testrg", "lb", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerOutboundRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerOutboundRules Get. */
+public final class LoadBalancerOutboundRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerOutboundRuleGet.json
+ */
+ /**
+ * Sample code: LoadBalancerOutboundRuleGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerOutboundRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerOutboundRules().getWithResponse("testrg", "lb1", "rule1", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerOutboundRules_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerOutboundRules List. */
+public final class LoadBalancerOutboundRulesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerOutboundRuleList.json
+ */
+ /**
+ * Sample code: LoadBalancerOutboundRuleList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerOutboundRuleList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerOutboundRules().list("testrg", "lb1", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerProbes_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerProbes Get. */
+public final class LoadBalancerProbesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerProbeGet.json
+ */
+ /**
+ * Sample code: LoadBalancerProbeGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerProbeGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerProbes().getWithResponse("testrg", "lb", "probe1", Context.NONE);
+ }
+}
+```
+
+### LoadBalancerProbes_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancerProbes List. */
+public final class LoadBalancerProbesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerProbeList.json
+ */
+ /**
+ * Sample code: LoadBalancerProbeList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void loadBalancerProbeList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancerProbes().list("testrg", "lb", Context.NONE);
+ }
+}
+```
+
+### LoadBalancers_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner;
+import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner;
+import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner;
+import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner;
+import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner;
+import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner;
+import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner;
+import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner;
+import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface;
+import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterfaceType;
+import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelProtocol;
+import com.azure.resourcemanager.network.generated.models.InboundNatPool;
+import com.azure.resourcemanager.network.generated.models.IpAllocationMethod;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerSku;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerSkuName;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerSkuTier;
+import com.azure.resourcemanager.network.generated.models.LoadDistribution;
+import com.azure.resourcemanager.network.generated.models.ProbeProtocol;
+import com.azure.resourcemanager.network.generated.models.TransportProtocol;
+import java.util.Arrays;
+
+/** Samples for LoadBalancers CreateOrUpdate. */
+public final class LoadBalancersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json
+ */
+ /**
+ * Sample code: Create load balancer with Gateway Load Balancer Provider configured with two Backend Pool.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.fromString("Premium")))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
+ .withBackendAddressPools(
+ Arrays
+ .asList(
+ new BackendAddressPoolInner().withName("be-lb1"),
+ new BackendAddressPoolInner().withName("be-lb2")))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPool(new SubResource())
+ .withBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"),
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2")))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.ALL)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(0)
+ .withBackendPort(0)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .withInboundNatPools(Arrays.asList())
+ .withOutboundRules(Arrays.asList())
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateWithInboundNatPool.json
+ */
+ /**
+ * Sample code: Create load balancer with inbound nat pool.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithInboundNatPool(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test")
+ .withName("test")
+ .withZones(Arrays.asList())
+ .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC)
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"))))
+ .withBackendAddressPools(Arrays.asList())
+ .withLoadBalancingRules(Arrays.asList())
+ .withProbes(Arrays.asList())
+ .withInboundNatRules(Arrays.asList())
+ .withInboundNatPools(
+ Arrays
+ .asList(
+ new InboundNatPool()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test")
+ .withName("test")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"))
+ .withProtocol(TransportProtocol.TCP)
+ .withFrontendPortRangeStart(8080)
+ .withFrontendPortRangeEnd(8085)
+ .withBackendPort(8888)
+ .withIdleTimeoutInMinutes(10)
+ .withEnableFloatingIp(true)
+ .withEnableTcpReset(true)))
+ .withOutboundRules(Arrays.asList())
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateWithZones.json
+ */
+ /**
+ * Sample code: Create load balancer with Frontend IP in Zone 1.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithFrontendIPInZone1(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withZones(Arrays.asList("1"))
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
+ .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(80)
+ .withBackendPort(80)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .withInboundNatRules(
+ Arrays
+ .asList(
+ new InboundNatRuleInner()
+ .withName("in-nat-rule")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withFrontendPort(3389)
+ .withBackendPort(3389)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withInboundNatPools(Arrays.asList())
+ .withOutboundRules(Arrays.asList())
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateWithOutboundRules.json
+ */
+ /**
+ * Sample code: Create load balancer with outbound rules.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithOutboundRules(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withPublicIpAddress(
+ new PublicIpAddressInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"))))
+ .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(80)
+ .withBackendPort(80)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)
+ .withDisableOutboundSnat(true)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .withInboundNatRules(
+ Arrays
+ .asList(
+ new InboundNatRuleInner()
+ .withName("in-nat-rule")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withFrontendPort(3389)
+ .withBackendPort(3389)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withInboundNatPools(Arrays.asList())
+ .withOutboundRules(
+ Arrays
+ .asList(
+ new OutboundRuleInner()
+ .withName("rule1")
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
+ .withProtocol(LoadBalancerOutboundRuleProtocol.ALL)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json
+ */
+ /**
+ * Sample code: Create load balancer with Gateway Load Balancer Provider configured with one Backend Pool.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.fromString("Premium")))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
+ .withBackendAddressPools(
+ Arrays
+ .asList(
+ new BackendAddressPoolInner()
+ .withName("be-lb")
+ .withTunnelInterfaces(
+ Arrays
+ .asList(
+ new GatewayLoadBalancerTunnelInterface()
+ .withPort(15000)
+ .withIdentifier(900)
+ .withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN)
+ .withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL),
+ new GatewayLoadBalancerTunnelInterface()
+ .withPort(15001)
+ .withIdentifier(901)
+ .withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN)
+ .withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL)))))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.ALL)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(0)
+ .withBackendPort(0)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .withInboundNatPools(Arrays.asList())
+ .withOutboundRules(Arrays.asList())
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreate.json
+ */
+ /**
+ * Sample code: Create load balancer.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
+ .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(80)
+ .withBackendPort(80)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)
+ .withEnableTcpReset(false)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .withInboundNatRules(
+ Arrays
+ .asList(
+ new InboundNatRuleInner()
+ .withName("in-nat-rule")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withFrontendPort(3389)
+ .withBackendPort(3389)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)
+ .withEnableTcpReset(false)))
+ .withInboundNatPools(Arrays.asList())
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateGlobalTier.json
+ */
+ /**
+ * Sample code: Create load balancer with Global Tier and one regional load balancer in its backend pool.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD).withTier(LoadBalancerSkuTier.GLOBAL))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
+ .withBackendAddressPools(
+ Arrays
+ .asList(
+ new BackendAddressPoolInner()
+ .withName("be-lb")
+ .withLoadBalancerBackendAddresses(
+ Arrays
+ .asList(
+ new LoadBalancerBackendAddress()
+ .withName("regional-lb1-address")
+ .withLoadBalancerFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"))))))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(80)
+ .withBackendPort(80)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(false)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateGatewayLoadBalancerConsumer.json
+ */
+ /**
+ * Sample code: Create load balancer with Gateway Load Balancer Consumer configured.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithGatewayLoadBalancerConsumerConfigured(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))
+ .withGatewayLoadBalancer(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"))))
+ .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(80)
+ .withBackendPort(80)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .withInboundNatRules(
+ Arrays
+ .asList(
+ new InboundNatRuleInner()
+ .withName("in-nat-rule")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withFrontendPort(3389)
+ .withBackendPort(3389)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withInboundNatPools(Arrays.asList())
+ .withOutboundRules(Arrays.asList())
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerCreateStandardSku.json
+ */
+ /**
+ * Sample code: Create load balancer with Standard SKU.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLoadBalancerWithStandardSKU(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .define("lb")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withName("fe-lb")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
+ .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
+ .withLoadBalancingRules(
+ Arrays
+ .asList(
+ new LoadBalancingRuleInner()
+ .withName("rulelb")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
+ .withProbe(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withLoadDistribution(LoadDistribution.DEFAULT)
+ .withFrontendPort(80)
+ .withBackendPort(80)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withProbes(
+ Arrays
+ .asList(
+ new ProbeInner()
+ .withName("probe-lb")
+ .withProtocol(ProbeProtocol.HTTP)
+ .withPort(80)
+ .withIntervalInSeconds(15)
+ .withNumberOfProbes(2)
+ .withRequestPath("healthcheck.aspx")))
+ .withInboundNatRules(
+ Arrays
+ .asList(
+ new InboundNatRuleInner()
+ .withName("in-nat-rule")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
+ .withProtocol(TransportProtocol.TCP)
+ .withFrontendPort(3389)
+ .withBackendPort(3389)
+ .withIdleTimeoutInMinutes(15)
+ .withEnableFloatingIp(true)))
+ .withInboundNatPools(Arrays.asList())
+ .withOutboundRules(Arrays.asList())
+ .create();
+ }
+}
+```
+
+### LoadBalancers_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancers Delete. */
+public final class LoadBalancersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerDelete.json
+ */
+ /**
+ * Sample code: Delete load balancer.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancers().delete("rg1", "lb", Context.NONE);
+ }
+}
+```
+
+### LoadBalancers_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancers GetByResourceGroup. */
+public final class LoadBalancersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerGet.json
+ */
+ /**
+ * Sample code: Get load balancer.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancers().getByResourceGroupWithResponse("rg1", "lb", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerGetInboundNatRulePortMapping.json
+ */
+ /**
+ * Sample code: Get load balancer with inbound NAT rule port mapping.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getLoadBalancerWithInboundNATRulePortMapping(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancers().getByResourceGroupWithResponse("rg1", "lb", null, Context.NONE);
+ }
+}
+```
+
+### LoadBalancers_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancers List. */
+public final class LoadBalancersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerListAll.json
+ */
+ /**
+ * Sample code: List all load balancers.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllLoadBalancers(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancers().list(Context.NONE);
+ }
+}
+```
+
+### LoadBalancers_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LoadBalancers ListByResourceGroup. */
+public final class LoadBalancersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerList.json
+ */
+ /**
+ * Sample code: List load balancers in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listLoadBalancersInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.loadBalancers().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### LoadBalancers_ListInboundNatRulePortMappings
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.QueryInboundNatRulePortMappingRequest;
+
+/** Samples for LoadBalancers ListInboundNatRulePortMappings. */
+public final class LoadBalancersListInboundNatRulePortMappingsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/QueryInboundNatRulePortMapping.json
+ */
+ /**
+ * Sample code: Query inbound NAT rule port mapping.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void queryInboundNATRulePortMapping(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .listInboundNatRulePortMappings(
+ "rg1",
+ "lb1",
+ "bp1",
+ new QueryInboundNatRulePortMappingRequest().withIpAddress("10.0.0.4"),
+ Context.NONE);
+ }
+}
+```
+
+### LoadBalancers_SwapPublicIpAddresses
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequestFrontendIpConfiguration;
+import java.util.Arrays;
+
+/** Samples for LoadBalancers SwapPublicIpAddresses. */
+public final class LoadBalancersSwapPublicIpAddressesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancersSwapPublicIpAddresses.json
+ */
+ /**
+ * Sample code: Swap VIPs between two load balancers.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void swapVIPsBetweenTwoLoadBalancers(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .loadBalancers()
+ .swapPublicIpAddresses(
+ "westus",
+ new LoadBalancerVipSwapRequest()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerVipSwapRequestFrontendIpConfiguration()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfe1")
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/pip2")),
+ new LoadBalancerVipSwapRequestFrontendIpConfiguration()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb2/frontendIPConfigurations/lbfe2")
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1")))),
+ Context.NONE);
+ }
+}
+```
+
+### LoadBalancers_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.LoadBalancer;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for LoadBalancers UpdateTags. */
+public final class LoadBalancersUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LoadBalancerUpdateTags.json
+ */
+ /**
+ * Sample code: Update load balancer tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateLoadBalancerTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ LoadBalancer resource =
+ manager.loadBalancers().getByResourceGroupWithResponse("rg1", "lb", null, Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### LocalNetworkGateways_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.AddressSpace;
+import java.util.Arrays;
+
+/** Samples for LocalNetworkGateways CreateOrUpdate. */
+public final class LocalNetworkGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LocalNetworkGatewayCreate.json
+ */
+ /**
+ * Sample code: CreateLocalNetworkGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .localNetworkGateways()
+ .define("localgw")
+ .withRegion("Central US")
+ .withExistingResourceGroup("rg1")
+ .withLocalNetworkAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.1.0.0/16")))
+ .withGatewayIpAddress("11.12.13.14")
+ .withFqdn("site1.contoso.com")
+ .create();
+ }
+}
+```
+
+### LocalNetworkGateways_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LocalNetworkGateways Delete. */
+public final class LocalNetworkGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LocalNetworkGatewayDelete.json
+ */
+ /**
+ * Sample code: DeleteLocalNetworkGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.localNetworkGateways().delete("rg1", "localgw", Context.NONE);
+ }
+}
+```
+
+### LocalNetworkGateways_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LocalNetworkGateways GetByResourceGroup. */
+public final class LocalNetworkGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LocalNetworkGatewayGet.json
+ */
+ /**
+ * Sample code: GetLocalNetworkGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.localNetworkGateways().getByResourceGroupWithResponse("rg1", "localgw", Context.NONE);
+ }
+}
+```
+
+### LocalNetworkGateways_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for LocalNetworkGateways ListByResourceGroup. */
+public final class LocalNetworkGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LocalNetworkGatewayList.json
+ */
+ /**
+ * Sample code: ListLocalNetworkGateways.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listLocalNetworkGateways(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.localNetworkGateways().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### LocalNetworkGateways_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for LocalNetworkGateways UpdateTags. */
+public final class LocalNetworkGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/LocalNetworkGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: UpdateLocalNetworkGatewayTags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateLocalNetworkGatewayTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ LocalNetworkGateway resource =
+ manager.localNetworkGateways().getByResourceGroupWithResponse("rg1", "lgw", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NatGateways_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.NatGatewaySku;
+import com.azure.resourcemanager.network.generated.models.NatGatewaySkuName;
+import java.util.Arrays;
+
+/** Samples for NatGateways CreateOrUpdate. */
+public final class NatGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatGatewayCreateOrUpdate.json
+ */
+ /**
+ * Sample code: Create nat gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .natGateways()
+ .define("test-natgateway")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new NatGatewaySku().withName(NatGatewaySkuName.STANDARD))
+ .withPublicIpAddresses(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1")))
+ .withPublicIpPrefixes(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1")))
+ .create();
+ }
+}
+```
+
+### NatGateways_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NatGateways Delete. */
+public final class NatGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatGatewayDelete.json
+ */
+ /**
+ * Sample code: Delete nat gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.natGateways().delete("rg1", "test-natGateway", Context.NONE);
+ }
+}
+```
+
+### NatGateways_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NatGateways GetByResourceGroup. */
+public final class NatGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatGatewayGet.json
+ */
+ /**
+ * Sample code: Get nat gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.natGateways().getByResourceGroupWithResponse("rg1", "test-natGateway", null, Context.NONE);
+ }
+}
+```
+
+### NatGateways_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NatGateways List. */
+public final class NatGatewaysListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatGatewayListAll.json
+ */
+ /**
+ * Sample code: List all nat gateways.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNatGateways(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.natGateways().list(Context.NONE);
+ }
+}
+```
+
+### NatGateways_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NatGateways ListByResourceGroup. */
+public final class NatGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatGatewayList.json
+ */
+ /**
+ * Sample code: List nat gateways in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listNatGatewaysInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.natGateways().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### NatGateways_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.NatGateway;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for NatGateways UpdateTags. */
+public final class NatGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: Update nat gateway tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateNatGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ NatGateway resource =
+ manager
+ .natGateways()
+ .getByResourceGroupWithResponse("rg1", "test-natGateway", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NatRules_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleType;
+import java.util.Arrays;
+
+/** Samples for NatRules CreateOrUpdate. */
+public final class NatRulesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatRulePut.json
+ */
+ /**
+ * Sample code: NatRulePut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void natRulePut(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .natRules()
+ .define("natRule1")
+ .withExistingVpnGateway("rg1", "gateway1")
+ .withTypePropertiesType(VpnNatRuleType.STATIC)
+ .withMode(VpnNatRuleMode.EGRESS_SNAT)
+ .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.4.0.0/24")))
+ .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.21.0/24")))
+ .withIpConfigurationId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default")
+ .create();
+ }
+}
+```
+
+### NatRules_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NatRules Delete. */
+public final class NatRulesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatRuleDelete.json
+ */
+ /**
+ * Sample code: NatRuleDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void natRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.natRules().delete("rg1", "gateway1", "natRule1", Context.NONE);
+ }
+}
+```
+
+### NatRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NatRules Get. */
+public final class NatRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatRuleGet.json
+ */
+ /**
+ * Sample code: NatRuleGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void natRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.natRules().getWithResponse("rg1", "gateway1", "natRule1", Context.NONE);
+ }
+}
+```
+
+### NatRules_ListByVpnGateway
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NatRules ListByVpnGateway. */
+public final class NatRulesListByVpnGatewaySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NatRuleList.json
+ */
+ /**
+ * Sample code: NatRuleList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void natRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.natRules().listByVpnGateway("rg1", "gateway1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaceIpConfigurations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaceIpConfigurations Get. */
+public final class NetworkInterfaceIpConfigurationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceIPConfigurationGet.json
+ */
+ /**
+ * Sample code: NetworkInterfaceIPConfigurationGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void networkInterfaceIPConfigurationGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaceIpConfigurations().getWithResponse("testrg", "mynic", "ipconfig1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaceIpConfigurations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaceIpConfigurations List. */
+public final class NetworkInterfaceIpConfigurationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceIPConfigurationList.json
+ */
+ /**
+ * Sample code: NetworkInterfaceIPConfigurationList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void networkInterfaceIPConfigurationList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaceIpConfigurations().list("testrg", "nic1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaceLoadBalancers_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaceLoadBalancers List. */
+public final class NetworkInterfaceLoadBalancersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceLoadBalancerList.json
+ */
+ /**
+ * Sample code: NetworkInterfaceLoadBalancerList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void networkInterfaceLoadBalancerList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaceLoadBalancers().list("testrg", "nic1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaceTapConfigurations_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner;
+
+/** Samples for NetworkInterfaceTapConfigurations CreateOrUpdate. */
+public final class NetworkInterfaceTapConfigurationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceTapConfigurationCreate.json
+ */
+ /**
+ * Sample code: Create Network Interface Tap Configurations.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkInterfaceTapConfigurations(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaceTapConfigurations()
+ .define("tapconfiguration1")
+ .withExistingNetworkInterface("testrg", "mynic")
+ .withVirtualNetworkTap(
+ new VirtualNetworkTapInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"))
+ .create();
+ }
+}
+```
+
+### NetworkInterfaceTapConfigurations_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaceTapConfigurations Delete. */
+public final class NetworkInterfaceTapConfigurationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceTapConfigurationDelete.json
+ */
+ /**
+ * Sample code: Delete tap configuration.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteTapConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaceTapConfigurations()
+ .delete("rg1", "test-networkinterface", "test-tapconfiguration", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaceTapConfigurations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaceTapConfigurations Get. */
+public final class NetworkInterfaceTapConfigurationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceTapConfigurationGet.json
+ */
+ /**
+ * Sample code: Get Network Interface Tap Configurations.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkInterfaceTapConfigurations(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaceTapConfigurations()
+ .getWithResponse("testrg", "mynic", "tapconfiguration1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaceTapConfigurations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaceTapConfigurations List. */
+public final class NetworkInterfaceTapConfigurationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceTapConfigurationList.json
+ */
+ /**
+ * Sample code: List virtual network tap configurations.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualNetworkTapConfigurations(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaceTapConfigurations().list("rg1", "mynic", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner;
+import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner;
+import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner;
+import java.util.Arrays;
+
+/** Samples for NetworkInterfaces CreateOrUpdate. */
+public final class NetworkInterfacesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceCreateGatewayLoadBalancerConsumer.json
+ */
+ /**
+ * Sample code: Create network interface with Gateway Load Balancer Consumer configured.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkInterfaceWithGatewayLoadBalancerConsumerConfigured(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaces()
+ .define("test-nic")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new NetworkInterfaceIpConfigurationInner()
+ .withName("ipconfig1")
+ .withGatewayLoadBalancer(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"))
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"))
+ .withPublicIpAddress(
+ new PublicIpAddressInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"))))
+ .withEnableAcceleratedNetworking(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceCreate.json
+ */
+ /**
+ * Sample code: Create network interface.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaces()
+ .define("test-nic")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new NetworkInterfaceIpConfigurationInner()
+ .withName("ipconfig1")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"))
+ .withPublicIpAddress(
+ new PublicIpAddressInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"))))
+ .withEnableAcceleratedNetworking(true)
+ .create();
+ }
+}
+```
+
+### NetworkInterfaces_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces Delete. */
+public final class NetworkInterfacesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceDelete.json
+ */
+ /**
+ * Sample code: Delete network interface.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().delete("rg1", "test-nic", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces GetByResourceGroup. */
+public final class NetworkInterfacesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceGet.json
+ */
+ /**
+ * Sample code: Get network interface.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().getByResourceGroupWithResponse("rg1", "test-nic", null, Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_GetCloudServiceNetworkInterface
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces GetCloudServiceNetworkInterface. */
+public final class NetworkInterfacesGetCloudServiceNetworkInterfaceSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CloudServiceNetworkInterfaceGet.json
+ */
+ /**
+ * Sample code: Get cloud service network interface.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getCloudServiceNetworkInterface(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaces()
+ .getCloudServiceNetworkInterfaceWithResponse("rg1", "cs1", "TestVMRole_IN_0", "nic1", null, Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_GetEffectiveRouteTable
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces GetEffectiveRouteTable. */
+public final class NetworkInterfacesGetEffectiveRouteTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceEffectiveRouteTableList.json
+ */
+ /**
+ * Sample code: Show network interface effective route tables.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void showNetworkInterfaceEffectiveRouteTables(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().getEffectiveRouteTable("rg1", "nic1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_GetVirtualMachineScaleSetIpConfiguration
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces GetVirtualMachineScaleSetIpConfiguration. */
+public final class NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssNetworkInterfaceIpConfigGet.json
+ */
+ /**
+ * Sample code: Get virtual machine scale set network interface.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualMachineScaleSetNetworkInterface(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaces()
+ .getVirtualMachineScaleSetIpConfigurationWithResponse(
+ "rg1", "vmss1", "2", "nic1", "ip1", null, Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_GetVirtualMachineScaleSetNetworkInterface
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces GetVirtualMachineScaleSetNetworkInterface. */
+public final class NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssNetworkInterfaceGet.json
+ */
+ /**
+ * Sample code: Get virtual machine scale set network interface.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualMachineScaleSetNetworkInterface(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaces()
+ .getVirtualMachineScaleSetNetworkInterfaceWithResponse("rg1", "vmss1", "1", "nic1", null, Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces List. */
+public final class NetworkInterfacesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceListAll.json
+ */
+ /**
+ * Sample code: List all network interfaces.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().list(Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces ListByResourceGroup. */
+public final class NetworkInterfacesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceList.json
+ */
+ /**
+ * Sample code: List network interfaces in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listNetworkInterfacesInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_ListCloudServiceNetworkInterfaces
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces ListCloudServiceNetworkInterfaces. */
+public final class NetworkInterfacesListCloudServiceNetworkInterfacesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CloudServiceNetworkInterfaceList.json
+ */
+ /**
+ * Sample code: List cloud service network interfaces.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listCloudServiceNetworkInterfaces(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().listCloudServiceNetworkInterfaces("rg1", "cs1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_ListCloudServiceRoleInstanceNetworkInterfaces
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces ListCloudServiceRoleInstanceNetworkInterfaces. */
+public final class NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CloudServiceRoleInstanceNetworkInterfaceList.json
+ */
+ /**
+ * Sample code: List cloud service role instance network interfaces.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listCloudServiceRoleInstanceNetworkInterfaces(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaces()
+ .listCloudServiceRoleInstanceNetworkInterfaces("rg1", "cs1", "TestVMRole_IN_0", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_ListEffectiveNetworkSecurityGroups
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces ListEffectiveNetworkSecurityGroups. */
+public final class NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceEffectiveNSGList.json
+ */
+ /**
+ * Sample code: List network interface effective network security groups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listNetworkInterfaceEffectiveNetworkSecurityGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().listEffectiveNetworkSecurityGroups("rg1", "nic1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_ListVirtualMachineScaleSetIpConfigurations
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces ListVirtualMachineScaleSetIpConfigurations. */
+public final class NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssNetworkInterfaceIpConfigList.json
+ */
+ /**
+ * Sample code: List virtual machine scale set network interface ip configurations.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualMachineScaleSetNetworkInterfaceIpConfigurations(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkInterfaces()
+ .listVirtualMachineScaleSetIpConfigurations("rg1", "vmss1", "2", "nic1", null, Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_ListVirtualMachineScaleSetNetworkInterfaces
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces ListVirtualMachineScaleSetNetworkInterfaces. */
+public final class NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssNetworkInterfaceList.json
+ */
+ /**
+ * Sample code: List virtual machine scale set network interfaces.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualMachineScaleSetNetworkInterfaces(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().listVirtualMachineScaleSetNetworkInterfaces("rg1", "vmss1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_ListVirtualMachineScaleSetVMNetworkInterfaces
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkInterfaces ListVirtualMachineScaleSetVMNetworkInterfaces. */
+public final class NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssVmNetworkInterfaceList.json
+ */
+ /**
+ * Sample code: List virtual machine scale set vm network interfaces.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualMachineScaleSetVmNetworkInterfaces(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkInterfaces().listVirtualMachineScaleSetVMNetworkInterfaces("rg1", "vmss1", "1", Context.NONE);
+ }
+}
+```
+
+### NetworkInterfaces_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.NetworkInterface;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for NetworkInterfaces UpdateTags. */
+public final class NetworkInterfacesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkInterfaceUpdateTags.json
+ */
+ /**
+ * Sample code: Update network interface tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateNetworkInterfaceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ NetworkInterface resource =
+ manager
+ .networkInterfaces()
+ .getByResourceGroupWithResponse("rg1", "test-nic", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NetworkProfiles_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner;
+import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner;
+import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration;
+import java.util.Arrays;
+
+/** Samples for NetworkProfiles CreateOrUpdate. */
+public final class NetworkProfilesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkProfileCreateConfigOnly.json
+ */
+ /**
+ * Sample code: Create network profile defaults.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkProfileDefaults(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkProfiles()
+ .define("networkProfile1")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withContainerNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new ContainerNetworkInterfaceConfiguration()
+ .withName("eth1")
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new IpConfigurationProfileInner()
+ .withName("ipconfig1")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"))))))
+ .create();
+ }
+}
+```
+
+### NetworkProfiles_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkProfiles Delete. */
+public final class NetworkProfilesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkProfileDelete.json
+ */
+ /**
+ * Sample code: Delete network profile.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNetworkProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkProfiles().delete("rg1", "networkProfile1", Context.NONE);
+ }
+}
+```
+
+### NetworkProfiles_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkProfiles GetByResourceGroup. */
+public final class NetworkProfilesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkProfileGetWithContainerNic.json
+ */
+ /**
+ * Sample code: Get network profile with container network interfaces.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkProfileWithContainerNetworkInterfaces(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkProfiles().getByResourceGroupWithResponse("rg1", "networkProfile1", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkProfileGetConfigOnly.json
+ */
+ /**
+ * Sample code: Get network profile.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkProfiles().getByResourceGroupWithResponse("rg1", "networkProfile1", null, Context.NONE);
+ }
+}
+```
+
+### NetworkProfiles_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkProfiles List. */
+public final class NetworkProfilesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkProfileListAll.json
+ */
+ /**
+ * Sample code: List all network profiles.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkProfiles(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkProfiles().list(Context.NONE);
+ }
+}
+```
+
+### NetworkProfiles_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkProfiles ListByResourceGroup. */
+public final class NetworkProfilesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkProfileList.json
+ */
+ /**
+ * Sample code: List resource group network profiles.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listResourceGroupNetworkProfiles(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkProfiles().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### NetworkProfiles_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.NetworkProfile;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for NetworkProfiles UpdateTags. */
+public final class NetworkProfilesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkProfileUpdateTags.json
+ */
+ /**
+ * Sample code: Update network profile tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateNetworkProfileTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ NetworkProfile resource =
+ manager.networkProfiles().getByResourceGroupWithResponse("rg1", "test-np", null, Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NetworkSecurityGroups_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner;
+import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess;
+import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection;
+import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol;
+import java.util.Arrays;
+
+/** Samples for NetworkSecurityGroups CreateOrUpdate. */
+public final class NetworkSecurityGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupCreateWithRule.json
+ */
+ /**
+ * Sample code: Create network security group with rule.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkSecurityGroupWithRule(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkSecurityGroups()
+ .define("testnsg")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSecurityRules(
+ Arrays
+ .asList(
+ new SecurityRuleInner()
+ .withName("rule1")
+ .withProtocol(SecurityRuleProtocol.ASTERISK)
+ .withSourcePortRange("*")
+ .withDestinationPortRange("80")
+ .withSourceAddressPrefix("*")
+ .withDestinationAddressPrefix("*")
+ .withAccess(SecurityRuleAccess.ALLOW)
+ .withPriority(130)
+ .withDirection(SecurityRuleDirection.INBOUND)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupCreate.json
+ */
+ /**
+ * Sample code: Create network security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkSecurityGroups()
+ .define("testnsg")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .create();
+ }
+}
+```
+
+### NetworkSecurityGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkSecurityGroups Delete. */
+public final class NetworkSecurityGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupDelete.json
+ */
+ /**
+ * Sample code: Delete network security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkSecurityGroups().delete("rg1", "testnsg", Context.NONE);
+ }
+}
+```
+
+### NetworkSecurityGroups_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkSecurityGroups GetByResourceGroup. */
+public final class NetworkSecurityGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupGet.json
+ */
+ /**
+ * Sample code: Get network security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkSecurityGroups().getByResourceGroupWithResponse("rg1", "testnsg", null, Context.NONE);
+ }
+}
+```
+
+### NetworkSecurityGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkSecurityGroups List. */
+public final class NetworkSecurityGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupListAll.json
+ */
+ /**
+ * Sample code: List all network security groups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkSecurityGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkSecurityGroups().list(Context.NONE);
+ }
+}
+```
+
+### NetworkSecurityGroups_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkSecurityGroups ListByResourceGroup. */
+public final class NetworkSecurityGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupList.json
+ */
+ /**
+ * Sample code: List network security groups in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listNetworkSecurityGroupsInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkSecurityGroups().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### NetworkSecurityGroups_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for NetworkSecurityGroups UpdateTags. */
+public final class NetworkSecurityGroupsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupUpdateTags.json
+ */
+ /**
+ * Sample code: Update network security group tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateNetworkSecurityGroupTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ NetworkSecurityGroup resource =
+ manager
+ .networkSecurityGroups()
+ .getByResourceGroupWithResponse("rg1", "testnsg", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NetworkVirtualAppliances_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities;
+import com.azure.resourcemanager.network.generated.models.ResourceIdentityType;
+import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for NetworkVirtualAppliances CreateOrUpdate. */
+public final class NetworkVirtualAppliancesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualAppliancePut.json
+ */
+ /**
+ * Sample code: Create NetworkVirtualAppliance.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkVirtualAppliance(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkVirtualAppliances()
+ .define("nva")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withIdentity(
+ new ManagedServiceIdentity()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
+ new ManagedServiceIdentityUserAssignedIdentities())))
+ .withNvaSku(
+ new VirtualApplianceSkuProperties()
+ .withVendor("Cisco SDWAN")
+ .withBundledScaleUnit("1")
+ .withMarketPlaceVersion("12.1"))
+ .withBootStrapConfigurationBlobs(
+ Arrays.asList("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"))
+ .withVirtualHub(
+ new SubResource()
+ .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"))
+ .withCloudInitConfigurationBlobs(
+ Arrays.asList("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"))
+ .withVirtualApplianceAsn(10000L)
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NetworkVirtualAppliances_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkVirtualAppliances Delete. */
+public final class NetworkVirtualAppliancesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceDelete.json
+ */
+ /**
+ * Sample code: Delete NetworkVirtualAppliance.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNetworkVirtualAppliance(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkVirtualAppliances().delete("rg1", "nva", Context.NONE);
+ }
+}
+```
+
+### NetworkVirtualAppliances_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkVirtualAppliances GetByResourceGroup. */
+public final class NetworkVirtualAppliancesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceGet.json
+ */
+ /**
+ * Sample code: Get NetworkVirtualAppliance.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkVirtualAppliances().getByResourceGroupWithResponse("rg1", "nva", null, Context.NONE);
+ }
+}
+```
+
+### NetworkVirtualAppliances_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkVirtualAppliances List. */
+public final class NetworkVirtualAppliancesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceListBySubscription.json
+ */
+ /**
+ * Sample code: List all Network Virtual Appliances for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkVirtualAppliancesForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkVirtualAppliances().list(Context.NONE);
+ }
+}
+```
+
+### NetworkVirtualAppliances_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkVirtualAppliances ListByResourceGroup. */
+public final class NetworkVirtualAppliancesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Network Virtual Appliance for a given resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkVirtualApplianceForAGivenResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkVirtualAppliances().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### NetworkVirtualAppliances_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for NetworkVirtualAppliances UpdateTags. */
+public final class NetworkVirtualAppliancesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceUpdateTags.json
+ */
+ /**
+ * Sample code: Update NetworkVirtualAppliance.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateNetworkVirtualAppliance(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ NetworkVirtualAppliance resource =
+ manager
+ .networkVirtualAppliances()
+ .getByResourceGroupWithResponse("rg1", "nva", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NetworkWatchers_CheckConnectivity
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ConnectivityDestination;
+import com.azure.resourcemanager.network.generated.models.ConnectivityParameters;
+import com.azure.resourcemanager.network.generated.models.ConnectivitySource;
+import com.azure.resourcemanager.network.generated.models.IpVersion;
+
+/** Samples for NetworkWatchers CheckConnectivity. */
+public final class NetworkWatchersCheckConnectivitySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherConnectivityCheck.json
+ */
+ /**
+ * Sample code: Check connectivity.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void checkConnectivity(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .checkConnectivity(
+ "rg1",
+ "nw1",
+ new ConnectivityParameters()
+ .withSource(
+ new ConnectivitySource()
+ .withResourceId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"))
+ .withDestination(new ConnectivityDestination().withAddress("192.168.100.4").withPort(3389))
+ .withPreferredIpVersion(IpVersion.IPV4),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_CreateOrUpdate
+
+```java
+/** Samples for NetworkWatchers CreateOrUpdate. */
+public final class NetworkWatchersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherCreate.json
+ */
+ /**
+ * Sample code: Create network watcher.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkWatchers().define("nw1").withRegion("eastus").withExistingResourceGroup("rg1").create();
+ }
+}
+```
+
+### NetworkWatchers_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkWatchers Delete. */
+public final class NetworkWatchersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherDelete.json
+ */
+ /**
+ * Sample code: Delete network watcher.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkWatchers().delete("rg1", "nw1", Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetAzureReachabilityReport
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation;
+import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for NetworkWatchers GetAzureReachabilityReport. */
+public final class NetworkWatchersGetAzureReachabilityReportSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherAzureReachabilityReportGet.json
+ */
+ /**
+ * Sample code: Get Azure Reachability Report.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAzureReachabilityReport(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getAzureReachabilityReport(
+ "rg1",
+ "nw1",
+ new AzureReachabilityReportParameters()
+ .withProviderLocation(
+ new AzureReachabilityReportLocation().withCountry("United States").withState("washington"))
+ .withProviders(Arrays.asList("Frontier Communications of America, Inc. - ASN 5650"))
+ .withAzureLocations(Arrays.asList("West US"))
+ .withStartTime(OffsetDateTime.parse("2017-09-07T00:00:00Z"))
+ .withEndTime(OffsetDateTime.parse("2017-09-10T00:00:00Z")),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkWatchers GetByResourceGroup. */
+public final class NetworkWatchersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherGet.json
+ */
+ /**
+ * Sample code: Get network watcher.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkWatchers().getByResourceGroupWithResponse("rg1", "nw1", Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetFlowLogStatus
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters;
+
+/** Samples for NetworkWatchers GetFlowLogStatus. */
+public final class NetworkWatchersGetFlowLogStatusSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherFlowLogStatusQuery.json
+ */
+ /**
+ * Sample code: Get flow log status.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getFlowLogStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getFlowLogStatus(
+ "rg1",
+ "nw1",
+ new FlowLogStatusParameters()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetNetworkConfigurationDiagnostic
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.Direction;
+import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters;
+import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticProfile;
+import java.util.Arrays;
+
+/** Samples for NetworkWatchers GetNetworkConfigurationDiagnostic. */
+public final class NetworkWatchersGetNetworkConfigurationDiagnosticSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherNetworkConfigurationDiagnostic.json
+ */
+ /**
+ * Sample code: Network configuration diagnostic.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void networkConfigurationDiagnostic(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getNetworkConfigurationDiagnostic(
+ "rg1",
+ "nw1",
+ new NetworkConfigurationDiagnosticParameters()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")
+ .withProfiles(
+ Arrays
+ .asList(
+ new NetworkConfigurationDiagnosticProfile()
+ .withDirection(Direction.INBOUND)
+ .withProtocol("TCP")
+ .withSource("10.1.0.4")
+ .withDestination("12.11.12.14")
+ .withDestinationPort("12100"))),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetNextHop
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.NextHopParameters;
+
+/** Samples for NetworkWatchers GetNextHop. */
+public final class NetworkWatchersGetNextHopSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherNextHopGet.json
+ */
+ /**
+ * Sample code: Get next hop.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNextHop(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getNextHop(
+ "rg1",
+ "nw1",
+ new NextHopParameters()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")
+ .withSourceIpAddress("10.0.0.5")
+ .withDestinationIpAddress("10.0.0.10")
+ .withTargetNicResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetTopology
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.TopologyParameters;
+
+/** Samples for NetworkWatchers GetTopology. */
+public final class NetworkWatchersGetTopologySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherTopologyGet.json
+ */
+ /**
+ * Sample code: Get Topology.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getTopology(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getTopologyWithResponse(
+ "rg1", "nw1", new TopologyParameters().withTargetResourceGroupName("rg2"), Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetTroubleshooting
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters;
+
+/** Samples for NetworkWatchers GetTroubleshooting. */
+public final class NetworkWatchersGetTroubleshootingSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherTroubleshootGet.json
+ */
+ /**
+ * Sample code: Get troubleshooting.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getTroubleshooting(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getTroubleshooting(
+ "rg1",
+ "nw1",
+ new TroubleshootingParameters()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")
+ .withStorageId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1")
+ .withStoragePath("https://st1.blob.core.windows.net/cn1"),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetTroubleshootingResult
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters;
+
+/** Samples for NetworkWatchers GetTroubleshootingResult. */
+public final class NetworkWatchersGetTroubleshootingResultSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherTroubleshootResultQuery.json
+ */
+ /**
+ * Sample code: Get troubleshoot result.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getTroubleshootResult(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getTroubleshootingResult(
+ "rg1",
+ "nw1",
+ new QueryTroubleshootingParameters()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_GetVMSecurityRules
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters;
+
+/** Samples for NetworkWatchers GetVMSecurityRules. */
+public final class NetworkWatchersGetVMSecurityRulesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherSecurityGroupViewGet.json
+ */
+ /**
+ * Sample code: Get security group view.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getSecurityGroupView(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .getVMSecurityRules(
+ "rg1",
+ "nw1",
+ new SecurityGroupViewParameters()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkWatchers List. */
+public final class NetworkWatchersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherListAll.json
+ */
+ /**
+ * Sample code: List all network watchers.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkWatchers(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkWatchers().list(Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_ListAvailableProviders
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters;
+import java.util.Arrays;
+
+/** Samples for NetworkWatchers ListAvailableProviders. */
+public final class NetworkWatchersListAvailableProvidersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherAvailableProvidersListGet.json
+ */
+ /**
+ * Sample code: Get Available Providers List.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAvailableProvidersList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .listAvailableProviders(
+ "rg1",
+ "nw1",
+ new AvailableProvidersListParameters()
+ .withAzureLocations(Arrays.asList("West US"))
+ .withCountry("United States")
+ .withState("washington")
+ .withCity("seattle"),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for NetworkWatchers ListByResourceGroup. */
+public final class NetworkWatchersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherList.json
+ */
+ /**
+ * Sample code: List network watchers.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listNetworkWatchers(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.networkWatchers().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_SetFlowLogConfiguration
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner;
+
+/** Samples for NetworkWatchers SetFlowLogConfiguration. */
+public final class NetworkWatchersSetFlowLogConfigurationSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherFlowLogConfigure.json
+ */
+ /**
+ * Sample code: Configure flow log.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void configureFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .setFlowLogConfiguration(
+ "rg1",
+ "nw1",
+ new FlowLogInformationInner()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1")
+ .withStorageId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1")
+ .withEnabled(true),
+ Context.NONE);
+ }
+}
+```
+
+### NetworkWatchers_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.NetworkWatcher;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for NetworkWatchers UpdateTags. */
+public final class NetworkWatchersUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherUpdateTags.json
+ */
+ /**
+ * Sample code: Update network watcher tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateNetworkWatcherTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ NetworkWatcher resource =
+ manager.networkWatchers().getByResourceGroupWithResponse("rg1", "nw1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### NetworkWatchers_VerifyIpFlow
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.Direction;
+import com.azure.resourcemanager.network.generated.models.IpFlowProtocol;
+import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters;
+
+/** Samples for NetworkWatchers VerifyIpFlow. */
+public final class NetworkWatchersVerifyIpFlowSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherIpFlowVerify.json
+ */
+ /**
+ * Sample code: Ip flow verify.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void ipFlowVerify(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .networkWatchers()
+ .verifyIpFlow(
+ "rg1",
+ "nw1",
+ new VerificationIpFlowParameters()
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")
+ .withDirection(Direction.OUTBOUND)
+ .withProtocol(IpFlowProtocol.TCP)
+ .withLocalPort("80")
+ .withRemotePort("80")
+ .withLocalIpAddress("10.2.0.4")
+ .withRemoteIpAddress("121.10.1.1"),
+ Context.NONE);
+ }
+}
+```
+
+### Operations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Operations List. */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/OperationList.json
+ */
+ /**
+ * Sample code: Get a list of operations for a resource provider.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAListOfOperationsForAResourceProvider(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.operations().list(Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.AddressSpace;
+import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration;
+import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable;
+import com.azure.resourcemanager.network.generated.models.RoutingConfiguration;
+import com.azure.resourcemanager.network.generated.models.VnetRoute;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for P2SVpnGateways CreateOrUpdate. */
+public final class P2SVpnGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayPut.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayPut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayPut(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .p2SVpnGateways()
+ .define("p2sVpnGateway1")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withVirtualHub(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"))
+ .withP2SConnectionConfigurations(
+ Arrays
+ .asList(
+ new P2SConnectionConfiguration()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1")
+ .withName("P2SConnectionConfig1")
+ .withVpnClientAddressPool(
+ new AddressSpace().withAddressPrefixes(Arrays.asList("101.3.0.0/16")))
+ .withRoutingConfiguration(
+ new RoutingConfiguration()
+ .withAssociatedRouteTable(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"))
+ .withPropagatedRouteTables(
+ new PropagatedRouteTable()
+ .withLabels(Arrays.asList("label1", "label2"))
+ .withIds(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"),
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"))))
+ .withVnetRoutes(new VnetRoute().withStaticRoutes(Arrays.asList())))))
+ .withVpnGatewayScaleUnit(1)
+ .withVpnServerConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"))
+ .withCustomDnsServers(Arrays.asList("1.1.1.1", "2.2.2.2"))
+ .withIsRoutingPreferenceInternet(false)
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### P2SVpnGateways_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for P2SVpnGateways Delete. */
+public final class P2SVpnGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayDelete.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.p2SVpnGateways().delete("rg1", "p2sVpnGateway1", Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_DisconnectP2SVpnConnections
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest;
+import java.util.Arrays;
+
+/** Samples for P2SVpnGateways DisconnectP2SVpnConnections. */
+public final class P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2sVpnGatewaysDisconnectP2sVpnConnections.json
+ */
+ /**
+ * Sample code: Disconnect VpnConnections from P2sVpn Gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void disconnectVpnConnectionsFromP2sVpnGateway(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .p2SVpnGateways()
+ .disconnectP2SVpnConnections(
+ "p2s-vpn-gateway-test",
+ "p2svpngateway",
+ new P2SVpnConnectionRequest().withVpnConnectionIds(Arrays.asList("vpnconnId1", "vpnconnId2")),
+ Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_GenerateVpnProfile
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.AuthenticationMethod;
+import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters;
+
+/** Samples for P2SVpnGateways GenerateVpnProfile. */
+public final class P2SVpnGatewaysGenerateVpnProfileSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayGenerateVpnProfile.json
+ */
+ /**
+ * Sample code: GenerateP2SVpnGatewayVPNProfile.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void generateP2SVpnGatewayVPNProfile(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .p2SVpnGateways()
+ .generateVpnProfile(
+ "rg1",
+ "p2sVpnGateway1",
+ new P2SVpnProfileParameters().withAuthenticationMethod(AuthenticationMethod.EAPTLS),
+ Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for P2SVpnGateways GetByResourceGroup. */
+public final class P2SVpnGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayGet.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.p2SVpnGateways().getByResourceGroupWithResponse("rg1", "p2sVpnGateway1", Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_GetP2SVpnConnectionHealth
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for P2SVpnGateways GetP2SVpnConnectionHealth. */
+public final class P2SVpnGatewaysGetP2SVpnConnectionHealthSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayGetConnectionHealth.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayGetConnectionHealth.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayGetConnectionHealth(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.p2SVpnGateways().getP2SVpnConnectionHealth("rg1", "p2sVpnGateway1", Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_GetP2SVpnConnectionHealthDetailed
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest;
+import java.util.Arrays;
+
+/** Samples for P2SVpnGateways GetP2SVpnConnectionHealthDetailed. */
+public final class P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayGetConnectionHealthDetailed.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayGetConnectionHealthDetailed.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayGetConnectionHealthDetailed(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .p2SVpnGateways()
+ .getP2SVpnConnectionHealthDetailed(
+ "p2s-vpn-gateway-test",
+ "p2svpngateway",
+ new P2SVpnConnectionHealthRequest()
+ .withVpnUserNamesFilter(Arrays.asList("vpnUser1", "vpnUser2"))
+ .withOutputBlobSasUrl(
+ "https://blobcortextesturl.blob.core.windows.net/folderforconfig/p2sconnectionhealths?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"),
+ Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for P2SVpnGateways List. */
+public final class P2SVpnGatewaysListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayList.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayListBySubscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayListBySubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.p2SVpnGateways().list(Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for P2SVpnGateways ListByResourceGroup. */
+public final class P2SVpnGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayListByResourceGroup.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.p2SVpnGateways().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_Reset
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for P2SVpnGateways Reset. */
+public final class P2SVpnGatewaysResetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayReset.json
+ */
+ /**
+ * Sample code: ResetP2SVpnGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void resetP2SVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.p2SVpnGateways().reset("rg1", "p2sVpnGateway1", Context.NONE);
+ }
+}
+```
+
+### P2SVpnGateways_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.P2SVpnGateway;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for P2SVpnGateways UpdateTags. */
+public final class P2SVpnGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/P2SVpnGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: P2SVpnGatewayUpdate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void p2SVpnGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ P2SVpnGateway resource =
+ manager.p2SVpnGateways().getByResourceGroupWithResponse("rg1", "p2sVpnGateway1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### PacketCaptures_Create
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.PacketCapture;
+import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter;
+import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation;
+import com.azure.resourcemanager.network.generated.models.PcProtocol;
+import java.util.Arrays;
+
+/** Samples for PacketCaptures Create. */
+public final class PacketCapturesCreateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherPacketCaptureCreate.json
+ */
+ /**
+ * Sample code: Create packet capture.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .packetCaptures()
+ .create(
+ "rg1",
+ "nw1",
+ "pc1",
+ new PacketCapture()
+ .withTarget(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")
+ .withBytesToCapturePerPacket(10000L)
+ .withTotalBytesPerSession(100000L)
+ .withTimeLimitInSeconds(100)
+ .withStorageLocation(
+ new PacketCaptureStorageLocation()
+ .withStorageId(
+ "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore")
+ .withStoragePath("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap")
+ .withFilePath("D:\\capture\\pc1.cap"))
+ .withFilters(
+ Arrays
+ .asList(
+ new PacketCaptureFilter()
+ .withProtocol(PcProtocol.TCP)
+ .withLocalIpAddress("10.0.0.4")
+ .withLocalPort("80"))),
+ Context.NONE);
+ }
+}
+```
+
+### PacketCaptures_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PacketCaptures Delete. */
+public final class PacketCapturesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherPacketCaptureDelete.json
+ */
+ /**
+ * Sample code: Delete packet capture.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.packetCaptures().delete("rg1", "nw1", "pc1", Context.NONE);
+ }
+}
+```
+
+### PacketCaptures_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PacketCaptures Get. */
+public final class PacketCapturesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherPacketCaptureGet.json
+ */
+ /**
+ * Sample code: Get packet capture.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.packetCaptures().getWithResponse("rg1", "nw1", "pc1", Context.NONE);
+ }
+}
+```
+
+### PacketCaptures_GetStatus
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PacketCaptures GetStatus. */
+public final class PacketCapturesGetStatusSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherPacketCaptureQueryStatus.json
+ */
+ /**
+ * Sample code: Query packet capture status.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void queryPacketCaptureStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.packetCaptures().getStatus("rg1", "nw1", "pc1", Context.NONE);
+ }
+}
+```
+
+### PacketCaptures_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PacketCaptures List. */
+public final class PacketCapturesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherPacketCapturesList.json
+ */
+ /**
+ * Sample code: List packet captures.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPacketCaptures(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.packetCaptures().list("rg1", "nw1", Context.NONE);
+ }
+}
+```
+
+### PacketCaptures_Stop
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PacketCaptures Stop. */
+public final class PacketCapturesStopSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkWatcherPacketCaptureStop.json
+ */
+ /**
+ * Sample code: Stop packet capture.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void stopPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.packetCaptures().stop("rg1", "nw1", "pc1", Context.NONE);
+ }
+}
+```
+
+### PeerExpressRouteCircuitConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PeerExpressRouteCircuitConnections Get. */
+public final class PeerExpressRouteCircuitConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PeerExpressRouteCircuitConnectionGet.json
+ */
+ /**
+ * Sample code: PeerExpressRouteCircuitConnectionGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void peerExpressRouteCircuitConnectionGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .peerExpressRouteCircuitConnections()
+ .getWithResponse(
+ "rg1",
+ "ExpressRouteARMCircuitA",
+ "AzurePrivatePeering",
+ "60aee347-e889-4a42-8c1b-0aae8b1e4013",
+ Context.NONE);
+ }
+}
+```
+
+### PeerExpressRouteCircuitConnections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PeerExpressRouteCircuitConnections List. */
+public final class PeerExpressRouteCircuitConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PeerExpressRouteCircuitConnectionList.json
+ */
+ /**
+ * Sample code: List Peer ExpressRouteCircuit Connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPeerExpressRouteCircuitConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .peerExpressRouteCircuitConnections()
+ .list("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", Context.NONE);
+ }
+}
+```
+
+### PrivateDnsZoneGroups_CreateOrUpdate
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner;
+import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig;
+import java.util.Arrays;
+
+/** Samples for PrivateDnsZoneGroups CreateOrUpdate. */
+public final class PrivateDnsZoneGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointDnsZoneGroupCreate.json
+ */
+ /**
+ * Sample code: Create private dns zone group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateDnsZoneGroups()
+ .createOrUpdate(
+ "rg1",
+ "testPe",
+ "testPdnsgroup",
+ new PrivateDnsZoneGroupInner()
+ .withPrivateDnsZoneConfigs(
+ Arrays
+ .asList(
+ new PrivateDnsZoneConfig()
+ .withPrivateDnsZoneId(
+ "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"))),
+ Context.NONE);
+ }
+}
+```
+
+### PrivateDnsZoneGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateDnsZoneGroups Delete. */
+public final class PrivateDnsZoneGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointDnsZoneGroupDelete.json
+ */
+ /**
+ * Sample code: Delete private dns zone group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateDnsZoneGroups().delete("rg1", "testPe", "testPdnsgroup", Context.NONE);
+ }
+}
+```
+
+### PrivateDnsZoneGroups_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateDnsZoneGroups Get. */
+public final class PrivateDnsZoneGroupsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointDnsZoneGroupGet.json
+ */
+ /**
+ * Sample code: Get private dns zone group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateDnsZoneGroups().getWithResponse("rg1", "testPe", "testPdnsgroup", Context.NONE);
+ }
+}
+```
+
+### PrivateDnsZoneGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateDnsZoneGroups List. */
+public final class PrivateDnsZoneGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointDnsZoneGroupList.json
+ */
+ /**
+ * Sample code: List private endpoints in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPrivateEndpointsInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateDnsZoneGroups().list("testPe", "rg1", Context.NONE);
+ }
+}
+```
+
+### PrivateEndpoints_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner;
+import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner;
+import com.azure.resourcemanager.network.generated.models.PrivateEndpointIpConfiguration;
+import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection;
+import java.util.Arrays;
+
+/** Samples for PrivateEndpoints CreateOrUpdate. */
+public final class PrivateEndpointsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointCreateWithASG.json
+ */
+ /**
+ * Sample code: Create private endpoint with application security groups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPrivateEndpointWithApplicationSecurityGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateEndpoints()
+ .define("testPe")
+ .withRegion("eastus2euap")
+ .withExistingResourceGroup("rg1")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"))
+ .withPrivateLinkServiceConnections(
+ Arrays
+ .asList(
+ new PrivateLinkServiceConnection()
+ .withPrivateLinkServiceId(
+ "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls")
+ .withGroupIds(Arrays.asList("groupIdFromResource"))
+ .withRequestMessage("Please approve my connection.")))
+ .withApplicationSecurityGroups(
+ Arrays
+ .asList(
+ new ApplicationSecurityGroupInner()
+ .withId(
+ "/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointCreate.json
+ */
+ /**
+ * Sample code: Create private endpoint.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateEndpoints()
+ .define("testPe")
+ .withRegion("eastus2euap")
+ .withExistingResourceGroup("rg1")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"))
+ .withPrivateLinkServiceConnections(
+ Arrays
+ .asList(
+ new PrivateLinkServiceConnection()
+ .withPrivateLinkServiceId(
+ "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls")
+ .withGroupIds(Arrays.asList("groupIdFromResource"))
+ .withRequestMessage("Please approve my connection.")))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new PrivateEndpointIpConfiguration()
+ .withName("pestaticconfig")
+ .withGroupId("file")
+ .withMemberName("file")
+ .withPrivateIpAddress("192.168.0.6")))
+ .withCustomNetworkInterfaceName("testPeNic")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointCreateForManualApproval.json
+ */
+ /**
+ * Sample code: Create private endpoint with manual approval connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPrivateEndpointWithManualApprovalConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateEndpoints()
+ .define("testPe")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"))
+ .withManualPrivateLinkServiceConnections(
+ Arrays
+ .asList(
+ new PrivateLinkServiceConnection()
+ .withPrivateLinkServiceId(
+ "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls")
+ .withGroupIds(Arrays.asList("groupIdFromResource"))
+ .withRequestMessage("Please manually approve my connection.")))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new PrivateEndpointIpConfiguration()
+ .withName("pestaticconfig")
+ .withGroupId("file")
+ .withMemberName("file")
+ .withPrivateIpAddress("192.168.0.5")))
+ .withCustomNetworkInterfaceName("testPeNic")
+ .create();
+ }
+}
+```
+
+### PrivateEndpoints_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpoints Delete. */
+public final class PrivateEndpointsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointDelete.json
+ */
+ /**
+ * Sample code: Delete private endpoint.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateEndpoints().delete("rg1", "testPe", Context.NONE);
+ }
+}
+```
+
+### PrivateEndpoints_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpoints GetByResourceGroup. */
+public final class PrivateEndpointsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointGetWithASG.json
+ */
+ /**
+ * Sample code: Get private endpoint with application security groups.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPrivateEndpointWithApplicationSecurityGroups(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateEndpoints().getByResourceGroupWithResponse("rg1", "testPe", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointGetForManualApproval.json
+ */
+ /**
+ * Sample code: Get private endpoint with manual approval connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPrivateEndpointWithManualApprovalConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateEndpoints().getByResourceGroupWithResponse("rg1", "testPe", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointGet.json
+ */
+ /**
+ * Sample code: Get private endpoint.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateEndpoints().getByResourceGroupWithResponse("rg1", "testPe", null, Context.NONE);
+ }
+}
+```
+
+### PrivateEndpoints_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpoints List. */
+public final class PrivateEndpointsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointListAll.json
+ */
+ /**
+ * Sample code: List all private endpoints.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllPrivateEndpoints(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateEndpoints().list(Context.NONE);
+ }
+}
+```
+
+### PrivateEndpoints_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpoints ListByResourceGroup. */
+public final class PrivateEndpointsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateEndpointList.json
+ */
+ /**
+ * Sample code: List private endpoints in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPrivateEndpointsInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateEndpoints().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_CheckPrivateLinkServiceVisibility
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest;
+
+/** Samples for PrivateLinkServices CheckPrivateLinkServiceVisibility. */
+public final class PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CheckPrivateLinkServiceVisibility.json
+ */
+ /**
+ * Sample code: Check private link service visibility.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void checkPrivateLinkServiceVisibility(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateLinkServices()
+ .checkPrivateLinkServiceVisibility(
+ "westus",
+ new CheckPrivateLinkServiceVisibilityRequest()
+ .withPrivateLinkServiceAlias("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"),
+ Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest;
+
+/** Samples for PrivateLinkServices CheckPrivateLinkServiceVisibilityByResourceGroup. */
+public final class PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CheckPrivateLinkServiceVisibilityByResourceGroup.json
+ */
+ /**
+ * Sample code: Check private link service visibility.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void checkPrivateLinkServiceVisibility(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateLinkServices()
+ .checkPrivateLinkServiceVisibilityByResourceGroup(
+ "westus",
+ "rg1",
+ new CheckPrivateLinkServiceVisibilityRequest()
+ .withPrivateLinkServiceAlias("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"),
+ Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner;
+import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner;
+import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner;
+import com.azure.resourcemanager.network.generated.models.IpAllocationMethod;
+import com.azure.resourcemanager.network.generated.models.IpVersion;
+import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval;
+import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility;
+import java.util.Arrays;
+
+/** Samples for PrivateLinkServices CreateOrUpdate. */
+public final class PrivateLinkServicesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceCreate.json
+ */
+ /**
+ * Sample code: Create private link service.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateLinkServices()
+ .define("testPls")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withLoadBalancerFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new FrontendIpConfigurationInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new PrivateLinkServiceIpConfigurationInner()
+ .withName("fe-lb")
+ .withPrivateIpAddress("10.0.1.4")
+ .withPrivateIpAllocationMethod(IpAllocationMethod.STATIC)
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))
+ .withPrivateIpAddressVersion(IpVersion.IPV4)))
+ .withVisibility(
+ new PrivateLinkServicePropertiesVisibility()
+ .withSubscriptions(Arrays.asList("subscription1", "subscription2", "subscription3")))
+ .withAutoApproval(
+ new PrivateLinkServicePropertiesAutoApproval()
+ .withSubscriptions(Arrays.asList("subscription1", "subscription2")))
+ .withFqdns(Arrays.asList("fqdn1", "fqdn2", "fqdn3"))
+ .create();
+ }
+}
+```
+
+### PrivateLinkServices_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices Delete. */
+public final class PrivateLinkServicesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceDelete.json
+ */
+ /**
+ * Sample code: Delete private link service.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateLinkServices().delete("rg1", "testPls", Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_DeletePrivateEndpointConnection
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices DeletePrivateEndpointConnection. */
+public final class PrivateLinkServicesDeletePrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceDeletePrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: delete private end point connection for a private link service.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePrivateEndPointConnectionForAPrivateLinkService(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateLinkServices()
+ .deletePrivateEndpointConnection("rg1", "testPls", "testPlePeConnection", Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices GetByResourceGroup. */
+public final class PrivateLinkServicesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceGet.json
+ */
+ /**
+ * Sample code: Get private link service.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateLinkServices().getByResourceGroupWithResponse("rg1", "testPls", null, Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_GetPrivateEndpointConnection
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices GetPrivateEndpointConnection. */
+public final class PrivateLinkServicesGetPrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceGetPrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: Get private end point connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPrivateEndPointConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateLinkServices()
+ .getPrivateEndpointConnectionWithResponse("rg1", "testPls", "testPlePeConnection", null, Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices List. */
+public final class PrivateLinkServicesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceListAll.json
+ */
+ /**
+ * Sample code: List all private list service.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllPrivateListService(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateLinkServices().list(Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_ListAutoApprovedPrivateLinkServices
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServices. */
+public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AutoApprovedPrivateLinkServicesGet.json
+ */
+ /**
+ * Sample code: Get list of private link service id that can be linked to a private end point with auto approved.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getListOfPrivateLinkServiceIdThatCanBeLinkedToAPrivateEndPointWithAutoApproved(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateLinkServices().listAutoApprovedPrivateLinkServices("regionName", Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServicesByResourceGroup. */
+public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AutoApprovedPrivateLinkServicesResourceGroupGet.json
+ */
+ /**
+ * Sample code: Get list of private link service id that can be linked to a private end point with auto approved.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getListOfPrivateLinkServiceIdThatCanBeLinkedToAPrivateEndPointWithAutoApproved(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateLinkServices()
+ .listAutoApprovedPrivateLinkServicesByResourceGroup("regionName", "rg1", Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices ListByResourceGroup. */
+public final class PrivateLinkServicesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceList.json
+ */
+ /**
+ * Sample code: List private link service in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPrivateLinkServiceInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateLinkServices().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_ListPrivateEndpointConnections
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkServices ListPrivateEndpointConnections. */
+public final class PrivateLinkServicesListPrivateEndpointConnectionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceListPrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: List private link service in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPrivateLinkServiceInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.privateLinkServices().listPrivateEndpointConnections("rg1", "testPls", Context.NONE);
+ }
+}
+```
+
+### PrivateLinkServices_UpdatePrivateEndpointConnection
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState;
+
+/** Samples for PrivateLinkServices UpdatePrivateEndpointConnection. */
+public final class PrivateLinkServicesUpdatePrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PrivateLinkServiceUpdatePrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: approve or reject private end point connection for a private link service.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void approveOrRejectPrivateEndPointConnectionForAPrivateLinkService(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .privateLinkServices()
+ .updatePrivateEndpointConnectionWithResponse(
+ "rg1",
+ "testPls",
+ "testPlePeConnection",
+ new PrivateEndpointConnectionInner()
+ .withName("testPlePeConnection")
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionState()
+ .withStatus("Approved")
+ .withDescription("approved it for some reason.")),
+ Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.IpAllocationMethod;
+import com.azure.resourcemanager.network.generated.models.IpVersion;
+import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings;
+import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku;
+import com.azure.resourcemanager.network.generated.models.PublicIpAddressSkuName;
+import com.azure.resourcemanager.network.generated.models.PublicIpAddressSkuTier;
+
+/** Samples for PublicIpAddresses CreateOrUpdate. */
+public final class PublicIpAddressesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressCreateDns.json
+ */
+ /**
+ * Sample code: Create public IP address DNS.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPublicIPAddressDNS(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpAddresses()
+ .define("test-ip")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withDnsSettings(new PublicIpAddressDnsSettings().withDomainNameLabel("dnslbl"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressCreateCustomizedValues.json
+ */
+ /**
+ * Sample code: Create public IP address allocation method.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPublicIPAddressAllocationMethod(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpAddresses()
+ .define("test-ip")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withSku(
+ new PublicIpAddressSku()
+ .withName(PublicIpAddressSkuName.STANDARD)
+ .withTier(PublicIpAddressSkuTier.GLOBAL))
+ .withPublicIpAllocationMethod(IpAllocationMethod.STATIC)
+ .withPublicIpAddressVersion(IpVersion.IPV4)
+ .withIdleTimeoutInMinutes(10)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressCreateDefaults.json
+ */
+ /**
+ * Sample code: Create public IP address defaults.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPublicIPAddressDefaults(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpAddresses().define("test-ip").withRegion("eastus").withExistingResourceGroup("rg1").create();
+ }
+}
+```
+
+### PublicIpAddresses_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses Delete. */
+public final class PublicIpAddressesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressDelete.json
+ */
+ /**
+ * Sample code: Delete public IP address.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpAddresses().delete("rg1", "test-ip", Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses GetByResourceGroup. */
+public final class PublicIpAddressesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressGet.json
+ */
+ /**
+ * Sample code: Get public IP address.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpAddresses().getByResourceGroupWithResponse("rg1", "testDNS-ip", null, Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_GetCloudServicePublicIpAddress
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses GetCloudServicePublicIpAddress. */
+public final class PublicIpAddressesGetCloudServicePublicIpAddressSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CloudServicePublicIpGet.json
+ */
+ /**
+ * Sample code: GetVMSSPublicIP.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpAddresses()
+ .getCloudServicePublicIpAddressWithResponse(
+ "cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", "pub1", null, Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_GetVirtualMachineScaleSetPublicIpAddress
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses GetVirtualMachineScaleSetPublicIpAddress. */
+public final class PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssPublicIpGet.json
+ */
+ /**
+ * Sample code: GetVMSSPublicIP.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpAddresses()
+ .getVirtualMachineScaleSetPublicIpAddressWithResponse(
+ "vmss-tester", "vmss1", "1", "nic1", "ip1", "pub1", null, Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses List. */
+public final class PublicIpAddressesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressListAll.json
+ */
+ /**
+ * Sample code: List all public IP addresses.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllPublicIPAddresses(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpAddresses().list(Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses ListByResourceGroup. */
+public final class PublicIpAddressesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressList.json
+ */
+ /**
+ * Sample code: List resource group public IP addresses.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listResourceGroupPublicIPAddresses(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpAddresses().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_ListCloudServicePublicIpAddresses
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses ListCloudServicePublicIpAddresses. */
+public final class PublicIpAddressesListCloudServicePublicIpAddressesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CloudServicePublicIpListAll.json
+ */
+ /**
+ * Sample code: ListVMSSPublicIP.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpAddresses().listCloudServicePublicIpAddresses("cs-tester", "cs1", Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_ListCloudServiceRoleInstancePublicIpAddresses
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses ListCloudServiceRoleInstancePublicIpAddresses. */
+public final class PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CloudServiceRoleInstancePublicIpList.json
+ */
+ /**
+ * Sample code: ListVMSSVMPublicIP.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVMSSVMPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpAddresses()
+ .listCloudServiceRoleInstancePublicIpAddresses(
+ "cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_ListVirtualMachineScaleSetPublicIpAddresses
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses ListVirtualMachineScaleSetPublicIpAddresses. */
+public final class PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssPublicIpListAll.json
+ */
+ /**
+ * Sample code: ListVMSSPublicIP.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpAddresses().listVirtualMachineScaleSetPublicIpAddresses("vmss-tester", "vmss1", Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_ListVirtualMachineScaleSetVMPublicIpAddresses
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpAddresses ListVirtualMachineScaleSetVMPublicIpAddresses. */
+public final class PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VmssVmPublicIpList.json
+ */
+ /**
+ * Sample code: ListVMSSVMPublicIP.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVMSSVMPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpAddresses()
+ .listVirtualMachineScaleSetVMPublicIpAddresses("vmss-tester", "vmss1", "1", "nic1", "ip1", Context.NONE);
+ }
+}
+```
+
+### PublicIpAddresses_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.PublicIpAddress;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for PublicIpAddresses UpdateTags. */
+public final class PublicIpAddressesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpAddressUpdateTags.json
+ */
+ /**
+ * Sample code: Update public IP address tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updatePublicIPAddressTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ PublicIpAddress resource =
+ manager.publicIpAddresses().getByResourceGroupWithResponse("rg1", "test-ip", null, Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### PublicIpPrefixes_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.IpVersion;
+import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku;
+import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSkuName;
+import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSkuTier;
+
+/** Samples for PublicIpPrefixes CreateOrUpdate. */
+public final class PublicIpPrefixesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpPrefixCreateDefaults.json
+ */
+ /**
+ * Sample code: Create public IP prefix defaults.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPublicIPPrefixDefaults(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpPrefixes()
+ .define("test-ipprefix")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withSku(new PublicIpPrefixSku().withName(PublicIpPrefixSkuName.STANDARD))
+ .withPrefixLength(30)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpPrefixCreateCustomizedValues.json
+ */
+ /**
+ * Sample code: Create public IP prefix allocation method.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPublicIPPrefixAllocationMethod(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .publicIpPrefixes()
+ .define("test-ipprefix")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withSku(
+ new PublicIpPrefixSku()
+ .withName(PublicIpPrefixSkuName.STANDARD)
+ .withTier(PublicIpPrefixSkuTier.REGIONAL))
+ .withPublicIpAddressVersion(IpVersion.IPV4)
+ .withPrefixLength(30)
+ .create();
+ }
+}
+```
+
+### PublicIpPrefixes_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpPrefixes Delete. */
+public final class PublicIpPrefixesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpPrefixDelete.json
+ */
+ /**
+ * Sample code: Delete public IP prefix.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePublicIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpPrefixes().delete("rg1", "test-ipprefix", Context.NONE);
+ }
+}
+```
+
+### PublicIpPrefixes_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpPrefixes GetByResourceGroup. */
+public final class PublicIpPrefixesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpPrefixGet.json
+ */
+ /**
+ * Sample code: Get public IP prefix.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPublicIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpPrefixes().getByResourceGroupWithResponse("rg1", "test-ipprefix", null, Context.NONE);
+ }
+}
+```
+
+### PublicIpPrefixes_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpPrefixes List. */
+public final class PublicIpPrefixesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpPrefixListAll.json
+ */
+ /**
+ * Sample code: List all public IP prefixes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllPublicIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpPrefixes().list(Context.NONE);
+ }
+}
+```
+
+### PublicIpPrefixes_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for PublicIpPrefixes ListByResourceGroup. */
+public final class PublicIpPrefixesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpPrefixList.json
+ */
+ /**
+ * Sample code: List resource group public IP prefixes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listResourceGroupPublicIPPrefixes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.publicIpPrefixes().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### PublicIpPrefixes_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.PublicIpPrefix;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for PublicIpPrefixes UpdateTags. */
+public final class PublicIpPrefixesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/PublicIpPrefixUpdateTags.json
+ */
+ /**
+ * Sample code: Update public IP prefix tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updatePublicIPPrefixTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ PublicIpPrefix resource =
+ manager
+ .publicIpPrefixes()
+ .getByResourceGroupWithResponse("rg1", "test-ipprefix", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ResourceNavigationLinks_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ResourceNavigationLinks List. */
+public final class ResourceNavigationLinksListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGetResourceNavigationLinks.json
+ */
+ /**
+ * Sample code: Get Resource Navigation Links.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getResourceNavigationLinks(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.resourceNavigationLinks().listWithResponse("rg1", "vnet", "subnet", Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_CheckDnsNameAvailability
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ResourceProvider CheckDnsNameAvailability. */
+public final class ResourceProviderCheckDnsNameAvailabilitySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/CheckDnsNameAvailability.json
+ */
+ /**
+ * Sample code: Check Dns Name Availability.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void checkDnsNameAvailability(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.resourceProviders().checkDnsNameAvailabilityWithResponse("westus", "testdns", Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_DeleteBastionShareableLink
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner;
+import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest;
+import com.azure.resourcemanager.network.generated.models.VM;
+import java.util.Arrays;
+
+/** Samples for ResourceProvider DeleteBastionShareableLink. */
+public final class ResourceProviderDeleteBastionShareableLinkSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionShareableLinkDelete.json
+ */
+ /**
+ * Sample code: Delete Bastion Shareable Links for the request VMs.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteBastionShareableLinksForTheRequestVMs(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .resourceProviders()
+ .deleteBastionShareableLink(
+ "rg1",
+ "bastionhosttenant",
+ new BastionShareableLinkListRequest()
+ .withVms(
+ Arrays
+ .asList(
+ new BastionShareableLinkInner()
+ .withVm(
+ new VM()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")),
+ new BastionShareableLinkInner()
+ .withVm(
+ new VM()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))),
+ Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_DisconnectActiveSessions
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.SessionIds;
+
+/** Samples for ResourceProvider DisconnectActiveSessions. */
+public final class ResourceProviderDisconnectActiveSessionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionSessionDelete.json
+ */
+ /**
+ * Sample code: Deletes the specified active session.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletesTheSpecifiedActiveSession(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .resourceProviders()
+ .disconnectActiveSessions("rg1", "bastionhosttenant", new SessionIds(), Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_Generatevirtualwanvpnserverconfigurationvpnprofile
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.AuthenticationMethod;
+import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters;
+
+/** Samples for ResourceProvider Generatevirtualwanvpnserverconfigurationvpnprofile. */
+public final class ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/GenerateVirtualWanVpnServerConfigurationVpnProfile.json
+ */
+ /**
+ * Sample code: GenerateVirtualWanVpnServerConfigurationVpnProfile.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void generateVirtualWanVpnServerConfigurationVpnProfile(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .resourceProviders()
+ .generatevirtualwanvpnserverconfigurationvpnprofile(
+ "rg1",
+ "wan1",
+ new VirtualWanVpnProfileParameters()
+ .withVpnServerConfigurationResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1")
+ .withAuthenticationMethod(AuthenticationMethod.EAPTLS),
+ Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_GetActiveSessions
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ResourceProvider GetActiveSessions. */
+public final class ResourceProviderGetActiveSessionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionSessionsList.json
+ */
+ /**
+ * Sample code: Returns a list of currently active sessions on the Bastion.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void returnsAListOfCurrentlyActiveSessionsOnTheBastion(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.resourceProviders().getActiveSessions("rg1", "bastionhosttenant", Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_GetBastionShareableLink
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner;
+import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest;
+import com.azure.resourcemanager.network.generated.models.VM;
+import java.util.Arrays;
+
+/** Samples for ResourceProvider GetBastionShareableLink. */
+public final class ResourceProviderGetBastionShareableLinkSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionShareableLinkGet.json
+ */
+ /**
+ * Sample code: Returns the Bastion Shareable Links for the request VMs.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void returnsTheBastionShareableLinksForTheRequestVMs(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .resourceProviders()
+ .getBastionShareableLink(
+ "rg1",
+ "bastionhosttenant",
+ new BastionShareableLinkListRequest()
+ .withVms(
+ Arrays
+ .asList(
+ new BastionShareableLinkInner()
+ .withVm(
+ new VM()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")),
+ new BastionShareableLinkInner()
+ .withVm(
+ new VM()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))),
+ Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_PutBastionShareableLink
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner;
+import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest;
+import com.azure.resourcemanager.network.generated.models.VM;
+import java.util.Arrays;
+
+/** Samples for ResourceProvider PutBastionShareableLink. */
+public final class ResourceProviderPutBastionShareableLinkSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/BastionShareableLinkCreate.json
+ */
+ /**
+ * Sample code: Create Bastion Shareable Links for the request VMs.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createBastionShareableLinksForTheRequestVMs(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .resourceProviders()
+ .putBastionShareableLink(
+ "rg1",
+ "bastionhosttenant",
+ new BastionShareableLinkListRequest()
+ .withVms(
+ Arrays
+ .asList(
+ new BastionShareableLinkInner()
+ .withVm(
+ new VM()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")),
+ new BastionShareableLinkInner()
+ .withVm(
+ new VM()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))),
+ Context.NONE);
+ }
+}
+```
+
+### ResourceProvider_SupportedSecurityProviders
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ResourceProvider SupportedSecurityProviders. */
+public final class ResourceProviderSupportedSecurityProvidersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualWanSupportedSecurityProviders.json
+ */
+ /**
+ * Sample code: supportedSecurityProviders.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void supportedSecurityProviders(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.resourceProviders().supportedSecurityProvidersWithResponse("rg1", "wan1", Context.NONE);
+ }
+}
+```
+
+### RouteFilterRules_CreateOrUpdate
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner;
+import com.azure.resourcemanager.network.generated.models.Access;
+import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType;
+import java.util.Arrays;
+
+/** Samples for RouteFilterRules CreateOrUpdate. */
+public final class RouteFilterRulesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterRuleCreate.json
+ */
+ /**
+ * Sample code: RouteFilterRuleCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterRuleCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .routeFilterRules()
+ .createOrUpdate(
+ "rg1",
+ "filterName",
+ "ruleName",
+ new RouteFilterRuleInner()
+ .withAccess(Access.ALLOW)
+ .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY)
+ .withCommunities(Arrays.asList("12076:5030", "12076:5040")),
+ Context.NONE);
+ }
+}
+```
+
+### RouteFilterRules_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteFilterRules Delete. */
+public final class RouteFilterRulesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterRuleDelete.json
+ */
+ /**
+ * Sample code: RouteFilterRuleDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeFilterRules().delete("rg1", "filterName", "ruleName", Context.NONE);
+ }
+}
+```
+
+### RouteFilterRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteFilterRules Get. */
+public final class RouteFilterRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterRuleGet.json
+ */
+ /**
+ * Sample code: RouteFilterRuleGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeFilterRules().getWithResponse("rg1", "filterName", "filterName", Context.NONE);
+ }
+}
+```
+
+### RouteFilterRules_ListByRouteFilter
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteFilterRules ListByRouteFilter. */
+public final class RouteFilterRulesListByRouteFilterSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterRuleListByRouteFilter.json
+ */
+ /**
+ * Sample code: RouteFilterRuleListByRouteFilter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterRuleListByRouteFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeFilterRules().listByRouteFilter("rg1", "filterName", Context.NONE);
+ }
+}
+```
+
+### RouteFilters_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner;
+import com.azure.resourcemanager.network.generated.models.Access;
+import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for RouteFilters CreateOrUpdate. */
+public final class RouteFiltersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterCreate.json
+ */
+ /**
+ * Sample code: RouteFilterCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .routeFilters()
+ .define("filterName")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withRules(
+ Arrays
+ .asList(
+ new RouteFilterRuleInner()
+ .withName("ruleName")
+ .withAccess(Access.ALLOW)
+ .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY)
+ .withCommunities(Arrays.asList("12076:5030", "12076:5040"))))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### RouteFilters_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteFilters Delete. */
+public final class RouteFiltersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterDelete.json
+ */
+ /**
+ * Sample code: RouteFilterDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeFilters().delete("rg1", "filterName", Context.NONE);
+ }
+}
+```
+
+### RouteFilters_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteFilters GetByResourceGroup. */
+public final class RouteFiltersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterGet.json
+ */
+ /**
+ * Sample code: RouteFilterGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeFilters().getByResourceGroupWithResponse("rg1", "filterName", null, Context.NONE);
+ }
+}
+```
+
+### RouteFilters_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteFilters List. */
+public final class RouteFiltersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterList.json
+ */
+ /**
+ * Sample code: RouteFilterList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeFilters().list(Context.NONE);
+ }
+}
+```
+
+### RouteFilters_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteFilters ListByResourceGroup. */
+public final class RouteFiltersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterListByResourceGroup.json
+ */
+ /**
+ * Sample code: RouteFilterListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeFilterListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeFilters().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### RouteFilters_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.RouteFilter;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for RouteFilters UpdateTags. */
+public final class RouteFiltersUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteFilterUpdateTags.json
+ */
+ /**
+ * Sample code: Update route filter tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateRouteFilterTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ RouteFilter resource =
+ manager.routeFilters().getByResourceGroupWithResponse("rg1", "filterName", null, Context.NONE).getValue();
+ resource.update().withTags(mapOf("key1", "value1")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### RouteTables_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.RouteInner;
+import com.azure.resourcemanager.network.generated.models.RouteNextHopType;
+import java.util.Arrays;
+
+/** Samples for RouteTables CreateOrUpdate. */
+public final class RouteTablesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableCreate.json
+ */
+ /**
+ * Sample code: Create route table.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeTables().define("testrt").withRegion("westus").withExistingResourceGroup("rg1").create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableCreateWithRoute.json
+ */
+ /**
+ * Sample code: Create route table with route.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createRouteTableWithRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .routeTables()
+ .define("testrt")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withRoutes(
+ Arrays
+ .asList(
+ new RouteInner()
+ .withName("route1")
+ .withAddressPrefix("10.0.3.0/24")
+ .withNextHopType(RouteNextHopType.VIRTUAL_NETWORK_GATEWAY)))
+ .withDisableBgpRoutePropagation(true)
+ .create();
+ }
+}
+```
+
+### RouteTables_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteTables Delete. */
+public final class RouteTablesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableDelete.json
+ */
+ /**
+ * Sample code: Delete route table.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeTables().delete("rg1", "testrt", Context.NONE);
+ }
+}
+```
+
+### RouteTables_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteTables GetByResourceGroup. */
+public final class RouteTablesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableGet.json
+ */
+ /**
+ * Sample code: Get route table.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeTables().getByResourceGroupWithResponse("rg1", "testrt", null, Context.NONE);
+ }
+}
+```
+
+### RouteTables_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteTables List. */
+public final class RouteTablesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableListAll.json
+ */
+ /**
+ * Sample code: List all route tables.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeTables().list(Context.NONE);
+ }
+}
+```
+
+### RouteTables_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RouteTables ListByResourceGroup. */
+public final class RouteTablesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableList.json
+ */
+ /**
+ * Sample code: List route tables in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listRouteTablesInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routeTables().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### RouteTables_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.RouteTable;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for RouteTables UpdateTags. */
+public final class RouteTablesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableUpdateTags.json
+ */
+ /**
+ * Sample code: Update route table tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateRouteTableTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ RouteTable resource =
+ manager.routeTables().getByResourceGroupWithResponse("rg1", "testrt", null, Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### Routes_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.RouteNextHopType;
+
+/** Samples for Routes CreateOrUpdate. */
+public final class RoutesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableRouteCreate.json
+ */
+ /**
+ * Sample code: Create route.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .routes()
+ .define("route1")
+ .withExistingRouteTable("rg1", "testrt")
+ .withAddressPrefix("10.0.3.0/24")
+ .withNextHopType(RouteNextHopType.VIRTUAL_NETWORK_GATEWAY)
+ .create();
+ }
+}
+```
+
+### Routes_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Routes Delete. */
+public final class RoutesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableRouteDelete.json
+ */
+ /**
+ * Sample code: Delete route.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routes().delete("rg1", "testrt", "route1", Context.NONE);
+ }
+}
+```
+
+### Routes_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Routes Get. */
+public final class RoutesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableRouteGet.json
+ */
+ /**
+ * Sample code: Get route.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routes().getWithResponse("rg1", "testrt", "route1", Context.NONE);
+ }
+}
+```
+
+### Routes_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Routes List. */
+public final class RoutesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RouteTableRouteList.json
+ */
+ /**
+ * Sample code: List routes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routes().list("rg1", "testrt", Context.NONE);
+ }
+}
+```
+
+### RoutingIntent_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.RoutingPolicy;
+import java.util.Arrays;
+
+/** Samples for RoutingIntent CreateOrUpdate. */
+public final class RoutingIntentCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RoutingIntentPut.json
+ */
+ /**
+ * Sample code: RouteTablePut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeTablePut(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .routingIntents()
+ .define("Intent1")
+ .withExistingVirtualHub("rg1", "virtualHub1")
+ .withRoutingPolicies(
+ Arrays
+ .asList(
+ new RoutingPolicy()
+ .withName("InternetTraffic")
+ .withDestinations(Arrays.asList("Internet"))
+ .withNextHop(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"),
+ new RoutingPolicy()
+ .withName("PrivateTrafficPolicy")
+ .withDestinations(Arrays.asList("PrivateTraffic"))
+ .withNextHop(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1")))
+ .create();
+ }
+}
+```
+
+### RoutingIntent_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RoutingIntent Delete. */
+public final class RoutingIntentDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RoutingIntentDelete.json
+ */
+ /**
+ * Sample code: RouteTableDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeTableDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routingIntents().delete("rg1", "virtualHub1", "Intent1", Context.NONE);
+ }
+}
+```
+
+### RoutingIntent_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RoutingIntent Get. */
+public final class RoutingIntentGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RoutingIntentGet.json
+ */
+ /**
+ * Sample code: RouteTableGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routeTableGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routingIntents().getWithResponse("rg1", "virtualHub1", "Intent1", Context.NONE);
+ }
+}
+```
+
+### RoutingIntent_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RoutingIntent List. */
+public final class RoutingIntentListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/RoutingIntentList.json
+ */
+ /**
+ * Sample code: RoutingIntentList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void routingIntentList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.routingIntents().list("rg1", "virtualHub1", Context.NONE);
+ }
+}
+```
+
+### SecurityPartnerProviders_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.SecurityProviderName;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SecurityPartnerProviders CreateOrUpdate. */
+public final class SecurityPartnerProvidersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SecurityPartnerProviderPut.json
+ */
+ /**
+ * Sample code: Create Security Partner Provider.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createSecurityPartnerProvider(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .securityPartnerProviders()
+ .define("securityPartnerProvider")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withSecurityProviderName(SecurityProviderName.ZSCALER)
+ .withVirtualHub(
+ new SubResource()
+ .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### SecurityPartnerProviders_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SecurityPartnerProviders Delete. */
+public final class SecurityPartnerProvidersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SecurityPartnerProviderDelete.json
+ */
+ /**
+ * Sample code: Delete Security Partner Provider.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteSecurityPartnerProvider(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.securityPartnerProviders().delete("rg1", "securityPartnerProvider", Context.NONE);
+ }
+}
+```
+
+### SecurityPartnerProviders_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SecurityPartnerProviders GetByResourceGroup. */
+public final class SecurityPartnerProvidersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SecurityPartnerProviderGet.json
+ */
+ /**
+ * Sample code: Get Security Partner Provider.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getSecurityPartnerProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .securityPartnerProviders()
+ .getByResourceGroupWithResponse("rg1", "securityPartnerProvider", Context.NONE);
+ }
+}
+```
+
+### SecurityPartnerProviders_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SecurityPartnerProviders List. */
+public final class SecurityPartnerProvidersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SecurityPartnerProviderListBySubscription.json
+ */
+ /**
+ * Sample code: List all Security Partner Providers for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllSecurityPartnerProvidersForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.securityPartnerProviders().list(Context.NONE);
+ }
+}
+```
+
+### SecurityPartnerProviders_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SecurityPartnerProviders ListByResourceGroup. */
+public final class SecurityPartnerProvidersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SecurityPartnerProviderListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Security Partner Providers for a given resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllSecurityPartnerProvidersForAGivenResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.securityPartnerProviders().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### SecurityPartnerProviders_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.SecurityPartnerProvider;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SecurityPartnerProviders UpdateTags. */
+public final class SecurityPartnerProvidersUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SecurityPartnerProviderUpdateTags.json
+ */
+ /**
+ * Sample code: Update Security Partner Provider Tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateSecurityPartnerProviderTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ SecurityPartnerProvider resource =
+ manager
+ .securityPartnerProviders()
+ .getByResourceGroupWithResponse("rg1", "securityPartnerProvider", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### SecurityRules_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess;
+import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection;
+import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol;
+
+/** Samples for SecurityRules CreateOrUpdate. */
+public final class SecurityRulesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupRuleCreate.json
+ */
+ /**
+ * Sample code: Create security rule.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createSecurityRule(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .securityRules()
+ .define("rule1")
+ .withExistingNetworkSecurityGroup("rg1", "testnsg")
+ .withProtocol(SecurityRuleProtocol.ASTERISK)
+ .withSourcePortRange("*")
+ .withDestinationPortRange("8080")
+ .withSourceAddressPrefix("10.0.0.0/8")
+ .withDestinationAddressPrefix("11.0.0.0/8")
+ .withAccess(SecurityRuleAccess.DENY)
+ .withPriority(100)
+ .withDirection(SecurityRuleDirection.OUTBOUND)
+ .create();
+ }
+}
+```
+
+### SecurityRules_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SecurityRules Delete. */
+public final class SecurityRulesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupRuleDelete.json
+ */
+ /**
+ * Sample code: Delete network security rule from network security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNetworkSecurityRuleFromNetworkSecurityGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.securityRules().delete("rg1", "testnsg", "rule1", Context.NONE);
+ }
+}
+```
+
+### SecurityRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SecurityRules Get. */
+public final class SecurityRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupRuleGet.json
+ */
+ /**
+ * Sample code: Get network security rule in network security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkSecurityRuleInNetworkSecurityGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.securityRules().getWithResponse("rg1", "testnsg", "rule1", Context.NONE);
+ }
+}
+```
+
+### SecurityRules_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SecurityRules List. */
+public final class SecurityRulesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkSecurityGroupRuleList.json
+ */
+ /**
+ * Sample code: List network security rules in network security group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listNetworkSecurityRulesInNetworkSecurityGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.securityRules().list("rg1", "testnsg", Context.NONE);
+ }
+}
+```
+
+### ServiceAssociationLinks_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceAssociationLinks List. */
+public final class ServiceAssociationLinksListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGetServiceAssociationLinks.json
+ */
+ /**
+ * Sample code: Get Service Association Links.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getServiceAssociationLinks(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceAssociationLinks().listWithResponse("rg1", "vnet", "subnet", Context.NONE);
+ }
+}
+```
+
+### ServiceEndpointPolicies_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner;
+import java.util.Arrays;
+
+/** Samples for ServiceEndpointPolicies CreateOrUpdate. */
+public final class ServiceEndpointPoliciesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyCreate.json
+ */
+ /**
+ * Sample code: Create service endpoint policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .serviceEndpointPolicies()
+ .define("testPolicy")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyCreateWithDefinition.json
+ */
+ /**
+ * Sample code: Create service endpoint policy with definition.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createServiceEndpointPolicyWithDefinition(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .serviceEndpointPolicies()
+ .define("testPolicy")
+ .withRegion("westus")
+ .withExistingResourceGroup("rg1")
+ .withServiceEndpointPolicyDefinitions(
+ Arrays
+ .asList(
+ new ServiceEndpointPolicyDefinitionInner()
+ .withName("StorageServiceEndpointPolicyDefinition")
+ .withDescription("Storage Service EndpointPolicy Definition")
+ .withService("Microsoft.Storage")
+ .withServiceResources(
+ Arrays
+ .asList(
+ "/subscriptions/subid1",
+ "/subscriptions/subid1/resourceGroups/storageRg",
+ "/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"))))
+ .create();
+ }
+}
+```
+
+### ServiceEndpointPolicies_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceEndpointPolicies Delete. */
+public final class ServiceEndpointPoliciesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyDelete.json
+ */
+ /**
+ * Sample code: Delete service endpoint policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceEndpointPolicies().delete("rg1", "serviceEndpointPolicy1", Context.NONE);
+ }
+}
+```
+
+### ServiceEndpointPolicies_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceEndpointPolicies GetByResourceGroup. */
+public final class ServiceEndpointPoliciesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyGet.json
+ */
+ /**
+ * Sample code: Get service endPoint Policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getServiceEndPointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .serviceEndpointPolicies()
+ .getByResourceGroupWithResponse("rg1", "testServiceEndpointPolicy", null, Context.NONE);
+ }
+}
+```
+
+### ServiceEndpointPolicies_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceEndpointPolicies List. */
+public final class ServiceEndpointPoliciesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyListAll.json
+ */
+ /**
+ * Sample code: List all service endpoint policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllServiceEndpointPolicy(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceEndpointPolicies().list(Context.NONE);
+ }
+}
+```
+
+### ServiceEndpointPolicies_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceEndpointPolicies ListByResourceGroup. */
+public final class ServiceEndpointPoliciesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyList.json
+ */
+ /**
+ * Sample code: List resource group service endpoint policies.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listResourceGroupServiceEndpointPolicies(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceEndpointPolicies().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### ServiceEndpointPolicies_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ServiceEndpointPolicies UpdateTags. */
+public final class ServiceEndpointPoliciesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyUpdateTags.json
+ */
+ /**
+ * Sample code: Update service endpoint policy tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateServiceEndpointPolicyTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ ServiceEndpointPolicy resource =
+ manager
+ .serviceEndpointPolicies()
+ .getByResourceGroupWithResponse("rg1", "testServiceEndpointPolicy", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ServiceEndpointPolicyDefinitions_CreateOrUpdate
+
+```java
+import java.util.Arrays;
+
+/** Samples for ServiceEndpointPolicyDefinitions CreateOrUpdate. */
+public final class ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyDefinitionCreate.json
+ */
+ /**
+ * Sample code: Create service endpoint policy definition.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createServiceEndpointPolicyDefinition(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .serviceEndpointPolicyDefinitions()
+ .define("testDefinition")
+ .withExistingServiceEndpointPolicy("rg1", "testPolicy")
+ .withDescription("Storage Service EndpointPolicy Definition")
+ .withService("Microsoft.Storage")
+ .withServiceResources(
+ Arrays
+ .asList(
+ "/subscriptions/subid1",
+ "/subscriptions/subid1/resourceGroups/storageRg",
+ "/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"))
+ .create();
+ }
+}
+```
+
+### ServiceEndpointPolicyDefinitions_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceEndpointPolicyDefinitions Delete. */
+public final class ServiceEndpointPolicyDefinitionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyDefinitionDelete.json
+ */
+ /**
+ * Sample code: Delete service endpoint policy definitions from service endpoint policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteServiceEndpointPolicyDefinitionsFromServiceEndpointPolicy(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceEndpointPolicyDefinitions().delete("rg1", "testPolicy", "testDefinition", Context.NONE);
+ }
+}
+```
+
+### ServiceEndpointPolicyDefinitions_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceEndpointPolicyDefinitions Get. */
+public final class ServiceEndpointPolicyDefinitionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyDefinitionGet.json
+ */
+ /**
+ * Sample code: Get service endpoint definition in service endpoint policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getServiceEndpointDefinitionInServiceEndpointPolicy(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceEndpointPolicyDefinitions().getWithResponse("rg1", "testPolicy", "testDefinition", Context.NONE);
+ }
+}
+```
+
+### ServiceEndpointPolicyDefinitions_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceEndpointPolicyDefinitions ListByResourceGroup. */
+public final class ServiceEndpointPolicyDefinitionsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceEndpointPolicyDefinitionList.json
+ */
+ /**
+ * Sample code: List service endpoint definitions in service end point policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listServiceEndpointDefinitionsInServiceEndPointPolicy(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceEndpointPolicyDefinitions().listByResourceGroup("rg1", "testPolicy", Context.NONE);
+ }
+}
+```
+
+### ServiceTagInformation_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceTagInformation List. */
+public final class ServiceTagInformationListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceTagInformationListResultWithNoAddressPrefixes.json
+ */
+ /**
+ * Sample code: Get list of service tags with no address prefixes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getListOfServiceTagsWithNoAddressPrefixes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceTagInformations().list("westeurope", true, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceTagInformationListResult.json
+ */
+ /**
+ * Sample code: Get list of service tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getListOfServiceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceTagInformations().list("westeurope", null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceTagInformationListResultWithTagname.json
+ */
+ /**
+ * Sample code: Get list of service tags with tag name.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getListOfServiceTagsWithTagName(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceTagInformations().list("westeurope", null, "ApiManagement", Context.NONE);
+ }
+}
+```
+
+### ServiceTags_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServiceTags List. */
+public final class ServiceTagsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/ServiceTagsList.json
+ */
+ /**
+ * Sample code: Get list of service tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getListOfServiceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.serviceTags().listWithResponse("westcentralus", Context.NONE);
+ }
+}
+```
+
+### Subnets_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat;
+import java.util.Arrays;
+
+/** Samples for Subnets CreateOrUpdate. */
+public final class SubnetsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetCreate.json
+ */
+ /**
+ * Sample code: Create subnet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .subnets()
+ .define("subnet1")
+ .withExistingVirtualNetwork("subnet-test", "vnetname")
+ .withAddressPrefix("10.0.0.0/16")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetCreateServiceEndpoint.json
+ */
+ /**
+ * Sample code: Create subnet with service endpoints.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createSubnetWithServiceEndpoints(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .subnets()
+ .define("subnet1")
+ .withExistingVirtualNetwork("subnet-test", "vnetname")
+ .withAddressPrefix("10.0.0.0/16")
+ .withServiceEndpoints(Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetCreateWithDelegation.json
+ */
+ /**
+ * Sample code: Create subnet with a delegation.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createSubnetWithADelegation(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .subnets()
+ .define("subnet1")
+ .withExistingVirtualNetwork("subnet-test", "vnetname")
+ .withAddressPrefix("10.0.0.0/16")
+ .create();
+ }
+}
+```
+
+### Subnets_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Subnets Delete. */
+public final class SubnetsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetDelete.json
+ */
+ /**
+ * Sample code: Delete subnet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.subnets().delete("subnet-test", "vnetname", "subnet1", Context.NONE);
+ }
+}
+```
+
+### Subnets_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Subnets Get. */
+public final class SubnetsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetGet.json
+ */
+ /**
+ * Sample code: Get subnet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetGetWithDelegation.json
+ */
+ /**
+ * Sample code: Get subnet with a delegation.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getSubnetWithADelegation(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, Context.NONE);
+ }
+}
+```
+
+### Subnets_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Subnets List. */
+public final class SubnetsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetList.json
+ */
+ /**
+ * Sample code: List subnets.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listSubnets(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.subnets().list("subnet-test", "vnetname", Context.NONE);
+ }
+}
+```
+
+### Subnets_PrepareNetworkPolicies
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest;
+
+/** Samples for Subnets PrepareNetworkPolicies. */
+public final class SubnetsPrepareNetworkPoliciesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetPrepareNetworkPolicies.json
+ */
+ /**
+ * Sample code: Prepare Network Policies.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void prepareNetworkPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .subnets()
+ .prepareNetworkPolicies(
+ "rg1",
+ "test-vnet",
+ "subnet1",
+ new PrepareNetworkPoliciesRequest().withServiceName("Microsoft.Sql/managedInstances"),
+ Context.NONE);
+ }
+}
+```
+
+### Subnets_UnprepareNetworkPolicies
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest;
+
+/** Samples for Subnets UnprepareNetworkPolicies. */
+public final class SubnetsUnprepareNetworkPoliciesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/SubnetUnprepareNetworkPolicies.json
+ */
+ /**
+ * Sample code: Unprepare Network Policies.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void unprepareNetworkPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .subnets()
+ .unprepareNetworkPolicies(
+ "rg1",
+ "test-vnet",
+ "subnet1",
+ new UnprepareNetworkPoliciesRequest().withServiceName("Microsoft.Sql/managedInstances"),
+ Context.NONE);
+ }
+}
+```
+
+### Usages_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Usages List. */
+public final class UsagesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/UsageList.json
+ */
+ /**
+ * Sample code: List usages.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listUsages(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.usages().list("westus", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/UsageListSpacedLocation.json
+ */
+ /**
+ * Sample code: List usages spaced location.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listUsagesSpacedLocation(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.usages().list("West US", Context.NONE);
+ }
+}
+```
+
+### VirtualApplianceSites_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.BreakOutCategoryPolicies;
+import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties;
+
+/** Samples for VirtualApplianceSites CreateOrUpdate. */
+public final class VirtualApplianceSitesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceSitePut.json
+ */
+ /**
+ * Sample code: Create Network Virtual Appliance Site.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createNetworkVirtualApplianceSite(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualApplianceSites()
+ .define("site1")
+ .withExistingNetworkVirtualAppliance("rg1", "nva")
+ .withAddressPrefix("192.168.1.0/24")
+ .withO365Policy(
+ new Office365PolicyProperties()
+ .withBreakOutCategories(
+ new BreakOutCategoryPolicies().withAllow(true).withOptimize(true).withDefaultProperty(true)))
+ .create();
+ }
+}
+```
+
+### VirtualApplianceSites_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualApplianceSites Delete. */
+public final class VirtualApplianceSitesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceSiteDelete.json
+ */
+ /**
+ * Sample code: Delete Network Virtual Appliance Site.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteNetworkVirtualApplianceSite(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualApplianceSites().delete("rg1", "nva", "site1", Context.NONE);
+ }
+}
+```
+
+### VirtualApplianceSites_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualApplianceSites Get. */
+public final class VirtualApplianceSitesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceSiteGet.json
+ */
+ /**
+ * Sample code: GetNetwork Virtual Appliance Site.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getNetworkVirtualApplianceSite(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualApplianceSites().getWithResponse("rg1", "nva", "site1", Context.NONE);
+ }
+}
+```
+
+### VirtualApplianceSites_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualApplianceSites List. */
+public final class VirtualApplianceSitesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceSiteList.json
+ */
+ /**
+ * Sample code: List all Network Virtual Appliance sites for a given Network Virtual Appliance.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllNetworkVirtualApplianceSitesForAGivenNetworkVirtualAppliance(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualApplianceSites().list("rg1", "nva", Context.NONE);
+ }
+}
+```
+
+### VirtualApplianceSkus_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualApplianceSkus Get. */
+public final class VirtualApplianceSkusGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceSkuGet.json
+ */
+ /**
+ * Sample code: NetworkVirtualApplianceSkuGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void networkVirtualApplianceSkuGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualApplianceSkus().getWithResponse("ciscoSdwan", Context.NONE);
+ }
+}
+```
+
+### VirtualApplianceSkus_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualApplianceSkus List. */
+public final class VirtualApplianceSkusListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/NetworkVirtualApplianceSkuList.json
+ */
+ /**
+ * Sample code: NetworkVirtualApplianceSkuListResult.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void networkVirtualApplianceSkuListResult(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualApplianceSkus().list(Context.NONE);
+ }
+}
+```
+
+### VirtualHubBgpConnections_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+
+/** Samples for VirtualHubBgpConnections CreateOrUpdate. */
+public final class VirtualHubBgpConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubBgpConnectionPut.json
+ */
+ /**
+ * Sample code: VirtualHubRouteTableV2Put.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubRouteTableV2Put(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualHubBgpConnections()
+ .define("conn1")
+ .withExistingVirtualHub("rg1", "hub1")
+ .withPeerAsn(20000L)
+ .withPeerIp("192.168.1.5")
+ .withHubVirtualNetworkConnection(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"))
+ .create();
+ }
+}
+```
+
+### VirtualHubBgpConnections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubBgpConnections Delete. */
+public final class VirtualHubBgpConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubBgpConnectionDelete.json
+ */
+ /**
+ * Sample code: VirtualHubRouteTableV2Delete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubRouteTableV2Delete(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubBgpConnections().delete("rg1", "hub1", "conn1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubBgpConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubBgpConnections Get. */
+public final class VirtualHubBgpConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubBgpConnectionGet.json
+ */
+ /**
+ * Sample code: VirtualHubVirtualHubRouteTableV2Get.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubVirtualHubRouteTableV2Get(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubBgpConnections().getWithResponse("rg1", "hub1", "conn1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubBgpConnections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubBgpConnections List. */
+public final class VirtualHubBgpConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubBgpConnectionList.json
+ */
+ /**
+ * Sample code: VirtualHubRouteTableV2List.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubBgpConnections().list("rg1", "hub1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubBgpConnections_ListAdvertisedRoutes
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubBgpConnections ListAdvertisedRoutes. */
+public final class VirtualHubBgpConnectionsListAdvertisedRoutesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterPeerListAdvertisedRoute.json
+ */
+ /**
+ * Sample code: VirtualRouterPeerListAdvertisedRoutes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualRouterPeerListAdvertisedRoutes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubBgpConnections().listAdvertisedRoutes("rg1", "virtualRouter1", "peer1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubBgpConnections_ListLearnedRoutes
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubBgpConnections ListLearnedRoutes. */
+public final class VirtualHubBgpConnectionsListLearnedRoutesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterPeerListLearnedRoute.json
+ */
+ /**
+ * Sample code: VirtualRouterPeerListLearnedRoutes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualRouterPeerListLearnedRoutes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubBgpConnections().listLearnedRoutes("rg1", "virtualRouter1", "peer1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubIpConfiguration_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner;
+
+/** Samples for VirtualHubIpConfiguration CreateOrUpdate. */
+public final class VirtualHubIpConfigurationCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubIpConfigurationPut.json
+ */
+ /**
+ * Sample code: VirtualHubIpConfigurationPut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubIpConfigurationPut(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualHubIpConfigurations()
+ .define("ipconfig1")
+ .withExistingVirtualHub("rg1", "hub1")
+ .withSubnet(
+ new SubnetInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"))
+ .create();
+ }
+}
+```
+
+### VirtualHubIpConfiguration_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubIpConfiguration Delete. */
+public final class VirtualHubIpConfigurationDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubIpConfigurationDelete.json
+ */
+ /**
+ * Sample code: VirtualHubIpConfigurationDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubIpConfigurationDelete(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubIpConfigurations().delete("rg1", "hub1", "ipconfig1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubIpConfiguration_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubIpConfiguration Get. */
+public final class VirtualHubIpConfigurationGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubIpConfigurationGet.json
+ */
+ /**
+ * Sample code: VirtualHubVirtualHubRouteTableV2Get.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubVirtualHubRouteTableV2Get(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubIpConfigurations().getWithResponse("rg1", "hub1", "ipconfig1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubIpConfiguration_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubIpConfiguration List. */
+public final class VirtualHubIpConfigurationListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubIpConfigurationList.json
+ */
+ /**
+ * Sample code: VirtualHubRouteTableV2List.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubIpConfigurations().list("rg1", "hub1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubRouteTableV2S_CreateOrUpdate
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner;
+import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2;
+import java.util.Arrays;
+
+/** Samples for VirtualHubRouteTableV2S CreateOrUpdate. */
+public final class VirtualHubRouteTableV2SCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubRouteTableV2Put.json
+ */
+ /**
+ * Sample code: VirtualHubRouteTableV2Put.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubRouteTableV2Put(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualHubRouteTableV2S()
+ .createOrUpdate(
+ "rg1",
+ "virtualHub1",
+ "virtualHubRouteTable1a",
+ new VirtualHubRouteTableV2Inner()
+ .withRoutes(
+ Arrays
+ .asList(
+ new VirtualHubRouteV2()
+ .withDestinationType("CIDR")
+ .withDestinations(Arrays.asList("20.10.0.0/16", "20.20.0.0/16"))
+ .withNextHopType("IPAddress")
+ .withNextHops(Arrays.asList("10.0.0.68")),
+ new VirtualHubRouteV2()
+ .withDestinationType("CIDR")
+ .withDestinations(Arrays.asList("0.0.0.0/0"))
+ .withNextHopType("IPAddress")
+ .withNextHops(Arrays.asList("10.0.0.68"))))
+ .withAttachedConnections(Arrays.asList("All_Vnets")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualHubRouteTableV2S_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubRouteTableV2S Delete. */
+public final class VirtualHubRouteTableV2SDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubRouteTableV2Delete.json
+ */
+ /**
+ * Sample code: VirtualHubRouteTableV2Delete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubRouteTableV2Delete(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubRouteTableV2S().delete("rg1", "virtualHub1", "virtualHubRouteTable1a", Context.NONE);
+ }
+}
+```
+
+### VirtualHubRouteTableV2S_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubRouteTableV2S Get. */
+public final class VirtualHubRouteTableV2SGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubRouteTableV2Get.json
+ */
+ /**
+ * Sample code: VirtualHubVirtualHubRouteTableV2Get.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubVirtualHubRouteTableV2Get(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubRouteTableV2S().getWithResponse("rg1", "virtualHub1", "virtualHubRouteTable1a", Context.NONE);
+ }
+}
+```
+
+### VirtualHubRouteTableV2S_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubRouteTableV2S List. */
+public final class VirtualHubRouteTableV2SListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubRouteTableV2List.json
+ */
+ /**
+ * Sample code: VirtualHubRouteTableV2List.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubRouteTableV2S().list("rg1", "virtualHub1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubs_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualHubs CreateOrUpdate. */
+public final class VirtualHubsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubPut.json
+ */
+ /**
+ * Sample code: VirtualHubPut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubPut(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualHubs()
+ .define("virtualHub2")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withVirtualWan(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"))
+ .withAddressPrefix("10.168.0.0/24")
+ .withSku("Basic")
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualHubs_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubs Delete. */
+public final class VirtualHubsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubDelete.json
+ */
+ /**
+ * Sample code: VirtualHubDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubs().delete("rg1", "virtualHub1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubs_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubs GetByResourceGroup. */
+public final class VirtualHubsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubGet.json
+ */
+ /**
+ * Sample code: VirtualHubGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubs().getByResourceGroupWithResponse("rg1", "virtualHub1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubs_GetEffectiveVirtualHubRoutes
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters;
+
+/** Samples for VirtualHubs GetEffectiveVirtualHubRoutes. */
+public final class VirtualHubsGetEffectiveVirtualHubRoutesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/EffectiveRoutesListForRouteTable.json
+ */
+ /**
+ * Sample code: Effective Routes for a Route Table resource.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void effectiveRoutesForARouteTableResource(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualHubs()
+ .getEffectiveVirtualHubRoutes(
+ "rg1",
+ "virtualHub1",
+ new EffectiveRoutesParameters()
+ .withResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")
+ .withVirtualWanResourceType("RouteTable"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/EffectiveRoutesListForConnection.json
+ */
+ /**
+ * Sample code: Effective Routes for a Connection resource.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void effectiveRoutesForAConnectionResource(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualHubs()
+ .getEffectiveVirtualHubRoutes(
+ "rg1",
+ "virtualHub1",
+ new EffectiveRoutesParameters()
+ .withResourceId(
+ "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName")
+ .withVirtualWanResourceType("ExpressRouteConnection"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/EffectiveRoutesListForVirtualHub.json
+ */
+ /**
+ * Sample code: Effective Routes for the Virtual Hub.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void effectiveRoutesForTheVirtualHub(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubs().getEffectiveVirtualHubRoutes("rg1", "virtualHub1", null, Context.NONE);
+ }
+}
+```
+
+### VirtualHubs_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubs List. */
+public final class VirtualHubsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubList.json
+ */
+ /**
+ * Sample code: VirtualHubList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubs().list(Context.NONE);
+ }
+}
+```
+
+### VirtualHubs_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualHubs ListByResourceGroup. */
+public final class VirtualHubsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubListByResourceGroup.json
+ */
+ /**
+ * Sample code: VirtualHubListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualHubs().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VirtualHubs_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VirtualHub;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualHubs UpdateTags. */
+public final class VirtualHubsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualHubUpdateTags.json
+ */
+ /**
+ * Sample code: VirtualHubUpdate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualHubUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VirtualHub resource =
+ manager.virtualHubs().getByResourceGroupWithResponse("rg1", "virtualHub2", Context.NONE).getValue();
+ resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner;
+import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner;
+import com.azure.resourcemanager.network.generated.models.AddressSpace;
+import com.azure.resourcemanager.network.generated.models.BgpSettings;
+import com.azure.resourcemanager.network.generated.models.IpAllocationMethod;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuName;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuTier;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType;
+import com.azure.resourcemanager.network.generated.models.VpnType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualNetworkGatewayConnections CreateOrUpdate. */
+public final class VirtualNetworkGatewayConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionCreate.json
+ */
+ /**
+ * Sample code: CreateVirtualNetworkGatewayConnection_S2S.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkGatewayConnectionS2S(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGatewayConnections()
+ .define("connS2S")
+ .withRegion("centralus")
+ .withExistingResourceGroup("rg1")
+ .withVirtualNetworkGateway1(
+ new VirtualNetworkGatewayInner()
+ .withLocation("centralus")
+ .withTags(mapOf())
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw")
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualNetworkGatewayIpConfiguration()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1")
+ .withName("gwipconfig1")
+ .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC)
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"))))
+ .withGatewayType(VirtualNetworkGatewayType.VPN)
+ .withVpnType(VpnType.ROUTE_BASED)
+ .withEnableBgp(false)
+ .withActive(false)
+ .withSku(
+ new VirtualNetworkGatewaySku()
+ .withName(VirtualNetworkGatewaySkuName.VPN_GW1)
+ .withTier(VirtualNetworkGatewaySkuTier.VPN_GW1))
+ .withBgpSettings(
+ new BgpSettings().withAsn(65514L).withBgpPeeringAddress("10.0.1.30").withPeerWeight(0)))
+ .withConnectionType(VirtualNetworkGatewayConnectionType.IPSEC)
+ .withLocalNetworkGateway2(
+ new LocalNetworkGatewayInner()
+ .withLocation("centralus")
+ .withTags(mapOf())
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw")
+ .withLocalNetworkAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.1.0.0/16")))
+ .withGatewayIpAddress("x.x.x.x"))
+ .withIngressNatRules(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1")))
+ .withEgressNatRules(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2")))
+ .withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol.IKEV2)
+ .withRoutingWeight(0)
+ .withDpdTimeoutSeconds(30)
+ .withConnectionMode(VirtualNetworkGatewayConnectionMode.DEFAULT)
+ .withSharedKey("Abc123")
+ .withEnableBgp(false)
+ .withUsePolicyBasedTrafficSelectors(false)
+ .withIpsecPolicies(Arrays.asList())
+ .withTrafficSelectorPolicies(Arrays.asList())
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayConnections Delete. */
+public final class VirtualNetworkGatewayConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionDelete.json
+ */
+ /**
+ * Sample code: DeleteVirtualNetworkGatewayConnection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteVirtualNetworkGatewayConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayConnections().delete("rg1", "conn1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayConnections GetByResourceGroup. */
+public final class VirtualNetworkGatewayConnectionsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionGet.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayConnection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayConnections().getByResourceGroupWithResponse("rg1", "connS2S", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_GetIkeSas
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayConnections GetIkeSas. */
+public final class VirtualNetworkGatewayConnectionsGetIkeSasSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionGetIkeSas.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayConnectionIkeSa.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayConnectionIkeSa(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayConnections().getIkeSas("rg1", "vpngwcn1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_GetSharedKey
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayConnections GetSharedKey. */
+public final class VirtualNetworkGatewayConnectionsGetSharedKeySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionGetSharedKey.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayConnectionSharedKey.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayConnectionSharedKey(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayConnections().getSharedKeyWithResponse("rg1", "connS2S", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayConnections ListByResourceGroup. */
+public final class VirtualNetworkGatewayConnectionsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionsList.json
+ */
+ /**
+ * Sample code: ListVirtualNetworkGatewayConnectionsinResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualNetworkGatewayConnectionsinResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayConnections().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_ResetConnection
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayConnections ResetConnection. */
+public final class VirtualNetworkGatewayConnectionsResetConnectionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionReset.json
+ */
+ /**
+ * Sample code: ResetVirtualNetworkGatewayConnection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void resetVirtualNetworkGatewayConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayConnections().resetConnection("rg1", "conn1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_ResetSharedKey
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner;
+
+/** Samples for VirtualNetworkGatewayConnections ResetSharedKey. */
+public final class VirtualNetworkGatewayConnectionsResetSharedKeySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionResetSharedKey.json
+ */
+ /**
+ * Sample code: ResetVirtualNetworkGatewayConnectionSharedKey.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void resetVirtualNetworkGatewayConnectionSharedKey(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGatewayConnections()
+ .resetSharedKey("rg1", "conn1", new ConnectionResetSharedKeyInner().withKeyLength(128), Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_SetSharedKey
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner;
+
+/** Samples for VirtualNetworkGatewayConnections SetSharedKey. */
+public final class VirtualNetworkGatewayConnectionsSetSharedKeySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionSetSharedKey.json
+ */
+ /**
+ * Sample code: SetVirtualNetworkGatewayConnectionSharedKey.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void setVirtualNetworkGatewayConnectionSharedKey(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGatewayConnections()
+ .setSharedKey("rg1", "connS2S", new ConnectionSharedKeyInner().withValue("AzureAbc123"), Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_StartPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters;
+
+/** Samples for VirtualNetworkGatewayConnections StartPacketCapture. */
+public final class VirtualNetworkGatewayConnectionsStartPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionStartPacketCapture.json
+ */
+ /**
+ * Sample code: Start packet capture on virtual network gateway connection without filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVirtualNetworkGatewayConnectionWithoutFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayConnections().startPacketCapture("rg1", "vpngwcn1", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionStartPacketCaptureFilterData.json
+ */
+ /**
+ * Sample code: Start packet capture on virtual network gateway connection with filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGatewayConnections()
+ .startPacketCapture(
+ "rg1",
+ "vpngwcn1",
+ new VpnPacketCaptureStartParameters()
+ .withFilterData(
+ "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters':"
+ + " [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort':"
+ + " [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags':"
+ + " 16,'CaptureSingleDirectionTrafficOnly': true}]}"),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_StopPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters;
+
+/** Samples for VirtualNetworkGatewayConnections StopPacketCapture. */
+public final class VirtualNetworkGatewayConnectionsStopPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionStopPacketCapture.json
+ */
+ /**
+ * Sample code: Stop packet capture on virtual network gateway connection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void stopPacketCaptureOnVirtualNetworkGatewayConnection(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGatewayConnections()
+ .stopPacketCapture(
+ "rg1",
+ "vpngwcn1",
+ new VpnPacketCaptureStopParameters()
+ .withSasUrl(
+ "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayConnections_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnection;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualNetworkGatewayConnections UpdateTags. */
+public final class VirtualNetworkGatewayConnectionsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayConnectionUpdateTags.json
+ */
+ /**
+ * Sample code: UpdateVirtualNetworkGatewayConnectionTags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateVirtualNetworkGatewayConnectionTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VirtualNetworkGatewayConnection resource =
+ manager
+ .virtualNetworkGatewayConnections()
+ .getByResourceGroupWithResponse("rg1", "test", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualNetworkGatewayNatRules_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleType;
+import java.util.Arrays;
+
+/** Samples for VirtualNetworkGatewayNatRules CreateOrUpdate. */
+public final class VirtualNetworkGatewayNatRulesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayNatRulePut.json
+ */
+ /**
+ * Sample code: VirtualNetworkGatewayNatRulePut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualNetworkGatewayNatRulePut(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGatewayNatRules()
+ .define("natRule1")
+ .withExistingVirtualNetworkGateway("rg1", "gateway1")
+ .withTypePropertiesType(VpnNatRuleType.STATIC)
+ .withMode(VpnNatRuleMode.EGRESS_SNAT)
+ .withInternalMappings(
+ Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.4.0.0/24").withPortRange("200-300")))
+ .withExternalMappings(
+ Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.21.0/24").withPortRange("300-400")))
+ .withIpConfigurationId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default")
+ .create();
+ }
+}
+```
+
+### VirtualNetworkGatewayNatRules_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayNatRules Delete. */
+public final class VirtualNetworkGatewayNatRulesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayNatRuleDelete.json
+ */
+ /**
+ * Sample code: VirtualNetworkGatewayNatRuleDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualNetworkGatewayNatRuleDelete(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayNatRules().delete("rg1", "gateway1", "natRule1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayNatRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayNatRules Get. */
+public final class VirtualNetworkGatewayNatRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayNatRuleGet.json
+ */
+ /**
+ * Sample code: VirtualNetworkGatewayNatRuleGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualNetworkGatewayNatRuleGet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayNatRules().getWithResponse("rg1", "gateway1", "natRule1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGatewayNatRules_ListByVirtualNetworkGateway
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGatewayNatRules ListByVirtualNetworkGateway. */
+public final class VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayNatRuleList.json
+ */
+ /**
+ * Sample code: VirtualNetworkGatewayNatRuleList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualNetworkGatewayNatRuleList(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGatewayNatRules().listByVirtualNetworkGateway("rg1", "gateway1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner;
+import com.azure.resourcemanager.network.generated.models.AddressSpace;
+import com.azure.resourcemanager.network.generated.models.BgpSettings;
+import com.azure.resourcemanager.network.generated.models.IpAllocationMethod;
+import com.azure.resourcemanager.network.generated.models.RadiusServer;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuName;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuTier;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType;
+import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration;
+import com.azure.resourcemanager.network.generated.models.VpnClientProtocol;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleType;
+import com.azure.resourcemanager.network.generated.models.VpnType;
+import java.util.Arrays;
+
+/** Samples for VirtualNetworkGateways CreateOrUpdate. */
+public final class VirtualNetworkGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayUpdate.json
+ */
+ /**
+ * Sample code: UpdateVirtualNetworkGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGateways()
+ .define("vpngw")
+ .withRegion("centralus")
+ .withExistingResourceGroup("rg1")
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualNetworkGatewayIpConfiguration()
+ .withName("gwipconfig1")
+ .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC)
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"))))
+ .withGatewayType(VirtualNetworkGatewayType.VPN)
+ .withVpnType(VpnType.ROUTE_BASED)
+ .withEnableBgp(false)
+ .withActive(false)
+ .withDisableIpSecReplayProtection(false)
+ .withSku(
+ new VirtualNetworkGatewaySku()
+ .withName(VirtualNetworkGatewaySkuName.VPN_GW1)
+ .withTier(VirtualNetworkGatewaySkuTier.VPN_GW1))
+ .withVpnClientConfiguration(
+ new VpnClientConfiguration()
+ .withVpnClientRootCertificates(Arrays.asList())
+ .withVpnClientRevokedCertificates(Arrays.asList())
+ .withVpnClientProtocols(Arrays.asList(VpnClientProtocol.OPEN_VPN))
+ .withRadiusServers(
+ Arrays
+ .asList(
+ new RadiusServer()
+ .withRadiusServerAddress("10.2.0.0")
+ .withRadiusServerScore(20L)
+ .withRadiusServerSecret("radiusServerSecret"))))
+ .withBgpSettings(new BgpSettings().withAsn(65515L).withBgpPeeringAddress("10.0.1.30").withPeerWeight(0))
+ .withCustomRoutes(new AddressSpace().withAddressPrefixes(Arrays.asList("101.168.0.6/32")))
+ .withEnableDnsForwarding(true)
+ .withNatRules(
+ Arrays
+ .asList(
+ new VirtualNetworkGatewayNatRuleInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1")
+ .withName("natRule1")
+ .withTypePropertiesType(VpnNatRuleType.STATIC)
+ .withMode(VpnNatRuleMode.EGRESS_SNAT)
+ .withInternalMappings(
+ Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.10.0.0/24")))
+ .withExternalMappings(
+ Arrays.asList(new VpnNatRuleMapping().withAddressSpace("50.0.0.0/24")))
+ .withIpConfigurationId(""),
+ new VirtualNetworkGatewayNatRuleInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2")
+ .withName("natRule2")
+ .withTypePropertiesType(VpnNatRuleType.STATIC)
+ .withMode(VpnNatRuleMode.INGRESS_SNAT)
+ .withInternalMappings(
+ Arrays.asList(new VpnNatRuleMapping().withAddressSpace("20.10.0.0/24")))
+ .withExternalMappings(
+ Arrays.asList(new VpnNatRuleMapping().withAddressSpace("30.0.0.0/24")))
+ .withIpConfigurationId("")))
+ .withEnableBgpRouteTranslationForNat(false)
+ .create();
+ }
+}
+```
+
+### VirtualNetworkGateways_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways Delete. */
+public final class VirtualNetworkGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayDelete.json
+ */
+ /**
+ * Sample code: DeleteVirtualNetworkGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().delete("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_DisconnectVirtualNetworkGatewayVpnConnections
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest;
+import java.util.Arrays;
+
+/** Samples for VirtualNetworkGateways DisconnectVirtualNetworkGatewayVpnConnections. */
+public final class VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewaysDisconnectP2sVpnConnections.json
+ */
+ /**
+ * Sample code: Disconnect VpnConnections from Virtual Network Gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void disconnectVpnConnectionsFromVirtualNetworkGateway(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGateways()
+ .disconnectVirtualNetworkGatewayVpnConnections(
+ "vpn-gateway-test",
+ "vpngateway",
+ new P2SVpnConnectionRequest().withVpnConnectionIds(Arrays.asList("vpnconnId1", "vpnconnId2")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GenerateVpnProfile
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnClientParameters;
+
+/** Samples for VirtualNetworkGateways GenerateVpnProfile. */
+public final class VirtualNetworkGatewaysGenerateVpnProfileSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGenerateVpnProfile.json
+ */
+ /**
+ * Sample code: GenerateVirtualNetworkGatewayVPNProfile.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void generateVirtualNetworkGatewayVPNProfile(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().generateVpnProfile("rg1", "vpngw", new VpnClientParameters(), Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_Generatevpnclientpackage
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnClientParameters;
+
+/** Samples for VirtualNetworkGateways Generatevpnclientpackage. */
+public final class VirtualNetworkGatewaysGeneratevpnclientpackageSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGenerateVpnClientPackage.json
+ */
+ /**
+ * Sample code: GenerateVPNClientPackage.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void generateVPNClientPackage(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGateways()
+ .generatevpnclientpackage("rg1", "vpngw", new VpnClientParameters(), Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GetAdvertisedRoutes
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways GetAdvertisedRoutes. */
+public final class VirtualNetworkGatewaysGetAdvertisedRoutesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGetAdvertisedRoutes.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayAdvertisedRoutes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayAdvertisedRoutes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().getAdvertisedRoutes("rg1", "vpngw", "test", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GetBgpPeerStatus
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways GetBgpPeerStatus. */
+public final class VirtualNetworkGatewaysGetBgpPeerStatusSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGetBGPPeerStatus.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayBGPPeerStatus.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayBGPPeerStatus(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().getBgpPeerStatus("rg1", "vpngw", null, Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways GetByResourceGroup. */
+public final class VirtualNetworkGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGet.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().getByResourceGroupWithResponse("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GetLearnedRoutes
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways GetLearnedRoutes. */
+public final class VirtualNetworkGatewaysGetLearnedRoutesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayLearnedRoutes.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayLearnedRoutes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayLearnedRoutes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().getLearnedRoutes("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GetVpnProfilePackageUrl
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways GetVpnProfilePackageUrl. */
+public final class VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayVPNProfilePackageURL.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayVPNProfilePackageURL(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().getVpnProfilePackageUrl("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GetVpnclientConnectionHealth
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways GetVpnclientConnectionHealth. */
+public final class VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGetVpnclientConnectionHealth.json
+ */
+ /**
+ * Sample code: GetVirtualNetworkGatewayVpnclientConnectionHealth.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayVpnclientConnectionHealth(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().getVpnclientConnectionHealth("p2s-vnet-test", "vpnp2sgw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_GetVpnclientIpsecParameters
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways GetVpnclientIpsecParameters. */
+public final class VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayGetVpnClientIpsecParameters.json
+ */
+ /**
+ * Sample code: Get VirtualNetworkGateway VpnClientIpsecParameters.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkGatewayVpnClientIpsecParameters(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().getVpnclientIpsecParameters("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways ListByResourceGroup. */
+public final class VirtualNetworkGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayList.json
+ */
+ /**
+ * Sample code: ListVirtualNetworkGatewaysinResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualNetworkGatewaysinResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_ListConnections
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways ListConnections. */
+public final class VirtualNetworkGatewaysListConnectionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewaysListConnections.json
+ */
+ /**
+ * Sample code: VirtualNetworkGatewaysListConnections.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualNetworkGatewaysListConnections(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().listConnections("testrg", "test-vpn-gateway-1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_Reset
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways Reset. */
+public final class VirtualNetworkGatewaysResetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayReset.json
+ */
+ /**
+ * Sample code: ResetVirtualNetworkGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void resetVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().reset("rg1", "vpngw", null, Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_ResetVpnClientSharedKey
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways ResetVpnClientSharedKey. */
+public final class VirtualNetworkGatewaysResetVpnClientSharedKeySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayResetVpnClientSharedKey.json
+ */
+ /**
+ * Sample code: ResetVpnClientSharedKey.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void resetVpnClientSharedKey(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().resetVpnClientSharedKey("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_SetVpnclientIpsecParameters
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner;
+import com.azure.resourcemanager.network.generated.models.DhGroup;
+import com.azure.resourcemanager.network.generated.models.IkeEncryption;
+import com.azure.resourcemanager.network.generated.models.IkeIntegrity;
+import com.azure.resourcemanager.network.generated.models.IpsecEncryption;
+import com.azure.resourcemanager.network.generated.models.IpsecIntegrity;
+import com.azure.resourcemanager.network.generated.models.PfsGroup;
+
+/** Samples for VirtualNetworkGateways SetVpnclientIpsecParameters. */
+public final class VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewaySetVpnClientIpsecParameters.json
+ */
+ /**
+ * Sample code: Set VirtualNetworkGateway VpnClientIpsecParameters.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void setVirtualNetworkGatewayVpnClientIpsecParameters(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGateways()
+ .setVpnclientIpsecParameters(
+ "rg1",
+ "vpngw",
+ new VpnClientIPsecParametersInner()
+ .withSaLifeTimeSeconds(86473)
+ .withSaDataSizeKilobytes(429497)
+ .withIpsecEncryption(IpsecEncryption.AES256)
+ .withIpsecIntegrity(IpsecIntegrity.SHA256)
+ .withIkeEncryption(IkeEncryption.AES256)
+ .withIkeIntegrity(IkeIntegrity.SHA384)
+ .withDhGroup(DhGroup.DHGROUP2)
+ .withPfsGroup(PfsGroup.PFS2),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_StartPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters;
+
+/** Samples for VirtualNetworkGateways StartPacketCapture. */
+public final class VirtualNetworkGatewaysStartPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayStartPacketCaptureFilterData.json
+ */
+ /**
+ * Sample code: Start packet capture on virtual network gateway with filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVirtualNetworkGatewayWithFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGateways()
+ .startPacketCapture(
+ "rg1",
+ "vpngw",
+ new VpnPacketCaptureStartParameters()
+ .withFilterData(
+ "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters':"
+ + " [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort':"
+ + " [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags':"
+ + " 16,'CaptureSingleDirectionTrafficOnly': true}]}"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayStartPacketCapture.json
+ */
+ /**
+ * Sample code: Start packet capture on virtual network gateway without filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVirtualNetworkGatewayWithoutFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().startPacketCapture("rg1", "vpngw", null, Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_StopPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters;
+
+/** Samples for VirtualNetworkGateways StopPacketCapture. */
+public final class VirtualNetworkGatewaysStopPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayStopPacketCapture.json
+ */
+ /**
+ * Sample code: Stop packet capture on virtual network gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void stopPacketCaptureOnVirtualNetworkGateway(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGateways()
+ .stopPacketCapture(
+ "rg1",
+ "vpngw",
+ new VpnPacketCaptureStopParameters()
+ .withSasUrl(
+ "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_SupportedVpnDevices
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkGateways SupportedVpnDevices. */
+public final class VirtualNetworkGatewaysSupportedVpnDevicesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewaySupportedVpnDevice.json
+ */
+ /**
+ * Sample code: ListVirtualNetworkGatewaySupportedVPNDevices.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualNetworkGatewaySupportedVPNDevices(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkGateways().supportedVpnDevicesWithResponse("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkGateways_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualNetworkGateways UpdateTags. */
+public final class VirtualNetworkGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: UpdateVirtualNetworkGatewayTags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateVirtualNetworkGatewayTags(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VirtualNetworkGateway resource =
+ manager.virtualNetworkGateways().getByResourceGroupWithResponse("rg1", "vpngw", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualNetworkGateways_VpnDeviceConfigurationScript
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters;
+
+/** Samples for VirtualNetworkGateways VpnDeviceConfigurationScript. */
+public final class VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGatewayVpnDeviceConfigurationScript.json
+ */
+ /**
+ * Sample code: GetVPNDeviceConfigurationScript.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVPNDeviceConfigurationScript(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkGateways()
+ .vpnDeviceConfigurationScriptWithResponse(
+ "rg1",
+ "vpngw",
+ new VpnDeviceScriptParameters()
+ .withVendor("Cisco")
+ .withDeviceFamily("ISR")
+ .withFirmwareVersion("IOS 15.1 (Preview)"),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkPeerings_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace;
+
+/** Samples for VirtualNetworkPeerings CreateOrUpdate. */
+public final class VirtualNetworkPeeringsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringSync.json
+ */
+ /**
+ * Sample code: Sync Peering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void syncPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkPeerings()
+ .define("peer")
+ .withExistingVirtualNetwork("peerTest", "vnet1")
+ .withAllowVirtualNetworkAccess(true)
+ .withAllowForwardedTraffic(true)
+ .withAllowGatewayTransit(false)
+ .withUseRemoteGateways(false)
+ .withRemoteVirtualNetwork(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"))
+ .withSyncRemoteAddressSpace(SyncRemoteAddressSpace.TRUE)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringCreate.json
+ */
+ /**
+ * Sample code: Create peering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkPeerings()
+ .define("peer")
+ .withExistingVirtualNetwork("peerTest", "vnet1")
+ .withAllowVirtualNetworkAccess(true)
+ .withAllowForwardedTraffic(true)
+ .withAllowGatewayTransit(false)
+ .withUseRemoteGateways(false)
+ .withRemoteVirtualNetwork(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringCreateWithRemoteVirtualNetworkEncryption.json
+ */
+ /**
+ * Sample code: Create peering with remote virtual network encryption.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createPeeringWithRemoteVirtualNetworkEncryption(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkPeerings()
+ .define("peer")
+ .withExistingVirtualNetwork("peerTest", "vnet1")
+ .withAllowVirtualNetworkAccess(true)
+ .withAllowForwardedTraffic(true)
+ .withAllowGatewayTransit(false)
+ .withUseRemoteGateways(false)
+ .withRemoteVirtualNetwork(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"))
+ .create();
+ }
+}
+```
+
+### VirtualNetworkPeerings_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkPeerings Delete. */
+public final class VirtualNetworkPeeringsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringDelete.json
+ */
+ /**
+ * Sample code: Delete peering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletePeering(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkPeerings().delete("peerTest", "vnet1", "peer", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkPeerings_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkPeerings Get. */
+public final class VirtualNetworkPeeringsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringGet.json
+ */
+ /**
+ * Sample code: Get peering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringGetWithRemoteVirtualNetworkEncryption.json
+ */
+ /**
+ * Sample code: Get peering with remote virtual network encryption.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getPeeringWithRemoteVirtualNetworkEncryption(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkPeerings_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkPeerings List. */
+public final class VirtualNetworkPeeringsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringList.json
+ */
+ /**
+ * Sample code: List peerings.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkPeerings().list("peerTest", "vnet1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkPeeringListWithRemoteVirtualNetworkEncryption.json
+ */
+ /**
+ * Sample code: List peerings with remote virtual network encryption.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listPeeringsWithRemoteVirtualNetworkEncryption(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkPeerings().list("peerTest", "vnet1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkTaps_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner;
+
+/** Samples for VirtualNetworkTaps CreateOrUpdate. */
+public final class VirtualNetworkTapsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkTapCreate.json
+ */
+ /**
+ * Sample code: Create Virtual Network Tap.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkTap(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworkTaps()
+ .define("test-vtap")
+ .withRegion("centraluseuap")
+ .withExistingResourceGroup("rg1")
+ .withDestinationNetworkInterfaceIpConfiguration(
+ new NetworkInterfaceIpConfigurationInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/ipconfig1"))
+ .create();
+ }
+}
+```
+
+### VirtualNetworkTaps_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkTaps Delete. */
+public final class VirtualNetworkTapsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkTapDelete.json
+ */
+ /**
+ * Sample code: Delete Virtual Network Tap resource.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteVirtualNetworkTapResource(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkTaps().delete("rg1", "test-vtap", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkTaps_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkTaps GetByResourceGroup. */
+public final class VirtualNetworkTapsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkTapGet.json
+ */
+ /**
+ * Sample code: Get Virtual Network Tap.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkTap(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkTaps().getByResourceGroupWithResponse("rg1", "testvtap", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkTaps_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkTaps List. */
+public final class VirtualNetworkTapsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkTapListAll.json
+ */
+ /**
+ * Sample code: List all virtual network taps.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllVirtualNetworkTaps(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkTaps().list(Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkTaps_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworkTaps ListByResourceGroup. */
+public final class VirtualNetworkTapsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkTapList.json
+ */
+ /**
+ * Sample code: List virtual network taps in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualNetworkTapsInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworkTaps().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworkTaps_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualNetworkTaps UpdateTags. */
+public final class VirtualNetworkTapsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkTapUpdateTags.json
+ */
+ /**
+ * Sample code: Update virtual network tap tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateVirtualNetworkTapTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VirtualNetworkTap resource =
+ manager.virtualNetworkTaps().getByResourceGroupWithResponse("rg1", "test-vtap", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualNetworks_CheckIpAddressAvailability
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworks CheckIpAddressAvailability. */
+public final class VirtualNetworksCheckIpAddressAvailabilitySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCheckIPAddressAvailability.json
+ */
+ /**
+ * Sample code: Check IP address availability.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void checkIPAddressAvailability(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().checkIpAddressAvailabilityWithResponse("rg1", "test-vnet", "10.0.1.4", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworks_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner;
+import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner;
+import com.azure.resourcemanager.network.generated.models.AddressSpace;
+import com.azure.resourcemanager.network.generated.models.Delegation;
+import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryption;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryptionEnforcement;
+import java.util.Arrays;
+
+/** Samples for VirtualNetworks CreateOrUpdate. */
+public final class VirtualNetworksCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreateSubnet.json
+ */
+ /**
+ * Sample code: Create virtual network with subnet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkWithSubnet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("test-vnet")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreateWithBgpCommunities.json
+ */
+ /**
+ * Sample code: Create virtual network with Bgp Communities.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkWithBgpCommunities(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("test-vnet")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24")))
+ .withBgpCommunities(new VirtualNetworkBgpCommunities().withVirtualNetworkCommunity("12076:20000"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreateSubnetWithAddressPrefixes.json
+ */
+ /**
+ * Sample code: Create virtual network with subnet containing address prefixes.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkWithSubnetContainingAddressPrefixes(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("test-vnet")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withSubnets(
+ Arrays
+ .asList(
+ new SubnetInner()
+ .withName("test-2")
+ .withAddressPrefixes(Arrays.asList("10.0.0.0/28", "10.0.1.0/28"))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreateSubnetWithDelegation.json
+ */
+ /**
+ * Sample code: Create virtual network with delegated subnets.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkWithDelegatedSubnets(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("test-vnet")
+ .withRegion("westcentralus")
+ .withExistingResourceGroup("rg1")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withSubnets(
+ Arrays
+ .asList(
+ new SubnetInner()
+ .withName("test-1")
+ .withAddressPrefix("10.0.0.0/24")
+ .withDelegations(
+ Arrays
+ .asList(
+ new Delegation()
+ .withName("myDelegation")
+ .withServiceName("Microsoft.Sql/managedInstances")))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreateWithEncryption.json
+ */
+ /**
+ * Sample code: Create virtual network with encryption.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkWithEncryption(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("test-vnet")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24")))
+ .withEncryption(
+ new VirtualNetworkEncryption()
+ .withEnabled(true)
+ .withEnforcement(VirtualNetworkEncryptionEnforcement.ALLOW_UNENCRYPTED))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreate.json
+ */
+ /**
+ * Sample code: Create virtual network.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("test-vnet")
+ .withRegion("eastus")
+ .withExistingResourceGroup("rg1")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withFlowTimeoutInMinutes(10)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreateServiceEndpointPolicy.json
+ */
+ /**
+ * Sample code: Create virtual network with service endpoints and service endpoint policy.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkWithServiceEndpointsAndServiceEndpointPolicy(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("vnet1")
+ .withRegion("eastus2euap")
+ .withExistingResourceGroup("vnetTest")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withSubnets(
+ Arrays
+ .asList(
+ new SubnetInner()
+ .withName("test-1")
+ .withAddressPrefix("10.0.0.0/16")
+ .withServiceEndpoints(
+ Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage")))
+ .withServiceEndpointPolicies(
+ Arrays
+ .asList(
+ new ServiceEndpointPolicyInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1")))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkCreateServiceEndpoints.json
+ */
+ /**
+ * Sample code: Create virtual network with service endpoints.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualNetworkWithServiceEndpoints(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualNetworks()
+ .define("vnet1")
+ .withRegion("eastus")
+ .withExistingResourceGroup("vnetTest")
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withSubnets(
+ Arrays
+ .asList(
+ new SubnetInner()
+ .withName("test-1")
+ .withAddressPrefix("10.0.0.0/16")
+ .withServiceEndpoints(
+ Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage")))))
+ .create();
+ }
+}
+```
+
+### VirtualNetworks_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworks Delete. */
+public final class VirtualNetworksDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkDelete.json
+ */
+ /**
+ * Sample code: Delete virtual network.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().delete("rg1", "test-vnet", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworks_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworks GetByResourceGroup. */
+public final class VirtualNetworksGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGetWithSubnetDelegation.json
+ */
+ /**
+ * Sample code: Get virtual network with a delegated subnet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkWithADelegatedSubnet(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().getByResourceGroupWithResponse("rg1", "test-vnet", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGetWithServiceAssociationLink.json
+ */
+ /**
+ * Sample code: Get virtual network with service association links.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetworkWithServiceAssociationLinks(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().getByResourceGroupWithResponse("rg1", "test-vnet", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkGet.json
+ */
+ /**
+ * Sample code: Get virtual network.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().getByResourceGroupWithResponse("rg1", "test-vnet", null, Context.NONE);
+ }
+}
+```
+
+### VirtualNetworks_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworks List. */
+public final class VirtualNetworksListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkListAll.json
+ */
+ /**
+ * Sample code: List all virtual networks.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllVirtualNetworks(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().list(Context.NONE);
+ }
+}
+```
+
+### VirtualNetworks_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworks ListByResourceGroup. */
+public final class VirtualNetworksListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkList.json
+ */
+ /**
+ * Sample code: List virtual networks in resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listVirtualNetworksInResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworks_ListUsage
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualNetworks ListUsage. */
+public final class VirtualNetworksListUsageSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkListUsage.json
+ */
+ /**
+ * Sample code: VnetGetUsage.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vnetGetUsage(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualNetworks().listUsage("rg1", "vnetName", Context.NONE);
+ }
+}
+```
+
+### VirtualNetworks_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VirtualNetwork;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualNetworks UpdateTags. */
+public final class VirtualNetworksUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualNetworkUpdateTags.json
+ */
+ /**
+ * Sample code: Update virtual network tags.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void updateVirtualNetworkTags(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VirtualNetwork resource =
+ manager.virtualNetworks().getByResourceGroupWithResponse("rg1", "test-vnet", null, Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualRouterPeerings_CreateOrUpdate
+
+```java
+/** Samples for VirtualRouterPeerings CreateOrUpdate. */
+public final class VirtualRouterPeeringsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterPeeringPut.json
+ */
+ /**
+ * Sample code: Create Virtual Router Peering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualRouterPeerings()
+ .define("peering1")
+ .withExistingVirtualRouter("rg1", "virtualRouter")
+ .withPeerAsn(20000L)
+ .withPeerIp("192.168.1.5")
+ .create();
+ }
+}
+```
+
+### VirtualRouterPeerings_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualRouterPeerings Delete. */
+public final class VirtualRouterPeeringsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterPeeringDelete.json
+ */
+ /**
+ * Sample code: Delete VirtualRouterPeering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualRouterPeerings().delete("rg1", "virtualRouter", "peering1", Context.NONE);
+ }
+}
+```
+
+### VirtualRouterPeerings_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualRouterPeerings Get. */
+public final class VirtualRouterPeeringsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterPeeringGet.json
+ */
+ /**
+ * Sample code: Get Virtual Router Peering.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualRouterPeerings().getWithResponse("rg1", "virtualRouter", "peering1", Context.NONE);
+ }
+}
+```
+
+### VirtualRouterPeerings_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualRouterPeerings List. */
+public final class VirtualRouterPeeringsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterPeeringList.json
+ */
+ /**
+ * Sample code: List all Virtual Router Peerings for a given Virtual Router.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllVirtualRouterPeeringsForAGivenVirtualRouter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualRouterPeerings().list("rg1", "virtualRouter", Context.NONE);
+ }
+}
+```
+
+### VirtualRouters_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualRouters CreateOrUpdate. */
+public final class VirtualRoutersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterPut.json
+ */
+ /**
+ * Sample code: Create VirtualRouter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualRouters()
+ .define("virtualRouter")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withHostedGateway(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualRouters_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualRouters Delete. */
+public final class VirtualRoutersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterDelete.json
+ */
+ /**
+ * Sample code: Delete VirtualRouter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deleteVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualRouters().delete("rg1", "virtualRouter", Context.NONE);
+ }
+}
+```
+
+### VirtualRouters_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualRouters GetByResourceGroup. */
+public final class VirtualRoutersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterGet.json
+ */
+ /**
+ * Sample code: Get VirtualRouter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualRouters().getByResourceGroupWithResponse("rg1", "virtualRouter", null, Context.NONE);
+ }
+}
+```
+
+### VirtualRouters_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualRouters List. */
+public final class VirtualRoutersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterListBySubscription.json
+ */
+ /**
+ * Sample code: List all Virtual Routers for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllVirtualRoutersForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualRouters().list(Context.NONE);
+ }
+}
+```
+
+### VirtualRouters_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualRouters ListByResourceGroup. */
+public final class VirtualRoutersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualRouterListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Virtual Router for a given resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllVirtualRouterForAGivenResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualRouters().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VirtualWans_CreateOrUpdate
+
+```java
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualWans CreateOrUpdate. */
+public final class VirtualWansCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualWANPut.json
+ */
+ /**
+ * Sample code: VirtualWANCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualWANCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .virtualWans()
+ .define("wan1")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withDisableVpnEncryption(false)
+ .withTypePropertiesType("Basic")
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualWans_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualWans Delete. */
+public final class VirtualWansDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualWANDelete.json
+ */
+ /**
+ * Sample code: VirtualWANDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualWANDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualWans().delete("rg1", "virtualWan1", Context.NONE);
+ }
+}
+```
+
+### VirtualWans_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualWans GetByResourceGroup. */
+public final class VirtualWansGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualWANGet.json
+ */
+ /**
+ * Sample code: VirtualWANGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualWANGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualWans().getByResourceGroupWithResponse("rg1", "wan1", Context.NONE);
+ }
+}
+```
+
+### VirtualWans_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualWans List. */
+public final class VirtualWansListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualWANList.json
+ */
+ /**
+ * Sample code: VirtualWANList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualWANList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualWans().list(Context.NONE);
+ }
+}
+```
+
+### VirtualWans_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualWans ListByResourceGroup. */
+public final class VirtualWansListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualWANListByResourceGroup.json
+ */
+ /**
+ * Sample code: VirtualWANListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualWANListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.virtualWans().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VirtualWans_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VirtualWan;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualWans UpdateTags. */
+public final class VirtualWansUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VirtualWANUpdateTags.json
+ */
+ /**
+ * Sample code: VirtualWANUpdate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void virtualWANUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VirtualWan resource =
+ manager.virtualWans().getByResourceGroupWithResponse("rg1", "wan1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VpnConnections_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner;
+import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol;
+import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode;
+import java.util.Arrays;
+
+/** Samples for VpnConnections CreateOrUpdate. */
+public final class VpnConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnConnectionPut.json
+ */
+ /**
+ * Sample code: VpnConnectionPut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnConnectionPut(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnConnections()
+ .createOrUpdate(
+ "rg1",
+ "gateway1",
+ "vpnConnection1",
+ new VpnConnectionInner()
+ .withRemoteVpnSite(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"))
+ .withTrafficSelectorPolicies(Arrays.asList())
+ .withVpnLinkConnections(
+ Arrays
+ .asList(
+ new VpnSiteLinkConnectionInner()
+ .withName("Connection-Link1")
+ .withVpnSiteLink(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"))
+ .withVpnLinkConnectionMode(VpnLinkConnectionMode.DEFAULT)
+ .withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol.IKEV2)
+ .withConnectionBandwidth(200)
+ .withSharedKey("key")
+ .withUsePolicyBasedTrafficSelectors(false))),
+ Context.NONE);
+ }
+}
+```
+
+### VpnConnections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnConnections Delete. */
+public final class VpnConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnConnectionDelete.json
+ */
+ /**
+ * Sample code: VpnConnectionDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnConnections().delete("rg1", "gateway1", "vpnConnection1", Context.NONE);
+ }
+}
+```
+
+### VpnConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnConnections Get. */
+public final class VpnConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnConnectionGet.json
+ */
+ /**
+ * Sample code: VpnConnectionGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnConnections().getWithResponse("rg1", "gateway1", "vpnConnection1", Context.NONE);
+ }
+}
+```
+
+### VpnConnections_ListByVpnGateway
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnConnections ListByVpnGateway. */
+public final class VpnConnectionsListByVpnGatewaySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnConnectionList.json
+ */
+ /**
+ * Sample code: VpnConnectionList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnConnections().listByVpnGateway("rg1", "gateway1", Context.NONE);
+ }
+}
+```
+
+### VpnConnections_StartPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters;
+import java.util.Arrays;
+
+/** Samples for VpnConnections StartPacketCapture. */
+public final class VpnConnectionsStartPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnConnectionStartPacketCaptureFilterData.json
+ */
+ /**
+ * Sample code: Start packet capture on vpn connection with filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVpnConnectionWithFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnConnections()
+ .startPacketCapture(
+ "rg1",
+ "gateway1",
+ "vpnConnection1",
+ new VpnConnectionPacketCaptureStartParameters()
+ .withFilterData(
+ "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters':"
+ + " [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort':"
+ + " [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags':"
+ + " 16,'CaptureSingleDirectionTrafficOnly': true}]}")
+ .withLinkConnectionNames(Arrays.asList("siteLink1", "siteLink2")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnConnectionStartPacketCapture.json
+ */
+ /**
+ * Sample code: Start packet capture on vpn connection without filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVpnConnectionWithoutFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnConnections()
+ .startPacketCapture(
+ "rg1",
+ "gateway1",
+ "vpnConnection1",
+ new VpnConnectionPacketCaptureStartParameters()
+ .withLinkConnectionNames(Arrays.asList("siteLink1", "siteLink2")),
+ Context.NONE);
+ }
+}
+```
+
+### VpnConnections_StopPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters;
+import java.util.Arrays;
+
+/** Samples for VpnConnections StopPacketCapture. */
+public final class VpnConnectionsStopPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnConnectionStopPacketCapture.json
+ */
+ /**
+ * Sample code: Start packet capture on vpn connection without filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVpnConnectionWithoutFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnConnections()
+ .stopPacketCapture(
+ "rg1",
+ "gateway1",
+ "vpnConnection1",
+ new VpnConnectionPacketCaptureStopParameters()
+ .withSasUrl(
+ "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D")
+ .withLinkConnectionNames(Arrays.asList("vpnSiteLink1", "vpnSiteLink2")),
+ Context.NONE);
+ }
+}
+```
+
+### VpnGateways_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner;
+import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner;
+import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner;
+import com.azure.resourcemanager.network.generated.models.BgpSettings;
+import com.azure.resourcemanager.network.generated.models.IpConfigurationBgpPeeringAddress;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode;
+import com.azure.resourcemanager.network.generated.models.VpnNatRuleType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VpnGateways CreateOrUpdate. */
+public final class VpnGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayPut.json
+ */
+ /**
+ * Sample code: VpnGatewayPut.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnGatewayPut(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnGateways()
+ .define("gateway1")
+ .withRegion("westcentralus")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withVirtualHub(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"))
+ .withConnections(
+ Arrays
+ .asList(
+ new VpnConnectionInner()
+ .withName("vpnConnection1")
+ .withRemoteVpnSite(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"))
+ .withVpnLinkConnections(
+ Arrays
+ .asList(
+ new VpnSiteLinkConnectionInner()
+ .withName("Connection-Link1")
+ .withVpnSiteLink(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"))
+ .withVpnConnectionProtocolType(
+ VirtualNetworkGatewayConnectionProtocol.IKEV2)
+ .withConnectionBandwidth(200)
+ .withSharedKey("key")
+ .withEgressNatRules(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03")))))))
+ .withBgpSettings(
+ new BgpSettings()
+ .withAsn(65515L)
+ .withPeerWeight(0)
+ .withBgpPeeringAddresses(
+ Arrays
+ .asList(
+ new IpConfigurationBgpPeeringAddress()
+ .withIpconfigurationId("Instance0")
+ .withCustomBgpIpAddresses(Arrays.asList("169.254.21.5")),
+ new IpConfigurationBgpPeeringAddress()
+ .withIpconfigurationId("Instance1")
+ .withCustomBgpIpAddresses(Arrays.asList("169.254.21.10")))))
+ .withEnableBgpRouteTranslationForNat(false)
+ .withIsRoutingPreferenceInternet(false)
+ .withNatRules(
+ Arrays
+ .asList(
+ new VpnGatewayNatRuleInner()
+ .withName("nat03")
+ .withTypePropertiesType(VpnNatRuleType.STATIC)
+ .withMode(VpnNatRuleMode.EGRESS_SNAT)
+ .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("0.0.0.0/26")))
+ .withExternalMappings(
+ Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.0.0/26")))
+ .withIpConfigurationId("")))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VpnGateways_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnGateways Delete. */
+public final class VpnGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayDelete.json
+ */
+ /**
+ * Sample code: VpnGatewayDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnGateways().delete("rg1", "gateway1", Context.NONE);
+ }
+}
+```
+
+### VpnGateways_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnGateways GetByResourceGroup. */
+public final class VpnGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayGet.json
+ */
+ /**
+ * Sample code: VpnGatewayGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnGateways().getByResourceGroupWithResponse("rg1", "gateway1", Context.NONE);
+ }
+}
+```
+
+### VpnGateways_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnGateways List. */
+public final class VpnGatewaysListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayList.json
+ */
+ /**
+ * Sample code: VpnGatewayListBySubscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnGatewayListBySubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnGateways().list(Context.NONE);
+ }
+}
+```
+
+### VpnGateways_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnGateways ListByResourceGroup. */
+public final class VpnGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayListByResourceGroup.json
+ */
+ /**
+ * Sample code: VpnGatewayListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnGatewayListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnGateways().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VpnGateways_Reset
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnGateways Reset. */
+public final class VpnGatewaysResetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayReset.json
+ */
+ /**
+ * Sample code: ResetVpnGateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void resetVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnGateways().reset("rg1", "vpngw", Context.NONE);
+ }
+}
+```
+
+### VpnGateways_StartPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters;
+
+/** Samples for VpnGateways StartPacketCapture. */
+public final class VpnGatewaysStartPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayStartPacketCaptureFilterData.json
+ */
+ /**
+ * Sample code: Start packet capture on vpn gateway with filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVpnGatewayWithFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnGateways()
+ .startPacketCapture(
+ "rg1",
+ "vpngw",
+ new VpnGatewayPacketCaptureStartParameters()
+ .withFilterData(
+ "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters':"
+ + " [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort':"
+ + " [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags':"
+ + " 16,'CaptureSingleDirectionTrafficOnly': true}]}"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayStartPacketCapture.json
+ */
+ /**
+ * Sample code: Start packet capture on vpn gateway without filter.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void startPacketCaptureOnVpnGatewayWithoutFilter(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnGateways().startPacketCapture("rg1", "vpngw", null, Context.NONE);
+ }
+}
+```
+
+### VpnGateways_StopPacketCapture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters;
+
+/** Samples for VpnGateways StopPacketCapture. */
+public final class VpnGatewaysStopPacketCaptureSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayStopPacketCapture.json
+ */
+ /**
+ * Sample code: Stop packet capture on vpn gateway.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void stopPacketCaptureOnVpnGateway(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnGateways()
+ .stopPacketCapture(
+ "rg1",
+ "vpngw",
+ new VpnGatewayPacketCaptureStopParameters()
+ .withSasUrl(
+ "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"),
+ Context.NONE);
+ }
+}
+```
+
+### VpnGateways_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnGateway;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VpnGateways UpdateTags. */
+public final class VpnGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: VpnGatewayUpdate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VpnGateway resource =
+ manager.vpnGateways().getByResourceGroupWithResponse("rg1", "gateway1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VpnLinkConnections_GetIkeSas
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnLinkConnections GetIkeSas. */
+public final class VpnLinkConnectionsGetIkeSasSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteLinkConnectionGetIkeSas.json
+ */
+ /**
+ * Sample code: GetVpnLinkConnectionIkeSa.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVpnLinkConnectionIkeSa(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnLinkConnections().getIkeSas("rg1", "gateway1", "vpnConnection1", "Connection-Link1", Context.NONE);
+ }
+}
+```
+
+### VpnLinkConnections_ListByVpnConnection
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnLinkConnections ListByVpnConnection. */
+public final class VpnLinkConnectionsListByVpnConnectionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteLinkConnectionList.json
+ */
+ /**
+ * Sample code: VpnSiteLinkConnectionList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteLinkConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnLinkConnections().listByVpnConnection("rg1", "gateway1", "vpnConnection1", Context.NONE);
+ }
+}
+```
+
+### VpnLinkConnections_ResetConnection
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnLinkConnections ResetConnection. */
+public final class VpnLinkConnectionsResetConnectionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteLinkConnectionReset.json
+ */
+ /**
+ * Sample code: ResetVpnLinkConnection.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void resetVpnLinkConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnLinkConnections()
+ .resetConnection("rg1", "gateway1", "vpnConnection1", "Connection-Link1", Context.NONE);
+ }
+}
+```
+
+### VpnServerConfigurations_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.DhGroup;
+import com.azure.resourcemanager.network.generated.models.IkeEncryption;
+import com.azure.resourcemanager.network.generated.models.IkeIntegrity;
+import com.azure.resourcemanager.network.generated.models.IpsecEncryption;
+import com.azure.resourcemanager.network.generated.models.IpsecIntegrity;
+import com.azure.resourcemanager.network.generated.models.IpsecPolicy;
+import com.azure.resourcemanager.network.generated.models.PfsGroup;
+import com.azure.resourcemanager.network.generated.models.RadiusServer;
+import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol;
+import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate;
+import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate;
+import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate;
+import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VpnServerConfigurations CreateOrUpdate. */
+public final class VpnServerConfigurationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnServerConfigurationPut.json
+ */
+ /**
+ * Sample code: VpnServerConfigurationCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnServerConfigurationCreate(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnServerConfigurations()
+ .define("vpnServerConfiguration1")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withVpnProtocols(Arrays.asList(VpnGatewayTunnelingProtocol.IKE_V2))
+ .withVpnClientRootCertificates(
+ Arrays
+ .asList(
+ new VpnServerConfigVpnClientRootCertificate()
+ .withName("vpnServerConfigVpnClientRootCert1")
+ .withPublicCertData(
+ "MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN")))
+ .withVpnClientRevokedCertificates(
+ Arrays
+ .asList(
+ new VpnServerConfigVpnClientRevokedCertificate()
+ .withName("vpnServerConfigVpnClientRevokedCert1")
+ .withThumbprint("83FFBFC8848B5A5836C94D0112367E16148A286F")))
+ .withRadiusServerRootCertificates(
+ Arrays
+ .asList(
+ new VpnServerConfigRadiusServerRootCertificate()
+ .withName("vpnServerConfigRadiusServerRootCer1")
+ .withPublicCertData(
+ "MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM")))
+ .withRadiusClientRootCertificates(
+ Arrays
+ .asList(
+ new VpnServerConfigRadiusClientRootCertificate()
+ .withName("vpnServerConfigRadiusClientRootCert1")
+ .withThumbprint("83FFBFC8848B5A5836C94D0112367E16148A286F")))
+ .withVpnClientIpsecPolicies(
+ Arrays
+ .asList(
+ new IpsecPolicy()
+ .withSaLifeTimeSeconds(86472)
+ .withSaDataSizeKilobytes(429497)
+ .withIpsecEncryption(IpsecEncryption.AES256)
+ .withIpsecIntegrity(IpsecIntegrity.SHA256)
+ .withIkeEncryption(IkeEncryption.AES256)
+ .withIkeIntegrity(IkeIntegrity.SHA384)
+ .withDhGroup(DhGroup.DHGROUP14)
+ .withPfsGroup(PfsGroup.PFS14)))
+ .withRadiusServers(
+ Arrays
+ .asList(
+ new RadiusServer()
+ .withRadiusServerAddress("10.0.0.0")
+ .withRadiusServerScore(25L)
+ .withRadiusServerSecret("radiusServerSecret")))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VpnServerConfigurations_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnServerConfigurations Delete. */
+public final class VpnServerConfigurationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnServerConfigurationDelete.json
+ */
+ /**
+ * Sample code: VpnServerConfigurationDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnServerConfigurationDelete(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnServerConfigurations().delete("rg1", "vpnServerConfiguration1", Context.NONE);
+ }
+}
+```
+
+### VpnServerConfigurations_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnServerConfigurations GetByResourceGroup. */
+public final class VpnServerConfigurationsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnServerConfigurationGet.json
+ */
+ /**
+ * Sample code: VpnServerConfigurationGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnServerConfigurationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnServerConfigurations()
+ .getByResourceGroupWithResponse("rg1", "vpnServerConfiguration1", Context.NONE);
+ }
+}
+```
+
+### VpnServerConfigurations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnServerConfigurations List. */
+public final class VpnServerConfigurationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnServerConfigurationList.json
+ */
+ /**
+ * Sample code: VpnServerConfigurationList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnServerConfigurationList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnServerConfigurations().list(Context.NONE);
+ }
+}
+```
+
+### VpnServerConfigurations_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnServerConfigurations ListByResourceGroup. */
+public final class VpnServerConfigurationsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnServerConfigurationListByResourceGroup.json
+ */
+ /**
+ * Sample code: VpnServerConfigurationListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnServerConfigurationListByResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnServerConfigurations().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VpnServerConfigurations_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnServerConfiguration;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VpnServerConfigurations UpdateTags. */
+public final class VpnServerConfigurationsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnServerConfigurationUpdateTags.json
+ */
+ /**
+ * Sample code: VpnServerConfigurationUpdate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnServerConfigurationUpdate(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VpnServerConfiguration resource =
+ manager
+ .vpnServerConfigurations()
+ .getByResourceGroupWithResponse("rg1", "vpnServerConfiguration1", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VpnServerConfigurationsAssociatedWithVirtualWan_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnServerConfigurationsAssociatedWithVirtualWan List. */
+public final class VpnServerConfigurationsAssociatedWithVirtualWanListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/GetVirtualWanVpnServerConfigurations.json
+ */
+ /**
+ * Sample code: GetVirtualWanVpnServerConfigurations.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getVirtualWanVpnServerConfigurations(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnServerConfigurationsAssociatedWithVirtualWans().list("rg1", "wan1", Context.NONE);
+ }
+}
+```
+
+### VpnSiteLinkConnections_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnSiteLinkConnections Get. */
+public final class VpnSiteLinkConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteLinkConnectionGet.json
+ */
+ /**
+ * Sample code: VpnSiteLinkConnectionGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteLinkConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnSiteLinkConnections()
+ .getWithResponse("rg1", "gateway1", "vpnConnection1", "Connection-Link1", Context.NONE);
+ }
+}
+```
+
+### VpnSiteLinks_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnSiteLinks Get. */
+public final class VpnSiteLinksGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteLinkGet.json
+ */
+ /**
+ * Sample code: VpnSiteGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnSiteLinks().getWithResponse("rg1", "vpnSite1", "vpnSiteLink1", Context.NONE);
+ }
+}
+```
+
+### VpnSiteLinks_ListByVpnSite
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnSiteLinks ListByVpnSite. */
+public final class VpnSiteLinksListByVpnSiteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteLinkListByVpnSite.json
+ */
+ /**
+ * Sample code: VpnSiteLinkListByVpnSite.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteLinkListByVpnSite(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnSiteLinks().listByVpnSite("rg1", "vpnSite1", Context.NONE);
+ }
+}
+```
+
+### VpnSites_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner;
+import com.azure.resourcemanager.network.generated.models.AddressSpace;
+import com.azure.resourcemanager.network.generated.models.O365BreakOutCategoryPolicies;
+import com.azure.resourcemanager.network.generated.models.O365PolicyProperties;
+import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings;
+import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VpnSites CreateOrUpdate. */
+public final class VpnSitesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSitePut.json
+ */
+ /**
+ * Sample code: VpnSiteCreate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnSites()
+ .define("vpnSite1")
+ .withRegion("West US")
+ .withExistingResourceGroup("rg1")
+ .withTags(mapOf("key1", "value1"))
+ .withVirtualWan(
+ new SubResource()
+ .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"))
+ .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16")))
+ .withIsSecuritySite(false)
+ .withVpnSiteLinks(
+ Arrays
+ .asList(
+ new VpnSiteLinkInner()
+ .withName("vpnSiteLink1")
+ .withLinkProperties(
+ new VpnLinkProviderProperties().withLinkProviderName("vendor1").withLinkSpeedInMbps(0))
+ .withIpAddress("50.50.50.56")
+ .withFqdn("link1.vpnsite1.contoso.com")
+ .withBgpProperties(
+ new VpnLinkBgpSettings().withAsn(1234L).withBgpPeeringAddress("192.168.0.0"))))
+ .withO365Policy(
+ new O365PolicyProperties()
+ .withBreakOutCategories(
+ new O365BreakOutCategoryPolicies()
+ .withAllow(true)
+ .withOptimize(true)
+ .withDefaultProperty(false)))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VpnSites_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnSites Delete. */
+public final class VpnSitesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteDelete.json
+ */
+ /**
+ * Sample code: VpnSiteDelete.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnSites().delete("rg1", "vpnSite1", Context.NONE);
+ }
+}
+```
+
+### VpnSites_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnSites GetByResourceGroup. */
+public final class VpnSitesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteGet.json
+ */
+ /**
+ * Sample code: VpnSiteGet.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteGet(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnSites().getByResourceGroupWithResponse("rg1", "vpnSite1", Context.NONE);
+ }
+}
+```
+
+### VpnSites_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnSites List. */
+public final class VpnSitesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteList.json
+ */
+ /**
+ * Sample code: VpnSiteList.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteList(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnSites().list(Context.NONE);
+ }
+}
+```
+
+### VpnSites_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VpnSites ListByResourceGroup. */
+public final class VpnSitesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteListByResourceGroup.json
+ */
+ /**
+ * Sample code: VpnSiteListByResourceGroup.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.vpnSites().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### VpnSites_UpdateTags
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.VpnSite;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VpnSites UpdateTags. */
+public final class VpnSitesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSiteUpdateTags.json
+ */
+ /**
+ * Sample code: VpnSiteUpdate.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSiteUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ VpnSite resource =
+ manager.vpnSites().getByResourceGroupWithResponse("rg1", "vpnSite1", Context.NONE).getValue();
+ resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VpnSitesConfiguration_Download
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest;
+import java.util.Arrays;
+
+/** Samples for VpnSitesConfiguration Download. */
+public final class VpnSitesConfigurationDownloadSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/VpnSitesConfigurationDownload.json
+ */
+ /**
+ * Sample code: VpnSitesConfigurationDownload.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void vpnSitesConfigurationDownload(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .vpnSitesConfigurations()
+ .download(
+ "rg1",
+ "wan1",
+ new GetVpnSitesConfigurationRequest()
+ .withVpnSites(
+ Arrays
+ .asList("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/abc"))
+ .withOutputBlobSasUrl(
+ "https://blobcortextesturl.blob.core.windows.net/folderforconfig/vpnFile?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"),
+ Context.NONE);
+ }
+}
+```
+
+### WebApplicationFirewallPolicies_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.network.generated.models.ExclusionManagedRule;
+import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleGroup;
+import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleSet;
+import com.azure.resourcemanager.network.generated.models.ManagedRuleSet;
+import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition;
+import com.azure.resourcemanager.network.generated.models.MatchCondition;
+import com.azure.resourcemanager.network.generated.models.MatchVariable;
+import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntry;
+import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntryMatchVariable;
+import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntrySelectorMatchOperator;
+import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallAction;
+import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule;
+import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallMatchVariable;
+import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallOperator;
+import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallRuleType;
+import java.util.Arrays;
+
+/** Samples for WebApplicationFirewallPolicies CreateOrUpdate. */
+public final class WebApplicationFirewallPoliciesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/WafPolicyCreateOrUpdate.json
+ */
+ /**
+ * Sample code: Creates or updates a WAF policy within a resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void createsOrUpdatesAWAFPolicyWithinAResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager
+ .webApplicationFirewallPolicies()
+ .define("Policy1")
+ .withRegion("WestUs")
+ .withExistingResourceGroup("rg1")
+ .withCustomRules(
+ Arrays
+ .asList(
+ new WebApplicationFirewallCustomRule()
+ .withName("Rule1")
+ .withPriority(1)
+ .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE)
+ .withMatchConditions(
+ Arrays
+ .asList(
+ new MatchCondition()
+ .withMatchVariables(
+ Arrays
+ .asList(
+ new MatchVariable()
+ .withVariableName(
+ WebApplicationFirewallMatchVariable.REMOTE_ADDR)))
+ .withOperator(WebApplicationFirewallOperator.IPMATCH)
+ .withMatchValues(Arrays.asList("192.168.1.0/24", "10.0.0.0/24"))))
+ .withAction(WebApplicationFirewallAction.BLOCK),
+ new WebApplicationFirewallCustomRule()
+ .withName("Rule2")
+ .withPriority(2)
+ .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE)
+ .withMatchConditions(
+ Arrays
+ .asList(
+ new MatchCondition()
+ .withMatchVariables(
+ Arrays
+ .asList(
+ new MatchVariable()
+ .withVariableName(
+ WebApplicationFirewallMatchVariable.REMOTE_ADDR)))
+ .withOperator(WebApplicationFirewallOperator.IPMATCH)
+ .withMatchValues(Arrays.asList("192.168.1.0/24")),
+ new MatchCondition()
+ .withMatchVariables(
+ Arrays
+ .asList(
+ new MatchVariable()
+ .withVariableName(
+ WebApplicationFirewallMatchVariable.REQUEST_HEADERS)
+ .withSelector("UserAgent")))
+ .withOperator(WebApplicationFirewallOperator.CONTAINS)
+ .withMatchValues(Arrays.asList("Windows"))))
+ .withAction(WebApplicationFirewallAction.BLOCK)))
+ .withManagedRules(
+ new ManagedRulesDefinition()
+ .withExclusions(
+ Arrays
+ .asList(
+ new OwaspCrsExclusionEntry()
+ .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES)
+ .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH)
+ .withSelector("hello")
+ .withExclusionManagedRuleSets(
+ Arrays
+ .asList(
+ new ExclusionManagedRuleSet()
+ .withRuleSetType("OWASP")
+ .withRuleSetVersion("3.2")
+ .withRuleGroups(
+ Arrays
+ .asList(
+ new ExclusionManagedRuleGroup()
+ .withRuleGroupName(
+ "REQUEST-930-APPLICATION-ATTACK-LFI")
+ .withRules(
+ Arrays
+ .asList(
+ new ExclusionManagedRule()
+ .withRuleId("930120"))),
+ new ExclusionManagedRuleGroup()
+ .withRuleGroupName(
+ "REQUEST-932-APPLICATION-ATTACK-RCE"))))),
+ new OwaspCrsExclusionEntry()
+ .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES)
+ .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.ENDS_WITH)
+ .withSelector("hello")
+ .withExclusionManagedRuleSets(
+ Arrays
+ .asList(
+ new ExclusionManagedRuleSet()
+ .withRuleSetType("OWASP")
+ .withRuleSetVersion("3.1")
+ .withRuleGroups(Arrays.asList()))),
+ new OwaspCrsExclusionEntry()
+ .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES)
+ .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH)
+ .withSelector("test"),
+ new OwaspCrsExclusionEntry()
+ .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_VALUES)
+ .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH)
+ .withSelector("test")))
+ .withManagedRuleSets(
+ Arrays.asList(new ManagedRuleSet().withRuleSetType("OWASP").withRuleSetVersion("3.2"))))
+ .create();
+ }
+}
+```
+
+### WebApplicationFirewallPolicies_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for WebApplicationFirewallPolicies Delete. */
+public final class WebApplicationFirewallPoliciesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/WafPolicyDelete.json
+ */
+ /**
+ * Sample code: Deletes a WAF policy within a resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void deletesAWAFPolicyWithinAResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.webApplicationFirewallPolicies().delete("rg1", "Policy1", Context.NONE);
+ }
+}
+```
+
+### WebApplicationFirewallPolicies_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for WebApplicationFirewallPolicies GetByResourceGroup. */
+public final class WebApplicationFirewallPoliciesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/WafPolicyGet.json
+ */
+ /**
+ * Sample code: Gets a WAF policy within a resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getsAWAFPolicyWithinAResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.webApplicationFirewallPolicies().getByResourceGroupWithResponse("rg1", "Policy1", Context.NONE);
+ }
+}
+```
+
+### WebApplicationFirewallPolicies_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for WebApplicationFirewallPolicies List. */
+public final class WebApplicationFirewallPoliciesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/WafListAllPolicies.json
+ */
+ /**
+ * Sample code: Lists all WAF policies in a subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listsAllWAFPoliciesInASubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.webApplicationFirewallPolicies().list(Context.NONE);
+ }
+}
+```
+
+### WebApplicationFirewallPolicies_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for WebApplicationFirewallPolicies ListByResourceGroup. */
+public final class WebApplicationFirewallPoliciesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/WafListPolicies.json
+ */
+ /**
+ * Sample code: Lists all WAF policies in a resource group.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listsAllWAFPoliciesInAResourceGroup(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.webApplicationFirewallPolicies().listByResourceGroup("rg1", Context.NONE);
+ }
+}
+```
+
+### WebCategories_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for WebCategories Get. */
+public final class WebCategoriesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureWebCategoryGet.json
+ */
+ /**
+ * Sample code: Get Azure Web Category by name.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void getAzureWebCategoryByName(com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.webCategories().getWithResponse("Arts", null, Context.NONE);
+ }
+}
+```
+
+### WebCategories_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for WebCategories List. */
+public final class WebCategoriesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/AzureWebCategoriesListBySubscription.json
+ */
+ /**
+ * Sample code: List all Azure Web Categories for a given subscription.
+ *
+ * @param manager Entry point to NetworkManager.
+ */
+ public static void listAllAzureWebCategoriesForAGivenSubscription(
+ com.azure.resourcemanager.network.generated.NetworkManager manager) {
+ manager.webCategories().list(Context.NONE);
+ }
+}
+```
+
diff --git a/sdk/network/azure-resourcemanager-network-generated/pom.xml b/sdk/network/azure-resourcemanager-network-generated/pom.xml
new file mode 100644
index 0000000000000..f8efbd79cd9d8
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/pom.xml
@@ -0,0 +1,55 @@
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-network-generated
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for Network Management
+ This package contains Microsoft Azure SDK for Network Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Network Client. Package tag package-2021-08.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+ true
+
+
+
+ com.azure
+ azure-core
+ 1.24.1
+
+
+ com.azure
+ azure-core-management
+ 1.5.1
+
+
+
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java
new file mode 100644
index 0000000000000..a83b9ec5afaf7
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java
@@ -0,0 +1,1643 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.HttpPipelinePosition;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.network.generated.fluent.NetworkManagementClient;
+import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateEndpointConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateLinkResourcesImpl;
+import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewaysImpl;
+import com.azure.resourcemanager.network.generated.implementation.ApplicationSecurityGroupsImpl;
+import com.azure.resourcemanager.network.generated.implementation.AvailableDelegationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.AvailableEndpointServicesImpl;
+import com.azure.resourcemanager.network.generated.implementation.AvailablePrivateEndpointTypesImpl;
+import com.azure.resourcemanager.network.generated.implementation.AvailableResourceGroupDelegationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.AvailableServiceAliasesImpl;
+import com.azure.resourcemanager.network.generated.implementation.AzureFirewallFqdnTagsImpl;
+import com.azure.resourcemanager.network.generated.implementation.AzureFirewallsImpl;
+import com.azure.resourcemanager.network.generated.implementation.BastionHostsImpl;
+import com.azure.resourcemanager.network.generated.implementation.BgpServiceCommunitiesImpl;
+import com.azure.resourcemanager.network.generated.implementation.ConnectionMonitorsImpl;
+import com.azure.resourcemanager.network.generated.implementation.CustomIpPrefixesImpl;
+import com.azure.resourcemanager.network.generated.implementation.DdosCustomPoliciesImpl;
+import com.azure.resourcemanager.network.generated.implementation.DdosProtectionPlansImpl;
+import com.azure.resourcemanager.network.generated.implementation.DefaultSecurityRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.DscpConfigurationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitAuthorizationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitPeeringsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionPeeringsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteGatewaysImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteLinksImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortAuthorizationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsLocationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ExpressRouteServiceProvidersImpl;
+import com.azure.resourcemanager.network.generated.implementation.FirewallPoliciesImpl;
+import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesFilterValuesImpl;
+import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesImpl;
+import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesOverridesImpl;
+import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyRuleCollectionGroupsImpl;
+import com.azure.resourcemanager.network.generated.implementation.FlowLogsImpl;
+import com.azure.resourcemanager.network.generated.implementation.HubRouteTablesImpl;
+import com.azure.resourcemanager.network.generated.implementation.HubVirtualNetworkConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.InboundNatRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.InboundSecurityRuleOperationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.IpAllocationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.IpGroupsImpl;
+import com.azure.resourcemanager.network.generated.implementation.LoadBalancerBackendAddressPoolsImpl;
+import com.azure.resourcemanager.network.generated.implementation.LoadBalancerFrontendIpConfigurationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.LoadBalancerLoadBalancingRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.LoadBalancerNetworkInterfacesImpl;
+import com.azure.resourcemanager.network.generated.implementation.LoadBalancerOutboundRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.LoadBalancerProbesImpl;
+import com.azure.resourcemanager.network.generated.implementation.LoadBalancersImpl;
+import com.azure.resourcemanager.network.generated.implementation.LocalNetworkGatewaysImpl;
+import com.azure.resourcemanager.network.generated.implementation.NatGatewaysImpl;
+import com.azure.resourcemanager.network.generated.implementation.NatRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceIpConfigurationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceLoadBalancersImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceTapConfigurationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkInterfacesImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkManagementClientBuilder;
+import com.azure.resourcemanager.network.generated.implementation.NetworkProfilesImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkSecurityGroupsImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkVirtualAppliancesImpl;
+import com.azure.resourcemanager.network.generated.implementation.NetworkWatchersImpl;
+import com.azure.resourcemanager.network.generated.implementation.OperationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.P2SVpnGatewaysImpl;
+import com.azure.resourcemanager.network.generated.implementation.PacketCapturesImpl;
+import com.azure.resourcemanager.network.generated.implementation.PeerExpressRouteCircuitConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.PrivateDnsZoneGroupsImpl;
+import com.azure.resourcemanager.network.generated.implementation.PrivateEndpointsImpl;
+import com.azure.resourcemanager.network.generated.implementation.PrivateLinkServicesImpl;
+import com.azure.resourcemanager.network.generated.implementation.PublicIpAddressesImpl;
+import com.azure.resourcemanager.network.generated.implementation.PublicIpPrefixesImpl;
+import com.azure.resourcemanager.network.generated.implementation.ResourceNavigationLinksImpl;
+import com.azure.resourcemanager.network.generated.implementation.ResourceProvidersImpl;
+import com.azure.resourcemanager.network.generated.implementation.RouteFilterRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.RouteFiltersImpl;
+import com.azure.resourcemanager.network.generated.implementation.RouteTablesImpl;
+import com.azure.resourcemanager.network.generated.implementation.RoutesImpl;
+import com.azure.resourcemanager.network.generated.implementation.RoutingIntentsImpl;
+import com.azure.resourcemanager.network.generated.implementation.SecurityPartnerProvidersImpl;
+import com.azure.resourcemanager.network.generated.implementation.SecurityRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.ServiceAssociationLinksImpl;
+import com.azure.resourcemanager.network.generated.implementation.ServiceEndpointPoliciesImpl;
+import com.azure.resourcemanager.network.generated.implementation.ServiceEndpointPolicyDefinitionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ServiceTagInformationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.ServiceTagsImpl;
+import com.azure.resourcemanager.network.generated.implementation.SubnetsImpl;
+import com.azure.resourcemanager.network.generated.implementation.UsagesImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSitesImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSkusImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualHubBgpConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualHubIpConfigurationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualHubRouteTableV2SImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualHubsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayNatRulesImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewaysImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkPeeringsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkTapsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualNetworksImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualRouterPeeringsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualRoutersImpl;
+import com.azure.resourcemanager.network.generated.implementation.VirtualWansImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnGatewaysImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnLinkConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsAssociatedWithVirtualWansImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnSiteLinkConnectionsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnSiteLinksImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnSitesConfigurationsImpl;
+import com.azure.resourcemanager.network.generated.implementation.VpnSitesImpl;
+import com.azure.resourcemanager.network.generated.implementation.WebApplicationFirewallPoliciesImpl;
+import com.azure.resourcemanager.network.generated.implementation.WebCategoriesImpl;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnections;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResources;
+import com.azure.resourcemanager.network.generated.models.ApplicationGateways;
+import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroups;
+import com.azure.resourcemanager.network.generated.models.AvailableDelegations;
+import com.azure.resourcemanager.network.generated.models.AvailableEndpointServices;
+import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointTypes;
+import com.azure.resourcemanager.network.generated.models.AvailableResourceGroupDelegations;
+import com.azure.resourcemanager.network.generated.models.AvailableServiceAliases;
+import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTags;
+import com.azure.resourcemanager.network.generated.models.AzureFirewalls;
+import com.azure.resourcemanager.network.generated.models.BastionHosts;
+import com.azure.resourcemanager.network.generated.models.BgpServiceCommunities;
+import com.azure.resourcemanager.network.generated.models.ConnectionMonitors;
+import com.azure.resourcemanager.network.generated.models.CustomIpPrefixes;
+import com.azure.resourcemanager.network.generated.models.DdosCustomPolicies;
+import com.azure.resourcemanager.network.generated.models.DdosProtectionPlans;
+import com.azure.resourcemanager.network.generated.models.DefaultSecurityRules;
+import com.azure.resourcemanager.network.generated.models.DscpConfigurations;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorizations;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnections;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeerings;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuits;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteConnections;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeerings;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnections;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteGateways;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteLinks;
+import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizations;
+import com.azure.resourcemanager.network.generated.models.ExpressRoutePorts;
+import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocations;
+import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviders;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicies;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignatures;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesFilterValues;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesOverrides;
+import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroups;
+import com.azure.resourcemanager.network.generated.models.FlowLogs;
+import com.azure.resourcemanager.network.generated.models.HubRouteTables;
+import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnections;
+import com.azure.resourcemanager.network.generated.models.InboundNatRules;
+import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleOperations;
+import com.azure.resourcemanager.network.generated.models.IpAllocations;
+import com.azure.resourcemanager.network.generated.models.IpGroups;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddressPools;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerFrontendIpConfigurations;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerLoadBalancingRules;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerNetworkInterfaces;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRules;
+import com.azure.resourcemanager.network.generated.models.LoadBalancerProbes;
+import com.azure.resourcemanager.network.generated.models.LoadBalancers;
+import com.azure.resourcemanager.network.generated.models.LocalNetworkGateways;
+import com.azure.resourcemanager.network.generated.models.NatGateways;
+import com.azure.resourcemanager.network.generated.models.NatRules;
+import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurations;
+import com.azure.resourcemanager.network.generated.models.NetworkInterfaceLoadBalancers;
+import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurations;
+import com.azure.resourcemanager.network.generated.models.NetworkInterfaces;
+import com.azure.resourcemanager.network.generated.models.NetworkProfiles;
+import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroups;
+import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances;
+import com.azure.resourcemanager.network.generated.models.NetworkWatchers;
+import com.azure.resourcemanager.network.generated.models.Operations;
+import com.azure.resourcemanager.network.generated.models.P2SVpnGateways;
+import com.azure.resourcemanager.network.generated.models.PacketCaptures;
+import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnections;
+import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroups;
+import com.azure.resourcemanager.network.generated.models.PrivateEndpoints;
+import com.azure.resourcemanager.network.generated.models.PrivateLinkServices;
+import com.azure.resourcemanager.network.generated.models.PublicIpAddresses;
+import com.azure.resourcemanager.network.generated.models.PublicIpPrefixes;
+import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinks;
+import com.azure.resourcemanager.network.generated.models.ResourceProviders;
+import com.azure.resourcemanager.network.generated.models.RouteFilterRules;
+import com.azure.resourcemanager.network.generated.models.RouteFilters;
+import com.azure.resourcemanager.network.generated.models.RouteTables;
+import com.azure.resourcemanager.network.generated.models.Routes;
+import com.azure.resourcemanager.network.generated.models.RoutingIntents;
+import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviders;
+import com.azure.resourcemanager.network.generated.models.SecurityRules;
+import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinks;
+import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicies;
+import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinitions;
+import com.azure.resourcemanager.network.generated.models.ServiceTagInformations;
+import com.azure.resourcemanager.network.generated.models.ServiceTags;
+import com.azure.resourcemanager.network.generated.models.Subnets;
+import com.azure.resourcemanager.network.generated.models.Usages;
+import com.azure.resourcemanager.network.generated.models.VirtualApplianceSites;
+import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkus;
+import com.azure.resourcemanager.network.generated.models.VirtualHubBgpConnections;
+import com.azure.resourcemanager.network.generated.models.VirtualHubIpConfigurations;
+import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2S;
+import com.azure.resourcemanager.network.generated.models.VirtualHubs;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnections;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRules;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateways;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeerings;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworkTaps;
+import com.azure.resourcemanager.network.generated.models.VirtualNetworks;
+import com.azure.resourcemanager.network.generated.models.VirtualRouterPeerings;
+import com.azure.resourcemanager.network.generated.models.VirtualRouters;
+import com.azure.resourcemanager.network.generated.models.VirtualWans;
+import com.azure.resourcemanager.network.generated.models.VpnConnections;
+import com.azure.resourcemanager.network.generated.models.VpnGateways;
+import com.azure.resourcemanager.network.generated.models.VpnLinkConnections;
+import com.azure.resourcemanager.network.generated.models.VpnServerConfigurations;
+import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsAssociatedWithVirtualWans;
+import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnections;
+import com.azure.resourcemanager.network.generated.models.VpnSiteLinks;
+import com.azure.resourcemanager.network.generated.models.VpnSites;
+import com.azure.resourcemanager.network.generated.models.VpnSitesConfigurations;
+import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicies;
+import com.azure.resourcemanager.network.generated.models.WebCategories;
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/** Entry point to NetworkManager. Network Client. */
+public final class NetworkManager {
+ private ApplicationGateways applicationGateways;
+
+ private ApplicationGatewayPrivateLinkResources applicationGatewayPrivateLinkResources;
+
+ private ApplicationGatewayPrivateEndpointConnections applicationGatewayPrivateEndpointConnections;
+
+ private ApplicationSecurityGroups applicationSecurityGroups;
+
+ private AvailableDelegations availableDelegations;
+
+ private AvailableResourceGroupDelegations availableResourceGroupDelegations;
+
+ private AvailableServiceAliases availableServiceAliases;
+
+ private AzureFirewalls azureFirewalls;
+
+ private AzureFirewallFqdnTags azureFirewallFqdnTags;
+
+ private WebCategories webCategories;
+
+ private BastionHosts bastionHosts;
+
+ private ResourceProviders resourceProviders;
+
+ private NetworkInterfaces networkInterfaces;
+
+ private PublicIpAddresses publicIpAddresses;
+
+ private CustomIpPrefixes customIpPrefixes;
+
+ private DdosCustomPolicies ddosCustomPolicies;
+
+ private DdosProtectionPlans ddosProtectionPlans;
+
+ private DscpConfigurations dscpConfigurations;
+
+ private AvailableEndpointServices availableEndpointServices;
+
+ private ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations;
+
+ private ExpressRouteCircuitPeerings expressRouteCircuitPeerings;
+
+ private ExpressRouteCircuitConnections expressRouteCircuitConnections;
+
+ private PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections;
+
+ private ExpressRouteCircuits expressRouteCircuits;
+
+ private ExpressRouteServiceProviders expressRouteServiceProviders;
+
+ private ExpressRouteCrossConnections expressRouteCrossConnections;
+
+ private ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings;
+
+ private ExpressRoutePortsLocations expressRoutePortsLocations;
+
+ private ExpressRoutePorts expressRoutePorts;
+
+ private ExpressRouteLinks expressRouteLinks;
+
+ private ExpressRoutePortAuthorizations expressRoutePortAuthorizations;
+
+ private FirewallPolicies firewallPolicies;
+
+ private FirewallPolicyRuleCollectionGroups firewallPolicyRuleCollectionGroups;
+
+ private FirewallPolicyIdpsSignatures firewallPolicyIdpsSignatures;
+
+ private FirewallPolicyIdpsSignaturesOverrides firewallPolicyIdpsSignaturesOverrides;
+
+ private FirewallPolicyIdpsSignaturesFilterValues firewallPolicyIdpsSignaturesFilterValues;
+
+ private IpAllocations ipAllocations;
+
+ private IpGroups ipGroups;
+
+ private LoadBalancers loadBalancers;
+
+ private LoadBalancerBackendAddressPools loadBalancerBackendAddressPools;
+
+ private LoadBalancerFrontendIpConfigurations loadBalancerFrontendIpConfigurations;
+
+ private InboundNatRules inboundNatRules;
+
+ private LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules;
+
+ private LoadBalancerOutboundRules loadBalancerOutboundRules;
+
+ private LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces;
+
+ private LoadBalancerProbes loadBalancerProbes;
+
+ private NatGateways natGateways;
+
+ private NetworkInterfaceIpConfigurations networkInterfaceIpConfigurations;
+
+ private NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers;
+
+ private NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations;
+
+ private NetworkProfiles networkProfiles;
+
+ private NetworkSecurityGroups networkSecurityGroups;
+
+ private SecurityRules securityRules;
+
+ private DefaultSecurityRules defaultSecurityRules;
+
+ private NetworkVirtualAppliances networkVirtualAppliances;
+
+ private VirtualApplianceSites virtualApplianceSites;
+
+ private VirtualApplianceSkus virtualApplianceSkus;
+
+ private InboundSecurityRuleOperations inboundSecurityRuleOperations;
+
+ private NetworkWatchers networkWatchers;
+
+ private PacketCaptures packetCaptures;
+
+ private ConnectionMonitors connectionMonitors;
+
+ private FlowLogs flowLogs;
+
+ private Operations operations;
+
+ private PrivateEndpoints privateEndpoints;
+
+ private AvailablePrivateEndpointTypes availablePrivateEndpointTypes;
+
+ private PrivateDnsZoneGroups privateDnsZoneGroups;
+
+ private PrivateLinkServices privateLinkServices;
+
+ private PublicIpPrefixes publicIpPrefixes;
+
+ private RouteFilters routeFilters;
+
+ private RouteFilterRules routeFilterRules;
+
+ private RouteTables routeTables;
+
+ private Routes routes;
+
+ private SecurityPartnerProviders securityPartnerProviders;
+
+ private BgpServiceCommunities bgpServiceCommunities;
+
+ private ServiceEndpointPolicies serviceEndpointPolicies;
+
+ private ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions;
+
+ private ServiceTags serviceTags;
+
+ private ServiceTagInformations serviceTagInformations;
+
+ private Usages usages;
+
+ private VirtualNetworks virtualNetworks;
+
+ private Subnets subnets;
+
+ private ResourceNavigationLinks resourceNavigationLinks;
+
+ private ServiceAssociationLinks serviceAssociationLinks;
+
+ private VirtualNetworkPeerings virtualNetworkPeerings;
+
+ private VirtualNetworkGateways virtualNetworkGateways;
+
+ private VirtualNetworkGatewayConnections virtualNetworkGatewayConnections;
+
+ private LocalNetworkGateways localNetworkGateways;
+
+ private VirtualNetworkGatewayNatRules virtualNetworkGatewayNatRules;
+
+ private VirtualNetworkTaps virtualNetworkTaps;
+
+ private VirtualRouters virtualRouters;
+
+ private VirtualRouterPeerings virtualRouterPeerings;
+
+ private VirtualWans virtualWans;
+
+ private VpnSites vpnSites;
+
+ private VpnSiteLinks vpnSiteLinks;
+
+ private VpnSitesConfigurations vpnSitesConfigurations;
+
+ private VpnServerConfigurations vpnServerConfigurations;
+
+ private VirtualHubs virtualHubs;
+
+ private HubVirtualNetworkConnections hubVirtualNetworkConnections;
+
+ private VpnGateways vpnGateways;
+
+ private VpnLinkConnections vpnLinkConnections;
+
+ private VpnConnections vpnConnections;
+
+ private VpnSiteLinkConnections vpnSiteLinkConnections;
+
+ private NatRules natRules;
+
+ private P2SVpnGateways p2SVpnGateways;
+
+ private VpnServerConfigurationsAssociatedWithVirtualWans vpnServerConfigurationsAssociatedWithVirtualWans;
+
+ private VirtualHubRouteTableV2S virtualHubRouteTableV2S;
+
+ private ExpressRouteGateways expressRouteGateways;
+
+ private ExpressRouteConnections expressRouteConnections;
+
+ private VirtualHubBgpConnections virtualHubBgpConnections;
+
+ private VirtualHubIpConfigurations virtualHubIpConfigurations;
+
+ private HubRouteTables hubRouteTables;
+
+ private RoutingIntents routingIntents;
+
+ private WebApplicationFirewallPolicies webApplicationFirewallPolicies;
+
+ private final NetworkManagementClient clientObject;
+
+ private NetworkManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ this.clientObject =
+ new NetworkManagementClientBuilder()
+ .pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval)
+ .buildClient();
+ }
+
+ /**
+ * Creates an instance of Network service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Network service API instance.
+ */
+ public static NetworkManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return configure().authenticate(credential, profile);
+ }
+
+ /**
+ * Gets a Configurable instance that can be used to create NetworkManager with optional configuration.
+ *
+ * @return the Configurable instance allowing configurations.
+ */
+ public static Configurable configure() {
+ return new NetworkManager.Configurable();
+ }
+
+ /** The Configurable allowing configurations to be set. */
+ public static final class Configurable {
+ private final ClientLogger logger = new ClientLogger(Configurable.class);
+
+ private HttpClient httpClient;
+ private HttpLogOptions httpLogOptions;
+ private final List policies = new ArrayList<>();
+ private final List scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of Network service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Network service API instance.
+ */
+ public NetworkManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.network.generated")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new NetworkManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /** @return Resource collection API of ApplicationGateways. */
+ public ApplicationGateways applicationGateways() {
+ if (this.applicationGateways == null) {
+ this.applicationGateways = new ApplicationGatewaysImpl(clientObject.getApplicationGateways(), this);
+ }
+ return applicationGateways;
+ }
+
+ /** @return Resource collection API of ApplicationGatewayPrivateLinkResources. */
+ public ApplicationGatewayPrivateLinkResources applicationGatewayPrivateLinkResources() {
+ if (this.applicationGatewayPrivateLinkResources == null) {
+ this.applicationGatewayPrivateLinkResources =
+ new ApplicationGatewayPrivateLinkResourcesImpl(
+ clientObject.getApplicationGatewayPrivateLinkResources(), this);
+ }
+ return applicationGatewayPrivateLinkResources;
+ }
+
+ /** @return Resource collection API of ApplicationGatewayPrivateEndpointConnections. */
+ public ApplicationGatewayPrivateEndpointConnections applicationGatewayPrivateEndpointConnections() {
+ if (this.applicationGatewayPrivateEndpointConnections == null) {
+ this.applicationGatewayPrivateEndpointConnections =
+ new ApplicationGatewayPrivateEndpointConnectionsImpl(
+ clientObject.getApplicationGatewayPrivateEndpointConnections(), this);
+ }
+ return applicationGatewayPrivateEndpointConnections;
+ }
+
+ /** @return Resource collection API of ApplicationSecurityGroups. */
+ public ApplicationSecurityGroups applicationSecurityGroups() {
+ if (this.applicationSecurityGroups == null) {
+ this.applicationSecurityGroups =
+ new ApplicationSecurityGroupsImpl(clientObject.getApplicationSecurityGroups(), this);
+ }
+ return applicationSecurityGroups;
+ }
+
+ /** @return Resource collection API of AvailableDelegations. */
+ public AvailableDelegations availableDelegations() {
+ if (this.availableDelegations == null) {
+ this.availableDelegations = new AvailableDelegationsImpl(clientObject.getAvailableDelegations(), this);
+ }
+ return availableDelegations;
+ }
+
+ /** @return Resource collection API of AvailableResourceGroupDelegations. */
+ public AvailableResourceGroupDelegations availableResourceGroupDelegations() {
+ if (this.availableResourceGroupDelegations == null) {
+ this.availableResourceGroupDelegations =
+ new AvailableResourceGroupDelegationsImpl(clientObject.getAvailableResourceGroupDelegations(), this);
+ }
+ return availableResourceGroupDelegations;
+ }
+
+ /** @return Resource collection API of AvailableServiceAliases. */
+ public AvailableServiceAliases availableServiceAliases() {
+ if (this.availableServiceAliases == null) {
+ this.availableServiceAliases =
+ new AvailableServiceAliasesImpl(clientObject.getAvailableServiceAliases(), this);
+ }
+ return availableServiceAliases;
+ }
+
+ /** @return Resource collection API of AzureFirewalls. */
+ public AzureFirewalls azureFirewalls() {
+ if (this.azureFirewalls == null) {
+ this.azureFirewalls = new AzureFirewallsImpl(clientObject.getAzureFirewalls(), this);
+ }
+ return azureFirewalls;
+ }
+
+ /** @return Resource collection API of AzureFirewallFqdnTags. */
+ public AzureFirewallFqdnTags azureFirewallFqdnTags() {
+ if (this.azureFirewallFqdnTags == null) {
+ this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsImpl(clientObject.getAzureFirewallFqdnTags(), this);
+ }
+ return azureFirewallFqdnTags;
+ }
+
+ /** @return Resource collection API of WebCategories. */
+ public WebCategories webCategories() {
+ if (this.webCategories == null) {
+ this.webCategories = new WebCategoriesImpl(clientObject.getWebCategories(), this);
+ }
+ return webCategories;
+ }
+
+ /** @return Resource collection API of BastionHosts. */
+ public BastionHosts bastionHosts() {
+ if (this.bastionHosts == null) {
+ this.bastionHosts = new BastionHostsImpl(clientObject.getBastionHosts(), this);
+ }
+ return bastionHosts;
+ }
+
+ /** @return Resource collection API of ResourceProviders. */
+ public ResourceProviders resourceProviders() {
+ if (this.resourceProviders == null) {
+ this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this);
+ }
+ return resourceProviders;
+ }
+
+ /** @return Resource collection API of NetworkInterfaces. */
+ public NetworkInterfaces networkInterfaces() {
+ if (this.networkInterfaces == null) {
+ this.networkInterfaces = new NetworkInterfacesImpl(clientObject.getNetworkInterfaces(), this);
+ }
+ return networkInterfaces;
+ }
+
+ /** @return Resource collection API of PublicIpAddresses. */
+ public PublicIpAddresses publicIpAddresses() {
+ if (this.publicIpAddresses == null) {
+ this.publicIpAddresses = new PublicIpAddressesImpl(clientObject.getPublicIpAddresses(), this);
+ }
+ return publicIpAddresses;
+ }
+
+ /** @return Resource collection API of CustomIpPrefixes. */
+ public CustomIpPrefixes customIpPrefixes() {
+ if (this.customIpPrefixes == null) {
+ this.customIpPrefixes = new CustomIpPrefixesImpl(clientObject.getCustomIpPrefixes(), this);
+ }
+ return customIpPrefixes;
+ }
+
+ /** @return Resource collection API of DdosCustomPolicies. */
+ public DdosCustomPolicies ddosCustomPolicies() {
+ if (this.ddosCustomPolicies == null) {
+ this.ddosCustomPolicies = new DdosCustomPoliciesImpl(clientObject.getDdosCustomPolicies(), this);
+ }
+ return ddosCustomPolicies;
+ }
+
+ /** @return Resource collection API of DdosProtectionPlans. */
+ public DdosProtectionPlans ddosProtectionPlans() {
+ if (this.ddosProtectionPlans == null) {
+ this.ddosProtectionPlans = new DdosProtectionPlansImpl(clientObject.getDdosProtectionPlans(), this);
+ }
+ return ddosProtectionPlans;
+ }
+
+ /** @return Resource collection API of DscpConfigurations. */
+ public DscpConfigurations dscpConfigurations() {
+ if (this.dscpConfigurations == null) {
+ this.dscpConfigurations = new DscpConfigurationsImpl(clientObject.getDscpConfigurations(), this);
+ }
+ return dscpConfigurations;
+ }
+
+ /** @return Resource collection API of AvailableEndpointServices. */
+ public AvailableEndpointServices availableEndpointServices() {
+ if (this.availableEndpointServices == null) {
+ this.availableEndpointServices =
+ new AvailableEndpointServicesImpl(clientObject.getAvailableEndpointServices(), this);
+ }
+ return availableEndpointServices;
+ }
+
+ /** @return Resource collection API of ExpressRouteCircuitAuthorizations. */
+ public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() {
+ if (this.expressRouteCircuitAuthorizations == null) {
+ this.expressRouteCircuitAuthorizations =
+ new ExpressRouteCircuitAuthorizationsImpl(clientObject.getExpressRouteCircuitAuthorizations(), this);
+ }
+ return expressRouteCircuitAuthorizations;
+ }
+
+ /** @return Resource collection API of ExpressRouteCircuitPeerings. */
+ public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() {
+ if (this.expressRouteCircuitPeerings == null) {
+ this.expressRouteCircuitPeerings =
+ new ExpressRouteCircuitPeeringsImpl(clientObject.getExpressRouteCircuitPeerings(), this);
+ }
+ return expressRouteCircuitPeerings;
+ }
+
+ /** @return Resource collection API of ExpressRouteCircuitConnections. */
+ public ExpressRouteCircuitConnections expressRouteCircuitConnections() {
+ if (this.expressRouteCircuitConnections == null) {
+ this.expressRouteCircuitConnections =
+ new ExpressRouteCircuitConnectionsImpl(clientObject.getExpressRouteCircuitConnections(), this);
+ }
+ return expressRouteCircuitConnections;
+ }
+
+ /** @return Resource collection API of PeerExpressRouteCircuitConnections. */
+ public PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections() {
+ if (this.peerExpressRouteCircuitConnections == null) {
+ this.peerExpressRouteCircuitConnections =
+ new PeerExpressRouteCircuitConnectionsImpl(clientObject.getPeerExpressRouteCircuitConnections(), this);
+ }
+ return peerExpressRouteCircuitConnections;
+ }
+
+ /** @return Resource collection API of ExpressRouteCircuits. */
+ public ExpressRouteCircuits expressRouteCircuits() {
+ if (this.expressRouteCircuits == null) {
+ this.expressRouteCircuits = new ExpressRouteCircuitsImpl(clientObject.getExpressRouteCircuits(), this);
+ }
+ return expressRouteCircuits;
+ }
+
+ /** @return Resource collection API of ExpressRouteServiceProviders. */
+ public ExpressRouteServiceProviders expressRouteServiceProviders() {
+ if (this.expressRouteServiceProviders == null) {
+ this.expressRouteServiceProviders =
+ new ExpressRouteServiceProvidersImpl(clientObject.getExpressRouteServiceProviders(), this);
+ }
+ return expressRouteServiceProviders;
+ }
+
+ /** @return Resource collection API of ExpressRouteCrossConnections. */
+ public ExpressRouteCrossConnections expressRouteCrossConnections() {
+ if (this.expressRouteCrossConnections == null) {
+ this.expressRouteCrossConnections =
+ new ExpressRouteCrossConnectionsImpl(clientObject.getExpressRouteCrossConnections(), this);
+ }
+ return expressRouteCrossConnections;
+ }
+
+ /** @return Resource collection API of ExpressRouteCrossConnectionPeerings. */
+ public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() {
+ if (this.expressRouteCrossConnectionPeerings == null) {
+ this.expressRouteCrossConnectionPeerings =
+ new ExpressRouteCrossConnectionPeeringsImpl(
+ clientObject.getExpressRouteCrossConnectionPeerings(), this);
+ }
+ return expressRouteCrossConnectionPeerings;
+ }
+
+ /** @return Resource collection API of ExpressRoutePortsLocations. */
+ public ExpressRoutePortsLocations expressRoutePortsLocations() {
+ if (this.expressRoutePortsLocations == null) {
+ this.expressRoutePortsLocations =
+ new ExpressRoutePortsLocationsImpl(clientObject.getExpressRoutePortsLocations(), this);
+ }
+ return expressRoutePortsLocations;
+ }
+
+ /** @return Resource collection API of ExpressRoutePorts. */
+ public ExpressRoutePorts expressRoutePorts() {
+ if (this.expressRoutePorts == null) {
+ this.expressRoutePorts = new ExpressRoutePortsImpl(clientObject.getExpressRoutePorts(), this);
+ }
+ return expressRoutePorts;
+ }
+
+ /** @return Resource collection API of ExpressRouteLinks. */
+ public ExpressRouteLinks expressRouteLinks() {
+ if (this.expressRouteLinks == null) {
+ this.expressRouteLinks = new ExpressRouteLinksImpl(clientObject.getExpressRouteLinks(), this);
+ }
+ return expressRouteLinks;
+ }
+
+ /** @return Resource collection API of ExpressRoutePortAuthorizations. */
+ public ExpressRoutePortAuthorizations expressRoutePortAuthorizations() {
+ if (this.expressRoutePortAuthorizations == null) {
+ this.expressRoutePortAuthorizations =
+ new ExpressRoutePortAuthorizationsImpl(clientObject.getExpressRoutePortAuthorizations(), this);
+ }
+ return expressRoutePortAuthorizations;
+ }
+
+ /** @return Resource collection API of FirewallPolicies. */
+ public FirewallPolicies firewallPolicies() {
+ if (this.firewallPolicies == null) {
+ this.firewallPolicies = new FirewallPoliciesImpl(clientObject.getFirewallPolicies(), this);
+ }
+ return firewallPolicies;
+ }
+
+ /** @return Resource collection API of FirewallPolicyRuleCollectionGroups. */
+ public FirewallPolicyRuleCollectionGroups firewallPolicyRuleCollectionGroups() {
+ if (this.firewallPolicyRuleCollectionGroups == null) {
+ this.firewallPolicyRuleCollectionGroups =
+ new FirewallPolicyRuleCollectionGroupsImpl(clientObject.getFirewallPolicyRuleCollectionGroups(), this);
+ }
+ return firewallPolicyRuleCollectionGroups;
+ }
+
+ /** @return Resource collection API of FirewallPolicyIdpsSignatures. */
+ public FirewallPolicyIdpsSignatures firewallPolicyIdpsSignatures() {
+ if (this.firewallPolicyIdpsSignatures == null) {
+ this.firewallPolicyIdpsSignatures =
+ new FirewallPolicyIdpsSignaturesImpl(clientObject.getFirewallPolicyIdpsSignatures(), this);
+ }
+ return firewallPolicyIdpsSignatures;
+ }
+
+ /** @return Resource collection API of FirewallPolicyIdpsSignaturesOverrides. */
+ public FirewallPolicyIdpsSignaturesOverrides firewallPolicyIdpsSignaturesOverrides() {
+ if (this.firewallPolicyIdpsSignaturesOverrides == null) {
+ this.firewallPolicyIdpsSignaturesOverrides =
+ new FirewallPolicyIdpsSignaturesOverridesImpl(
+ clientObject.getFirewallPolicyIdpsSignaturesOverrides(), this);
+ }
+ return firewallPolicyIdpsSignaturesOverrides;
+ }
+
+ /** @return Resource collection API of FirewallPolicyIdpsSignaturesFilterValues. */
+ public FirewallPolicyIdpsSignaturesFilterValues firewallPolicyIdpsSignaturesFilterValues() {
+ if (this.firewallPolicyIdpsSignaturesFilterValues == null) {
+ this.firewallPolicyIdpsSignaturesFilterValues =
+ new FirewallPolicyIdpsSignaturesFilterValuesImpl(
+ clientObject.getFirewallPolicyIdpsSignaturesFilterValues(), this);
+ }
+ return firewallPolicyIdpsSignaturesFilterValues;
+ }
+
+ /** @return Resource collection API of IpAllocations. */
+ public IpAllocations ipAllocations() {
+ if (this.ipAllocations == null) {
+ this.ipAllocations = new IpAllocationsImpl(clientObject.getIpAllocations(), this);
+ }
+ return ipAllocations;
+ }
+
+ /** @return Resource collection API of IpGroups. */
+ public IpGroups ipGroups() {
+ if (this.ipGroups == null) {
+ this.ipGroups = new IpGroupsImpl(clientObject.getIpGroups(), this);
+ }
+ return ipGroups;
+ }
+
+ /** @return Resource collection API of LoadBalancers. */
+ public LoadBalancers loadBalancers() {
+ if (this.loadBalancers == null) {
+ this.loadBalancers = new LoadBalancersImpl(clientObject.getLoadBalancers(), this);
+ }
+ return loadBalancers;
+ }
+
+ /** @return Resource collection API of LoadBalancerBackendAddressPools. */
+ public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() {
+ if (this.loadBalancerBackendAddressPools == null) {
+ this.loadBalancerBackendAddressPools =
+ new LoadBalancerBackendAddressPoolsImpl(clientObject.getLoadBalancerBackendAddressPools(), this);
+ }
+ return loadBalancerBackendAddressPools;
+ }
+
+ /** @return Resource collection API of LoadBalancerFrontendIpConfigurations. */
+ public LoadBalancerFrontendIpConfigurations loadBalancerFrontendIpConfigurations() {
+ if (this.loadBalancerFrontendIpConfigurations == null) {
+ this.loadBalancerFrontendIpConfigurations =
+ new LoadBalancerFrontendIpConfigurationsImpl(
+ clientObject.getLoadBalancerFrontendIpConfigurations(), this);
+ }
+ return loadBalancerFrontendIpConfigurations;
+ }
+
+ /** @return Resource collection API of InboundNatRules. */
+ public InboundNatRules inboundNatRules() {
+ if (this.inboundNatRules == null) {
+ this.inboundNatRules = new InboundNatRulesImpl(clientObject.getInboundNatRules(), this);
+ }
+ return inboundNatRules;
+ }
+
+ /** @return Resource collection API of LoadBalancerLoadBalancingRules. */
+ public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() {
+ if (this.loadBalancerLoadBalancingRules == null) {
+ this.loadBalancerLoadBalancingRules =
+ new LoadBalancerLoadBalancingRulesImpl(clientObject.getLoadBalancerLoadBalancingRules(), this);
+ }
+ return loadBalancerLoadBalancingRules;
+ }
+
+ /** @return Resource collection API of LoadBalancerOutboundRules. */
+ public LoadBalancerOutboundRules loadBalancerOutboundRules() {
+ if (this.loadBalancerOutboundRules == null) {
+ this.loadBalancerOutboundRules =
+ new LoadBalancerOutboundRulesImpl(clientObject.getLoadBalancerOutboundRules(), this);
+ }
+ return loadBalancerOutboundRules;
+ }
+
+ /** @return Resource collection API of LoadBalancerNetworkInterfaces. */
+ public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() {
+ if (this.loadBalancerNetworkInterfaces == null) {
+ this.loadBalancerNetworkInterfaces =
+ new LoadBalancerNetworkInterfacesImpl(clientObject.getLoadBalancerNetworkInterfaces(), this);
+ }
+ return loadBalancerNetworkInterfaces;
+ }
+
+ /** @return Resource collection API of LoadBalancerProbes. */
+ public LoadBalancerProbes loadBalancerProbes() {
+ if (this.loadBalancerProbes == null) {
+ this.loadBalancerProbes = new LoadBalancerProbesImpl(clientObject.getLoadBalancerProbes(), this);
+ }
+ return loadBalancerProbes;
+ }
+
+ /** @return Resource collection API of NatGateways. */
+ public NatGateways natGateways() {
+ if (this.natGateways == null) {
+ this.natGateways = new NatGatewaysImpl(clientObject.getNatGateways(), this);
+ }
+ return natGateways;
+ }
+
+ /** @return Resource collection API of NetworkInterfaceIpConfigurations. */
+ public NetworkInterfaceIpConfigurations networkInterfaceIpConfigurations() {
+ if (this.networkInterfaceIpConfigurations == null) {
+ this.networkInterfaceIpConfigurations =
+ new NetworkInterfaceIpConfigurationsImpl(clientObject.getNetworkInterfaceIpConfigurations(), this);
+ }
+ return networkInterfaceIpConfigurations;
+ }
+
+ /** @return Resource collection API of NetworkInterfaceLoadBalancers. */
+ public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() {
+ if (this.networkInterfaceLoadBalancers == null) {
+ this.networkInterfaceLoadBalancers =
+ new NetworkInterfaceLoadBalancersImpl(clientObject.getNetworkInterfaceLoadBalancers(), this);
+ }
+ return networkInterfaceLoadBalancers;
+ }
+
+ /** @return Resource collection API of NetworkInterfaceTapConfigurations. */
+ public NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations() {
+ if (this.networkInterfaceTapConfigurations == null) {
+ this.networkInterfaceTapConfigurations =
+ new NetworkInterfaceTapConfigurationsImpl(clientObject.getNetworkInterfaceTapConfigurations(), this);
+ }
+ return networkInterfaceTapConfigurations;
+ }
+
+ /** @return Resource collection API of NetworkProfiles. */
+ public NetworkProfiles networkProfiles() {
+ if (this.networkProfiles == null) {
+ this.networkProfiles = new NetworkProfilesImpl(clientObject.getNetworkProfiles(), this);
+ }
+ return networkProfiles;
+ }
+
+ /** @return Resource collection API of NetworkSecurityGroups. */
+ public NetworkSecurityGroups networkSecurityGroups() {
+ if (this.networkSecurityGroups == null) {
+ this.networkSecurityGroups = new NetworkSecurityGroupsImpl(clientObject.getNetworkSecurityGroups(), this);
+ }
+ return networkSecurityGroups;
+ }
+
+ /** @return Resource collection API of SecurityRules. */
+ public SecurityRules securityRules() {
+ if (this.securityRules == null) {
+ this.securityRules = new SecurityRulesImpl(clientObject.getSecurityRules(), this);
+ }
+ return securityRules;
+ }
+
+ /** @return Resource collection API of DefaultSecurityRules. */
+ public DefaultSecurityRules defaultSecurityRules() {
+ if (this.defaultSecurityRules == null) {
+ this.defaultSecurityRules = new DefaultSecurityRulesImpl(clientObject.getDefaultSecurityRules(), this);
+ }
+ return defaultSecurityRules;
+ }
+
+ /** @return Resource collection API of NetworkVirtualAppliances. */
+ public NetworkVirtualAppliances networkVirtualAppliances() {
+ if (this.networkVirtualAppliances == null) {
+ this.networkVirtualAppliances =
+ new NetworkVirtualAppliancesImpl(clientObject.getNetworkVirtualAppliances(), this);
+ }
+ return networkVirtualAppliances;
+ }
+
+ /** @return Resource collection API of VirtualApplianceSites. */
+ public VirtualApplianceSites virtualApplianceSites() {
+ if (this.virtualApplianceSites == null) {
+ this.virtualApplianceSites = new VirtualApplianceSitesImpl(clientObject.getVirtualApplianceSites(), this);
+ }
+ return virtualApplianceSites;
+ }
+
+ /** @return Resource collection API of VirtualApplianceSkus. */
+ public VirtualApplianceSkus virtualApplianceSkus() {
+ if (this.virtualApplianceSkus == null) {
+ this.virtualApplianceSkus = new VirtualApplianceSkusImpl(clientObject.getVirtualApplianceSkus(), this);
+ }
+ return virtualApplianceSkus;
+ }
+
+ /** @return Resource collection API of InboundSecurityRuleOperations. */
+ public InboundSecurityRuleOperations inboundSecurityRuleOperations() {
+ if (this.inboundSecurityRuleOperations == null) {
+ this.inboundSecurityRuleOperations =
+ new InboundSecurityRuleOperationsImpl(clientObject.getInboundSecurityRuleOperations(), this);
+ }
+ return inboundSecurityRuleOperations;
+ }
+
+ /** @return Resource collection API of NetworkWatchers. */
+ public NetworkWatchers networkWatchers() {
+ if (this.networkWatchers == null) {
+ this.networkWatchers = new NetworkWatchersImpl(clientObject.getNetworkWatchers(), this);
+ }
+ return networkWatchers;
+ }
+
+ /** @return Resource collection API of PacketCaptures. */
+ public PacketCaptures packetCaptures() {
+ if (this.packetCaptures == null) {
+ this.packetCaptures = new PacketCapturesImpl(clientObject.getPacketCaptures(), this);
+ }
+ return packetCaptures;
+ }
+
+ /** @return Resource collection API of ConnectionMonitors. */
+ public ConnectionMonitors connectionMonitors() {
+ if (this.connectionMonitors == null) {
+ this.connectionMonitors = new ConnectionMonitorsImpl(clientObject.getConnectionMonitors(), this);
+ }
+ return connectionMonitors;
+ }
+
+ /** @return Resource collection API of FlowLogs. */
+ public FlowLogs flowLogs() {
+ if (this.flowLogs == null) {
+ this.flowLogs = new FlowLogsImpl(clientObject.getFlowLogs(), this);
+ }
+ return flowLogs;
+ }
+
+ /** @return Resource collection API of Operations. */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /** @return Resource collection API of PrivateEndpoints. */
+ public PrivateEndpoints privateEndpoints() {
+ if (this.privateEndpoints == null) {
+ this.privateEndpoints = new PrivateEndpointsImpl(clientObject.getPrivateEndpoints(), this);
+ }
+ return privateEndpoints;
+ }
+
+ /** @return Resource collection API of AvailablePrivateEndpointTypes. */
+ public AvailablePrivateEndpointTypes availablePrivateEndpointTypes() {
+ if (this.availablePrivateEndpointTypes == null) {
+ this.availablePrivateEndpointTypes =
+ new AvailablePrivateEndpointTypesImpl(clientObject.getAvailablePrivateEndpointTypes(), this);
+ }
+ return availablePrivateEndpointTypes;
+ }
+
+ /** @return Resource collection API of PrivateDnsZoneGroups. */
+ public PrivateDnsZoneGroups privateDnsZoneGroups() {
+ if (this.privateDnsZoneGroups == null) {
+ this.privateDnsZoneGroups = new PrivateDnsZoneGroupsImpl(clientObject.getPrivateDnsZoneGroups(), this);
+ }
+ return privateDnsZoneGroups;
+ }
+
+ /** @return Resource collection API of PrivateLinkServices. */
+ public PrivateLinkServices privateLinkServices() {
+ if (this.privateLinkServices == null) {
+ this.privateLinkServices = new PrivateLinkServicesImpl(clientObject.getPrivateLinkServices(), this);
+ }
+ return privateLinkServices;
+ }
+
+ /** @return Resource collection API of PublicIpPrefixes. */
+ public PublicIpPrefixes publicIpPrefixes() {
+ if (this.publicIpPrefixes == null) {
+ this.publicIpPrefixes = new PublicIpPrefixesImpl(clientObject.getPublicIpPrefixes(), this);
+ }
+ return publicIpPrefixes;
+ }
+
+ /** @return Resource collection API of RouteFilters. */
+ public RouteFilters routeFilters() {
+ if (this.routeFilters == null) {
+ this.routeFilters = new RouteFiltersImpl(clientObject.getRouteFilters(), this);
+ }
+ return routeFilters;
+ }
+
+ /** @return Resource collection API of RouteFilterRules. */
+ public RouteFilterRules routeFilterRules() {
+ if (this.routeFilterRules == null) {
+ this.routeFilterRules = new RouteFilterRulesImpl(clientObject.getRouteFilterRules(), this);
+ }
+ return routeFilterRules;
+ }
+
+ /** @return Resource collection API of RouteTables. */
+ public RouteTables routeTables() {
+ if (this.routeTables == null) {
+ this.routeTables = new RouteTablesImpl(clientObject.getRouteTables(), this);
+ }
+ return routeTables;
+ }
+
+ /** @return Resource collection API of Routes. */
+ public Routes routes() {
+ if (this.routes == null) {
+ this.routes = new RoutesImpl(clientObject.getRoutes(), this);
+ }
+ return routes;
+ }
+
+ /** @return Resource collection API of SecurityPartnerProviders. */
+ public SecurityPartnerProviders securityPartnerProviders() {
+ if (this.securityPartnerProviders == null) {
+ this.securityPartnerProviders =
+ new SecurityPartnerProvidersImpl(clientObject.getSecurityPartnerProviders(), this);
+ }
+ return securityPartnerProviders;
+ }
+
+ /** @return Resource collection API of BgpServiceCommunities. */
+ public BgpServiceCommunities bgpServiceCommunities() {
+ if (this.bgpServiceCommunities == null) {
+ this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(clientObject.getBgpServiceCommunities(), this);
+ }
+ return bgpServiceCommunities;
+ }
+
+ /** @return Resource collection API of ServiceEndpointPolicies. */
+ public ServiceEndpointPolicies serviceEndpointPolicies() {
+ if (this.serviceEndpointPolicies == null) {
+ this.serviceEndpointPolicies =
+ new ServiceEndpointPoliciesImpl(clientObject.getServiceEndpointPolicies(), this);
+ }
+ return serviceEndpointPolicies;
+ }
+
+ /** @return Resource collection API of ServiceEndpointPolicyDefinitions. */
+ public ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions() {
+ if (this.serviceEndpointPolicyDefinitions == null) {
+ this.serviceEndpointPolicyDefinitions =
+ new ServiceEndpointPolicyDefinitionsImpl(clientObject.getServiceEndpointPolicyDefinitions(), this);
+ }
+ return serviceEndpointPolicyDefinitions;
+ }
+
+ /** @return Resource collection API of ServiceTags. */
+ public ServiceTags serviceTags() {
+ if (this.serviceTags == null) {
+ this.serviceTags = new ServiceTagsImpl(clientObject.getServiceTags(), this);
+ }
+ return serviceTags;
+ }
+
+ /** @return Resource collection API of ServiceTagInformations. */
+ public ServiceTagInformations serviceTagInformations() {
+ if (this.serviceTagInformations == null) {
+ this.serviceTagInformations =
+ new ServiceTagInformationsImpl(clientObject.getServiceTagInformations(), this);
+ }
+ return serviceTagInformations;
+ }
+
+ /** @return Resource collection API of Usages. */
+ public Usages usages() {
+ if (this.usages == null) {
+ this.usages = new UsagesImpl(clientObject.getUsages(), this);
+ }
+ return usages;
+ }
+
+ /** @return Resource collection API of VirtualNetworks. */
+ public VirtualNetworks virtualNetworks() {
+ if (this.virtualNetworks == null) {
+ this.virtualNetworks = new VirtualNetworksImpl(clientObject.getVirtualNetworks(), this);
+ }
+ return virtualNetworks;
+ }
+
+ /** @return Resource collection API of Subnets. */
+ public Subnets subnets() {
+ if (this.subnets == null) {
+ this.subnets = new SubnetsImpl(clientObject.getSubnets(), this);
+ }
+ return subnets;
+ }
+
+ /** @return Resource collection API of ResourceNavigationLinks. */
+ public ResourceNavigationLinks resourceNavigationLinks() {
+ if (this.resourceNavigationLinks == null) {
+ this.resourceNavigationLinks =
+ new ResourceNavigationLinksImpl(clientObject.getResourceNavigationLinks(), this);
+ }
+ return resourceNavigationLinks;
+ }
+
+ /** @return Resource collection API of ServiceAssociationLinks. */
+ public ServiceAssociationLinks serviceAssociationLinks() {
+ if (this.serviceAssociationLinks == null) {
+ this.serviceAssociationLinks =
+ new ServiceAssociationLinksImpl(clientObject.getServiceAssociationLinks(), this);
+ }
+ return serviceAssociationLinks;
+ }
+
+ /** @return Resource collection API of VirtualNetworkPeerings. */
+ public VirtualNetworkPeerings virtualNetworkPeerings() {
+ if (this.virtualNetworkPeerings == null) {
+ this.virtualNetworkPeerings =
+ new VirtualNetworkPeeringsImpl(clientObject.getVirtualNetworkPeerings(), this);
+ }
+ return virtualNetworkPeerings;
+ }
+
+ /** @return Resource collection API of VirtualNetworkGateways. */
+ public VirtualNetworkGateways virtualNetworkGateways() {
+ if (this.virtualNetworkGateways == null) {
+ this.virtualNetworkGateways =
+ new VirtualNetworkGatewaysImpl(clientObject.getVirtualNetworkGateways(), this);
+ }
+ return virtualNetworkGateways;
+ }
+
+ /** @return Resource collection API of VirtualNetworkGatewayConnections. */
+ public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() {
+ if (this.virtualNetworkGatewayConnections == null) {
+ this.virtualNetworkGatewayConnections =
+ new VirtualNetworkGatewayConnectionsImpl(clientObject.getVirtualNetworkGatewayConnections(), this);
+ }
+ return virtualNetworkGatewayConnections;
+ }
+
+ /** @return Resource collection API of LocalNetworkGateways. */
+ public LocalNetworkGateways localNetworkGateways() {
+ if (this.localNetworkGateways == null) {
+ this.localNetworkGateways = new LocalNetworkGatewaysImpl(clientObject.getLocalNetworkGateways(), this);
+ }
+ return localNetworkGateways;
+ }
+
+ /** @return Resource collection API of VirtualNetworkGatewayNatRules. */
+ public VirtualNetworkGatewayNatRules virtualNetworkGatewayNatRules() {
+ if (this.virtualNetworkGatewayNatRules == null) {
+ this.virtualNetworkGatewayNatRules =
+ new VirtualNetworkGatewayNatRulesImpl(clientObject.getVirtualNetworkGatewayNatRules(), this);
+ }
+ return virtualNetworkGatewayNatRules;
+ }
+
+ /** @return Resource collection API of VirtualNetworkTaps. */
+ public VirtualNetworkTaps virtualNetworkTaps() {
+ if (this.virtualNetworkTaps == null) {
+ this.virtualNetworkTaps = new VirtualNetworkTapsImpl(clientObject.getVirtualNetworkTaps(), this);
+ }
+ return virtualNetworkTaps;
+ }
+
+ /** @return Resource collection API of VirtualRouters. */
+ public VirtualRouters virtualRouters() {
+ if (this.virtualRouters == null) {
+ this.virtualRouters = new VirtualRoutersImpl(clientObject.getVirtualRouters(), this);
+ }
+ return virtualRouters;
+ }
+
+ /** @return Resource collection API of VirtualRouterPeerings. */
+ public VirtualRouterPeerings virtualRouterPeerings() {
+ if (this.virtualRouterPeerings == null) {
+ this.virtualRouterPeerings = new VirtualRouterPeeringsImpl(clientObject.getVirtualRouterPeerings(), this);
+ }
+ return virtualRouterPeerings;
+ }
+
+ /** @return Resource collection API of VirtualWans. */
+ public VirtualWans virtualWans() {
+ if (this.virtualWans == null) {
+ this.virtualWans = new VirtualWansImpl(clientObject.getVirtualWans(), this);
+ }
+ return virtualWans;
+ }
+
+ /** @return Resource collection API of VpnSites. */
+ public VpnSites vpnSites() {
+ if (this.vpnSites == null) {
+ this.vpnSites = new VpnSitesImpl(clientObject.getVpnSites(), this);
+ }
+ return vpnSites;
+ }
+
+ /** @return Resource collection API of VpnSiteLinks. */
+ public VpnSiteLinks vpnSiteLinks() {
+ if (this.vpnSiteLinks == null) {
+ this.vpnSiteLinks = new VpnSiteLinksImpl(clientObject.getVpnSiteLinks(), this);
+ }
+ return vpnSiteLinks;
+ }
+
+ /** @return Resource collection API of VpnSitesConfigurations. */
+ public VpnSitesConfigurations vpnSitesConfigurations() {
+ if (this.vpnSitesConfigurations == null) {
+ this.vpnSitesConfigurations =
+ new VpnSitesConfigurationsImpl(clientObject.getVpnSitesConfigurations(), this);
+ }
+ return vpnSitesConfigurations;
+ }
+
+ /** @return Resource collection API of VpnServerConfigurations. */
+ public VpnServerConfigurations vpnServerConfigurations() {
+ if (this.vpnServerConfigurations == null) {
+ this.vpnServerConfigurations =
+ new VpnServerConfigurationsImpl(clientObject.getVpnServerConfigurations(), this);
+ }
+ return vpnServerConfigurations;
+ }
+
+ /** @return Resource collection API of VirtualHubs. */
+ public VirtualHubs virtualHubs() {
+ if (this.virtualHubs == null) {
+ this.virtualHubs = new VirtualHubsImpl(clientObject.getVirtualHubs(), this);
+ }
+ return virtualHubs;
+ }
+
+ /** @return Resource collection API of HubVirtualNetworkConnections. */
+ public HubVirtualNetworkConnections hubVirtualNetworkConnections() {
+ if (this.hubVirtualNetworkConnections == null) {
+ this.hubVirtualNetworkConnections =
+ new HubVirtualNetworkConnectionsImpl(clientObject.getHubVirtualNetworkConnections(), this);
+ }
+ return hubVirtualNetworkConnections;
+ }
+
+ /** @return Resource collection API of VpnGateways. */
+ public VpnGateways vpnGateways() {
+ if (this.vpnGateways == null) {
+ this.vpnGateways = new VpnGatewaysImpl(clientObject.getVpnGateways(), this);
+ }
+ return vpnGateways;
+ }
+
+ /** @return Resource collection API of VpnLinkConnections. */
+ public VpnLinkConnections vpnLinkConnections() {
+ if (this.vpnLinkConnections == null) {
+ this.vpnLinkConnections = new VpnLinkConnectionsImpl(clientObject.getVpnLinkConnections(), this);
+ }
+ return vpnLinkConnections;
+ }
+
+ /** @return Resource collection API of VpnConnections. */
+ public VpnConnections vpnConnections() {
+ if (this.vpnConnections == null) {
+ this.vpnConnections = new VpnConnectionsImpl(clientObject.getVpnConnections(), this);
+ }
+ return vpnConnections;
+ }
+
+ /** @return Resource collection API of VpnSiteLinkConnections. */
+ public VpnSiteLinkConnections vpnSiteLinkConnections() {
+ if (this.vpnSiteLinkConnections == null) {
+ this.vpnSiteLinkConnections =
+ new VpnSiteLinkConnectionsImpl(clientObject.getVpnSiteLinkConnections(), this);
+ }
+ return vpnSiteLinkConnections;
+ }
+
+ /** @return Resource collection API of NatRules. */
+ public NatRules natRules() {
+ if (this.natRules == null) {
+ this.natRules = new NatRulesImpl(clientObject.getNatRules(), this);
+ }
+ return natRules;
+ }
+
+ /** @return Resource collection API of P2SVpnGateways. */
+ public P2SVpnGateways p2SVpnGateways() {
+ if (this.p2SVpnGateways == null) {
+ this.p2SVpnGateways = new P2SVpnGatewaysImpl(clientObject.getP2SVpnGateways(), this);
+ }
+ return p2SVpnGateways;
+ }
+
+ /** @return Resource collection API of VpnServerConfigurationsAssociatedWithVirtualWans. */
+ public VpnServerConfigurationsAssociatedWithVirtualWans vpnServerConfigurationsAssociatedWithVirtualWans() {
+ if (this.vpnServerConfigurationsAssociatedWithVirtualWans == null) {
+ this.vpnServerConfigurationsAssociatedWithVirtualWans =
+ new VpnServerConfigurationsAssociatedWithVirtualWansImpl(
+ clientObject.getVpnServerConfigurationsAssociatedWithVirtualWans(), this);
+ }
+ return vpnServerConfigurationsAssociatedWithVirtualWans;
+ }
+
+ /** @return Resource collection API of VirtualHubRouteTableV2S. */
+ public VirtualHubRouteTableV2S virtualHubRouteTableV2S() {
+ if (this.virtualHubRouteTableV2S == null) {
+ this.virtualHubRouteTableV2S =
+ new VirtualHubRouteTableV2SImpl(clientObject.getVirtualHubRouteTableV2S(), this);
+ }
+ return virtualHubRouteTableV2S;
+ }
+
+ /** @return Resource collection API of ExpressRouteGateways. */
+ public ExpressRouteGateways expressRouteGateways() {
+ if (this.expressRouteGateways == null) {
+ this.expressRouteGateways = new ExpressRouteGatewaysImpl(clientObject.getExpressRouteGateways(), this);
+ }
+ return expressRouteGateways;
+ }
+
+ /** @return Resource collection API of ExpressRouteConnections. */
+ public ExpressRouteConnections expressRouteConnections() {
+ if (this.expressRouteConnections == null) {
+ this.expressRouteConnections =
+ new ExpressRouteConnectionsImpl(clientObject.getExpressRouteConnections(), this);
+ }
+ return expressRouteConnections;
+ }
+
+ /** @return Resource collection API of VirtualHubBgpConnections. */
+ public VirtualHubBgpConnections virtualHubBgpConnections() {
+ if (this.virtualHubBgpConnections == null) {
+ this.virtualHubBgpConnections =
+ new VirtualHubBgpConnectionsImpl(clientObject.getVirtualHubBgpConnections(), this);
+ }
+ return virtualHubBgpConnections;
+ }
+
+ /** @return Resource collection API of VirtualHubIpConfigurations. */
+ public VirtualHubIpConfigurations virtualHubIpConfigurations() {
+ if (this.virtualHubIpConfigurations == null) {
+ this.virtualHubIpConfigurations =
+ new VirtualHubIpConfigurationsImpl(clientObject.getVirtualHubIpConfigurations(), this);
+ }
+ return virtualHubIpConfigurations;
+ }
+
+ /** @return Resource collection API of HubRouteTables. */
+ public HubRouteTables hubRouteTables() {
+ if (this.hubRouteTables == null) {
+ this.hubRouteTables = new HubRouteTablesImpl(clientObject.getHubRouteTables(), this);
+ }
+ return hubRouteTables;
+ }
+
+ /** @return Resource collection API of RoutingIntents. */
+ public RoutingIntents routingIntents() {
+ if (this.routingIntents == null) {
+ this.routingIntents = new RoutingIntentsImpl(clientObject.getRoutingIntents(), this);
+ }
+ return routingIntents;
+ }
+
+ /** @return Resource collection API of WebApplicationFirewallPolicies. */
+ public WebApplicationFirewallPolicies webApplicationFirewallPolicies() {
+ if (this.webApplicationFirewallPolicies == null) {
+ this.webApplicationFirewallPolicies =
+ new WebApplicationFirewallPoliciesImpl(clientObject.getWebApplicationFirewallPolicies(), this);
+ }
+ return webApplicationFirewallPolicies;
+ }
+
+ /**
+ * @return Wrapped service client NetworkManagementClient providing direct access to the underlying auto-generated
+ * API implementation, based on Azure REST API.
+ */
+ public NetworkManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java
new file mode 100644
index 0000000000000..9220d2c3d5359
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java
@@ -0,0 +1,227 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * ApplicationGatewayPrivateEndpointConnectionsClient.
+ */
+public interface ApplicationGatewayPrivateEndpointConnectionsClient {
+ /**
+ * Deletes the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String applicationGatewayName, String connectionName);
+
+ /**
+ * Deletes the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String applicationGatewayName, String connectionName, Context context);
+
+ /**
+ * Deletes the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String applicationGatewayName, String connectionName);
+
+ /**
+ * Deletes the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String applicationGatewayName, String connectionName, Context context);
+
+ /**
+ * Updates the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @param parameters Parameters supplied to update application gateway private endpoint connection operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return private Endpoint connection on an application gateway along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller<
+ PollResult,
+ ApplicationGatewayPrivateEndpointConnectionInner>
+ beginUpdate(
+ String resourceGroupName,
+ String applicationGatewayName,
+ String connectionName,
+ ApplicationGatewayPrivateEndpointConnectionInner parameters);
+
+ /**
+ * Updates the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @param parameters Parameters supplied to update application gateway private endpoint connection operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return private Endpoint connection on an application gateway along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller<
+ PollResult,
+ ApplicationGatewayPrivateEndpointConnectionInner>
+ beginUpdate(
+ String resourceGroupName,
+ String applicationGatewayName,
+ String connectionName,
+ ApplicationGatewayPrivateEndpointConnectionInner parameters,
+ Context context);
+
+ /**
+ * Updates the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @param parameters Parameters supplied to update application gateway private endpoint connection operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return private Endpoint connection on an application gateway.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayPrivateEndpointConnectionInner update(
+ String resourceGroupName,
+ String applicationGatewayName,
+ String connectionName,
+ ApplicationGatewayPrivateEndpointConnectionInner parameters);
+
+ /**
+ * Updates the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @param parameters Parameters supplied to update application gateway private endpoint connection operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return private Endpoint connection on an application gateway.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayPrivateEndpointConnectionInner update(
+ String resourceGroupName,
+ String applicationGatewayName,
+ String connectionName,
+ ApplicationGatewayPrivateEndpointConnectionInner parameters,
+ Context context);
+
+ /**
+ * Gets the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified private endpoint connection on application gateway.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayPrivateEndpointConnectionInner get(
+ String resourceGroupName, String applicationGatewayName, String connectionName);
+
+ /**
+ * Gets the specified private endpoint connection on application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param connectionName The name of the application gateway private endpoint connection.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified private endpoint connection on application gateway along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String applicationGatewayName, String connectionName, Context context);
+
+ /**
+ * Lists all private endpoint connections on an application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ListApplicationGatewayPrivateEndpointConnection API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Lists all private endpoint connections on an application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ListApplicationGatewayPrivateEndpointConnection API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String applicationGatewayName, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java
new file mode 100644
index 0000000000000..925f2af5cf5c3
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * ApplicationGatewayPrivateLinkResourcesClient.
+ */
+public interface ApplicationGatewayPrivateLinkResourcesClient {
+ /**
+ * Lists all private link resources on an application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ListApplicationGatewayPrivateLinkResources API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Lists all private link resources on an application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ListApplicationGatewayPrivateLinkResources API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String applicationGatewayName, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java
new file mode 100644
index 0000000000000..dd07ef5bcc345
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java
@@ -0,0 +1,700 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner;
+import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe;
+import com.azure.resourcemanager.network.generated.models.TagsObject;
+import java.util.List;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ApplicationGatewaysClient. */
+public interface ApplicationGatewaysClient {
+ /**
+ * Deletes the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Deletes the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String applicationGatewayName, Context context);
+
+ /**
+ * Deletes the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Deletes the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String applicationGatewayName, Context context);
+
+ /**
+ * Gets the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified application gateway.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Gets the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified application gateway along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String applicationGatewayName, Context context);
+
+ /**
+ * Creates or updates the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param parameters Parameters supplied to the create or update application gateway operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return application gateway resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate(
+ String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters);
+
+ /**
+ * Creates or updates the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param parameters Parameters supplied to the create or update application gateway operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return application gateway resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate(
+ String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context);
+
+ /**
+ * Creates or updates the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param parameters Parameters supplied to the create or update application gateway operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return application gateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayInner createOrUpdate(
+ String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters);
+
+ /**
+ * Creates or updates the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param parameters Parameters supplied to the create or update application gateway operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return application gateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayInner createOrUpdate(
+ String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context);
+
+ /**
+ * Updates the specified application gateway tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param parameters Parameters supplied to update application gateway tags.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return application gateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, TagsObject parameters);
+
+ /**
+ * Updates the specified application gateway tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param parameters Parameters supplied to update application gateway tags.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return application gateway resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateTagsWithResponse(
+ String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context);
+
+ /**
+ * Lists all application gateways in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ListApplicationGateways API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all application gateways in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ListApplicationGateways API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Gets all the application gateways in a subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all the application gateways in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets all the application gateways in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all the application gateways in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Starts the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Starts the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStart(
+ String resourceGroupName, String applicationGatewayName, Context context);
+
+ /**
+ * Starts the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void start(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Starts the specified application gateway.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void start(String resourceGroupName, String applicationGatewayName, Context context);
+
+ /**
+ * Stops the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Stops the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStop(
+ String resourceGroupName, String applicationGatewayName, Context context);
+
+ /**
+ * Stops the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void stop(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Stops the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void stop(String resourceGroupName, String applicationGatewayName, Context context);
+
+ /**
+ * Gets the backend health of the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health of the specified application gateway in a resource group along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationGatewayBackendHealthInner>
+ beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand);
+
+ /**
+ * Gets the backend health of the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health of the specified application gateway in a resource group along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationGatewayBackendHealthInner>
+ beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context);
+
+ /**
+ * Gets the backend health of the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health of the specified application gateway in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayBackendHealthInner backendHealth(
+ String resourceGroupName, String applicationGatewayName, String expand);
+
+ /**
+ * Gets the backend health of the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health of the specified application gateway in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName);
+
+ /**
+ * Gets the backend health of the specified application gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health of the specified application gateway in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayBackendHealthInner backendHealth(
+ String resourceGroupName, String applicationGatewayName, String expand, Context context);
+
+ /**
+ * Gets the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param probeRequest Request body for on-demand test probe operation.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationGatewayBackendHealthOnDemandInner>
+ beginBackendHealthOnDemand(
+ String resourceGroupName,
+ String applicationGatewayName,
+ ApplicationGatewayOnDemandProbe probeRequest,
+ String expand);
+
+ /**
+ * Gets the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param probeRequest Request body for on-demand test probe operation.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationGatewayBackendHealthOnDemandInner>
+ beginBackendHealthOnDemand(
+ String resourceGroupName,
+ String applicationGatewayName,
+ ApplicationGatewayOnDemandProbe probeRequest,
+ String expand,
+ Context context);
+
+ /**
+ * Gets the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param probeRequest Request body for on-demand test probe operation.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand(
+ String resourceGroupName,
+ String applicationGatewayName,
+ ApplicationGatewayOnDemandProbe probeRequest,
+ String expand);
+
+ /**
+ * Gets the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param probeRequest Request body for on-demand test probe operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand(
+ String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest);
+
+ /**
+ * Gets the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationGatewayName The name of the application gateway.
+ * @param probeRequest Request body for on-demand test probe operation.
+ * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the backend health for given combination of backend pool and http setting of the specified application
+ * gateway in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand(
+ String resourceGroupName,
+ String applicationGatewayName,
+ ApplicationGatewayOnDemandProbe probeRequest,
+ String expand,
+ Context context);
+
+ /**
+ * Lists all available server variables.
+ *
+ * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableServerVariables API service call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List listAvailableServerVariables();
+
+ /**
+ * Lists all available server variables.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableServerVariables API service call along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response> listAvailableServerVariablesWithResponse(Context context);
+
+ /**
+ * Lists all available request headers.
+ *
+ * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableRequestHeaders API service call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List listAvailableRequestHeaders();
+
+ /**
+ * Lists all available request headers.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableRequestHeaders API service call along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response> listAvailableRequestHeadersWithResponse(Context context);
+
+ /**
+ * Lists all available response headers.
+ *
+ * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableResponseHeaders API service call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List listAvailableResponseHeaders();
+
+ /**
+ * Lists all available response headers.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableResponseHeaders API service call along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response> listAvailableResponseHeadersWithResponse(Context context);
+
+ /**
+ * Lists all available web application firewall rule sets.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableWafRuleSets API service call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets();
+
+ /**
+ * Lists all available web application firewall rule sets.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableWafRuleSets API service call along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listAvailableWafRuleSetsWithResponse(Context context);
+
+ /**
+ * Lists available Ssl options for configuring Ssl policy.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableSslOptions API service call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions();
+
+ /**
+ * Lists available Ssl options for configuring Ssl policy.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableSslOptions API service call along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listAvailableSslOptionsWithResponse(Context context);
+
+ /**
+ * Lists all SSL predefined policies for configuring Ssl policy.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableSslOptions API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAvailableSslPredefinedPolicies();
+
+ /**
+ * Lists all SSL predefined policies for configuring Ssl policy.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ApplicationGatewayAvailableSslOptions API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAvailableSslPredefinedPolicies(Context context);
+
+ /**
+ * Gets Ssl predefined policy with the specified policy name.
+ *
+ * @param predefinedPolicyName Name of Ssl predefined policy.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return ssl predefined policy with the specified policy name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName);
+
+ /**
+ * Gets Ssl predefined policy with the specified policy name.
+ *
+ * @param predefinedPolicyName Name of Ssl predefined policy.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return ssl predefined policy with the specified policy name along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getSslPredefinedPolicyWithResponse(
+ String predefinedPolicyName, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java
new file mode 100644
index 0000000000000..a0b6bed55adf9
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java
@@ -0,0 +1,248 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner;
+import com.azure.resourcemanager.network.generated.models.TagsObject;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ApplicationSecurityGroupsClient. */
+public interface ApplicationSecurityGroupsClient {
+ /**
+ * Deletes the specified application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String applicationSecurityGroupName);
+
+ /**
+ * Deletes the specified application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String applicationSecurityGroupName, Context context);
+
+ /**
+ * Deletes the specified application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String applicationSecurityGroupName);
+
+ /**
+ * Deletes the specified application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String applicationSecurityGroupName, Context context);
+
+ /**
+ * Gets information about the specified application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified application security group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName);
+
+ /**
+ * Gets information about the specified application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified application security group along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String applicationSecurityGroupName, Context context);
+
+ /**
+ * Creates or updates an application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an application security group in a resource group along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate(
+ String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters);
+
+ /**
+ * Creates or updates an application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an application security group in a resource group along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String applicationSecurityGroupName,
+ ApplicationSecurityGroupInner parameters,
+ Context context);
+
+ /**
+ * Creates or updates an application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an application security group in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationSecurityGroupInner createOrUpdate(
+ String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters);
+
+ /**
+ * Creates or updates an application security group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an application security group in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationSecurityGroupInner createOrUpdate(
+ String resourceGroupName,
+ String applicationSecurityGroupName,
+ ApplicationSecurityGroupInner parameters,
+ Context context);
+
+ /**
+ * Updates an application security group's tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param parameters Parameters supplied to update application security group tags.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an application security group in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApplicationSecurityGroupInner updateTags(
+ String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters);
+
+ /**
+ * Updates an application security group's tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param applicationSecurityGroupName The name of the application security group.
+ * @param parameters Parameters supplied to update application security group tags.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an application security group in a resource group along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateTagsWithResponse(
+ String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context);
+
+ /**
+ * Gets all application security groups in a subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all application security groups in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets all application security groups in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all application security groups in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Gets all the application security groups in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all the application security groups in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Gets all the application security groups in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all the application security groups in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java
new file mode 100644
index 0000000000000..565708b31364b
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner;
+
+/** An instance of this class provides access to all the operations defined in AvailableDelegationsClient. */
+public interface AvailableDelegationsClient {
+ /**
+ * Gets all of the available subnet delegations for this subscription in this region.
+ *
+ * @param location The location of the subnet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all of the available subnet delegations for this subscription in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location);
+
+ /**
+ * Gets all of the available subnet delegations for this subscription in this region.
+ *
+ * @param location The location of the subnet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all of the available subnet delegations for this subscription in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java
new file mode 100644
index 0000000000000..56d342f174f23
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner;
+
+/** An instance of this class provides access to all the operations defined in AvailableEndpointServicesClient. */
+public interface AvailableEndpointServicesClient {
+ /**
+ * List what values of endpoint services are available for use.
+ *
+ * @param location The location to check available endpoint services.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListAvailableEndpointServices API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location);
+
+ /**
+ * List what values of endpoint services are available for use.
+ *
+ * @param location The location to check available endpoint services.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListAvailableEndpointServices API service call.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java
new file mode 100644
index 0000000000000..7beb6351d958b
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner;
+
+/** An instance of this class provides access to all the operations defined in AvailablePrivateEndpointTypesClient. */
+public interface AvailablePrivateEndpointTypesClient {
+ /**
+ * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.
+ *
+ * @param location The location of the domain name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an array of available PrivateEndpoint types.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location);
+
+ /**
+ * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.
+ *
+ * @param location The location of the domain name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an array of available PrivateEndpoint types.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location, Context context);
+
+ /**
+ * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.
+ *
+ * @param location The location of the domain name.
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an array of available PrivateEndpoint types.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String location, String resourceGroupName);
+
+ /**
+ * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.
+ *
+ * @param location The location of the domain name.
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an array of available PrivateEndpoint types.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(
+ String location, String resourceGroupName, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java
new file mode 100644
index 0000000000000..e640f0c35fe35
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in AvailableResourceGroupDelegationsClient.
+ */
+public interface AvailableResourceGroupDelegationsClient {
+ /**
+ * Gets all of the available subnet delegations for this resource group in this region.
+ *
+ * @param location The location of the domain name.
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all of the available subnet delegations for this resource group in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location, String resourceGroupName);
+
+ /**
+ * Gets all of the available subnet delegations for this resource group in this region.
+ *
+ * @param location The location of the domain name.
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all of the available subnet delegations for this resource group in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location, String resourceGroupName, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java
new file mode 100644
index 0000000000000..ad66184f17029
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner;
+
+/** An instance of this class provides access to all the operations defined in AvailableServiceAliasesClient. */
+public interface AvailableServiceAliasesClient {
+ /**
+ * Gets all available service aliases for this subscription in this region.
+ *
+ * @param location The location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all available service aliases for this subscription in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location);
+
+ /**
+ * Gets all available service aliases for this subscription in this region.
+ *
+ * @param location The location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all available service aliases for this subscription in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String location, Context context);
+
+ /**
+ * Gets all available service aliases for this resource group in this region.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param location The location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all available service aliases for this resource group in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, String location);
+
+ /**
+ * Gets all available service aliases for this resource group in this region.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param location The location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all available service aliases for this resource group in this region.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(
+ String resourceGroupName, String location, Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java
new file mode 100644
index 0000000000000..bbae7e0405b3d
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner;
+
+/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */
+public interface AzureFirewallFqdnTagsClient {
+ /**
+ * Gets all the Azure Firewall FQDN Tags in a subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all the Azure Firewall FQDN Tags in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets all the Azure Firewall FQDN Tags in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all the Azure Firewall FQDN Tags in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java
new file mode 100644
index 0000000000000..bf49987108ce9
--- /dev/null
+++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java
@@ -0,0 +1,269 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner;
+import com.azure.resourcemanager.network.generated.models.TagsObject;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in AzureFirewallsClient. */
+public interface AzureFirewallsClient {
+ /**
+ * Deletes the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName);
+
+ /**
+ * Deletes the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName, Context context);
+
+ /**
+ * Deletes the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String azureFirewallName);
+
+ /**
+ * Deletes the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String azureFirewallName, Context context);
+
+ /**
+ * Gets the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified Azure Firewall.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName);
+
+ /**
+ * Gets the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified Azure Firewall along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String azureFirewallName, Context context);
+
+ /**
+ * Creates or updates the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param parameters Parameters supplied to the create or update Azure Firewall operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AzureFirewallInner> beginCreateOrUpdate(
+ String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters);
+
+ /**
+ * Creates or updates the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param parameters Parameters supplied to the create or update Azure Firewall operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AzureFirewallInner> beginCreateOrUpdate(
+ String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context);
+
+ /**
+ * Creates or updates the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param parameters Parameters supplied to the create or update Azure Firewall operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure Firewall resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureFirewallInner createOrUpdate(
+ String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters);
+
+ /**
+ * Creates or updates the specified Azure Firewall.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param parameters Parameters supplied to the create or update Azure Firewall operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure Firewall resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureFirewallInner createOrUpdate(
+ String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context);
+
+ /**
+ * Updates tags of an Azure Firewall resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param parameters Parameters supplied to update azure firewall tags.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AzureFirewallInner> beginUpdateTags(
+ String resourceGroupName, String azureFirewallName, TagsObject parameters);
+
+ /**
+ * Updates tags of an Azure Firewall resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureFirewallName The name of the Azure Firewall.
+ * @param parameters Parameters supplied to update azure firewall tags.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller